@hienlh/ppm 0.23.29 → 0.23.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (450) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/assets/skills/ppm/SKILL.md +1 -1
  3. package/assets/skills/ppm/references/cli-reference.md +4 -4
  4. package/assets/skills/ppm/references/http-api.md +1 -1
  5. package/dist/web/assets/{accounts-settings-section-CWJnzrEb.js → accounts-settings-section-DD2YMv3Y.js} +1 -1
  6. package/dist/web/assets/accounts-settings-section-DD2YMv3Y.js.br +0 -0
  7. package/dist/web/assets/accounts-settings-section-DD2YMv3Y.js.gz +0 -0
  8. package/dist/web/assets/{agent-session-sheet-BwqLMa10.js → agent-session-sheet-B1W_lTep.js} +2 -2
  9. package/dist/web/assets/agent-session-sheet-B1W_lTep.js.br +0 -0
  10. package/dist/web/assets/agent-session-sheet-B1W_lTep.js.gz +0 -0
  11. package/dist/web/assets/{agent-session-window-content-D65wYohz.js → agent-session-window-content-D78XKwmQ.js} +1 -1
  12. package/dist/web/assets/agent-session-window-content-D78XKwmQ.js.br +0 -0
  13. package/dist/web/assets/agent-session-window-content-D78XKwmQ.js.gz +0 -0
  14. package/dist/web/assets/{ai-resource-editor-CPPA5cpe.js → ai-resource-editor-DhoQH34n.js} +1 -1
  15. package/dist/web/assets/ai-resource-editor-DhoQH34n.js.br +0 -0
  16. package/dist/web/assets/ai-resource-editor-DhoQH34n.js.gz +0 -0
  17. package/dist/web/assets/{ai-settings-section-ByhlEVEz.js → ai-settings-section-B4ZYWGpd.js} +1 -1
  18. package/dist/web/assets/{ai-settings-section--iLVno0Y.js → ai-settings-section-Cdiz-9xs.js} +1 -1
  19. package/dist/web/assets/ai-settings-section-Cdiz-9xs.js.br +0 -0
  20. package/dist/web/assets/ai-settings-section-Cdiz-9xs.js.gz +0 -0
  21. package/dist/web/assets/{android-tab-Jy6qxPvs.js → android-tab-tr_eVlkA.js} +1 -1
  22. package/dist/web/assets/android-tab-tr_eVlkA.js.br +0 -0
  23. package/dist/web/assets/android-tab-tr_eVlkA.js.gz +0 -0
  24. package/dist/web/assets/{appearance-settings-section-CeX0Js4W.js → appearance-settings-section-B1Vfua9w.js} +1 -1
  25. package/dist/web/assets/appearance-settings-section-B1Vfua9w.js.br +0 -0
  26. package/dist/web/assets/appearance-settings-section-B1Vfua9w.js.gz +0 -0
  27. package/dist/web/assets/{apps-panel-CPBY5ODG.js → apps-panel-Dx_TJGYK.js} +1 -1
  28. package/dist/web/assets/apps-panel-Dx_TJGYK.js.br +0 -0
  29. package/dist/web/assets/apps-panel-Dx_TJGYK.js.gz +0 -0
  30. package/dist/web/assets/{branch-review-tab-BmNsPO7I.js → branch-review-tab-C4qc6-vb.js} +1 -1
  31. package/dist/web/assets/branch-review-tab-C4qc6-vb.js.br +0 -0
  32. package/dist/web/assets/branch-review-tab-C4qc6-vb.js.gz +0 -0
  33. package/dist/web/assets/{chat-tab-NSTLcMIi.js → chat-tab-BCTWw50n.js} +11 -11
  34. package/dist/web/assets/chat-tab-BCTWw50n.js.br +0 -0
  35. package/dist/web/assets/chat-tab-BCTWw50n.js.gz +0 -0
  36. package/dist/web/assets/{chat-tab-JoTqS3yP.js → chat-tab-BzSXCIRv.js} +1 -1
  37. package/dist/web/assets/chat-tab-BzSXCIRv.js.br +0 -0
  38. package/dist/web/assets/chat-tab-BzSXCIRv.js.gz +0 -0
  39. package/dist/web/assets/{code-editor-CF1BjIoL.js → code-editor-a-s1xUtO.js} +4 -4
  40. package/dist/web/assets/code-editor-a-s1xUtO.js.br +0 -0
  41. package/dist/web/assets/code-editor-a-s1xUtO.js.gz +0 -0
  42. package/dist/web/assets/{codex-reset-credit-button-B5W0_kbI.js → codex-reset-credit-button-DnAKxfZz.js} +1 -1
  43. package/dist/web/assets/codex-reset-credit-button-DnAKxfZz.js.br +0 -0
  44. package/dist/web/assets/{codex-reset-credit-button-B5W0_kbI.js.gz → codex-reset-credit-button-DnAKxfZz.js.gz} +0 -0
  45. package/dist/web/assets/{conflict-editor-DRAquT76.js → conflict-editor-B1PAig3O.js} +1 -1
  46. package/dist/web/assets/conflict-editor-B1PAig3O.js.br +0 -0
  47. package/dist/web/assets/conflict-editor-B1PAig3O.js.gz +0 -0
  48. package/dist/web/assets/{connection-form-tab-2_e7v_GN.js → connection-form-tab-CVxtuVH6.js} +1 -1
  49. package/dist/web/assets/connection-form-tab-CVxtuVH6.js.br +0 -0
  50. package/dist/web/assets/connection-form-tab-CVxtuVH6.js.gz +0 -0
  51. package/dist/web/assets/{csv-preview-DqcWu79t.js → csv-preview-81Ua76G1.js} +1 -1
  52. package/dist/web/assets/csv-preview-81Ua76G1.js.br +0 -0
  53. package/dist/web/assets/csv-preview-81Ua76G1.js.gz +0 -0
  54. package/dist/web/assets/{db-tab-parts-BJBsSfr4.js → db-tab-parts-DyUcv7XU.js} +1 -1
  55. package/dist/web/assets/db-tab-parts-DyUcv7XU.js.br +0 -0
  56. package/dist/web/assets/db-tab-parts-DyUcv7XU.js.gz +0 -0
  57. package/dist/web/assets/{design-settings-section-B0qn1h3L.js → design-settings-section-B0k5ezUu.js} +1 -1
  58. package/dist/web/assets/design-settings-section-B0k5ezUu.js.br +0 -0
  59. package/dist/web/assets/design-settings-section-B0k5ezUu.js.gz +0 -0
  60. package/dist/web/assets/{design-tab-BR6xhynq.js → design-tab-bG_qGA7d.js} +1 -1
  61. package/dist/web/assets/design-tab-bG_qGA7d.js.br +0 -0
  62. package/dist/web/assets/design-tab-bG_qGA7d.js.gz +0 -0
  63. package/dist/web/assets/{designs-sidebar-panel-DGldGuR0.js → designs-sidebar-panel-Bh4424ck.js} +1 -1
  64. package/dist/web/assets/designs-sidebar-panel-Bh4424ck.js.br +0 -0
  65. package/dist/web/assets/designs-sidebar-panel-Bh4424ck.js.gz +0 -0
  66. package/dist/web/assets/{diff-viewer-DK3Vjj6m.js → diff-viewer-B8pMh4I6.js} +1 -1
  67. package/dist/web/assets/diff-viewer-B8pMh4I6.js.br +0 -0
  68. package/dist/web/assets/diff-viewer-B8pMh4I6.js.gz +0 -0
  69. package/dist/web/assets/{docx-preview-DFmwoPNA.js → docx-preview-BJ--yUXU.js} +1 -1
  70. package/dist/web/assets/docx-preview-BJ--yUXU.js.br +0 -0
  71. package/dist/web/assets/docx-preview-BJ--yUXU.js.gz +0 -0
  72. package/dist/web/assets/{editor-dialog-C2CYejSY.js → editor-dialog-CgKwdJ-A.js} +1 -1
  73. package/dist/web/assets/editor-dialog-CgKwdJ-A.js.br +0 -0
  74. package/dist/web/assets/editor-dialog-CgKwdJ-A.js.gz +0 -0
  75. package/dist/web/assets/{editor-language-service-q8IOkBpt.js → editor-language-service-Cw9d4QBy.js} +1 -1
  76. package/dist/web/assets/editor-language-service-Cw9d4QBy.js.br +0 -0
  77. package/dist/web/assets/editor-language-service-Cw9d4QBy.js.gz +0 -0
  78. package/dist/web/assets/{explorer-body-Cn6nVc0Q.js → explorer-body-BUtudEHQ.js} +1 -1
  79. package/dist/web/assets/explorer-body-BUtudEHQ.js.br +0 -0
  80. package/dist/web/assets/explorer-body-BUtudEHQ.js.gz +0 -0
  81. package/dist/web/assets/{explorer-window-content-hU1-iXIk.js → explorer-window-content-OzDfC9Y6.js} +1 -1
  82. package/dist/web/assets/explorer-window-content-OzDfC9Y6.js.br +0 -0
  83. package/dist/web/assets/explorer-window-content-OzDfC9Y6.js.gz +0 -0
  84. package/dist/web/assets/{extension-manager-section-_IUNt3dv.js → extension-manager-section-CXVBRDcC.js} +1 -1
  85. package/dist/web/assets/extension-manager-section-CXVBRDcC.js.br +0 -0
  86. package/dist/web/assets/extension-manager-section-CXVBRDcC.js.gz +0 -0
  87. package/dist/web/assets/{extension-webview-Bhrts-Zw.js → extension-webview-DOPyhxsA.js} +1 -1
  88. package/dist/web/assets/extension-webview-DOPyhxsA.js.br +0 -0
  89. package/dist/web/assets/extension-webview-DOPyhxsA.js.gz +0 -0
  90. package/dist/web/assets/{files-settings-section-Bnmw5ZzK.js → files-settings-section-Ca8zUes8.js} +1 -1
  91. package/dist/web/assets/files-settings-section-Ca8zUes8.js.br +0 -0
  92. package/dist/web/assets/files-settings-section-Ca8zUes8.js.gz +0 -0
  93. package/dist/web/assets/{general-settings-section-CWBPWIJR.js → general-settings-section-54xUwr8M.js} +1 -1
  94. package/dist/web/assets/general-settings-section-54xUwr8M.js.br +0 -0
  95. package/dist/web/assets/general-settings-section-54xUwr8M.js.gz +0 -0
  96. package/dist/web/assets/{git-log-panel-DjcstHBs.js → git-log-panel-CsmVTxkQ.js} +1 -1
  97. package/dist/web/assets/git-log-panel-CsmVTxkQ.js.br +0 -0
  98. package/dist/web/assets/git-log-panel-CsmVTxkQ.js.gz +0 -0
  99. package/dist/web/assets/{git-review-tab-aSto91M3.js → git-review-tab-C6pRHRCA.js} +1 -1
  100. package/dist/web/assets/git-review-tab-C6pRHRCA.js.br +0 -0
  101. package/dist/web/assets/git-review-tab-C6pRHRCA.js.gz +0 -0
  102. package/dist/web/assets/{glide-data-grid-DSCd1ujd.js → glide-data-grid-3FtXQop5.js} +1 -1
  103. package/dist/web/assets/glide-data-grid-3FtXQop5.js.br +0 -0
  104. package/dist/web/assets/glide-data-grid-3FtXQop5.js.gz +0 -0
  105. package/dist/web/assets/{grid-save-dialog-BhGNSIv3.js → grid-save-dialog-Cye6uX5D.js} +1 -1
  106. package/dist/web/assets/grid-save-dialog-Cye6uX5D.js.br +0 -0
  107. package/dist/web/assets/grid-save-dialog-Cye6uX5D.js.gz +0 -0
  108. package/dist/web/assets/{group-chat-tab-BzWkqhua.js → group-chat-tab-Dh2HDKc3.js} +1 -1
  109. package/dist/web/assets/group-chat-tab-Dh2HDKc3.js.br +0 -0
  110. package/dist/web/assets/group-chat-tab-Dh2HDKc3.js.gz +0 -0
  111. package/dist/web/assets/{impexp-tab-DUk4R7Wp.js → impexp-tab-OTygyvyb.js} +1 -1
  112. package/dist/web/assets/impexp-tab-OTygyvyb.js.br +0 -0
  113. package/dist/web/assets/impexp-tab-OTygyvyb.js.gz +0 -0
  114. package/dist/web/assets/{index-dfjFhOrF.js → index-DUVlC2ML.js} +5 -5
  115. package/dist/web/assets/index-DUVlC2ML.js.br +0 -0
  116. package/dist/web/assets/index-DUVlC2ML.js.gz +0 -0
  117. package/dist/web/assets/index-iEAtV2k-.css +1 -0
  118. package/dist/web/assets/index-iEAtV2k-.css.br +0 -0
  119. package/dist/web/assets/index-iEAtV2k-.css.gz +0 -0
  120. package/dist/web/assets/{jira-watcher-section-DbzAuf4Z.js → jira-watcher-section-Don5x1sG.js} +1 -1
  121. package/dist/web/assets/{keybindings-store-DJvCTGiH.js → keybindings-store-DULPC6Ht.js} +1 -1
  122. package/dist/web/assets/{keyboard-shortcuts-section-CnXGO8Ww.js → keyboard-shortcuts-section-DU_8UCnk.js} +1 -1
  123. package/dist/web/assets/keyboard-shortcuts-section-DU_8UCnk.js.br +0 -0
  124. package/dist/web/assets/keyboard-shortcuts-section-DU_8UCnk.js.gz +0 -0
  125. package/dist/web/assets/{language-servers-section-CS2a4xfB.js → language-servers-section-B0VXPxYi.js} +2 -2
  126. package/dist/web/assets/language-servers-section-B0VXPxYi.js.br +0 -0
  127. package/dist/web/assets/language-servers-section-B0VXPxYi.js.gz +0 -0
  128. package/dist/web/assets/{logs-app-Dhnv3B_V.js → logs-app-CmGH7uZH.js} +1 -1
  129. package/dist/web/assets/logs-app-CmGH7uZH.js.br +0 -0
  130. package/dist/web/assets/{logs-app-Dhnv3B_V.js.gz → logs-app-CmGH7uZH.js.gz} +0 -0
  131. package/dist/web/assets/{logs-tab-BodDFNow.js → logs-tab-Bd-rHoig.js} +1 -1
  132. package/dist/web/assets/{logs-window-content-B-TigADI.js → logs-window-content-0H5Udh1T.js} +1 -1
  133. package/dist/web/assets/{lsp-client-DQSgDD68.js → lsp-client-D7Ve0Eyr.js} +1 -1
  134. package/dist/web/assets/lsp-client-D7Ve0Eyr.js.br +0 -0
  135. package/dist/web/assets/lsp-client-D7Ve0Eyr.js.gz +0 -0
  136. package/dist/web/assets/{markdown-renderer-DEiprwsn.js → markdown-renderer-Cz1Ed2n2.js} +1 -1
  137. package/dist/web/assets/{markdown-renderer-BiYsGykC.js → markdown-renderer-pFpnM8nX.js} +1 -1
  138. package/dist/web/assets/markdown-renderer-pFpnM8nX.js.br +0 -0
  139. package/dist/web/assets/markdown-renderer-pFpnM8nX.js.gz +0 -0
  140. package/dist/web/assets/{mobile-explorer-sheet-jaq7Mg6b.js → mobile-explorer-sheet-CeKmZJSK.js} +1 -1
  141. package/dist/web/assets/mobile-explorer-sheet-CeKmZJSK.js.br +0 -0
  142. package/dist/web/assets/mobile-explorer-sheet-CeKmZJSK.js.gz +0 -0
  143. package/dist/web/assets/{new-design-dialog-BwCvH6O2.js → new-design-dialog-CNlFB05y.js} +1 -1
  144. package/dist/web/assets/new-design-dialog-CNlFB05y.js.br +0 -0
  145. package/dist/web/assets/new-design-dialog-CNlFB05y.js.gz +0 -0
  146. package/dist/web/assets/{notification-store-B_W0dzzt.js → notification-store-BN1L3Zrg.js} +1 -1
  147. package/dist/web/assets/{notifications-settings-section-DxrC1etV.js → notifications-settings-section-YJmUNsee.js} +1 -1
  148. package/dist/web/assets/notifications-settings-section-YJmUNsee.js.br +0 -0
  149. package/dist/web/assets/notifications-settings-section-YJmUNsee.js.gz +0 -0
  150. package/dist/web/assets/{ppmbot-settings-section-DOQRM-QG.js → ppmbot-settings-section-BlEVoUo3.js} +1 -1
  151. package/dist/web/assets/ppmbot-settings-section-BlEVoUo3.js.br +0 -0
  152. package/dist/web/assets/ppmbot-settings-section-BlEVoUo3.js.gz +0 -0
  153. package/dist/web/assets/{problems-panel-Ba82qdj_.js → problems-panel-msNBVaJC.js} +1 -1
  154. package/dist/web/assets/problems-panel-msNBVaJC.js.br +0 -0
  155. package/dist/web/assets/problems-panel-msNBVaJC.js.gz +0 -0
  156. package/dist/web/assets/{process-table-CShM_06i.js → process-table-BWXCHHSO.js} +1 -1
  157. package/dist/web/assets/process-table-BWXCHHSO.js.br +0 -0
  158. package/dist/web/assets/process-table-BWXCHHSO.js.gz +0 -0
  159. package/dist/web/assets/{proxy-settings-section-BSkXhBlt.js → proxy-settings-section-DwaF7zkx.js} +1 -1
  160. package/dist/web/assets/proxy-settings-section-DwaF7zkx.js.br +0 -0
  161. package/dist/web/assets/proxy-settings-section-DwaF7zkx.js.gz +0 -0
  162. package/dist/web/assets/{query-tab-QXTAI8_o.js → query-tab-BGTBApV8.js} +1 -1
  163. package/dist/web/assets/query-tab-BGTBApV8.js.br +0 -0
  164. package/dist/web/assets/query-tab-BGTBApV8.js.gz +0 -0
  165. package/dist/web/assets/{release-notes-window-content-BZ_KpKIh.js → release-notes-window-content-BNnpQley.js} +1 -1
  166. package/dist/web/assets/{remote-access-settings-section-1u6n8wyz.js → remote-access-settings-section-pxtw1CPh.js} +1 -1
  167. package/dist/web/assets/remote-access-settings-section-pxtw1CPh.js.br +0 -0
  168. package/dist/web/assets/remote-access-settings-section-pxtw1CPh.js.gz +0 -0
  169. package/dist/web/assets/{remote-desktop-clipboard-notice-CYKZ-BfJ.js → remote-desktop-clipboard-notice-49G-anNI.js} +1 -1
  170. package/dist/web/assets/remote-desktop-clipboard-notice-49G-anNI.js.br +0 -0
  171. package/dist/web/assets/remote-desktop-clipboard-notice-49G-anNI.js.gz +0 -0
  172. package/dist/web/assets/{remote-desktop-mobile-sheet-ktcOkEX6.js → remote-desktop-mobile-sheet-CyLsaL17.js} +2 -2
  173. package/dist/web/assets/remote-desktop-mobile-sheet-CyLsaL17.js.br +0 -0
  174. package/dist/web/assets/remote-desktop-mobile-sheet-CyLsaL17.js.gz +0 -0
  175. package/dist/web/assets/{remote-desktop-mobile-view-FCh2F0H_.js → remote-desktop-mobile-view-CS5FRm7H.js} +1 -1
  176. package/dist/web/assets/remote-desktop-mobile-view-CS5FRm7H.js.br +0 -0
  177. package/dist/web/assets/remote-desktop-mobile-view-CS5FRm7H.js.gz +0 -0
  178. package/dist/web/assets/{remote-desktop-readiness-gate-0nIs2xs7.js → remote-desktop-readiness-gate-BgOYkS5E.js} +1 -1
  179. package/dist/web/assets/remote-desktop-readiness-gate-BgOYkS5E.js.br +0 -0
  180. package/dist/web/assets/remote-desktop-readiness-gate-BgOYkS5E.js.gz +0 -0
  181. package/dist/web/assets/{remote-desktop-window-content-DWek641T.js → remote-desktop-window-content-CVpBEvyu.js} +1 -1
  182. package/dist/web/assets/remote-desktop-window-content-CVpBEvyu.js.br +0 -0
  183. package/dist/web/assets/remote-desktop-window-content-CVpBEvyu.js.gz +0 -0
  184. package/dist/web/assets/{rename-object-dialog-BpkditUB.js → rename-object-dialog-C-sopHnW.js} +1 -1
  185. package/dist/web/assets/rename-object-dialog-C-sopHnW.js.br +0 -0
  186. package/dist/web/assets/rename-object-dialog-C-sopHnW.js.gz +0 -0
  187. package/dist/web/assets/{review-address-setup-Nn1TCSWK.js → review-address-setup-i8DrQMsw.js} +1 -1
  188. package/dist/web/assets/review-address-setup-i8DrQMsw.js.br +0 -0
  189. package/dist/web/assets/review-address-setup-i8DrQMsw.js.gz +0 -0
  190. package/dist/web/assets/{review-code-ZSeHU4ZV.js → review-code-CYMy-B-i.js} +1 -1
  191. package/dist/web/assets/review-code-CYMy-B-i.js.br +0 -0
  192. package/dist/web/assets/review-code-CYMy-B-i.js.gz +0 -0
  193. package/dist/web/assets/{save-as-dialog-BTheU6SL.js → save-as-dialog-DJN6Z4nq.js} +1 -1
  194. package/dist/web/assets/save-as-dialog-DJN6Z4nq.js.br +0 -0
  195. package/dist/web/assets/save-as-dialog-DJN6Z4nq.js.gz +0 -0
  196. package/dist/web/assets/{schedule-script-editor-DmWFZjGb.js → schedule-script-editor-vtEjMwFH.js} +1 -1
  197. package/dist/web/assets/schedule-script-editor-vtEjMwFH.js.br +0 -0
  198. package/dist/web/assets/schedule-script-editor-vtEjMwFH.js.gz +0 -0
  199. package/dist/web/assets/{schedules-settings-section-C_-ZuPKw.js → schedules-settings-section-CSC2ce8R.js} +3 -3
  200. package/dist/web/assets/schedules-settings-section-CSC2ce8R.js.br +0 -0
  201. package/dist/web/assets/schedules-settings-section-CSC2ce8R.js.gz +0 -0
  202. package/dist/web/assets/{session-review-tab-DoUPZWcr.js → session-review-tab-nTAdQSig.js} +1 -1
  203. package/dist/web/assets/session-review-tab-nTAdQSig.js.br +0 -0
  204. package/dist/web/assets/session-review-tab-nTAdQSig.js.gz +0 -0
  205. package/dist/web/assets/{settings-body-BoDqDvDa.js → settings-body-nzPCB7P_.js} +1 -1
  206. package/dist/web/assets/settings-body-nzPCB7P_.js.br +0 -0
  207. package/dist/web/assets/settings-body-nzPCB7P_.js.gz +0 -0
  208. package/dist/web/assets/{settings-rows-DpOwXhiC.js → settings-rows-Bq7UM8m9.js} +1 -1
  209. package/dist/web/assets/settings-rows-Bq7UM8m9.js.br +0 -0
  210. package/dist/web/assets/settings-rows-Bq7UM8m9.js.gz +0 -0
  211. package/dist/web/assets/{settings-section-content-3EQ7dlY0.js → settings-section-content-B1YSAfBg.js} +1 -1
  212. package/dist/web/assets/{settings-section-content-1hItUZe5.js → settings-section-content-eX7Kw0-y.js} +2 -2
  213. package/dist/web/assets/settings-section-content-eX7Kw0-y.js.br +0 -0
  214. package/dist/web/assets/settings-section-content-eX7Kw0-y.js.gz +0 -0
  215. package/dist/web/assets/{settings-tab-BPuZJOKv.js → settings-tab-BE06XrAA.js} +1 -1
  216. package/dist/web/assets/{settings-window-content-Cs9m38Jz.js → settings-window-content-BdrZrJST.js} +1 -1
  217. package/dist/web/assets/{slash-command-picker-BjheCmNV.js → slash-command-picker-Cwns8EK_.js} +1 -1
  218. package/dist/web/assets/slash-command-picker-Cwns8EK_.js.br +0 -0
  219. package/dist/web/assets/slash-command-picker-Cwns8EK_.js.gz +0 -0
  220. package/dist/web/assets/{sql-object-tab-BYrNT42v.js → sql-object-tab-CgK4JZHK.js} +1 -1
  221. package/dist/web/assets/sql-object-tab-CgK4JZHK.js.br +0 -0
  222. package/dist/web/assets/sql-object-tab-CgK4JZHK.js.gz +0 -0
  223. package/dist/web/assets/{sqlite-viewer-BlTxAex4.js → sqlite-viewer-c0qfRFnJ.js} +1 -1
  224. package/dist/web/assets/sqlite-viewer-c0qfRFnJ.js.br +0 -0
  225. package/dist/web/assets/sqlite-viewer-c0qfRFnJ.js.gz +0 -0
  226. package/dist/web/assets/{structure-save-dialog-di0ND8mR.js → structure-save-dialog-45B8zpse.js} +1 -1
  227. package/dist/web/assets/structure-save-dialog-45B8zpse.js.br +0 -0
  228. package/dist/web/assets/structure-save-dialog-45B8zpse.js.gz +0 -0
  229. package/dist/web/assets/{structure-tab-CjOPHxmp.js → structure-tab-BktpUPf0.js} +1 -1
  230. package/dist/web/assets/structure-tab-BktpUPf0.js.br +0 -0
  231. package/dist/web/assets/structure-tab-BktpUPf0.js.gz +0 -0
  232. package/dist/web/assets/{system-monitor-body-C2lm2rrH.js → system-monitor-body-C9ltqBLi.js} +2 -2
  233. package/dist/web/assets/system-monitor-body-C9ltqBLi.js.br +0 -0
  234. package/dist/web/assets/system-monitor-body-C9ltqBLi.js.gz +0 -0
  235. package/dist/web/assets/{system-monitor-tab-DyEhQc9V.js → system-monitor-tab-BpESI7Cc.js} +1 -1
  236. package/dist/web/assets/{system-monitor-window-content-DZomRk_m.js → system-monitor-window-content-CEn5tjZq.js} +1 -1
  237. package/dist/web/assets/{tab-host-window-content-1Mp12Al4.js → tab-host-window-content-B9ybsi4d.js} +1 -1
  238. package/dist/web/assets/tab-host-window-content-B9ybsi4d.js.br +0 -0
  239. package/dist/web/assets/tab-host-window-content-B9ybsi4d.js.gz +0 -0
  240. package/dist/web/assets/{table-tab-CKFHBAli.js → table-tab-CZEEn77y.js} +1 -1
  241. package/dist/web/assets/table-tab-CZEEn77y.js.br +0 -0
  242. package/dist/web/assets/table-tab-CZEEn77y.js.gz +0 -0
  243. package/dist/web/assets/{telegram-bot-token-field-D3Go3gl_.js → telegram-bot-token-field-CyaKZoZH.js} +1 -1
  244. package/dist/web/assets/telegram-bot-token-field-CyaKZoZH.js.br +0 -0
  245. package/dist/web/assets/telegram-bot-token-field-CyaKZoZH.js.gz +0 -0
  246. package/dist/web/assets/{terminal-tab-BNf3yl9z.js → terminal-tab-ClHY4gMX.js} +1 -1
  247. package/dist/web/assets/terminal-tab-ClHY4gMX.js.br +0 -0
  248. package/dist/web/assets/terminal-tab-ClHY4gMX.js.gz +0 -0
  249. package/dist/web/assets/{tool-cards-B9bTL2ee.js → tool-cards-UzhEoLIM.js} +3 -3
  250. package/dist/web/assets/tool-cards-UzhEoLIM.js.br +0 -0
  251. package/dist/web/assets/tool-cards-UzhEoLIM.js.gz +0 -0
  252. package/dist/web/assets/{tools-settings-section-DJNAy0fk.js → tools-settings-section-YSUmOgYC.js} +1 -1
  253. package/dist/web/assets/tools-settings-section-YSUmOgYC.js.br +0 -0
  254. package/dist/web/assets/tools-settings-section-YSUmOgYC.js.gz +0 -0
  255. package/dist/web/assets/{use-inline-blame-ecF1PiwV.js → use-inline-blame-hJJLY-7G.js} +1 -1
  256. package/dist/web/assets/use-inline-blame-hJJLY-7G.js.br +0 -0
  257. package/dist/web/assets/use-inline-blame-hJJLY-7G.js.gz +0 -0
  258. package/dist/web/assets/{use-lsp-CGExPn9f.js → use-lsp-xrdp5w6F.js} +1 -1
  259. package/dist/web/assets/use-lsp-xrdp5w6F.js.br +0 -0
  260. package/dist/web/assets/use-lsp-xrdp5w6F.js.gz +0 -0
  261. package/dist/web/assets/{use-monaco-theme-DDqeltM9.js → use-monaco-theme-DJYRkfrb.js} +1 -1
  262. package/dist/web/assets/{use-process-kill-DIfudshA.js → use-process-kill-Clj55qop.js} +1 -1
  263. package/dist/web/assets/use-process-kill-Clj55qop.js.br +0 -0
  264. package/dist/web/assets/use-process-kill-Clj55qop.js.gz +0 -0
  265. package/dist/web/assets/{use-sql-schema-info-C-gzaPpU.js → use-sql-schema-info-By-QAH0p.js} +1 -1
  266. package/dist/web/assets/use-sql-schema-info-By-QAH0p.js.br +0 -0
  267. package/dist/web/assets/use-sql-schema-info-By-QAH0p.js.gz +0 -0
  268. package/dist/web/assets/{use-websocket-CZoU6oe-.js → use-websocket-DYa4Qf2I.js} +1 -1
  269. package/dist/web/assets/{web-preview-tab-CndNrVng.js → web-preview-tab-Bk9C92jW.js} +1 -1
  270. package/dist/web/assets/web-preview-tab-Bk9C92jW.js.br +0 -0
  271. package/dist/web/assets/web-preview-tab-Bk9C92jW.js.gz +0 -0
  272. package/dist/web/index.html +2 -2
  273. package/dist/web/index.html.br +0 -0
  274. package/dist/web/index.html.gz +0 -0
  275. package/dist/web/sw.js +1 -1
  276. package/dist/web/sw.js.br +0 -0
  277. package/dist/web/sw.js.gz +0 -0
  278. package/package.json +1 -1
  279. package/release.out +772 -0
  280. package/src/shared/chat-questions.ts +4 -1
  281. package/src/web/components/chat/question-card.tsx +17 -2
  282. package/src/web/components/chat/question-option-preview.tsx +44 -0
  283. package/src/web/components/chat/tool-cards.tsx +9 -1
  284. package/dist/web/assets/accounts-settings-section-CWJnzrEb.js.br +0 -0
  285. package/dist/web/assets/accounts-settings-section-CWJnzrEb.js.gz +0 -0
  286. package/dist/web/assets/agent-session-sheet-BwqLMa10.js.br +0 -0
  287. package/dist/web/assets/agent-session-sheet-BwqLMa10.js.gz +0 -0
  288. package/dist/web/assets/agent-session-window-content-D65wYohz.js.br +0 -0
  289. package/dist/web/assets/agent-session-window-content-D65wYohz.js.gz +0 -0
  290. package/dist/web/assets/ai-resource-editor-CPPA5cpe.js.br +0 -0
  291. package/dist/web/assets/ai-resource-editor-CPPA5cpe.js.gz +0 -0
  292. package/dist/web/assets/ai-settings-section--iLVno0Y.js.br +0 -0
  293. package/dist/web/assets/ai-settings-section--iLVno0Y.js.gz +0 -0
  294. package/dist/web/assets/android-tab-Jy6qxPvs.js.br +0 -0
  295. package/dist/web/assets/android-tab-Jy6qxPvs.js.gz +0 -0
  296. package/dist/web/assets/appearance-settings-section-CeX0Js4W.js.br +0 -0
  297. package/dist/web/assets/appearance-settings-section-CeX0Js4W.js.gz +0 -0
  298. package/dist/web/assets/apps-panel-CPBY5ODG.js.br +0 -0
  299. package/dist/web/assets/apps-panel-CPBY5ODG.js.gz +0 -0
  300. package/dist/web/assets/branch-review-tab-BmNsPO7I.js.br +0 -0
  301. package/dist/web/assets/branch-review-tab-BmNsPO7I.js.gz +0 -0
  302. package/dist/web/assets/chat-tab-JoTqS3yP.js.br +0 -0
  303. package/dist/web/assets/chat-tab-JoTqS3yP.js.gz +0 -0
  304. package/dist/web/assets/chat-tab-NSTLcMIi.js.br +0 -0
  305. package/dist/web/assets/chat-tab-NSTLcMIi.js.gz +0 -0
  306. package/dist/web/assets/code-editor-CF1BjIoL.js.br +0 -0
  307. package/dist/web/assets/code-editor-CF1BjIoL.js.gz +0 -0
  308. package/dist/web/assets/codex-reset-credit-button-B5W0_kbI.js.br +0 -0
  309. package/dist/web/assets/conflict-editor-DRAquT76.js.br +0 -0
  310. package/dist/web/assets/conflict-editor-DRAquT76.js.gz +0 -0
  311. package/dist/web/assets/connection-form-tab-2_e7v_GN.js.br +0 -0
  312. package/dist/web/assets/connection-form-tab-2_e7v_GN.js.gz +0 -0
  313. package/dist/web/assets/csv-preview-DqcWu79t.js.br +0 -0
  314. package/dist/web/assets/csv-preview-DqcWu79t.js.gz +0 -0
  315. package/dist/web/assets/db-tab-parts-BJBsSfr4.js.br +0 -0
  316. package/dist/web/assets/db-tab-parts-BJBsSfr4.js.gz +0 -0
  317. package/dist/web/assets/design-settings-section-B0qn1h3L.js.br +0 -0
  318. package/dist/web/assets/design-settings-section-B0qn1h3L.js.gz +0 -0
  319. package/dist/web/assets/design-tab-BR6xhynq.js.br +0 -0
  320. package/dist/web/assets/design-tab-BR6xhynq.js.gz +0 -0
  321. package/dist/web/assets/designs-sidebar-panel-DGldGuR0.js.br +0 -0
  322. package/dist/web/assets/designs-sidebar-panel-DGldGuR0.js.gz +0 -0
  323. package/dist/web/assets/diff-viewer-DK3Vjj6m.js.br +0 -0
  324. package/dist/web/assets/diff-viewer-DK3Vjj6m.js.gz +0 -0
  325. package/dist/web/assets/docx-preview-DFmwoPNA.js.br +0 -0
  326. package/dist/web/assets/docx-preview-DFmwoPNA.js.gz +0 -0
  327. package/dist/web/assets/editor-dialog-C2CYejSY.js.br +0 -0
  328. package/dist/web/assets/editor-dialog-C2CYejSY.js.gz +0 -0
  329. package/dist/web/assets/editor-language-service-q8IOkBpt.js.br +0 -0
  330. package/dist/web/assets/editor-language-service-q8IOkBpt.js.gz +0 -0
  331. package/dist/web/assets/explorer-body-Cn6nVc0Q.js.br +0 -0
  332. package/dist/web/assets/explorer-body-Cn6nVc0Q.js.gz +0 -0
  333. package/dist/web/assets/explorer-window-content-hU1-iXIk.js.br +0 -0
  334. package/dist/web/assets/explorer-window-content-hU1-iXIk.js.gz +0 -0
  335. package/dist/web/assets/extension-manager-section-_IUNt3dv.js.br +0 -0
  336. package/dist/web/assets/extension-manager-section-_IUNt3dv.js.gz +0 -0
  337. package/dist/web/assets/extension-webview-Bhrts-Zw.js.br +0 -0
  338. package/dist/web/assets/extension-webview-Bhrts-Zw.js.gz +0 -0
  339. package/dist/web/assets/files-settings-section-Bnmw5ZzK.js.br +0 -0
  340. package/dist/web/assets/files-settings-section-Bnmw5ZzK.js.gz +0 -0
  341. package/dist/web/assets/general-settings-section-CWBPWIJR.js.br +0 -0
  342. package/dist/web/assets/general-settings-section-CWBPWIJR.js.gz +0 -0
  343. package/dist/web/assets/git-log-panel-DjcstHBs.js.br +0 -0
  344. package/dist/web/assets/git-log-panel-DjcstHBs.js.gz +0 -0
  345. package/dist/web/assets/git-review-tab-aSto91M3.js.br +0 -0
  346. package/dist/web/assets/git-review-tab-aSto91M3.js.gz +0 -0
  347. package/dist/web/assets/glide-data-grid-DSCd1ujd.js.br +0 -0
  348. package/dist/web/assets/glide-data-grid-DSCd1ujd.js.gz +0 -0
  349. package/dist/web/assets/grid-save-dialog-BhGNSIv3.js.br +0 -0
  350. package/dist/web/assets/grid-save-dialog-BhGNSIv3.js.gz +0 -0
  351. package/dist/web/assets/group-chat-tab-BzWkqhua.js.br +0 -0
  352. package/dist/web/assets/group-chat-tab-BzWkqhua.js.gz +0 -0
  353. package/dist/web/assets/impexp-tab-DUk4R7Wp.js.br +0 -0
  354. package/dist/web/assets/impexp-tab-DUk4R7Wp.js.gz +0 -0
  355. package/dist/web/assets/index-Cb3Z6wNy.css +0 -1
  356. package/dist/web/assets/index-Cb3Z6wNy.css.br +0 -0
  357. package/dist/web/assets/index-Cb3Z6wNy.css.gz +0 -0
  358. package/dist/web/assets/index-dfjFhOrF.js.br +0 -0
  359. package/dist/web/assets/index-dfjFhOrF.js.gz +0 -0
  360. package/dist/web/assets/keyboard-shortcuts-section-CnXGO8Ww.js.br +0 -0
  361. package/dist/web/assets/keyboard-shortcuts-section-CnXGO8Ww.js.gz +0 -0
  362. package/dist/web/assets/language-servers-section-CS2a4xfB.js.br +0 -0
  363. package/dist/web/assets/language-servers-section-CS2a4xfB.js.gz +0 -0
  364. package/dist/web/assets/logs-app-Dhnv3B_V.js.br +0 -0
  365. package/dist/web/assets/lsp-client-DQSgDD68.js.br +0 -0
  366. package/dist/web/assets/lsp-client-DQSgDD68.js.gz +0 -0
  367. package/dist/web/assets/markdown-renderer-BiYsGykC.js.br +0 -0
  368. package/dist/web/assets/markdown-renderer-BiYsGykC.js.gz +0 -0
  369. package/dist/web/assets/mobile-explorer-sheet-jaq7Mg6b.js.br +0 -0
  370. package/dist/web/assets/mobile-explorer-sheet-jaq7Mg6b.js.gz +0 -0
  371. package/dist/web/assets/new-design-dialog-BwCvH6O2.js.br +0 -0
  372. package/dist/web/assets/new-design-dialog-BwCvH6O2.js.gz +0 -0
  373. package/dist/web/assets/notifications-settings-section-DxrC1etV.js.br +0 -0
  374. package/dist/web/assets/notifications-settings-section-DxrC1etV.js.gz +0 -0
  375. package/dist/web/assets/ppmbot-settings-section-DOQRM-QG.js.br +0 -0
  376. package/dist/web/assets/ppmbot-settings-section-DOQRM-QG.js.gz +0 -0
  377. package/dist/web/assets/problems-panel-Ba82qdj_.js.br +0 -0
  378. package/dist/web/assets/problems-panel-Ba82qdj_.js.gz +0 -0
  379. package/dist/web/assets/process-table-CShM_06i.js.br +0 -0
  380. package/dist/web/assets/process-table-CShM_06i.js.gz +0 -0
  381. package/dist/web/assets/proxy-settings-section-BSkXhBlt.js.br +0 -0
  382. package/dist/web/assets/proxy-settings-section-BSkXhBlt.js.gz +0 -0
  383. package/dist/web/assets/query-tab-QXTAI8_o.js.br +0 -0
  384. package/dist/web/assets/query-tab-QXTAI8_o.js.gz +0 -0
  385. package/dist/web/assets/remote-access-settings-section-1u6n8wyz.js.br +0 -0
  386. package/dist/web/assets/remote-access-settings-section-1u6n8wyz.js.gz +0 -0
  387. package/dist/web/assets/remote-desktop-clipboard-notice-CYKZ-BfJ.js.br +0 -0
  388. package/dist/web/assets/remote-desktop-clipboard-notice-CYKZ-BfJ.js.gz +0 -0
  389. package/dist/web/assets/remote-desktop-mobile-sheet-ktcOkEX6.js.br +0 -0
  390. package/dist/web/assets/remote-desktop-mobile-sheet-ktcOkEX6.js.gz +0 -0
  391. package/dist/web/assets/remote-desktop-mobile-view-FCh2F0H_.js.br +0 -0
  392. package/dist/web/assets/remote-desktop-mobile-view-FCh2F0H_.js.gz +0 -0
  393. package/dist/web/assets/remote-desktop-readiness-gate-0nIs2xs7.js.br +0 -0
  394. package/dist/web/assets/remote-desktop-readiness-gate-0nIs2xs7.js.gz +0 -0
  395. package/dist/web/assets/remote-desktop-window-content-DWek641T.js.br +0 -0
  396. package/dist/web/assets/remote-desktop-window-content-DWek641T.js.gz +0 -0
  397. package/dist/web/assets/rename-object-dialog-BpkditUB.js.br +0 -0
  398. package/dist/web/assets/rename-object-dialog-BpkditUB.js.gz +0 -0
  399. package/dist/web/assets/review-address-setup-Nn1TCSWK.js.br +0 -0
  400. package/dist/web/assets/review-address-setup-Nn1TCSWK.js.gz +0 -0
  401. package/dist/web/assets/review-code-ZSeHU4ZV.js.br +0 -0
  402. package/dist/web/assets/review-code-ZSeHU4ZV.js.gz +0 -0
  403. package/dist/web/assets/save-as-dialog-BTheU6SL.js.br +0 -0
  404. package/dist/web/assets/save-as-dialog-BTheU6SL.js.gz +0 -0
  405. package/dist/web/assets/schedule-script-editor-DmWFZjGb.js.br +0 -0
  406. package/dist/web/assets/schedule-script-editor-DmWFZjGb.js.gz +0 -0
  407. package/dist/web/assets/schedules-settings-section-C_-ZuPKw.js.br +0 -0
  408. package/dist/web/assets/schedules-settings-section-C_-ZuPKw.js.gz +0 -0
  409. package/dist/web/assets/session-review-tab-DoUPZWcr.js.br +0 -0
  410. package/dist/web/assets/session-review-tab-DoUPZWcr.js.gz +0 -0
  411. package/dist/web/assets/settings-body-BoDqDvDa.js.br +0 -0
  412. package/dist/web/assets/settings-body-BoDqDvDa.js.gz +0 -0
  413. package/dist/web/assets/settings-rows-DpOwXhiC.js.br +0 -0
  414. package/dist/web/assets/settings-rows-DpOwXhiC.js.gz +0 -0
  415. package/dist/web/assets/settings-section-content-1hItUZe5.js.br +0 -0
  416. package/dist/web/assets/settings-section-content-1hItUZe5.js.gz +0 -0
  417. package/dist/web/assets/slash-command-picker-BjheCmNV.js.br +0 -0
  418. package/dist/web/assets/slash-command-picker-BjheCmNV.js.gz +0 -0
  419. package/dist/web/assets/sql-object-tab-BYrNT42v.js.br +0 -0
  420. package/dist/web/assets/sql-object-tab-BYrNT42v.js.gz +0 -0
  421. package/dist/web/assets/sqlite-viewer-BlTxAex4.js.br +0 -0
  422. package/dist/web/assets/sqlite-viewer-BlTxAex4.js.gz +0 -0
  423. package/dist/web/assets/structure-save-dialog-di0ND8mR.js.br +0 -0
  424. package/dist/web/assets/structure-save-dialog-di0ND8mR.js.gz +0 -0
  425. package/dist/web/assets/structure-tab-CjOPHxmp.js.br +0 -0
  426. package/dist/web/assets/structure-tab-CjOPHxmp.js.gz +0 -0
  427. package/dist/web/assets/system-monitor-body-C2lm2rrH.js.br +0 -0
  428. package/dist/web/assets/system-monitor-body-C2lm2rrH.js.gz +0 -0
  429. package/dist/web/assets/tab-host-window-content-1Mp12Al4.js.br +0 -0
  430. package/dist/web/assets/tab-host-window-content-1Mp12Al4.js.gz +0 -0
  431. package/dist/web/assets/table-tab-CKFHBAli.js.br +0 -0
  432. package/dist/web/assets/table-tab-CKFHBAli.js.gz +0 -0
  433. package/dist/web/assets/telegram-bot-token-field-D3Go3gl_.js.br +0 -0
  434. package/dist/web/assets/telegram-bot-token-field-D3Go3gl_.js.gz +0 -0
  435. package/dist/web/assets/terminal-tab-BNf3yl9z.js.br +0 -0
  436. package/dist/web/assets/terminal-tab-BNf3yl9z.js.gz +0 -0
  437. package/dist/web/assets/tool-cards-B9bTL2ee.js.br +0 -0
  438. package/dist/web/assets/tool-cards-B9bTL2ee.js.gz +0 -0
  439. package/dist/web/assets/tools-settings-section-DJNAy0fk.js.br +0 -0
  440. package/dist/web/assets/tools-settings-section-DJNAy0fk.js.gz +0 -0
  441. package/dist/web/assets/use-inline-blame-ecF1PiwV.js.br +0 -0
  442. package/dist/web/assets/use-inline-blame-ecF1PiwV.js.gz +0 -0
  443. package/dist/web/assets/use-lsp-CGExPn9f.js.br +0 -0
  444. package/dist/web/assets/use-lsp-CGExPn9f.js.gz +0 -0
  445. package/dist/web/assets/use-process-kill-DIfudshA.js.br +0 -0
  446. package/dist/web/assets/use-process-kill-DIfudshA.js.gz +0 -0
  447. package/dist/web/assets/use-sql-schema-info-C-gzaPpU.js.br +0 -0
  448. package/dist/web/assets/use-sql-schema-info-C-gzaPpU.js.gz +0 -0
  449. package/dist/web/assets/web-preview-tab-CndNrVng.js.br +0 -0
  450. package/dist/web/assets/web-preview-tab-CndNrVng.js.gz +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.23.30] - 2026-11-05
4
+
5
+ ### Fixed
6
+
7
+ - **An AI question now shows the preview Claude attached to its options.** A plan or mockup Claude put "in the panel next to the options" was dropped, leaving only the bare question; it now sits beside the options (below them on a phone, scrolling inside), follows the option you move to, and stays readable on the answered card.
8
+
3
9
  ## [0.23.29] - 2026-11-04
4
10
 
5
11
  ### Fixed
@@ -73,4 +73,4 @@ This skill covers the `ppm` CLI, its HTTP API, and its config DB. It does **not*
73
73
  - Third-party extensions (inspect via `ppm ext list`).
74
74
  - The Claude Agent SDK internals (separate skill).
75
75
 
76
- <!-- Generated for PPM v0.23.29 at build time. Re-run `ppm export skill --install` to refresh. -->
76
+ <!-- Generated for PPM v0.23.30 at build time. Re-run `ppm export skill --install` to refresh. -->
@@ -843,7 +843,7 @@ Replace a script schedule's state with a JSON file; the schedule must be off
843
843
  Manage and inspect discovered skills & commands
844
844
 
845
845
  **Options:**
846
- - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm-release"`)
846
+ - `--project <path>` — Project path (default: `"C:\\Users\\PC\\AppData\\Local\\Temp\\claude\\C--Users-PC-ppm\\21a3467d-c805-408b-a71e-1bd7a4784a87\\scratchpad\\relclone"`)
847
847
 
848
848
  **Usage:** `ppm skills [options] [command]`
849
849
 
@@ -853,7 +853,7 @@ List all discovered skills and commands
853
853
 
854
854
  **Options:**
855
855
  - `--json` — JSON output
856
- - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm-release"`)
856
+ - `--project <path>` — Project path (default: `"C:\\Users\\PC\\AppData\\Local\\Temp\\claude\\C--Users-PC-ppm\\21a3467d-c805-408b-a71e-1bd7a4784a87\\scratchpad\\relclone"`)
857
857
 
858
858
  ### `ppm skills search`
859
859
 
@@ -861,7 +861,7 @@ Fuzzy search skills and commands
861
861
 
862
862
  **Options:**
863
863
  - `--json` — JSON output
864
- - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm-release"`)
864
+ - `--project <path>` — Project path (default: `"C:\\Users\\PC\\AppData\\Local\\Temp\\claude\\C--Users-PC-ppm\\21a3467d-c805-408b-a71e-1bd7a4784a87\\scratchpad\\relclone"`)
865
865
 
866
866
  **Usage:** `ppm skills search [options] <query>`
867
867
 
@@ -871,7 +871,7 @@ Show detailed info for a specific skill
871
871
 
872
872
  **Options:**
873
873
  - `--json` — JSON output
874
- - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm-release"`)
874
+ - `--project <path>` — Project path (default: `"C:\\Users\\PC\\AppData\\Local\\Temp\\claude\\C--Users-PC-ppm\\21a3467d-c805-408b-a71e-1bd7a4784a87\\scratchpad\\relclone"`)
875
875
 
876
876
  **Usage:** `ppm skills info [options] <name>`
877
877
 
@@ -500,4 +500,4 @@ _Base URL: `http://localhost:8080` (default; override via `ppm config set port <
500
500
  - `ws://<host>/ws/terminal` — PTY terminal multiplexer
501
501
  - `ws://<host>/ws/extensions` — extension host channel
502
502
 
503
- <!-- Generated from src/server/routes/ for PPM v0.23.29 -->
503
+ <!-- Generated from src/server/routes/ for PPM v0.23.30 -->
@@ -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{At as r,Cn as i,Cr as a,J as o,Kr as s,Zr as c,cr as l,ht as u,li as d,ln as f,ut as p,xn as m}from"./icons-C1wDt09O.js";import{a as h}from"./api-client-BnYFnEfK.js";import{n as g}from"./utils-D3xTlJyU.js";import"./portal-container-context-Gepuvxdg.js";import"./chat-preparation-cache-Bzb-T1pm.js";import{n as _}from"./use-is-mobile-CL2I7hLf.js";import{r as v}from"./clipboard-D3XnL7CB.js";import{r as y,t as b}from"./button-BHGVTbam.js";import{a as x,i as S,n as C,o as w,r as T,t as E}from"./dialog-DnE192fh.js";import{t as D}from"./mobile-bottom-sheet-RpOWOJpG.js";import"./use-visual-viewport-CgUU5t0c.js";import{t as O}from"./input-DlAmNJA0.js";import{$i as k,$n as A,Pr as j,Qi as M,Qn as N,Ri as P,Xn as F,Yn as I,Zi as L,Zn as R,er as z}from"./index-dfjFhOrF.js";import{_ as ee,a as te,h as B,m as ne,o as re,p as ie,r as ae,v as oe,x as V,y as se}from"./api-settings-VptFeOUT.js";import{_ as ce,a as le,b as ue,c as de,d as fe,g as H,h as U,l as pe,m as me,n as he,o as ge,p as W,r as _e,s as G,t as ve,u as ye,x as K,y as q}from"./codex-reset-credit-button-B5W0_kbI.js";var J=e(t(),1),Y=n(),X=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],Z=Array.from({length:24},(e,t)=>t);function be(e,t){let n=Array.from({length:7},()=>Array.from({length:24},()=>({sum:0,count:0,avg:0})));for(let r of e){let e=t===`5h`?r.five_hour_util:r.weekly_util;if(e==null)continue;let i=new Date(r.recorded_at+(r.recorded_at.endsWith(`Z`)?``:`Z`)),a=(i.getDay()+6)%7,o=i.getHours();n[a][o].sum+=e,n[a][o].count+=1}for(let e of n)for(let t of e)t.avg=t.count>0?t.sum/t.count:0;return n}function xe(e){return e.map(e=>{let t=e.reduce((e,t)=>e+t.sum,0),n=e.reduce((e,t)=>e+t.count,0);return n>0?t/n:0})}function Se(e){return Z.map(t=>{let n=0,r=0;for(let i of e)n+=i[t].sum,r+=i[t].count;return r>0?n/r:0})}function Q(e){return e===0?`bg-surface-elevated`:e<.3?`bg-success/30`:e<.5?`bg-success/60`:e<.7?`bg-warning/50`:e<.9?`bg-warning/80`:`bg-error/80`}function Ce(e){return e<.3?`bg-success`:e<.7?`bg-warning`:`bg-error`}function we({accountId:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(!0),[a,o]=(0,J.useState)(`5h`);(0,J.useEffect)(()=>{i(!0),ie(e).then(n).catch(()=>n([])).finally(()=>i(!1))},[e]);let s=(0,J.useMemo)(()=>t?be(t,a):null,[t,a]),c=(0,J.useMemo)(()=>s?xe(s):[],[s]),l=(0,J.useMemo)(()=>s?Se(s):[],[s]),u=Math.max(...c,.01);if(Math.max(...l,.01),r)return(0,Y.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,Y.jsx)(m,{className:`size-3 animate-spin text-text-subtle`})});if(!t||t.length===0)return(0,Y.jsx)(`div`,{className:`text-[10px] text-text-subtle py-2 text-center`,children:`No usage history yet`});let d=t.length,f=new Set(t.map(e=>new Date(e.recorded_at+(e.recorded_at.endsWith(`Z`)?``:`Z`)).toDateString())).size;return(0,Y.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-medium text-text-subtle`,children:`Usage Pattern (7d)`}),(0,Y.jsxs)(`div`,{className:`flex gap-0.5 text-[9px]`,children:[(0,Y.jsx)(`button`,{onClick:()=>o(`5h`),className:`px-1.5 py-0.5 rounded cursor-pointer transition-colors ${a===`5h`?`bg-primary/15 text-primary`:`text-text-subtle hover:text-text-secondary`}`,title:`5-hour rolling window limit — resets every 5 hours`,children:`5h`}),(0,Y.jsx)(`button`,{onClick:()=>o(`weekly`),className:`px-1.5 py-0.5 rounded cursor-pointer transition-colors ${a===`weekly`?`bg-primary/15 text-primary`:`text-text-subtle hover:text-text-secondary`}`,title:`Weekly limit — resets every 7 days`,children:`Wk`})]})]}),(0,Y.jsxs)(`p`,{className:`text-[9px] text-text-subtle leading-tight`,children:[`Avg `,a===`5h`?`5-hour`:`weekly`,` limit usage over `,f,`d (`,d,` samples). Higher % = closer to rate limit. Hover cells for details.`]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Avg usage by day of week`}),(0,Y.jsx)(`div`,{className:`flex flex-col gap-[2px] mt-0.5`,children:X.map((e,t)=>{let n=c[t]??0;return(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(`span`,{className:`text-[8px] text-text-subtle w-5 shrink-0 text-right tabular-nums`,children:e}),(0,Y.jsx)(`div`,{className:`flex-1 h-2.5 bg-surface-elevated rounded-sm overflow-hidden`,children:(0,Y.jsx)(`div`,{className:`h-full rounded-sm transition-all ${Ce(n)}`,style:{width:`${Math.round(n/u*100)}%`}})}),(0,Y.jsxs)(`span`,{className:`text-[8px] text-text-subtle w-6 shrink-0 text-right tabular-nums`,children:[Math.round(n*100),`%`]})]},e)})})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Avg usage by hour (0h-23h)`}),(0,Y.jsx)(`div`,{className:`flex gap-[1px] mt-0.5`,children:Z.map(e=>{let t=l[e]??0;return(0,Y.jsxs)(`div`,{className:`flex-1 flex flex-col items-center gap-[1px]`,children:[(0,Y.jsx)(`div`,{className:`w-full aspect-square rounded-[2px] ${Q(t)}`,title:`${e}:00 — avg ${Math.round(t*100)}% usage`}),e%6==0&&(0,Y.jsx)(`span`,{className:`text-[7px] text-text-subtle tabular-nums`,children:e})]},e)})})]}),s&&(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Day x Hour heatmap`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-[1px] mt-0.5`,children:[X.map((e,t)=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-[1px]`,children:[(0,Y.jsx)(`span`,{className:`text-[7px] text-text-subtle w-4 shrink-0 text-right`,children:e.charAt(0)}),Z.map(n=>{let r=s[t][n];return(0,Y.jsx)(`div`,{className:`flex-1 aspect-square rounded-[1px] ${Q(r.avg)}`,title:`${e} ${n}:00 — ${r.count>0?`avg ${Math.round(r.avg*100)}% (${r.count} samples)`:`no data`}`},n)})]},e)),(0,Y.jsxs)(`div`,{className:`flex items-center gap-[1px]`,children:[(0,Y.jsx)(`span`,{className:`w-4 shrink-0`}),Z.map(e=>(0,Y.jsx)(`div`,{className:`flex-1 text-center`,children:e%6==0&&(0,Y.jsx)(`span`,{className:`text-[7px] text-text-subtle tabular-nums`,children:e})},e))]})]})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[8px] text-text-subtle`,children:[(0,Y.jsx)(`span`,{children:`Low`}),(0,Y.jsxs)(`div`,{className:`flex gap-[2px]`,children:[(0,Y.jsx)(`div`,{className:`size-2 rounded-[1px] bg-success/30`}),(0,Y.jsx)(`div`,{className:`size-2 rounded-[1px] bg-success/60`}),(0,Y.jsx)(`div`,{className:`size-2 rounded-[1px] bg-warning/50`}),(0,Y.jsx)(`div`,{className:`size-2 rounded-[1px] bg-warning/80`}),(0,Y.jsx)(`div`,{className:`size-2 rounded-[1px] bg-error/80`})]}),(0,Y.jsx)(`span`,{children:`High`}),(0,Y.jsx)(`span`,{className:`ml-1`,children:`|`}),(0,Y.jsx)(`div`,{className:`size-2 rounded-[1px] bg-surface-elevated border border-border/30`}),(0,Y.jsx)(`span`,{children:`No data`})]})]})}function Te({profile:e,accountId:t,onClose:n}){let r=[[`Name`,e.account?.display_name],[`Email`,e.account?.email],[`Org`,e.organization?.name],[`Type`,e.organization?.organization_type],[`Tier`,e.organization?.rate_limit_tier],[`Status`,e.organization?.subscription_status]];return(0,Y.jsxs)(`section`,{className:`space-y-2 border-t border-border pt-3`,"data-testid":`account-profile-panel`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:`Profile`}),(0,Y.jsx)(`button`,{className:`p-2 text-muted-foreground hover:text-foreground cursor-pointer`,onClick:n,"aria-label":`Close profile`,children:(0,Y.jsx)(d,{className:`size-4`})})]}),(0,Y.jsx)(`div`,{className:`grid grid-cols-[80px_1fr] gap-x-3 gap-y-1 text-xs`,children:r.map(([e,t])=>t?(0,Y.jsxs)(`span`,{className:`contents`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,Y.jsx)(`span`,{className:`break-all`,children:t})]},e):null)}),(0,Y.jsx)(we,{accountId:t})]})}function Ee({display:e,onConfirm:t,onCancel:n}){let r=_(),i=(0,Y.jsxs)(`div`,{className:`space-y-4`,"data-testid":`account-delete-confirm`,children:[(0,Y.jsxs)(`p`,{className:`text-sm`,children:[`Remove `,(0,Y.jsx)(`span`,{className:`font-medium`,children:e}),`?`]}),(0,Y.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`The stored token is deleted from this machine. Any export you already made keeps working.`}),(0,Y.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end pt-2`,children:[(0,Y.jsx)(b,{variant:`outline`,onClick:n,className:`min-h-11`,children:`Cancel`}),(0,Y.jsx)(b,{variant:`destructive`,autoFocus:!1,onClick:t,className:`min-h-11`,children:`Remove account`})]})]});return r?(0,Y.jsx)(D,{open:!0,onClose:n,children:(0,Y.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,Y.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:`Remove account`}),i]})}):(0,Y.jsx)(E,{open:!0,onOpenChange:e=>{e||n()},children:(0,Y.jsxs)(C,{className:`sm:max-w-sm`,children:[(0,Y.jsx)(x,{children:(0,Y.jsx)(w,{className:`text-sm`,children:`Remove account`})}),i]})})}var De=80;function Oe({current:e,onSave:t,onCancel:n}){let r=_(),[i,a]=(0,J.useState)(e),[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(null),u=i.trim(),d=!!u&&u!==e&&!o,f=async()=>{if(d){s(!0),l(null);try{await t(u)}catch(e){l(e.message||`Could not rename the account`),s(!1)}}},p=()=>{o||n()},h=(0,Y.jsxs)(`form`,{className:`space-y-4`,"data-testid":`account-rename-dialog`,onSubmit:e=>{e.preventDefault(),f()},children:[(0,Y.jsx)(O,{autoFocus:!0,value:i,maxLength:De,onChange:e=>a(e.target.value),placeholder:`e.g. Personal, Work`,"aria-label":`Account name`,className:`min-h-11 text-sm md:min-h-9`}),c&&(0,Y.jsx)(`p`,{className:`text-xs text-error`,role:`alert`,children:c}),(0,Y.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end`,children:[(0,Y.jsx)(b,{type:`button`,variant:`outline`,onClick:p,disabled:o,className:`min-h-11 md:min-h-9`,children:`Cancel`}),(0,Y.jsxs)(b,{type:`submit`,disabled:!d,className:`min-h-11 md:min-h-9`,children:[o&&(0,Y.jsx)(m,{className:`size-4 animate-spin`}),` Save`]})]})]});return r?(0,Y.jsx)(D,{open:!0,onClose:p,children:(0,Y.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,Y.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:`Rename account`}),h]})}):(0,Y.jsx)(E,{open:!0,onOpenChange:e=>{e||p()},children:(0,Y.jsxs)(C,{className:`sm:max-w-sm`,children:[(0,Y.jsx)(x,{children:(0,Y.jsx)(w,{className:`text-sm`,children:`Rename account`})}),h]})})}function ke(e){let t=new Blob([e],{type:`application/json`}),n=document.createElement(`a`);n.href=URL.createObjectURL(t),n.download=`ppm-accounts-backup.json`,n.click(),URL.revokeObjectURL(n.href)}function Ae({open:e,onOpenChange:t,accounts:n,preselectId:r,onMessage:a}){let o=n.filter(e=>e.hasRefreshToken),[s,c]=(0,J.useState)(new Set),[l,d]=(0,J.useState)(``),[f,g]=(0,J.useState)(!1),[_,y]=(0,J.useState)(!1),[D,k]=(0,J.useState)(!1),[A,M]=(0,J.useState)(!1);e&&!A&&(c(r?new Set([r]):new Set(o.map(e=>e.id))),M(!0)),!e&&A&&M(!1);function N(){t(!1),d(``),g(!1),y(!1)}async function P(e){if(s.size===0)return;k(!0);let t=l.trim()||`ppm-hienlh`;try{let n={"Content-Type":`application/json`},r=h();r&&(n.Authorization=`Bearer ${r}`);let i=await fetch(`/api/accounts/export`,{method:`POST`,headers:n,body:JSON.stringify({password:t,accountIds:[...s],includeRefreshToken:f,refreshBeforeExport:_})});if(!i.ok){let e=await i.json();throw Error(e.error??`Export failed: ${i.status}`)}let o=await i.text();e&&await v(o)?a?.(`Backup copied to clipboard!`):(ke(o),a?.(`Backup downloaded.`)),N()}catch{}k(!1)}let F=s.size>0&&!D;return(0,Y.jsx)(E,{open:e,onOpenChange:e=>{e||N()},children:(0,Y.jsxs)(C,{className:`sm:max-w-md`,children:[(0,Y.jsxs)(x,{children:[(0,Y.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,Y.jsx)(i,{className:`size-3.5`}),` Export Accounts`]}),(0,Y.jsx)(T,{className:`text-xs`,children:`Select accounts and set a password to protect the backup.`})]}),(0,Y.jsxs)(`div`,{className:`space-y-3`,children:[(0,Y.jsxs)(`div`,{className:`space-y-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,Y.jsx)(`p`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Accounts to export`}),(0,Y.jsx)(`button`,{className:`text-[10px] text-primary hover:underline cursor-pointer`,onClick:()=>c(s.size===o.length?new Set:new Set(o.map(e=>e.id))),children:s.size===o.length?`Deselect all`:`Select all`})]}),o.length===0?(0,Y.jsx)(`p`,{className:`text-[10px] text-muted-foreground p-2 border rounded`,children:`No exportable accounts.`}):(0,Y.jsx)(`div`,{className:`max-h-36 overflow-y-auto space-y-1 border rounded p-2`,children:o.map(e=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,id:`exp-${e.id}`,checked:s.has(e.id),onChange:t=>{let n=new Set(s);t.target.checked?n.add(e.id):n.delete(e.id),c(n)},className:`size-3.5 accent-primary cursor-pointer`}),(0,Y.jsx)(`label`,{htmlFor:`exp-${e.id}`,className:`text-xs cursor-pointer truncate`,children:e.label??e.email??e.id.slice(0,8)})]},e.id))})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsxs)(j,{className:`text-xs`,children:[`Password `,(0,Y.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,Y.jsx)(O,{type:`password`,placeholder:`Leave empty for default`,value:l,onChange:e=>d(e.target.value),className:`text-xs h-8`,autoComplete:`new-password`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,id:`exp-full`,checked:f,onChange:e=>g(e.target.checked),className:`size-3.5 accent-primary cursor-pointer`}),(0,Y.jsx)(`label`,{htmlFor:`exp-full`,className:`text-[11px] cursor-pointer`,children:`Include refresh tokens (full transfer)`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,id:`exp-refresh`,checked:_,onChange:e=>y(e.target.checked),className:`size-3.5 accent-primary cursor-pointer`}),(0,Y.jsx)(`label`,{htmlFor:`exp-refresh`,className:`text-[11px] cursor-pointer`,children:`Refresh tokens before export`})]}),f?(0,Y.jsxs)(`div`,{className:`rounded-md border border-error/30 bg-error/5 p-2.5`,children:[(0,Y.jsx)(`p`,{className:`text-[10px] font-medium text-error`,children:`Full transfer — source accounts will expire`}),(0,Y.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Refresh tokens included. Source machine expires in ~1h after target refreshes.`})]}):_?(0,Y.jsx)(`div`,{className:`rounded-md border border-warning/30 bg-warning/5 p-2.5`,children:(0,Y.jsx)(`p`,{className:`text-[10px] font-medium text-warning`,children:`Refresh before export — invalidates previous shares`})}):(0,Y.jsx)(`div`,{className:`rounded-md border border-success/30 bg-success/5 p-2.5`,children:(0,Y.jsx)(`p`,{className:`text-[10px] font-medium text-success`,children:`Share current token (safe)`})}),(0,Y.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Encrypted with AES-256-GCM + scrypt.`})]}),(0,Y.jsxs)(S,{className:`gap-1.5 flex-col sm:flex-row`,children:[(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:N,children:`Cancel`}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,disabled:!F,onClick:()=>P(!0),children:[(0,Y.jsx)(p,{className:`size-3 mr-1`}),` Copy`]}),(0,Y.jsx)(b,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!F,onClick:()=>P(!1),children:D?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(m,{className:`size-3 animate-spin mr-1`}),` Exporting...`]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(u,{className:`size-3 mr-1`}),` Download`]})})]})]})})}function je({open:e,onOpenChange:t,onSuccess:n}){let[r,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(null);function f(){t(!1),a(``),s(``),d(null)}async function p(){if(r.trim()){l(!0),d(null);try{let e=await ne({data:r.trim(),password:o.trim()||`ppm-hienlh`});f(),n(`Imported ${e.imported} account(s)`)}catch(e){d(e.message||`Import failed`)}l(!1)}}return(0,Y.jsx)(E,{open:e,onOpenChange:e=>{e||f()},children:(0,Y.jsxs)(C,{className:`sm:max-w-md`,children:[(0,Y.jsxs)(x,{children:[(0,Y.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,Y.jsx)(i,{className:`size-3.5`}),` Import Accounts`]}),(0,Y.jsx)(T,{className:`text-xs`,children:`Paste backup data and enter the export password. Imported accounts are temporary (~1h).`})]}),(0,Y.jsxs)(`div`,{className:`space-y-3`,children:[(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsx)(j,{className:`text-xs`,children:`Backup data`}),(0,Y.jsx)(`textarea`,{value:r,onChange:e=>a(e.target.value),placeholder:`Paste backup JSON here...`,rows:4,className:`w-full text-xs p-2 rounded border border-border bg-background font-mono resize-none focus:outline-none focus:ring-1 focus:ring-primary`})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsxs)(j,{className:`text-xs`,children:[`Password `,(0,Y.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,Y.jsx)(O,{type:`password`,placeholder:`Leave empty for default`,value:o,onChange:e=>s(e.target.value),className:`text-xs h-8`,autoComplete:`current-password`})]})]}),u&&(0,Y.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:u}),(0,Y.jsxs)(S,{children:[(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:f,children:`Cancel`}),(0,Y.jsx)(b,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!r.trim()||c,onClick:p,children:c?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(m,{className:`size-3 animate-spin mr-1`}),` Importing...`]}):`Import`})]})]})})}var $=typeof window<`u`?window.matchMedia(`(min-width: 768px)`):null;function Me(e){return $?.addEventListener(`change`,e),()=>$?.removeEventListener(`change`,e)}function Ne(){return $?.matches??!0}function Pe(){let[e,t]=(0,J.useState)(null),[n,r]=(0,J.useState)(!0);return(0,J.useEffect)(()=>{r(!0),re().then(t).finally(()=>r(!1))},[]),n?(0,Y.jsx)(`p`,{className:`text-xs text-text-subtle py-4 text-center`,children:`Loading...`}):e?(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Rotation Strategy`}),(0,Y.jsxs)(I,{value:e.strategy,onValueChange:async e=>{t(await V({strategy:e}))},children:[(0,Y.jsx)(N,{className:`w-full h-9 text-xs`,children:(0,Y.jsx)(A,{})}),(0,Y.jsxs)(F,{children:[(0,Y.jsx)(R,{value:`round-robin`,children:`Round-robin`}),(0,Y.jsx)(R,{value:`fill-first`,children:`Fill-first`}),(0,Y.jsx)(R,{value:`lowest-usage`,children:`Lowest usage`})]})]}),(0,Y.jsxs)(`p`,{className:`text-[10px] text-text-subtle`,children:[e.strategy===`round-robin`&&`Cycles through accounts evenly`,e.strategy===`fill-first`&&`Uses one account until its limit, then moves on`,e.strategy===`lowest-usage`&&`Picks the account with the lowest current usage`]})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Max Retry`}),(0,Y.jsx)(`input`,{type:`number`,min:0,value:e.maxRetry,className:`w-full h-9 text-xs border rounded-md px-3 bg-background`,onChange:async e=>{let n=parseInt(e.target.value,10);!isNaN(n)&&n>=0&&t(await V({maxRetry:n}))}}),(0,Y.jsx)(`p`,{className:`text-[10px] text-text-subtle`,children:`How many accounts to try on failure. 0 = try all available accounts.`})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5 border-t border-border pt-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Cooldown parking`}),(0,Y.jsx)(z,{checked:e.cooldownEnabled,onCheckedChange:async e=>{t(await V({cooldownEnabled:e}))}})]}),(0,Y.jsx)(`p`,{className:`text-[10px] text-text-subtle`,children:`Park a failing account (rate limit / usage limit / auth error) until it recovers. Off: accounts stay selectable — rotation still skips accounts already ≥95% on the 5-hour limit.`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between text-xs border-t border-border pt-3`,children:[(0,Y.jsx)(`span`,{className:`text-text-subtle`,children:`Active accounts`}),(0,Y.jsx)(`span`,{className:`font-medium text-text-primary`,children:e.activeCount})]})]}):(0,Y.jsx)(`p`,{className:`text-xs text-text-subtle py-4 text-center`,children:`Failed to load settings`})}function Fe({open:e,onOpenChange:t}){let n=(0,J.useSyncExternalStore)(Me,Ne);return e?n?(0,Y.jsx)(E,{open:e,onOpenChange:t,children:(0,Y.jsxs)(C,{className:`sm:max-w-sm`,children:[(0,Y.jsx)(x,{children:(0,Y.jsxs)(w,{className:`text-sm flex items-center gap-2`,children:[(0,Y.jsx)(a,{className:`size-4`}),` Rotation & Retry`]})}),(0,Y.jsx)(Pe,{})]})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`fixed inset-0 z-50 transition-opacity duration-200 opacity-100`,onClick:()=>t(!1),style:{backgroundColor:`rgba(0,0,0,0.5)`}}),(0,Y.jsxs)(`div`,{className:g(`fixed bottom-0 left-0 right-0 z-50 bg-background rounded-t-2xl border-t border-border shadow-2xl`,`transition-transform duration-300 ease-out max-h-[85vh] overflow-y-auto`,`translate-y-0`),children:[(0,Y.jsx)(`div`,{className:`flex justify-center pt-3 pb-1`,children:(0,Y.jsx)(`div`,{className:`w-10 h-1 rounded-full bg-border`})}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-b border-border`,children:[(0,Y.jsxs)(`span`,{className:`text-sm font-semibold flex items-center gap-2`,children:[(0,Y.jsx)(a,{className:`size-4`}),` Rotation & Retry`]}),(0,Y.jsx)(`button`,{onClick:()=>t(!1),className:`flex items-center justify-center size-7 rounded-md hover:bg-surface-elevated transition-colors`,children:(0,Y.jsx)(d,{className:`size-4`})})]}),(0,Y.jsx)(`div`,{className:`px-4 py-4 pb-8`,children:(0,Y.jsx)(Pe,{})})]})]}):null}var Ie=y(`inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground shadow`,secondary:`border-transparent bg-secondary text-secondary-foreground`,destructive:`border-transparent bg-destructive text-destructive-foreground shadow`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function Le({className:e,variant:t,...n}){return(0,Y.jsx)(`div`,{className:g(Ie({variant:t}),e),...n})}function Re(e){let t=Math.floor(Date.now()/1e3);return e>t?`${Math.floor((e-t)/60)}m`:`exp`}function ze({accounts:e}){let[t,n]=(0,J.useState)([]),[r,i]=(0,J.useState)(!1),[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(new Map),l=e.filter(e=>e.hasRefreshToken);async function u(){if(l.length!==0){i(!0);try{let e=await oe(l.map(e=>e.id),a);n(t=>[...t,{round:t.length+1,time:new Date().toLocaleTimeString(),includeRefresh:a,items:e}])}catch{}i(!1)}}async function d(e,t){c(t=>new Map(t).set(e,{loading:!0}));try{let n=await se(t);c(t=>new Map(t).set(e,{loading:!1,...n}))}catch(t){c(n=>new Map(n).set(e,{loading:!1,status:`error`,error:t.message}))}}function f(e,t){return[{key:`r${e.round}-pre-${t.id}`,label:`Pre-export`,token:t.preExportTokenFull,preview:t.preExportToken,expires:t.preExportExpires},{key:`r${e.round}-exp-${t.id}`,label:`Exported`,token:t.exportedTokenFull,preview:t.exportedToken,expires:t.exportedExpires},{key:`r${e.round}-post-${t.id}`,label:`Post-export`,token:t.postExportTokenFull,preview:t.postExportToken,expires:t.postExportExpires}]}function p(){for(let e of t)for(let t of e.items)for(let n of f(e,t))n.token&&d(n.key,n.token)}return(0,Y.jsxs)(`section`,{className:`border-t pt-4 space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsx)(`p`,{className:`text-xs font-medium`,children:`Simulate export`}),t.length>0&&(0,Y.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[t.length,` round(s)`]})]}),(0,Y.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Every run appends a round. Earlier rounds are kept so tokens can be compared across runs.`}),l.length===0?(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No OAuth account with a refresh token to export.`}):(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(z,{id:`sim-include-refresh`,checked:a,onCheckedChange:o,className:`cursor-pointer`}),(0,Y.jsx)(j,{htmlFor:`sim-include-refresh`,className:`text-[11px] cursor-pointer`,children:`Include refresh tokens`})]}),(0,Y.jsx)(b,{size:`sm`,className:`h-7 text-xs cursor-pointer`,disabled:r,onClick:()=>void u(),children:r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(m,{className:`size-3 animate-spin mr-1`}),` Exporting...`]}):`Run export #${t.length+1}`})]}),t.length>0&&(0,Y.jsxs)(`div`,{className:`space-y-3`,children:[(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`w-full h-7 text-[11px] cursor-pointer`,onClick:p,children:[`Test all tokens (`,t.reduce((e,t)=>e+t.items.length*3,0),`)`]}),t.map(e=>(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsxs)(`p`,{className:`text-xs font-medium text-primary`,children:[`Round #`,e.round]}),(0,Y.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.time}),(0,Y.jsx)(Le,{variant:e.includeRefresh?`destructive`:`secondary`,className:`text-[9px] px-1 py-0`,children:e.includeRefresh?`with refresh`:`access only`})]}),e.items.map(t=>(0,Y.jsxs)(`div`,{className:`p-2 rounded-lg border bg-card space-y-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[11px] font-medium`,children:t.label??t.email??t.id.slice(0,8)}),t.tokenChanged&&(0,Y.jsx)(Le,{variant:`secondary`,className:`text-[9px] px-1 py-0`,children:`DB token changed`})]}),f(e,t).map(e=>{let t=s.get(e.key);return(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px]`,children:[(0,Y.jsx)(`span`,{className:`w-20 shrink-0 text-muted-foreground text-[10px]`,children:e.label}),(0,Y.jsx)(`code`,{className:`flex-1 truncate font-mono text-[10px] bg-muted px-1 rounded`,children:e.preview??`N/A`}),e.expires&&(0,Y.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:Re(e.expires)}),e.token?(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`h-6 text-[10px] px-1.5 cursor-pointer shrink-0`,disabled:t?.loading,onClick:()=>void d(e.key,e.token),children:t?.loading?(0,Y.jsx)(m,{className:`size-3 animate-spin`}):`Test`}):(0,Y.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`-`}),t&&!t.loading&&(0,Y.jsx)(`span`,{className:`text-[10px] font-medium shrink-0 ${t.status?.startsWith(`valid`)?`text-success`:`text-error`}`,children:t.status})]},e.key)})]},`r${e.round}-${t.id}`))]},e.round))]})]})}function Be(e){let t=Math.floor(Date.now()/1e3),n=Math.floor(Math.abs(e-t)/60);return e>t?`${n}m left`:`expired ${n}m ago`}function Ve({open:e,onOpenChange:t,accounts:n}){let[i,a]=(0,J.useState)(new Map),[o,s]=(0,J.useState)(!1);async function c(e){a(t=>new Map(t).set(e,{loading:!0}));try{let t=await ee(e,o);a(n=>new Map(n).set(e,{loading:!1,result:t}))}catch(t){a(n=>new Map(n).set(e,{loading:!1,error:t.message}))}}function l(){for(let e of n.filter(e=>e.expiresAt!==null))c(e.id)}return(0,Y.jsx)(E,{open:e,onOpenChange:t,children:(0,Y.jsxs)(C,{className:`sm:max-w-xl max-h-[85vh] flex flex-col`,children:[(0,Y.jsxs)(x,{children:[(0,Y.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,Y.jsx)(r,{className:`size-4`}),` Token Test`]}),(0,Y.jsx)(T,{className:`text-xs`,children:`Probe stored tokens for validity. Nothing is modified.`})]}),(0,Y.jsxs)(`div`,{className:`space-y-4 overflow-y-auto flex-1 pr-1`,children:[(0,Y.jsxs)(`section`,{className:`space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsx)(`p`,{className:`text-xs font-medium`,children:`Current tokens`}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(z,{id:`token-test-refresh`,checked:o,onCheckedChange:s,className:`cursor-pointer`}),(0,Y.jsx)(j,{htmlFor:`token-test-refresh`,className:`text-[11px] cursor-pointer`,children:`Also test refresh`})]}),(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`h-7 text-xs cursor-pointer`,onClick:l,children:`Test all`})]})]}),n.length===0&&(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No accounts to test.`}),(0,Y.jsx)(`div`,{className:`space-y-1.5`,children:n.map(e=>{let t=i.get(e.id),n=t?.result?.accessToken.status;return(0,Y.jsxs)(`div`,{className:`p-2 rounded border bg-card space-y-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`span`,{className:`text-xs font-medium truncate block`,children:e.label??e.email??e.id.slice(0,8)}),e.expiresAt&&(0,Y.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:Be(e.expiresAt)})]}),(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`h-7 text-xs cursor-pointer shrink-0`,disabled:t?.loading,onClick:()=>void c(e.id),children:t?.loading?(0,Y.jsx)(m,{className:`size-3 animate-spin`}):`Test`})]}),t&&!t.loading&&(0,Y.jsxs)(`div`,{className:`text-[11px] pl-2 border-l-2 border-muted`,children:[t.error&&(0,Y.jsx)(`p`,{className:`text-error`,children:t.error}),n&&(0,Y.jsxs)(`span`,{className:n.startsWith(`valid`)?`text-success`:`text-error`,children:[n,t.result?.accessToken.code?` (${t.result.accessToken.code})`:``]})]})]},e.id)})})]}),(0,Y.jsx)(ze,{accounts:n})]}),(0,Y.jsx)(S,{children:(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Close`})})]})})}function He(){let{usages:e,accounts:t,activeAccountId:n,initialLoading:i,refreshing:o,flashIds:s,reload:d}=pe(),[p,h]=(0,J.useState)(null),[g,_]=(0,J.useState)(null),[v,y]=(0,J.useState)(null),[x,S]=(0,J.useState)(null),[C,w]=(0,J.useState)(null),[T,E]=(0,J.useState)(null),[D,O]=(0,J.useState)(null),[k,A]=(0,J.useState)(void 0);function j(e){d(),e&&h(e)}async function M(e,t){_(e);try{await B(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){h(e.message)}_(null),d()}async function N(){if(v){try{await ae(v.id),h(`Account "${v.display}" removed.`),d()}catch(e){h(`Failed to remove: ${e.message}`)}y(null)}}async function P(e){x&&(await B(x.id,{label:e}),S(null),h(`Account renamed to "${e}".`),d())}let F=new Map(t.map(e=>[e.id,e])),I=e[0]?.usage.lastFetchedAt;return(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsx)(U,{description:`Connect multiple Claude accounts. PPM rotates between them automatically to avoid rate limits.`,onRefresh:()=>void d(),refreshing:o,disabled:i,actions:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(b,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>{A(void 0),O(`add`)},children:[(0,Y.jsx)(l,{className:`size-4`}),` Add account`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>{E(null),O(`export`)},children:[(0,Y.jsx)(u,{className:`size-4`}),` Export`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`import`),children:[(0,Y.jsx)(c,{className:`size-4`}),` Import`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`rotation`),children:[(0,Y.jsx)(a,{className:`size-4`}),` Rotation`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`token-test`),children:[(0,Y.jsx)(r,{className:`size-4`}),` Token test`]})]})}),(0,Y.jsx)(H,{message:p,onDismiss:()=>h(null)}),(0,Y.jsxs)(`section`,{className:`space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:`Accounts`}),I&&(0,Y.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[`usage `,ue(new Date(I).getTime())]})]}),i?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,Y.jsx)(m,{className:`size-4 animate-spin`}),` Loading accounts...`]}):e.length===0?(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-8 text-center`,children:[(0,Y.jsx)(f,{className:`size-5 text-muted-foreground`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No accounts connected yet.`}),(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Add one to start using PPM.`})]}):(0,Y.jsx)(W,{children:e.map(e=>(0,Y.jsx)(ye,{layout:`strip`,entry:e,isActive:e.accountId===n,accountInfo:F.get(e.accountId),onToggle:M,toggling:g===e.accountId,onDelete:(e,t)=>y({id:e,display:t}),onRename:(e,t)=>S({id:e,current:t}),onExport:e=>{E(e),O(`export`)},onViewProfile:(e,t)=>w({profile:e,accountId:t}),onReauth:()=>{A({id:e.accountId,label:e.accountLabel??e.accountId.slice(0,8)}),O(`add`)},flash:s.has(e.accountId)},e.accountId))})]}),C&&(0,Y.jsx)(Te,{profile:C.profile,accountId:C.accountId,onClose:()=>w(null)}),v&&(0,Y.jsx)(Ee,{display:v.display,onConfirm:()=>void N(),onCancel:()=>y(null)}),x&&(0,Y.jsx)(Oe,{current:x.current,onSave:P,onCancel:()=>S(null)}),(0,Y.jsx)(de,{open:D===`add`,onOpenChange:e=>{O(e?`add`:null),e||A(void 0)},onSuccess:j,signInAgainFor:k}),(0,Y.jsx)(Ae,{open:D===`export`,onOpenChange:e=>{O(e?`export`:null),e||E(null)},accounts:t,preselectId:T,onMessage:h}),(0,Y.jsx)(je,{open:D===`import`,onOpenChange:e=>O(e?`import`:null),onSuccess:j}),(0,Y.jsx)(Fe,{open:D===`rotation`,onOpenChange:e=>O(e?`rotation`:null)}),(0,Y.jsx)(Ve,{open:D===`token-test`,onOpenChange:e=>O(e?`token-test`:null),accounts:t})]})}function Ue({mode:e,onOpenChange:t,password:n,onPasswordChange:r,busy:a,onExport:o,onImport:s,error:l}){let d=(0,J.useRef)(null),f=e===`export`;return(0,Y.jsx)(E,{open:e!==null,onOpenChange:t,children:(0,Y.jsxs)(C,{className:`sm:max-w-md`,children:[(0,Y.jsxs)(x,{children:[(0,Y.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,Y.jsx)(i,{className:`size-4`}),` `,f?`Export Codex Accounts`:`Import Codex Accounts`]}),(0,Y.jsx)(T,{className:`text-xs leading-relaxed`,children:f?`Writes a password-encrypted file containing each account's login.`:`Reads a backup file. The password must be the one it was exported with.`})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsx)(j,{htmlFor:`codex-backup-password`,className:`text-xs`,children:`Password`}),(0,Y.jsx)(O,{id:`codex-backup-password`,type:`password`,placeholder:f?`Choose a password`:`Password used for the export`,value:n,onChange:e=>r(e.target.value),className:`text-xs`,autoComplete:f?`new-password`:`current-password`}),(0,Y.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`A backup holds full logins — keep the file and its password together.`})]}),l&&(0,Y.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:l}),(0,Y.jsx)(`input`,{ref:d,type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&s(t)}}),(0,Y.jsxs)(S,{children:[(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Cancel`}),(0,Y.jsxs)(b,{size:`sm`,className:`text-xs cursor-pointer gap-1.5`,disabled:!n.trim()||a,onClick:()=>f?o():d.current?.click(),children:[a?(0,Y.jsx)(m,{className:`size-3.5 animate-spin`}):f?(0,Y.jsx)(u,{className:`size-3.5`}):(0,Y.jsx)(c,{className:`size-3.5`}),f?`Download backup`:`Choose file`]})]})]})})}var We=[{value:`round-robin`,label:`Round-robin`,hint:`Take the next account each time.`},{value:`fill-first`,label:`Fill-first`,hint:`Stay on one account until it runs out.`},{value:`lowest-usage`,label:`Lowest usage`,hint:`Pick whichever has the most left.`}];function Ge({open:e,onOpenChange:t,strategy:n,onChange:r}){return(0,Y.jsx)(E,{open:e,onOpenChange:t,children:(0,Y.jsxs)(C,{className:`sm:max-w-md`,children:[(0,Y.jsxs)(x,{children:[(0,Y.jsx)(w,{className:`text-sm`,children:`Codex Rotation`}),(0,Y.jsx)(T,{className:`text-xs leading-relaxed`,children:`How a new chat chooses among your Codex accounts.`})]}),(0,Y.jsx)(`div`,{className:`space-y-2`,children:We.map(e=>(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),"aria-current":n===e.value?`true`:void 0,className:g(`w-full text-left rounded-md border px-3 py-2.5 min-h-11 cursor-pointer transition-colors`,n===e.value?`border-primary bg-primary/10`:`border-border hover:bg-accent/50 active:bg-accent`),children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:e.label}),(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.hint})]},e.value))}),(0,Y.jsx)(S,{children:(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Done`})})]})})}function Ke(e){return e==null?null:Math.round(e*100)}function qe({usage:e}){let t=e.session==null&&e.weekly==null;return(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(t||e.session!=null)&&(0,Y.jsx)(q,{label:`5-Hour Session`,pct:Ke(e.fiveHour),reset:K(e.session),resetsAt:e.session?.resetsAt}),(t||e.weekly!=null)&&(0,Y.jsx)(q,{label:`Weekly`,pct:Ke(e.sevenDay),reset:K(e.weekly),resetsAt:e.weekly?.resetsAt})]})}function Je(){let[e,t]=(0,J.useState)(null),n=le(()=>t(null)),[r,i]=(0,J.useState)(null);return(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsx)(U,{description:(0,Y.jsxs)(Y.Fragment,{children:[`Each Codex account keeps its own login (`,(0,Y.jsx)(`code`,{children:`CODEX_HOME`}),`). One is picked per chat by the rotation setting.`]}),onRefresh:()=>void n.load(),refreshing:n.loading,actions:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(b,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`add`),children:[(0,Y.jsx)(l,{className:`size-4`}),` Add account`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`export`),children:[(0,Y.jsx)(u,{className:`size-4`}),` Export`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`import`),children:[(0,Y.jsx)(c,{className:`size-4`}),` Import`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`rotation`),children:[(0,Y.jsx)(a,{className:`size-4`}),` Rotation`]})]})}),(0,Y.jsx)(H,{message:n.msg??n.err,onDismiss:()=>{n.setMsg(null),n.setErr(null)}}),(0,Y.jsxs)(`section`,{className:`space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:`Codex Accounts`}),(0,Y.jsx)(`span`,{className:`text-[10px] text-muted-foreground capitalize`,children:n.strategy.replace(`-`,` `)})]}),n.loading&&n.accounts.length===0?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,Y.jsx)(m,{className:`size-4 animate-spin`}),` Loading accounts...`]}):n.accounts.length===0?(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-8 text-center`,children:[(0,Y.jsx)(f,{className:`size-5 text-muted-foreground`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No Codex accounts yet.`}),(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Chats use your default `,(0,Y.jsx)(`code`,{children:`~/.codex`}),` login until you add one.`]})]}):(0,Y.jsx)(W,{children:n.accounts.map(e=>{let t=n.usages[e.id]??{};return(0,Y.jsxs)(me,{dense:!0,className:`min-w-[300px] shrink-0 snap-start${e.signedOut?` opacity-60`:``}`,"data-testid":`account-card`,"data-account-id":e.id,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium truncate flex-1 min-w-0`,children:e.label}),e.signedOut&&(0,Y.jsx)(ce,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`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.`,onClick:e.type===`chatgpt`?()=>i(e):void 0,children:`Sign in again`}),(0,Y.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-text-subtle border border-border rounded px-1 shrink-0`,children:e.type}),G(e.planType)&&(0,Y.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:G(e.planType)}),(0,Y.jsx)(z,{checked:e.status!==`disabled`,onCheckedChange:()=>void n.toggle(e.id,e.status??`active`),disabled:n.toggling.has(e.id),"aria-label":e.status===`disabled`?`Enable account`:`Disable account`,className:`cursor-pointer shrink-0`}),(0,Y.jsxs)(L,{children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsx)(`button`,{type:`button`,onClick:()=>void n.remove(e.id),"aria-label":`Remove account`,className:`p-2 rounded cursor-pointer text-text-subtle hover:text-error hover:bg-surface-elevated transition-colors shrink-0`,children:(0,Y.jsx)(s,{className:`size-4`})})}),(0,Y.jsx)(M,{side:`top`,children:`Remove account`})]})]}),(0,Y.jsx)(qe,{usage:t}),t.resetCredits&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap text-[10px] text-text-subtle`,children:[(0,Y.jsx)(fe,{credits:t.resetCredits}),(0,Y.jsx)(ve,{account:e,usage:t,onDone:e=>{n.setMsg(e),n.load()}})]}),t.session==null&&(()=>{let r=ge(t.weekly);return r?(0,Y.jsxs)(`div`,{className:`flex min-h-12 items-center justify-between gap-3 rounded-md border px-2.5 py-1.5 ${e.dailyGuardEnabled&&r.blocked?`border-error/40 bg-error/5`:`border-border/50 bg-surface/40`}`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium ${e.dailyGuardEnabled&&r.blocked?`text-error`:`text-text-secondary`}`,children:[(0,Y.jsx)(`span`,{children:`Daily guard`}),(0,Y.jsxs)(L,{children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsx)(`button`,{type:`button`,"aria-label":`About Daily guard`,className:`text-text-subtle hover:text-text-primary cursor-help`,children:(0,Y.jsx)(o,{className:`size-3.5`})})}),(0,Y.jsx)(M,{side:`top`,className:`max-w-64 text-xs leading-relaxed`,children:`Spreads the weekly quota across five weekdays, adding 20% per weekday. Weekend slots keep the previous cap; unused allowance carries forward. Daily slots start at the reset time and use UTC weekdays. Turn it off any time to use the remaining quota freely.`})]})]}),(0,Y.jsx)(`p`,{className:`text-[10px] tabular-nums ${e.dailyGuardEnabled&&r.blocked?`text-error`:`text-text-subtle`}`,children:e.dailyGuardEnabled&&r.blocked?`${Math.round(r.used*100)}% used / ${Math.round(r.cap*100)}% daily cap. New turns paused.`:`Weekday ${r.day}/5, ${Math.round(r.cap*100)}% daily cap`})]}),(0,Y.jsxs)(`span`,{className:`hidden`,title:`Weekday ${r.day}/5: hold weekly usage at or below ${Math.round(r.cap*100)}% to last until reset.`,children:[`Daily guard `,e.dailyGuardEnabled?`· Weekday ${r.day}/5 cap ${Math.round(r.cap*100)}%`:``]}),(0,Y.jsx)(z,{checked:!!e.dailyGuardEnabled,onCheckedChange:()=>void n.toggleDailyGuard(e.id,!!e.dailyGuardEnabled),disabled:n.toggling.has(e.id),"aria-label":e.dailyGuardEnabled?`Disable Daily guard`:`Enable Daily guard`,className:`cursor-pointer shrink-0`})]}):null})()]},e.id)})})]}),(0,Y.jsx)(_e,{open:e===`add`,onOpenChange:e=>{e||n.cancelLogin(),t(e?`add`:null)},label:n.label,onLabelChange:n.setLabel,apiKey:n.apiKey,onApiKeyChange:n.setApiKey,adding:n.adding,onAddApiKey:()=>void n.addApiKey(),deviceWaiting:n.deviceWaiting,onStartDevice:()=>void n.startDevice(),device:n.device,browser:n.browser,onStartBrowser:()=>void n.startBrowser(),loginStarting:n.loginStarting,callbackUrl:n.callbackUrl,onCallbackUrlChange:n.setCallbackUrl,submittingCallback:n.submittingCallback,onSubmitCallback:()=>void n.submitCallback(),error:n.err}),(0,Y.jsx)(Ue,{mode:e===`export`?`export`:e===`import`?`import`:null,onOpenChange:e=>{e||t(null)},password:n.backupPassword,onPasswordChange:n.setBackupPassword,busy:n.exporting||n.importing,onExport:()=>void n.doExport(),onImport:e=>void n.doImport(e),error:n.err}),r&&(0,Y.jsx)(he,{account:r,onClose:()=>i(null),onDone:()=>void n.load()}),(0,Y.jsx)(Ge,{open:e===`rotation`,onOpenChange:e=>t(e?`rotation`:null),strategy:n.strategy,onChange:e=>void n.changeStrategy(e)})]})}var Ye=[{id:`claude`,label:`Claude`},{id:`codex`,label:`Codex`}];function Xe(){let[e,t]=(0,J.useState)(null),[n,r]=(0,J.useState)(`claude`);(0,J.useEffect)(()=>{let e=!1;return te().then(n=>{e||t(new Set(Object.keys(n.providers??{})))}).catch(()=>{e||t(new Set([`claude`]))}),()=>{e=!0}},[]);let i=Ye.filter(t=>t.id===`claude`||e?.has(t.id)),a=i.length>1;return(0,Y.jsxs)(`div`,{className:`space-y-4`,"data-testid":`accounts-pane`,"data-provider":n,children:[a&&(0,Y.jsx)(`div`,{className:`flex gap-1 border-b border-border/50`,children:i.map(e=>(0,Y.jsxs)(`button`,{onClick:()=>r(e.id),"data-testid":`accounts-tab-${e.id}`,"aria-current":n===e.id?`page`:void 0,className:`flex items-center gap-1.5 px-3 py-2 text-xs rounded-t transition-colors cursor-pointer ${n===e.id?`text-primary border-b-2 border-primary font-medium`:`text-text-subtle hover:text-text-secondary`}`,children:[(0,Y.jsx)(P,{providerId:e.id}),e.label]},e.id))}),e===null&&!a&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,Y.jsx)(m,{className:`size-3 animate-spin`}),` Checking configured providers...`]}),n===`claude`?(0,Y.jsx)(He,{}):(0,Y.jsx)(Je,{})]})}export{Xe as AccountsSettingsSection};
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{At as r,Cn as i,Cr as a,J as o,Kr as s,Zr as c,cr as l,ht as u,li as d,ln as f,ut as p,xn as m}from"./icons-C1wDt09O.js";import{a as h}from"./api-client-BnYFnEfK.js";import{n as g}from"./utils-D3xTlJyU.js";import"./portal-container-context-Gepuvxdg.js";import"./chat-preparation-cache-Bzb-T1pm.js";import{n as _}from"./use-is-mobile-CL2I7hLf.js";import{r as v}from"./clipboard-D3XnL7CB.js";import{r as y,t as b}from"./button-BHGVTbam.js";import{a as x,i as S,n as C,o as w,r as T,t as E}from"./dialog-DnE192fh.js";import{t as D}from"./mobile-bottom-sheet-RpOWOJpG.js";import"./use-visual-viewport-CgUU5t0c.js";import{t as O}from"./input-DlAmNJA0.js";import{$i as k,$n as A,Pr as j,Qi as M,Qn as N,Ri as P,Xn as F,Yn as I,Zi as L,Zn as R,er as z}from"./index-DUVlC2ML.js";import{_ as ee,a as te,h as B,m as ne,o as re,p as ie,r as ae,v as oe,x as V,y as se}from"./api-settings-VptFeOUT.js";import{_ as ce,a as le,b as ue,c as de,d as fe,g as H,h as U,l as pe,m as me,n as he,o as ge,p as W,r as _e,s as G,t as ve,u as ye,x as K,y as q}from"./codex-reset-credit-button-DnAKxfZz.js";var J=e(t(),1),Y=n(),X=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],Z=Array.from({length:24},(e,t)=>t);function be(e,t){let n=Array.from({length:7},()=>Array.from({length:24},()=>({sum:0,count:0,avg:0})));for(let r of e){let e=t===`5h`?r.five_hour_util:r.weekly_util;if(e==null)continue;let i=new Date(r.recorded_at+(r.recorded_at.endsWith(`Z`)?``:`Z`)),a=(i.getDay()+6)%7,o=i.getHours();n[a][o].sum+=e,n[a][o].count+=1}for(let e of n)for(let t of e)t.avg=t.count>0?t.sum/t.count:0;return n}function xe(e){return e.map(e=>{let t=e.reduce((e,t)=>e+t.sum,0),n=e.reduce((e,t)=>e+t.count,0);return n>0?t/n:0})}function Se(e){return Z.map(t=>{let n=0,r=0;for(let i of e)n+=i[t].sum,r+=i[t].count;return r>0?n/r:0})}function Q(e){return e===0?`bg-surface-elevated`:e<.3?`bg-success/30`:e<.5?`bg-success/60`:e<.7?`bg-warning/50`:e<.9?`bg-warning/80`:`bg-error/80`}function Ce(e){return e<.3?`bg-success`:e<.7?`bg-warning`:`bg-error`}function we({accountId:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(!0),[a,o]=(0,J.useState)(`5h`);(0,J.useEffect)(()=>{i(!0),ie(e).then(n).catch(()=>n([])).finally(()=>i(!1))},[e]);let s=(0,J.useMemo)(()=>t?be(t,a):null,[t,a]),c=(0,J.useMemo)(()=>s?xe(s):[],[s]),l=(0,J.useMemo)(()=>s?Se(s):[],[s]),u=Math.max(...c,.01);if(Math.max(...l,.01),r)return(0,Y.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,Y.jsx)(m,{className:`size-3 animate-spin text-text-subtle`})});if(!t||t.length===0)return(0,Y.jsx)(`div`,{className:`text-[10px] text-text-subtle py-2 text-center`,children:`No usage history yet`});let d=t.length,f=new Set(t.map(e=>new Date(e.recorded_at+(e.recorded_at.endsWith(`Z`)?``:`Z`)).toDateString())).size;return(0,Y.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-medium text-text-subtle`,children:`Usage Pattern (7d)`}),(0,Y.jsxs)(`div`,{className:`flex gap-0.5 text-[9px]`,children:[(0,Y.jsx)(`button`,{onClick:()=>o(`5h`),className:`px-1.5 py-0.5 rounded cursor-pointer transition-colors ${a===`5h`?`bg-primary/15 text-primary`:`text-text-subtle hover:text-text-secondary`}`,title:`5-hour rolling window limit — resets every 5 hours`,children:`5h`}),(0,Y.jsx)(`button`,{onClick:()=>o(`weekly`),className:`px-1.5 py-0.5 rounded cursor-pointer transition-colors ${a===`weekly`?`bg-primary/15 text-primary`:`text-text-subtle hover:text-text-secondary`}`,title:`Weekly limit — resets every 7 days`,children:`Wk`})]})]}),(0,Y.jsxs)(`p`,{className:`text-[9px] text-text-subtle leading-tight`,children:[`Avg `,a===`5h`?`5-hour`:`weekly`,` limit usage over `,f,`d (`,d,` samples). Higher % = closer to rate limit. Hover cells for details.`]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Avg usage by day of week`}),(0,Y.jsx)(`div`,{className:`flex flex-col gap-[2px] mt-0.5`,children:X.map((e,t)=>{let n=c[t]??0;return(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(`span`,{className:`text-[8px] text-text-subtle w-5 shrink-0 text-right tabular-nums`,children:e}),(0,Y.jsx)(`div`,{className:`flex-1 h-2.5 bg-surface-elevated rounded-sm overflow-hidden`,children:(0,Y.jsx)(`div`,{className:`h-full rounded-sm transition-all ${Ce(n)}`,style:{width:`${Math.round(n/u*100)}%`}})}),(0,Y.jsxs)(`span`,{className:`text-[8px] text-text-subtle w-6 shrink-0 text-right tabular-nums`,children:[Math.round(n*100),`%`]})]},e)})})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Avg usage by hour (0h-23h)`}),(0,Y.jsx)(`div`,{className:`flex gap-[1px] mt-0.5`,children:Z.map(e=>{let t=l[e]??0;return(0,Y.jsxs)(`div`,{className:`flex-1 flex flex-col items-center gap-[1px]`,children:[(0,Y.jsx)(`div`,{className:`w-full aspect-square rounded-[2px] ${Q(t)}`,title:`${e}:00 — avg ${Math.round(t*100)}% usage`}),e%6==0&&(0,Y.jsx)(`span`,{className:`text-[7px] text-text-subtle tabular-nums`,children:e})]},e)})})]}),s&&(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Day x Hour heatmap`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-[1px] mt-0.5`,children:[X.map((e,t)=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-[1px]`,children:[(0,Y.jsx)(`span`,{className:`text-[7px] text-text-subtle w-4 shrink-0 text-right`,children:e.charAt(0)}),Z.map(n=>{let r=s[t][n];return(0,Y.jsx)(`div`,{className:`flex-1 aspect-square rounded-[1px] ${Q(r.avg)}`,title:`${e} ${n}:00 — ${r.count>0?`avg ${Math.round(r.avg*100)}% (${r.count} samples)`:`no data`}`},n)})]},e)),(0,Y.jsxs)(`div`,{className:`flex items-center gap-[1px]`,children:[(0,Y.jsx)(`span`,{className:`w-4 shrink-0`}),Z.map(e=>(0,Y.jsx)(`div`,{className:`flex-1 text-center`,children:e%6==0&&(0,Y.jsx)(`span`,{className:`text-[7px] text-text-subtle tabular-nums`,children:e})},e))]})]})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[8px] text-text-subtle`,children:[(0,Y.jsx)(`span`,{children:`Low`}),(0,Y.jsxs)(`div`,{className:`flex gap-[2px]`,children:[(0,Y.jsx)(`div`,{className:`size-2 rounded-[1px] bg-success/30`}),(0,Y.jsx)(`div`,{className:`size-2 rounded-[1px] bg-success/60`}),(0,Y.jsx)(`div`,{className:`size-2 rounded-[1px] bg-warning/50`}),(0,Y.jsx)(`div`,{className:`size-2 rounded-[1px] bg-warning/80`}),(0,Y.jsx)(`div`,{className:`size-2 rounded-[1px] bg-error/80`})]}),(0,Y.jsx)(`span`,{children:`High`}),(0,Y.jsx)(`span`,{className:`ml-1`,children:`|`}),(0,Y.jsx)(`div`,{className:`size-2 rounded-[1px] bg-surface-elevated border border-border/30`}),(0,Y.jsx)(`span`,{children:`No data`})]})]})}function Te({profile:e,accountId:t,onClose:n}){let r=[[`Name`,e.account?.display_name],[`Email`,e.account?.email],[`Org`,e.organization?.name],[`Type`,e.organization?.organization_type],[`Tier`,e.organization?.rate_limit_tier],[`Status`,e.organization?.subscription_status]];return(0,Y.jsxs)(`section`,{className:`space-y-2 border-t border-border pt-3`,"data-testid":`account-profile-panel`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:`Profile`}),(0,Y.jsx)(`button`,{className:`p-2 text-muted-foreground hover:text-foreground cursor-pointer`,onClick:n,"aria-label":`Close profile`,children:(0,Y.jsx)(d,{className:`size-4`})})]}),(0,Y.jsx)(`div`,{className:`grid grid-cols-[80px_1fr] gap-x-3 gap-y-1 text-xs`,children:r.map(([e,t])=>t?(0,Y.jsxs)(`span`,{className:`contents`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,Y.jsx)(`span`,{className:`break-all`,children:t})]},e):null)}),(0,Y.jsx)(we,{accountId:t})]})}function Ee({display:e,onConfirm:t,onCancel:n}){let r=_(),i=(0,Y.jsxs)(`div`,{className:`space-y-4`,"data-testid":`account-delete-confirm`,children:[(0,Y.jsxs)(`p`,{className:`text-sm`,children:[`Remove `,(0,Y.jsx)(`span`,{className:`font-medium`,children:e}),`?`]}),(0,Y.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`The stored token is deleted from this machine. Any export you already made keeps working.`}),(0,Y.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end pt-2`,children:[(0,Y.jsx)(b,{variant:`outline`,onClick:n,className:`min-h-11`,children:`Cancel`}),(0,Y.jsx)(b,{variant:`destructive`,autoFocus:!1,onClick:t,className:`min-h-11`,children:`Remove account`})]})]});return r?(0,Y.jsx)(D,{open:!0,onClose:n,children:(0,Y.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,Y.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:`Remove account`}),i]})}):(0,Y.jsx)(E,{open:!0,onOpenChange:e=>{e||n()},children:(0,Y.jsxs)(C,{className:`sm:max-w-sm`,children:[(0,Y.jsx)(x,{children:(0,Y.jsx)(w,{className:`text-sm`,children:`Remove account`})}),i]})})}var De=80;function Oe({current:e,onSave:t,onCancel:n}){let r=_(),[i,a]=(0,J.useState)(e),[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(null),u=i.trim(),d=!!u&&u!==e&&!o,f=async()=>{if(d){s(!0),l(null);try{await t(u)}catch(e){l(e.message||`Could not rename the account`),s(!1)}}},p=()=>{o||n()},h=(0,Y.jsxs)(`form`,{className:`space-y-4`,"data-testid":`account-rename-dialog`,onSubmit:e=>{e.preventDefault(),f()},children:[(0,Y.jsx)(O,{autoFocus:!0,value:i,maxLength:De,onChange:e=>a(e.target.value),placeholder:`e.g. Personal, Work`,"aria-label":`Account name`,className:`min-h-11 text-sm md:min-h-9`}),c&&(0,Y.jsx)(`p`,{className:`text-xs text-error`,role:`alert`,children:c}),(0,Y.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end`,children:[(0,Y.jsx)(b,{type:`button`,variant:`outline`,onClick:p,disabled:o,className:`min-h-11 md:min-h-9`,children:`Cancel`}),(0,Y.jsxs)(b,{type:`submit`,disabled:!d,className:`min-h-11 md:min-h-9`,children:[o&&(0,Y.jsx)(m,{className:`size-4 animate-spin`}),` Save`]})]})]});return r?(0,Y.jsx)(D,{open:!0,onClose:p,children:(0,Y.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,Y.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:`Rename account`}),h]})}):(0,Y.jsx)(E,{open:!0,onOpenChange:e=>{e||p()},children:(0,Y.jsxs)(C,{className:`sm:max-w-sm`,children:[(0,Y.jsx)(x,{children:(0,Y.jsx)(w,{className:`text-sm`,children:`Rename account`})}),h]})})}function ke(e){let t=new Blob([e],{type:`application/json`}),n=document.createElement(`a`);n.href=URL.createObjectURL(t),n.download=`ppm-accounts-backup.json`,n.click(),URL.revokeObjectURL(n.href)}function Ae({open:e,onOpenChange:t,accounts:n,preselectId:r,onMessage:a}){let o=n.filter(e=>e.hasRefreshToken),[s,c]=(0,J.useState)(new Set),[l,d]=(0,J.useState)(``),[f,g]=(0,J.useState)(!1),[_,y]=(0,J.useState)(!1),[D,k]=(0,J.useState)(!1),[A,M]=(0,J.useState)(!1);e&&!A&&(c(r?new Set([r]):new Set(o.map(e=>e.id))),M(!0)),!e&&A&&M(!1);function N(){t(!1),d(``),g(!1),y(!1)}async function P(e){if(s.size===0)return;k(!0);let t=l.trim()||`ppm-hienlh`;try{let n={"Content-Type":`application/json`},r=h();r&&(n.Authorization=`Bearer ${r}`);let i=await fetch(`/api/accounts/export`,{method:`POST`,headers:n,body:JSON.stringify({password:t,accountIds:[...s],includeRefreshToken:f,refreshBeforeExport:_})});if(!i.ok){let e=await i.json();throw Error(e.error??`Export failed: ${i.status}`)}let o=await i.text();e&&await v(o)?a?.(`Backup copied to clipboard!`):(ke(o),a?.(`Backup downloaded.`)),N()}catch{}k(!1)}let F=s.size>0&&!D;return(0,Y.jsx)(E,{open:e,onOpenChange:e=>{e||N()},children:(0,Y.jsxs)(C,{className:`sm:max-w-md`,children:[(0,Y.jsxs)(x,{children:[(0,Y.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,Y.jsx)(i,{className:`size-3.5`}),` Export Accounts`]}),(0,Y.jsx)(T,{className:`text-xs`,children:`Select accounts and set a password to protect the backup.`})]}),(0,Y.jsxs)(`div`,{className:`space-y-3`,children:[(0,Y.jsxs)(`div`,{className:`space-y-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,Y.jsx)(`p`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Accounts to export`}),(0,Y.jsx)(`button`,{className:`text-[10px] text-primary hover:underline cursor-pointer`,onClick:()=>c(s.size===o.length?new Set:new Set(o.map(e=>e.id))),children:s.size===o.length?`Deselect all`:`Select all`})]}),o.length===0?(0,Y.jsx)(`p`,{className:`text-[10px] text-muted-foreground p-2 border rounded`,children:`No exportable accounts.`}):(0,Y.jsx)(`div`,{className:`max-h-36 overflow-y-auto space-y-1 border rounded p-2`,children:o.map(e=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,id:`exp-${e.id}`,checked:s.has(e.id),onChange:t=>{let n=new Set(s);t.target.checked?n.add(e.id):n.delete(e.id),c(n)},className:`size-3.5 accent-primary cursor-pointer`}),(0,Y.jsx)(`label`,{htmlFor:`exp-${e.id}`,className:`text-xs cursor-pointer truncate`,children:e.label??e.email??e.id.slice(0,8)})]},e.id))})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsxs)(j,{className:`text-xs`,children:[`Password `,(0,Y.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,Y.jsx)(O,{type:`password`,placeholder:`Leave empty for default`,value:l,onChange:e=>d(e.target.value),className:`text-xs h-8`,autoComplete:`new-password`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,id:`exp-full`,checked:f,onChange:e=>g(e.target.checked),className:`size-3.5 accent-primary cursor-pointer`}),(0,Y.jsx)(`label`,{htmlFor:`exp-full`,className:`text-[11px] cursor-pointer`,children:`Include refresh tokens (full transfer)`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,id:`exp-refresh`,checked:_,onChange:e=>y(e.target.checked),className:`size-3.5 accent-primary cursor-pointer`}),(0,Y.jsx)(`label`,{htmlFor:`exp-refresh`,className:`text-[11px] cursor-pointer`,children:`Refresh tokens before export`})]}),f?(0,Y.jsxs)(`div`,{className:`rounded-md border border-error/30 bg-error/5 p-2.5`,children:[(0,Y.jsx)(`p`,{className:`text-[10px] font-medium text-error`,children:`Full transfer — source accounts will expire`}),(0,Y.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Refresh tokens included. Source machine expires in ~1h after target refreshes.`})]}):_?(0,Y.jsx)(`div`,{className:`rounded-md border border-warning/30 bg-warning/5 p-2.5`,children:(0,Y.jsx)(`p`,{className:`text-[10px] font-medium text-warning`,children:`Refresh before export — invalidates previous shares`})}):(0,Y.jsx)(`div`,{className:`rounded-md border border-success/30 bg-success/5 p-2.5`,children:(0,Y.jsx)(`p`,{className:`text-[10px] font-medium text-success`,children:`Share current token (safe)`})}),(0,Y.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Encrypted with AES-256-GCM + scrypt.`})]}),(0,Y.jsxs)(S,{className:`gap-1.5 flex-col sm:flex-row`,children:[(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:N,children:`Cancel`}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,disabled:!F,onClick:()=>P(!0),children:[(0,Y.jsx)(p,{className:`size-3 mr-1`}),` Copy`]}),(0,Y.jsx)(b,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!F,onClick:()=>P(!1),children:D?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(m,{className:`size-3 animate-spin mr-1`}),` Exporting...`]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(u,{className:`size-3 mr-1`}),` Download`]})})]})]})})}function je({open:e,onOpenChange:t,onSuccess:n}){let[r,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(null);function f(){t(!1),a(``),s(``),d(null)}async function p(){if(r.trim()){l(!0),d(null);try{let e=await ne({data:r.trim(),password:o.trim()||`ppm-hienlh`});f(),n(`Imported ${e.imported} account(s)`)}catch(e){d(e.message||`Import failed`)}l(!1)}}return(0,Y.jsx)(E,{open:e,onOpenChange:e=>{e||f()},children:(0,Y.jsxs)(C,{className:`sm:max-w-md`,children:[(0,Y.jsxs)(x,{children:[(0,Y.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,Y.jsx)(i,{className:`size-3.5`}),` Import Accounts`]}),(0,Y.jsx)(T,{className:`text-xs`,children:`Paste backup data and enter the export password. Imported accounts are temporary (~1h).`})]}),(0,Y.jsxs)(`div`,{className:`space-y-3`,children:[(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsx)(j,{className:`text-xs`,children:`Backup data`}),(0,Y.jsx)(`textarea`,{value:r,onChange:e=>a(e.target.value),placeholder:`Paste backup JSON here...`,rows:4,className:`w-full text-xs p-2 rounded border border-border bg-background font-mono resize-none focus:outline-none focus:ring-1 focus:ring-primary`})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsxs)(j,{className:`text-xs`,children:[`Password `,(0,Y.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,Y.jsx)(O,{type:`password`,placeholder:`Leave empty for default`,value:o,onChange:e=>s(e.target.value),className:`text-xs h-8`,autoComplete:`current-password`})]})]}),u&&(0,Y.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:u}),(0,Y.jsxs)(S,{children:[(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:f,children:`Cancel`}),(0,Y.jsx)(b,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!r.trim()||c,onClick:p,children:c?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(m,{className:`size-3 animate-spin mr-1`}),` Importing...`]}):`Import`})]})]})})}var $=typeof window<`u`?window.matchMedia(`(min-width: 768px)`):null;function Me(e){return $?.addEventListener(`change`,e),()=>$?.removeEventListener(`change`,e)}function Ne(){return $?.matches??!0}function Pe(){let[e,t]=(0,J.useState)(null),[n,r]=(0,J.useState)(!0);return(0,J.useEffect)(()=>{r(!0),re().then(t).finally(()=>r(!1))},[]),n?(0,Y.jsx)(`p`,{className:`text-xs text-text-subtle py-4 text-center`,children:`Loading...`}):e?(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Rotation Strategy`}),(0,Y.jsxs)(I,{value:e.strategy,onValueChange:async e=>{t(await V({strategy:e}))},children:[(0,Y.jsx)(N,{className:`w-full h-9 text-xs`,children:(0,Y.jsx)(A,{})}),(0,Y.jsxs)(F,{children:[(0,Y.jsx)(R,{value:`round-robin`,children:`Round-robin`}),(0,Y.jsx)(R,{value:`fill-first`,children:`Fill-first`}),(0,Y.jsx)(R,{value:`lowest-usage`,children:`Lowest usage`})]})]}),(0,Y.jsxs)(`p`,{className:`text-[10px] text-text-subtle`,children:[e.strategy===`round-robin`&&`Cycles through accounts evenly`,e.strategy===`fill-first`&&`Uses one account until its limit, then moves on`,e.strategy===`lowest-usage`&&`Picks the account with the lowest current usage`]})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Max Retry`}),(0,Y.jsx)(`input`,{type:`number`,min:0,value:e.maxRetry,className:`w-full h-9 text-xs border rounded-md px-3 bg-background`,onChange:async e=>{let n=parseInt(e.target.value,10);!isNaN(n)&&n>=0&&t(await V({maxRetry:n}))}}),(0,Y.jsx)(`p`,{className:`text-[10px] text-text-subtle`,children:`How many accounts to try on failure. 0 = try all available accounts.`})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5 border-t border-border pt-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Cooldown parking`}),(0,Y.jsx)(z,{checked:e.cooldownEnabled,onCheckedChange:async e=>{t(await V({cooldownEnabled:e}))}})]}),(0,Y.jsx)(`p`,{className:`text-[10px] text-text-subtle`,children:`Park a failing account (rate limit / usage limit / auth error) until it recovers. Off: accounts stay selectable — rotation still skips accounts already ≥95% on the 5-hour limit.`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between text-xs border-t border-border pt-3`,children:[(0,Y.jsx)(`span`,{className:`text-text-subtle`,children:`Active accounts`}),(0,Y.jsx)(`span`,{className:`font-medium text-text-primary`,children:e.activeCount})]})]}):(0,Y.jsx)(`p`,{className:`text-xs text-text-subtle py-4 text-center`,children:`Failed to load settings`})}function Fe({open:e,onOpenChange:t}){let n=(0,J.useSyncExternalStore)(Me,Ne);return e?n?(0,Y.jsx)(E,{open:e,onOpenChange:t,children:(0,Y.jsxs)(C,{className:`sm:max-w-sm`,children:[(0,Y.jsx)(x,{children:(0,Y.jsxs)(w,{className:`text-sm flex items-center gap-2`,children:[(0,Y.jsx)(a,{className:`size-4`}),` Rotation & Retry`]})}),(0,Y.jsx)(Pe,{})]})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`fixed inset-0 z-50 transition-opacity duration-200 opacity-100`,onClick:()=>t(!1),style:{backgroundColor:`rgba(0,0,0,0.5)`}}),(0,Y.jsxs)(`div`,{className:g(`fixed bottom-0 left-0 right-0 z-50 bg-background rounded-t-2xl border-t border-border shadow-2xl`,`transition-transform duration-300 ease-out max-h-[85vh] overflow-y-auto`,`translate-y-0`),children:[(0,Y.jsx)(`div`,{className:`flex justify-center pt-3 pb-1`,children:(0,Y.jsx)(`div`,{className:`w-10 h-1 rounded-full bg-border`})}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-b border-border`,children:[(0,Y.jsxs)(`span`,{className:`text-sm font-semibold flex items-center gap-2`,children:[(0,Y.jsx)(a,{className:`size-4`}),` Rotation & Retry`]}),(0,Y.jsx)(`button`,{onClick:()=>t(!1),className:`flex items-center justify-center size-7 rounded-md hover:bg-surface-elevated transition-colors`,children:(0,Y.jsx)(d,{className:`size-4`})})]}),(0,Y.jsx)(`div`,{className:`px-4 py-4 pb-8`,children:(0,Y.jsx)(Pe,{})})]})]}):null}var Ie=y(`inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground shadow`,secondary:`border-transparent bg-secondary text-secondary-foreground`,destructive:`border-transparent bg-destructive text-destructive-foreground shadow`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function Le({className:e,variant:t,...n}){return(0,Y.jsx)(`div`,{className:g(Ie({variant:t}),e),...n})}function Re(e){let t=Math.floor(Date.now()/1e3);return e>t?`${Math.floor((e-t)/60)}m`:`exp`}function ze({accounts:e}){let[t,n]=(0,J.useState)([]),[r,i]=(0,J.useState)(!1),[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(new Map),l=e.filter(e=>e.hasRefreshToken);async function u(){if(l.length!==0){i(!0);try{let e=await oe(l.map(e=>e.id),a);n(t=>[...t,{round:t.length+1,time:new Date().toLocaleTimeString(),includeRefresh:a,items:e}])}catch{}i(!1)}}async function d(e,t){c(t=>new Map(t).set(e,{loading:!0}));try{let n=await se(t);c(t=>new Map(t).set(e,{loading:!1,...n}))}catch(t){c(n=>new Map(n).set(e,{loading:!1,status:`error`,error:t.message}))}}function f(e,t){return[{key:`r${e.round}-pre-${t.id}`,label:`Pre-export`,token:t.preExportTokenFull,preview:t.preExportToken,expires:t.preExportExpires},{key:`r${e.round}-exp-${t.id}`,label:`Exported`,token:t.exportedTokenFull,preview:t.exportedToken,expires:t.exportedExpires},{key:`r${e.round}-post-${t.id}`,label:`Post-export`,token:t.postExportTokenFull,preview:t.postExportToken,expires:t.postExportExpires}]}function p(){for(let e of t)for(let t of e.items)for(let n of f(e,t))n.token&&d(n.key,n.token)}return(0,Y.jsxs)(`section`,{className:`border-t pt-4 space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsx)(`p`,{className:`text-xs font-medium`,children:`Simulate export`}),t.length>0&&(0,Y.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[t.length,` round(s)`]})]}),(0,Y.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Every run appends a round. Earlier rounds are kept so tokens can be compared across runs.`}),l.length===0?(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No OAuth account with a refresh token to export.`}):(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(z,{id:`sim-include-refresh`,checked:a,onCheckedChange:o,className:`cursor-pointer`}),(0,Y.jsx)(j,{htmlFor:`sim-include-refresh`,className:`text-[11px] cursor-pointer`,children:`Include refresh tokens`})]}),(0,Y.jsx)(b,{size:`sm`,className:`h-7 text-xs cursor-pointer`,disabled:r,onClick:()=>void u(),children:r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(m,{className:`size-3 animate-spin mr-1`}),` Exporting...`]}):`Run export #${t.length+1}`})]}),t.length>0&&(0,Y.jsxs)(`div`,{className:`space-y-3`,children:[(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`w-full h-7 text-[11px] cursor-pointer`,onClick:p,children:[`Test all tokens (`,t.reduce((e,t)=>e+t.items.length*3,0),`)`]}),t.map(e=>(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsxs)(`p`,{className:`text-xs font-medium text-primary`,children:[`Round #`,e.round]}),(0,Y.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.time}),(0,Y.jsx)(Le,{variant:e.includeRefresh?`destructive`:`secondary`,className:`text-[9px] px-1 py-0`,children:e.includeRefresh?`with refresh`:`access only`})]}),e.items.map(t=>(0,Y.jsxs)(`div`,{className:`p-2 rounded-lg border bg-card space-y-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[11px] font-medium`,children:t.label??t.email??t.id.slice(0,8)}),t.tokenChanged&&(0,Y.jsx)(Le,{variant:`secondary`,className:`text-[9px] px-1 py-0`,children:`DB token changed`})]}),f(e,t).map(e=>{let t=s.get(e.key);return(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px]`,children:[(0,Y.jsx)(`span`,{className:`w-20 shrink-0 text-muted-foreground text-[10px]`,children:e.label}),(0,Y.jsx)(`code`,{className:`flex-1 truncate font-mono text-[10px] bg-muted px-1 rounded`,children:e.preview??`N/A`}),e.expires&&(0,Y.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:Re(e.expires)}),e.token?(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`h-6 text-[10px] px-1.5 cursor-pointer shrink-0`,disabled:t?.loading,onClick:()=>void d(e.key,e.token),children:t?.loading?(0,Y.jsx)(m,{className:`size-3 animate-spin`}):`Test`}):(0,Y.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`-`}),t&&!t.loading&&(0,Y.jsx)(`span`,{className:`text-[10px] font-medium shrink-0 ${t.status?.startsWith(`valid`)?`text-success`:`text-error`}`,children:t.status})]},e.key)})]},`r${e.round}-${t.id}`))]},e.round))]})]})}function Be(e){let t=Math.floor(Date.now()/1e3),n=Math.floor(Math.abs(e-t)/60);return e>t?`${n}m left`:`expired ${n}m ago`}function Ve({open:e,onOpenChange:t,accounts:n}){let[i,a]=(0,J.useState)(new Map),[o,s]=(0,J.useState)(!1);async function c(e){a(t=>new Map(t).set(e,{loading:!0}));try{let t=await ee(e,o);a(n=>new Map(n).set(e,{loading:!1,result:t}))}catch(t){a(n=>new Map(n).set(e,{loading:!1,error:t.message}))}}function l(){for(let e of n.filter(e=>e.expiresAt!==null))c(e.id)}return(0,Y.jsx)(E,{open:e,onOpenChange:t,children:(0,Y.jsxs)(C,{className:`sm:max-w-xl max-h-[85vh] flex flex-col`,children:[(0,Y.jsxs)(x,{children:[(0,Y.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,Y.jsx)(r,{className:`size-4`}),` Token Test`]}),(0,Y.jsx)(T,{className:`text-xs`,children:`Probe stored tokens for validity. Nothing is modified.`})]}),(0,Y.jsxs)(`div`,{className:`space-y-4 overflow-y-auto flex-1 pr-1`,children:[(0,Y.jsxs)(`section`,{className:`space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsx)(`p`,{className:`text-xs font-medium`,children:`Current tokens`}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(z,{id:`token-test-refresh`,checked:o,onCheckedChange:s,className:`cursor-pointer`}),(0,Y.jsx)(j,{htmlFor:`token-test-refresh`,className:`text-[11px] cursor-pointer`,children:`Also test refresh`})]}),(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`h-7 text-xs cursor-pointer`,onClick:l,children:`Test all`})]})]}),n.length===0&&(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No accounts to test.`}),(0,Y.jsx)(`div`,{className:`space-y-1.5`,children:n.map(e=>{let t=i.get(e.id),n=t?.result?.accessToken.status;return(0,Y.jsxs)(`div`,{className:`p-2 rounded border bg-card space-y-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`span`,{className:`text-xs font-medium truncate block`,children:e.label??e.email??e.id.slice(0,8)}),e.expiresAt&&(0,Y.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:Be(e.expiresAt)})]}),(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`h-7 text-xs cursor-pointer shrink-0`,disabled:t?.loading,onClick:()=>void c(e.id),children:t?.loading?(0,Y.jsx)(m,{className:`size-3 animate-spin`}):`Test`})]}),t&&!t.loading&&(0,Y.jsxs)(`div`,{className:`text-[11px] pl-2 border-l-2 border-muted`,children:[t.error&&(0,Y.jsx)(`p`,{className:`text-error`,children:t.error}),n&&(0,Y.jsxs)(`span`,{className:n.startsWith(`valid`)?`text-success`:`text-error`,children:[n,t.result?.accessToken.code?` (${t.result.accessToken.code})`:``]})]})]},e.id)})})]}),(0,Y.jsx)(ze,{accounts:n})]}),(0,Y.jsx)(S,{children:(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Close`})})]})})}function He(){let{usages:e,accounts:t,activeAccountId:n,initialLoading:i,refreshing:o,flashIds:s,reload:d}=pe(),[p,h]=(0,J.useState)(null),[g,_]=(0,J.useState)(null),[v,y]=(0,J.useState)(null),[x,S]=(0,J.useState)(null),[C,w]=(0,J.useState)(null),[T,E]=(0,J.useState)(null),[D,O]=(0,J.useState)(null),[k,A]=(0,J.useState)(void 0);function j(e){d(),e&&h(e)}async function M(e,t){_(e);try{await B(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){h(e.message)}_(null),d()}async function N(){if(v){try{await ae(v.id),h(`Account "${v.display}" removed.`),d()}catch(e){h(`Failed to remove: ${e.message}`)}y(null)}}async function P(e){x&&(await B(x.id,{label:e}),S(null),h(`Account renamed to "${e}".`),d())}let F=new Map(t.map(e=>[e.id,e])),I=e[0]?.usage.lastFetchedAt;return(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsx)(U,{description:`Connect multiple Claude accounts. PPM rotates between them automatically to avoid rate limits.`,onRefresh:()=>void d(),refreshing:o,disabled:i,actions:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(b,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>{A(void 0),O(`add`)},children:[(0,Y.jsx)(l,{className:`size-4`}),` Add account`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>{E(null),O(`export`)},children:[(0,Y.jsx)(u,{className:`size-4`}),` Export`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`import`),children:[(0,Y.jsx)(c,{className:`size-4`}),` Import`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`rotation`),children:[(0,Y.jsx)(a,{className:`size-4`}),` Rotation`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`token-test`),children:[(0,Y.jsx)(r,{className:`size-4`}),` Token test`]})]})}),(0,Y.jsx)(H,{message:p,onDismiss:()=>h(null)}),(0,Y.jsxs)(`section`,{className:`space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:`Accounts`}),I&&(0,Y.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[`usage `,ue(new Date(I).getTime())]})]}),i?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,Y.jsx)(m,{className:`size-4 animate-spin`}),` Loading accounts...`]}):e.length===0?(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-8 text-center`,children:[(0,Y.jsx)(f,{className:`size-5 text-muted-foreground`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No accounts connected yet.`}),(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Add one to start using PPM.`})]}):(0,Y.jsx)(W,{children:e.map(e=>(0,Y.jsx)(ye,{layout:`strip`,entry:e,isActive:e.accountId===n,accountInfo:F.get(e.accountId),onToggle:M,toggling:g===e.accountId,onDelete:(e,t)=>y({id:e,display:t}),onRename:(e,t)=>S({id:e,current:t}),onExport:e=>{E(e),O(`export`)},onViewProfile:(e,t)=>w({profile:e,accountId:t}),onReauth:()=>{A({id:e.accountId,label:e.accountLabel??e.accountId.slice(0,8)}),O(`add`)},flash:s.has(e.accountId)},e.accountId))})]}),C&&(0,Y.jsx)(Te,{profile:C.profile,accountId:C.accountId,onClose:()=>w(null)}),v&&(0,Y.jsx)(Ee,{display:v.display,onConfirm:()=>void N(),onCancel:()=>y(null)}),x&&(0,Y.jsx)(Oe,{current:x.current,onSave:P,onCancel:()=>S(null)}),(0,Y.jsx)(de,{open:D===`add`,onOpenChange:e=>{O(e?`add`:null),e||A(void 0)},onSuccess:j,signInAgainFor:k}),(0,Y.jsx)(Ae,{open:D===`export`,onOpenChange:e=>{O(e?`export`:null),e||E(null)},accounts:t,preselectId:T,onMessage:h}),(0,Y.jsx)(je,{open:D===`import`,onOpenChange:e=>O(e?`import`:null),onSuccess:j}),(0,Y.jsx)(Fe,{open:D===`rotation`,onOpenChange:e=>O(e?`rotation`:null)}),(0,Y.jsx)(Ve,{open:D===`token-test`,onOpenChange:e=>O(e?`token-test`:null),accounts:t})]})}function Ue({mode:e,onOpenChange:t,password:n,onPasswordChange:r,busy:a,onExport:o,onImport:s,error:l}){let d=(0,J.useRef)(null),f=e===`export`;return(0,Y.jsx)(E,{open:e!==null,onOpenChange:t,children:(0,Y.jsxs)(C,{className:`sm:max-w-md`,children:[(0,Y.jsxs)(x,{children:[(0,Y.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,Y.jsx)(i,{className:`size-4`}),` `,f?`Export Codex Accounts`:`Import Codex Accounts`]}),(0,Y.jsx)(T,{className:`text-xs leading-relaxed`,children:f?`Writes a password-encrypted file containing each account's login.`:`Reads a backup file. The password must be the one it was exported with.`})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsx)(j,{htmlFor:`codex-backup-password`,className:`text-xs`,children:`Password`}),(0,Y.jsx)(O,{id:`codex-backup-password`,type:`password`,placeholder:f?`Choose a password`:`Password used for the export`,value:n,onChange:e=>r(e.target.value),className:`text-xs`,autoComplete:f?`new-password`:`current-password`}),(0,Y.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`A backup holds full logins — keep the file and its password together.`})]}),l&&(0,Y.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:l}),(0,Y.jsx)(`input`,{ref:d,type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&s(t)}}),(0,Y.jsxs)(S,{children:[(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Cancel`}),(0,Y.jsxs)(b,{size:`sm`,className:`text-xs cursor-pointer gap-1.5`,disabled:!n.trim()||a,onClick:()=>f?o():d.current?.click(),children:[a?(0,Y.jsx)(m,{className:`size-3.5 animate-spin`}):f?(0,Y.jsx)(u,{className:`size-3.5`}):(0,Y.jsx)(c,{className:`size-3.5`}),f?`Download backup`:`Choose file`]})]})]})})}var We=[{value:`round-robin`,label:`Round-robin`,hint:`Take the next account each time.`},{value:`fill-first`,label:`Fill-first`,hint:`Stay on one account until it runs out.`},{value:`lowest-usage`,label:`Lowest usage`,hint:`Pick whichever has the most left.`}];function Ge({open:e,onOpenChange:t,strategy:n,onChange:r}){return(0,Y.jsx)(E,{open:e,onOpenChange:t,children:(0,Y.jsxs)(C,{className:`sm:max-w-md`,children:[(0,Y.jsxs)(x,{children:[(0,Y.jsx)(w,{className:`text-sm`,children:`Codex Rotation`}),(0,Y.jsx)(T,{className:`text-xs leading-relaxed`,children:`How a new chat chooses among your Codex accounts.`})]}),(0,Y.jsx)(`div`,{className:`space-y-2`,children:We.map(e=>(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),"aria-current":n===e.value?`true`:void 0,className:g(`w-full text-left rounded-md border px-3 py-2.5 min-h-11 cursor-pointer transition-colors`,n===e.value?`border-primary bg-primary/10`:`border-border hover:bg-accent/50 active:bg-accent`),children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:e.label}),(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.hint})]},e.value))}),(0,Y.jsx)(S,{children:(0,Y.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Done`})})]})})}function Ke(e){return e==null?null:Math.round(e*100)}function qe({usage:e}){let t=e.session==null&&e.weekly==null;return(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(t||e.session!=null)&&(0,Y.jsx)(q,{label:`5-Hour Session`,pct:Ke(e.fiveHour),reset:K(e.session),resetsAt:e.session?.resetsAt}),(t||e.weekly!=null)&&(0,Y.jsx)(q,{label:`Weekly`,pct:Ke(e.sevenDay),reset:K(e.weekly),resetsAt:e.weekly?.resetsAt})]})}function Je(){let[e,t]=(0,J.useState)(null),n=le(()=>t(null)),[r,i]=(0,J.useState)(null);return(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsx)(U,{description:(0,Y.jsxs)(Y.Fragment,{children:[`Each Codex account keeps its own login (`,(0,Y.jsx)(`code`,{children:`CODEX_HOME`}),`). One is picked per chat by the rotation setting.`]}),onRefresh:()=>void n.load(),refreshing:n.loading,actions:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(b,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`add`),children:[(0,Y.jsx)(l,{className:`size-4`}),` Add account`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`export`),children:[(0,Y.jsx)(u,{className:`size-4`}),` Export`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`import`),children:[(0,Y.jsx)(c,{className:`size-4`}),` Import`]}),(0,Y.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`rotation`),children:[(0,Y.jsx)(a,{className:`size-4`}),` Rotation`]})]})}),(0,Y.jsx)(H,{message:n.msg??n.err,onDismiss:()=>{n.setMsg(null),n.setErr(null)}}),(0,Y.jsxs)(`section`,{className:`space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:`Codex Accounts`}),(0,Y.jsx)(`span`,{className:`text-[10px] text-muted-foreground capitalize`,children:n.strategy.replace(`-`,` `)})]}),n.loading&&n.accounts.length===0?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,Y.jsx)(m,{className:`size-4 animate-spin`}),` Loading accounts...`]}):n.accounts.length===0?(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-8 text-center`,children:[(0,Y.jsx)(f,{className:`size-5 text-muted-foreground`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No Codex accounts yet.`}),(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Chats use your default `,(0,Y.jsx)(`code`,{children:`~/.codex`}),` login until you add one.`]})]}):(0,Y.jsx)(W,{children:n.accounts.map(e=>{let t=n.usages[e.id]??{};return(0,Y.jsxs)(me,{dense:!0,className:`min-w-[300px] shrink-0 snap-start${e.signedOut?` opacity-60`:``}`,"data-testid":`account-card`,"data-account-id":e.id,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium truncate flex-1 min-w-0`,children:e.label}),e.signedOut&&(0,Y.jsx)(ce,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`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.`,onClick:e.type===`chatgpt`?()=>i(e):void 0,children:`Sign in again`}),(0,Y.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-text-subtle border border-border rounded px-1 shrink-0`,children:e.type}),G(e.planType)&&(0,Y.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:G(e.planType)}),(0,Y.jsx)(z,{checked:e.status!==`disabled`,onCheckedChange:()=>void n.toggle(e.id,e.status??`active`),disabled:n.toggling.has(e.id),"aria-label":e.status===`disabled`?`Enable account`:`Disable account`,className:`cursor-pointer shrink-0`}),(0,Y.jsxs)(L,{children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsx)(`button`,{type:`button`,onClick:()=>void n.remove(e.id),"aria-label":`Remove account`,className:`p-2 rounded cursor-pointer text-text-subtle hover:text-error hover:bg-surface-elevated transition-colors shrink-0`,children:(0,Y.jsx)(s,{className:`size-4`})})}),(0,Y.jsx)(M,{side:`top`,children:`Remove account`})]})]}),(0,Y.jsx)(qe,{usage:t}),t.resetCredits&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap text-[10px] text-text-subtle`,children:[(0,Y.jsx)(fe,{credits:t.resetCredits}),(0,Y.jsx)(ve,{account:e,usage:t,onDone:e=>{n.setMsg(e),n.load()}})]}),t.session==null&&(()=>{let r=ge(t.weekly);return r?(0,Y.jsxs)(`div`,{className:`flex min-h-12 items-center justify-between gap-3 rounded-md border px-2.5 py-1.5 ${e.dailyGuardEnabled&&r.blocked?`border-error/40 bg-error/5`:`border-border/50 bg-surface/40`}`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium ${e.dailyGuardEnabled&&r.blocked?`text-error`:`text-text-secondary`}`,children:[(0,Y.jsx)(`span`,{children:`Daily guard`}),(0,Y.jsxs)(L,{children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsx)(`button`,{type:`button`,"aria-label":`About Daily guard`,className:`text-text-subtle hover:text-text-primary cursor-help`,children:(0,Y.jsx)(o,{className:`size-3.5`})})}),(0,Y.jsx)(M,{side:`top`,className:`max-w-64 text-xs leading-relaxed`,children:`Spreads the weekly quota across five weekdays, adding 20% per weekday. Weekend slots keep the previous cap; unused allowance carries forward. Daily slots start at the reset time and use UTC weekdays. Turn it off any time to use the remaining quota freely.`})]})]}),(0,Y.jsx)(`p`,{className:`text-[10px] tabular-nums ${e.dailyGuardEnabled&&r.blocked?`text-error`:`text-text-subtle`}`,children:e.dailyGuardEnabled&&r.blocked?`${Math.round(r.used*100)}% used / ${Math.round(r.cap*100)}% daily cap. New turns paused.`:`Weekday ${r.day}/5, ${Math.round(r.cap*100)}% daily cap`})]}),(0,Y.jsxs)(`span`,{className:`hidden`,title:`Weekday ${r.day}/5: hold weekly usage at or below ${Math.round(r.cap*100)}% to last until reset.`,children:[`Daily guard `,e.dailyGuardEnabled?`· Weekday ${r.day}/5 cap ${Math.round(r.cap*100)}%`:``]}),(0,Y.jsx)(z,{checked:!!e.dailyGuardEnabled,onCheckedChange:()=>void n.toggleDailyGuard(e.id,!!e.dailyGuardEnabled),disabled:n.toggling.has(e.id),"aria-label":e.dailyGuardEnabled?`Disable Daily guard`:`Enable Daily guard`,className:`cursor-pointer shrink-0`})]}):null})()]},e.id)})})]}),(0,Y.jsx)(_e,{open:e===`add`,onOpenChange:e=>{e||n.cancelLogin(),t(e?`add`:null)},label:n.label,onLabelChange:n.setLabel,apiKey:n.apiKey,onApiKeyChange:n.setApiKey,adding:n.adding,onAddApiKey:()=>void n.addApiKey(),deviceWaiting:n.deviceWaiting,onStartDevice:()=>void n.startDevice(),device:n.device,browser:n.browser,onStartBrowser:()=>void n.startBrowser(),loginStarting:n.loginStarting,callbackUrl:n.callbackUrl,onCallbackUrlChange:n.setCallbackUrl,submittingCallback:n.submittingCallback,onSubmitCallback:()=>void n.submitCallback(),error:n.err}),(0,Y.jsx)(Ue,{mode:e===`export`?`export`:e===`import`?`import`:null,onOpenChange:e=>{e||t(null)},password:n.backupPassword,onPasswordChange:n.setBackupPassword,busy:n.exporting||n.importing,onExport:()=>void n.doExport(),onImport:e=>void n.doImport(e),error:n.err}),r&&(0,Y.jsx)(he,{account:r,onClose:()=>i(null),onDone:()=>void n.load()}),(0,Y.jsx)(Ge,{open:e===`rotation`,onOpenChange:e=>t(e?`rotation`:null),strategy:n.strategy,onChange:e=>void n.changeStrategy(e)})]})}var Ye=[{id:`claude`,label:`Claude`},{id:`codex`,label:`Codex`}];function Xe(){let[e,t]=(0,J.useState)(null),[n,r]=(0,J.useState)(`claude`);(0,J.useEffect)(()=>{let e=!1;return te().then(n=>{e||t(new Set(Object.keys(n.providers??{})))}).catch(()=>{e||t(new Set([`claude`]))}),()=>{e=!0}},[]);let i=Ye.filter(t=>t.id===`claude`||e?.has(t.id)),a=i.length>1;return(0,Y.jsxs)(`div`,{className:`space-y-4`,"data-testid":`accounts-pane`,"data-provider":n,children:[a&&(0,Y.jsx)(`div`,{className:`flex gap-1 border-b border-border/50`,children:i.map(e=>(0,Y.jsxs)(`button`,{onClick:()=>r(e.id),"data-testid":`accounts-tab-${e.id}`,"aria-current":n===e.id?`page`:void 0,className:`flex items-center gap-1.5 px-3 py-2 text-xs rounded-t transition-colors cursor-pointer ${n===e.id?`text-primary border-b-2 border-primary font-medium`:`text-text-subtle hover:text-text-secondary`}`,children:[(0,Y.jsx)(P,{providerId:e.id}),e.label]},e.id))}),e===null&&!a&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,Y.jsx)(m,{className:`size-3 animate-spin`}),` Checking configured providers...`]}),n===`claude`?(0,Y.jsx)(He,{}):(0,Y.jsx)(Je,{})]})}export{Xe as AccountsSettingsSection};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-session-window-content-D65wYohz.js","assets/rolldown-runtime-C5c2KzVm.js","assets/index-dfjFhOrF.js","assets/preload-helper-Bf_JiD2A.js","assets/vendor-ui-BTSIXzhZ.js","assets/vendor-markdown-C-P1aR4p.js","assets/button-BHGVTbam.js","assets/utils-D3xTlJyU.js","assets/createLucideIcon-B2pji242.js","assets/file-diff-CScJM-VZ.js","assets/git-commit-horizontal-ZMFP54eB.js","assets/api-client-BnYFnEfK.js","assets/react-B9hau9ra.js","assets/open-db-tabs-Dc-a6j_u.js","assets/window-store-D6EgLSfT.js","assets/minimal-mode-rLZOjciW.js","assets/panel-store-Cw4-kVsv.js","assets/settings-store-CjjbQ_IU.js","assets/session-list-sync-triggers-D9i1FxWd.js","assets/project-store-Bs-kiU8m.js","assets/project-framework-store-nuePqBBa.js","assets/explorer-model-D50ZwYks.js","assets/db-sidebar-reveal-DKSe_O67.js","assets/use-is-mobile-CL2I7hLf.js","assets/db-types-hlC-1ed6.js","assets/tab-store-Dd4yGD0K.js","assets/use-db-driver-installed-HHEJoK9Y.js","assets/impexp-state-nsc2lvc8.js","assets/file-store-Bn0vbkCx.js","assets/sql-identifiers-Bsi_01Gv.js","assets/db-explorer-store-BSUKkLM2.js","assets/onboarding-quick-orientation-DTMrcMf0.js","assets/dialog-DnE192fh.js","assets/portal-container-context-Gepuvxdg.js","assets/icons-C1wDt09O.js","assets/format-file-meta-ABYzEkni.js","assets/fs-api-TJ2uXAo3.js","assets/open-settings-CW7OBvT8.js","assets/settings-categories-BY9n3BRr.js","assets/adaptive-context-menu-CYR_lEOb.js","assets/context-menu-DhKbkI1X.js","assets/mobile-bottom-sheet-RpOWOJpG.js","assets/use-visual-viewport-CgUU5t0c.js","assets/dropdown-menu-D0-udN3A.js","assets/input-DlAmNJA0.js","assets/scroll-area-BbasgxEc.js","assets/start-ellipsis-L_MBLKbJ.js","assets/chat-preparation-cache-Bzb-T1pm.js","assets/clipboard-D3XnL7CB.js","assets/design-tab-metadata-o2TAAwEt.js","assets/file-icons-CB0RsVdl.js","assets/format-date-SZ6qU2sD.js","assets/git-repo-store-CESIqItW.js","assets/patch-tab-metadata-BX2AJ4Mb.js","assets/ws-auth-LR3MO-_A.js","assets/apply-theme-Kiqxd1NZ.js","assets/resolve-theme-VXGBVjoJ.js","assets/index-Cb3Z6wNy.css","assets/libesm-CI9u0udP.js","assets/tool-cards-B9bTL2ee.js","assets/db-ai-tools-BfuB2Ip6.js","assets/split-sql-statements-4O42xZCh.js","assets/agent-session-sheet-store-C7UxeOed.js","assets/image-preview-geometry-C9UPxBms.js","assets/use-blob-url-BpuGebd-.js","assets/html-preview-loads-8S95kTsY.js","assets/image-gallery-B5bo_AuR.js","assets/design-canvas-check-BiR2RmWA.js"])))=>i.map(i=>d[i]);
2
- 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{li as r}from"./icons-C1wDt09O.js";import{t as i}from"./preload-helper-Bf_JiD2A.js";import"./portal-container-context-Gepuvxdg.js";import{t as a}from"./mobile-bottom-sheet-RpOWOJpG.js";import"./use-visual-viewport-CgUU5t0c.js";import{t as o}from"./agent-session-sheet-store-C7UxeOed.js";var s=e(t(),1),c=n(),l=(0,s.lazy)(()=>i(()=>import(`./agent-session-window-content-D65wYohz.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67])));function u(){let e=o(e=>e.payload),t=o(e=>e.close);return e?(0,c.jsxs)(a,{open:!0,onClose:t,zIndex:45,className:`flex h-[var(--sheet-vh)] flex-col p-0`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,c.jsx)(`span`,{className:`truncate text-sm font-medium text-text-primary`,children:e.title??`Agent session`}),(0,c.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto flex size-11 items-center justify-center rounded text-text-secondary hover:text-text-primary`,"aria-label":`Close`,children:(0,c.jsx)(r,{className:`size-5`})})]}),(0,c.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`p-4 text-sm text-text-2`,children:`Loading…`}),children:(0,c.jsx)(l,{id:`sheet-${e.sessionId}`,payload:e})})})]}):null}export{u as AgentSessionSheet};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-session-window-content-D78XKwmQ.js","assets/rolldown-runtime-C5c2KzVm.js","assets/index-DUVlC2ML.js","assets/preload-helper-Bf_JiD2A.js","assets/vendor-ui-BTSIXzhZ.js","assets/vendor-markdown-C-P1aR4p.js","assets/button-BHGVTbam.js","assets/utils-D3xTlJyU.js","assets/createLucideIcon-B2pji242.js","assets/file-diff-CScJM-VZ.js","assets/git-commit-horizontal-ZMFP54eB.js","assets/api-client-BnYFnEfK.js","assets/react-B9hau9ra.js","assets/open-db-tabs-Dc-a6j_u.js","assets/window-store-D6EgLSfT.js","assets/minimal-mode-rLZOjciW.js","assets/panel-store-Cw4-kVsv.js","assets/settings-store-CjjbQ_IU.js","assets/session-list-sync-triggers-D9i1FxWd.js","assets/project-store-Bs-kiU8m.js","assets/project-framework-store-nuePqBBa.js","assets/explorer-model-D50ZwYks.js","assets/db-sidebar-reveal-DKSe_O67.js","assets/use-is-mobile-CL2I7hLf.js","assets/db-types-hlC-1ed6.js","assets/tab-store-Dd4yGD0K.js","assets/use-db-driver-installed-HHEJoK9Y.js","assets/impexp-state-nsc2lvc8.js","assets/file-store-Bn0vbkCx.js","assets/sql-identifiers-Bsi_01Gv.js","assets/db-explorer-store-BSUKkLM2.js","assets/onboarding-quick-orientation-DTMrcMf0.js","assets/dialog-DnE192fh.js","assets/portal-container-context-Gepuvxdg.js","assets/icons-C1wDt09O.js","assets/format-file-meta-ABYzEkni.js","assets/fs-api-TJ2uXAo3.js","assets/open-settings-CW7OBvT8.js","assets/settings-categories-BY9n3BRr.js","assets/adaptive-context-menu-CYR_lEOb.js","assets/context-menu-DhKbkI1X.js","assets/mobile-bottom-sheet-RpOWOJpG.js","assets/use-visual-viewport-CgUU5t0c.js","assets/dropdown-menu-D0-udN3A.js","assets/input-DlAmNJA0.js","assets/scroll-area-BbasgxEc.js","assets/start-ellipsis-L_MBLKbJ.js","assets/chat-preparation-cache-Bzb-T1pm.js","assets/clipboard-D3XnL7CB.js","assets/design-tab-metadata-o2TAAwEt.js","assets/file-icons-CB0RsVdl.js","assets/format-date-SZ6qU2sD.js","assets/git-repo-store-CESIqItW.js","assets/patch-tab-metadata-BX2AJ4Mb.js","assets/ws-auth-LR3MO-_A.js","assets/apply-theme-Kiqxd1NZ.js","assets/resolve-theme-VXGBVjoJ.js","assets/index-iEAtV2k-.css","assets/libesm-CI9u0udP.js","assets/tool-cards-UzhEoLIM.js","assets/db-ai-tools-BfuB2Ip6.js","assets/split-sql-statements-4O42xZCh.js","assets/agent-session-sheet-store-C7UxeOed.js","assets/image-preview-geometry-C9UPxBms.js","assets/use-blob-url-BpuGebd-.js","assets/html-preview-loads-8S95kTsY.js","assets/image-gallery-B5bo_AuR.js","assets/design-canvas-check-BiR2RmWA.js"])))=>i.map(i=>d[i]);
2
+ 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{li as r}from"./icons-C1wDt09O.js";import{t as i}from"./preload-helper-Bf_JiD2A.js";import"./portal-container-context-Gepuvxdg.js";import{t as a}from"./mobile-bottom-sheet-RpOWOJpG.js";import"./use-visual-viewport-CgUU5t0c.js";import{t as o}from"./agent-session-sheet-store-C7UxeOed.js";var s=e(t(),1),c=n(),l=(0,s.lazy)(()=>i(()=>import(`./agent-session-window-content-D78XKwmQ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67])));function u(){let e=o(e=>e.payload),t=o(e=>e.close);return e?(0,c.jsxs)(a,{open:!0,onClose:t,zIndex:45,className:`flex h-[var(--sheet-vh)] flex-col p-0`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,c.jsx)(`span`,{className:`truncate text-sm font-medium text-text-primary`,children:e.title??`Agent session`}),(0,c.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto flex size-11 items-center justify-center rounded text-text-secondary hover:text-text-primary`,"aria-label":`Close`,children:(0,c.jsx)(r,{className:`size-5`})})]}),(0,c.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`p-4 text-sm text-text-2`,children:`Loading…`}),children:(0,c.jsx)(l,{id:`sheet-${e.sessionId}`,payload:e})})})]}):null}export{u as AgentSessionSheet};
@@ -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{L as r,P as i,xn as a}from"./icons-C1wDt09O.js";import"./api-client-BnYFnEfK.js";import"./settings-store-CjjbQ_IU.js";import{n as o}from"./utils-D3xTlJyU.js";import"./window-store-D6EgLSfT.js";import"./panel-store-Cw4-kVsv.js";import"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./session-list-sync-triggers-D9i1FxWd.js";import"./tab-store-Dd4yGD0K.js";import"./file-store-Bn0vbkCx.js";import"./use-is-mobile-CL2I7hLf.js";import"./fs-api-TJ2uXAo3.js";import{H as s,U as c,ii as l}from"./index-dfjFhOrF.js";import"./agent-session-sheet-store-C7UxeOed.js";import"./libesm-CI9u0udP.js";import{f as u,l as d,t as f,u as p}from"./tool-cards-B9bTL2ee.js";import"./use-blob-url-BpuGebd-.js";import"./design-canvas-check-BiR2RmWA.js";import"./db-ai-tools-BfuB2Ip6.js";var m=e(t(),1),h=2e3;function g(e,t){let n=t.reset?[]:e.slice();for(let{ev:e,ts:r,k:i,replace:a}of t.events){let t=n.findIndex(e=>e.k===i);if(t!==-1){a&&(n[t]={k:i,ts:r,ev:e});continue}let o=n.length;for(;o>0&&n[o-1].ts>r;)o--;n.splice(o,0,{k:i,ts:r,ev:e})}return n.length>2e3?n.slice(n.length-h):n}function _(){return`ats-${Math.random().toString(36).slice(2,10)}`}function v(e){let{projectName:t,providerId:n,sessionId:r,source:i,fallbackEvents:a}=e,[o,l]=(0,m.useState)([]),[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(!1),[h,v]=(0,m.useState)(!0),[y,b]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=_(),a=[],o;l([]),d(!1),p(!1),v(!0),b(null);let u=()=>{c(JSON.stringify({type:`agent-transcript:subscribe`,subId:e,projectName:t,providerId:n,sessionId:r,source:i,...o?{cursor:o}:{}}))},f=t=>{let n=t.detail;n.subId===e&&(a=g(a,n),o=n.cursor,l(a),d(n.available),p(n.running),v(!1),b(null))},m=t=>{let n=t.detail;n.subId===e&&(d(!1),v(!1),b(n.code))};window.addEventListener(`agent-transcript:events`,f),window.addEventListener(`agent-transcript:error`,m);let h=s(u);return u(),()=>{window.removeEventListener(`agent-transcript:events`,f),window.removeEventListener(`agent-transcript:error`,m),h(),c(JSON.stringify({type:`agent-transcript:unsubscribe`,subId:e}))}},[JSON.stringify([t,n,r,i])]);let x=(0,m.useMemo)(()=>o.map(e=>e.ev),[o]);return{events:u?x:a??[],available:u,running:f,loading:h,error:y}}var y=n();function b(e){return e.filter(e=>e.type===`tool_use`).length}function x({status:e}){return e===`loading`?null:e===`running`?(0,y.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-primary shrink-0`,children:[(0,y.jsx)(a,{className:`size-2.5 animate-spin`}),` running`]}):e===`failed`?(0,y.jsx)(`span`,{className:`text-[10px] text-error shrink-0`,children:`failed`}):(0,y.jsx)(`span`,{className:`text-[10px] text-success shrink-0`,children:`done`})}function S({payload:e}){let t=e??{},n=t.sessionId?d(t.sessionId,t.source):``,s=p(e=>n?e.entries[n]:void 0),{events:c,available:h,running:g,loading:_,error:S}=v({projectName:t.projectName,providerId:t.providerId,sessionId:t.sessionId,source:t.source,fallbackEvents:s}),[C,w]=(0,m.useState)(!1),T=l(),E=(0,m.useMemo)(()=>b(c),[c]),D=c[c.length-1],O=!g&&!!D&&D.type===`tool_result`&&!!D.isError,k=_?`loading`:g?`running`:O?`failed`:`done`;return(0,y.jsxs)(`div`,{className:`flex flex-col h-full min-h-0 bg-surface @container`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border/30 shrink-0`,children:[(0,y.jsx)(`span`,{className:`truncate text-xs font-medium`,children:t.title??`Agent session`}),c.length>0&&(0,y.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:u(E)}),(0,y.jsx)(x,{status:k}),!h&&!_&&(0,y.jsx)(`span`,{className:`ml-auto text-[10px] text-text-subtle shrink-0`,title:`No live transcript for this session — showing steps already held in memory`,children:`offline`})]}),!!t.prompt&&(0,y.jsxs)(`div`,{className:`border-b border-border/30 shrink-0`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>w(e=>!e),className:o(`flex w-full items-center gap-1.5 px-3 py-1.5 text-[11px] text-text-subtle hover:text-foreground`,T?`min-h-[44px]`:`min-h-[28px]`),children:[C?(0,y.jsx)(i,{className:`size-3`}):(0,y.jsx)(r,{className:`size-3`}),`Prompt`]}),C&&(0,y.jsx)(`div`,{className:`px-3 pb-2 text-[11px] text-text-secondary whitespace-pre-wrap select-text`,children:t.prompt})]}),_&&c.length===0?(0,y.jsxs)(`div`,{className:`flex-1 flex items-center justify-center gap-2 text-xs text-text-subtle`,children:[(0,y.jsx)(a,{className:`size-3 animate-spin`}),`Loading session…`]}):c.length===0?(0,y.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-text-subtle px-4 text-center`,children:S?`Could not load this session`:`No recorded steps`}):(0,y.jsx)(f,{events:c,projectName:t.projectName,variant:`window`,className:`flex-1 min-h-0 overflow-y-auto px-3 py-2 space-y-1`})]})}export{S as default};
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{L as r,P as i,xn as a}from"./icons-C1wDt09O.js";import"./api-client-BnYFnEfK.js";import"./settings-store-CjjbQ_IU.js";import{n as o}from"./utils-D3xTlJyU.js";import"./window-store-D6EgLSfT.js";import"./panel-store-Cw4-kVsv.js";import"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./session-list-sync-triggers-D9i1FxWd.js";import"./tab-store-Dd4yGD0K.js";import"./file-store-Bn0vbkCx.js";import"./use-is-mobile-CL2I7hLf.js";import"./fs-api-TJ2uXAo3.js";import{H as s,U as c,ii as l}from"./index-DUVlC2ML.js";import"./agent-session-sheet-store-C7UxeOed.js";import"./libesm-CI9u0udP.js";import{f as u,l as d,t as f,u as p}from"./tool-cards-UzhEoLIM.js";import"./use-blob-url-BpuGebd-.js";import"./design-canvas-check-BiR2RmWA.js";import"./db-ai-tools-BfuB2Ip6.js";var m=e(t(),1),h=2e3;function g(e,t){let n=t.reset?[]:e.slice();for(let{ev:e,ts:r,k:i,replace:a}of t.events){let t=n.findIndex(e=>e.k===i);if(t!==-1){a&&(n[t]={k:i,ts:r,ev:e});continue}let o=n.length;for(;o>0&&n[o-1].ts>r;)o--;n.splice(o,0,{k:i,ts:r,ev:e})}return n.length>2e3?n.slice(n.length-h):n}function _(){return`ats-${Math.random().toString(36).slice(2,10)}`}function v(e){let{projectName:t,providerId:n,sessionId:r,source:i,fallbackEvents:a}=e,[o,l]=(0,m.useState)([]),[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(!1),[h,v]=(0,m.useState)(!0),[y,b]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=_(),a=[],o;l([]),d(!1),p(!1),v(!0),b(null);let u=()=>{c(JSON.stringify({type:`agent-transcript:subscribe`,subId:e,projectName:t,providerId:n,sessionId:r,source:i,...o?{cursor:o}:{}}))},f=t=>{let n=t.detail;n.subId===e&&(a=g(a,n),o=n.cursor,l(a),d(n.available),p(n.running),v(!1),b(null))},m=t=>{let n=t.detail;n.subId===e&&(d(!1),v(!1),b(n.code))};window.addEventListener(`agent-transcript:events`,f),window.addEventListener(`agent-transcript:error`,m);let h=s(u);return u(),()=>{window.removeEventListener(`agent-transcript:events`,f),window.removeEventListener(`agent-transcript:error`,m),h(),c(JSON.stringify({type:`agent-transcript:unsubscribe`,subId:e}))}},[JSON.stringify([t,n,r,i])]);let x=(0,m.useMemo)(()=>o.map(e=>e.ev),[o]);return{events:u?x:a??[],available:u,running:f,loading:h,error:y}}var y=n();function b(e){return e.filter(e=>e.type===`tool_use`).length}function x({status:e}){return e===`loading`?null:e===`running`?(0,y.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-primary shrink-0`,children:[(0,y.jsx)(a,{className:`size-2.5 animate-spin`}),` running`]}):e===`failed`?(0,y.jsx)(`span`,{className:`text-[10px] text-error shrink-0`,children:`failed`}):(0,y.jsx)(`span`,{className:`text-[10px] text-success shrink-0`,children:`done`})}function S({payload:e}){let t=e??{},n=t.sessionId?d(t.sessionId,t.source):``,s=p(e=>n?e.entries[n]:void 0),{events:c,available:h,running:g,loading:_,error:S}=v({projectName:t.projectName,providerId:t.providerId,sessionId:t.sessionId,source:t.source,fallbackEvents:s}),[C,w]=(0,m.useState)(!1),T=l(),E=(0,m.useMemo)(()=>b(c),[c]),D=c[c.length-1],O=!g&&!!D&&D.type===`tool_result`&&!!D.isError,k=_?`loading`:g?`running`:O?`failed`:`done`;return(0,y.jsxs)(`div`,{className:`flex flex-col h-full min-h-0 bg-surface @container`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border/30 shrink-0`,children:[(0,y.jsx)(`span`,{className:`truncate text-xs font-medium`,children:t.title??`Agent session`}),c.length>0&&(0,y.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:u(E)}),(0,y.jsx)(x,{status:k}),!h&&!_&&(0,y.jsx)(`span`,{className:`ml-auto text-[10px] text-text-subtle shrink-0`,title:`No live transcript for this session — showing steps already held in memory`,children:`offline`})]}),!!t.prompt&&(0,y.jsxs)(`div`,{className:`border-b border-border/30 shrink-0`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>w(e=>!e),className:o(`flex w-full items-center gap-1.5 px-3 py-1.5 text-[11px] text-text-subtle hover:text-foreground`,T?`min-h-[44px]`:`min-h-[28px]`),children:[C?(0,y.jsx)(i,{className:`size-3`}):(0,y.jsx)(r,{className:`size-3`}),`Prompt`]}),C&&(0,y.jsx)(`div`,{className:`px-3 pb-2 text-[11px] text-text-secondary whitespace-pre-wrap select-text`,children:t.prompt})]}),_&&c.length===0?(0,y.jsxs)(`div`,{className:`flex-1 flex items-center justify-center gap-2 text-xs text-text-subtle`,children:[(0,y.jsx)(a,{className:`size-3 animate-spin`}),`Loading session…`]}):c.length===0?(0,y.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-text-subtle px-4 text-center`,children:S?`Could not load this session`:`No recorded steps`}):(0,y.jsx)(f,{events:c,projectName:t.projectName,variant:`window`,className:`flex-1 min-h-0 overflow-y-auto px-3 py-2 space-y-1`})]})}export{S as default};
@@ -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{Cn as r,Yr as i,r as a,vr as o,xn as s}from"./icons-C1wDt09O.js";import{k as c}from"./api-client-BnYFnEfK.js";import"./settings-store-CjjbQ_IU.js";import{n as l}from"./utils-D3xTlJyU.js";import{Gn as u,Jn as d,Kn as f,Wn as p,nt as m,qn as h,tt as g}from"./index-dfjFhOrF.js";import{t as _}from"./use-monaco-theme-DDqeltM9.js";var v=e(t(),1),y=n();function b({metadata:e}){let t=e?.filePath,n=e?.name,l=e?.resourceType??`skill`,b=e?.scope??`user`,S=e?.readOnly===!0,C=e?.shadowed===!0,w=e?.shadowedBy,T=e?.project??``,[E,D]=(0,v.useState)(``),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(!0),[M,N]=(0,v.useState)(null),[P,F]=(0,v.useState)(!1),I=_(),L=(0,v.useRef)(``),R=E!==O;(0,v.useEffect)(()=>{let e=!1;return j(!0),N(null),h(t,T).then(t=>{e||(D(t.content),k(t.content),L.current=t.content)}).catch(t=>{e||N(t.message)}).finally(()=>{e||j(!1)}),()=>{e=!0}},[t,T]);let z=(0,v.useCallback)(async()=>{if(S||P)return;let e=L.current;if(e!==O){F(!0);try{await d(t,e,T),k(e),D(e),c.success(`Saved`),f.getState().reload()}catch(e){c.error(e.message)}finally{F(!1)}}},[t,T,O,S,P]);(0,v.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),z())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[z]);let B=u[l];return(0,y.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,y.jsx)(B,{className:`size-4 text-text-subtle`}),(0,y.jsx)(`span`,{className:`text-sm font-semibold`,children:n}),(0,y.jsx)(p,{scope:b}),R&&!S&&(0,y.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary`,title:`Unsaved changes`}),(0,y.jsx)(`div`,{className:`flex-1`}),(0,y.jsxs)(`span`,{className:`hidden sm:block text-[11px] text-text-subtle`,children:[l,` · markdown`]}),!S&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`button`,{onClick:()=>D(O),disabled:!R||P,className:`flex items-center gap-1 rounded px-2 py-1 text-xs text-text-secondary hover:bg-surface-elevated disabled:opacity-40`,children:[(0,y.jsx)(i,{className:`size-3.5`}),` Revert`]}),(0,y.jsxs)(`button`,{onClick:()=>void z(),disabled:!R||P,className:`flex items-center gap-1 rounded bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-40`,children:[P?(0,y.jsx)(s,{className:`size-3.5 animate-spin`}):(0,y.jsx)(o,{className:`size-3.5`}),` Save`]})]})]}),S&&(0,y.jsx)(x,{icon:r,tone:`muted`,children:`Bundled resource — read-only. Duplicate it (from the AI Resources panel) to make an editable copy.`}),C&&w&&(0,y.jsxs)(x,{icon:a,tone:`warn`,children:[`This `,l,` is overridden by another “`,w.name,`” from a higher-priority source (`,w.source,`). It is currently inactive.`]}),(0,y.jsx)(`div`,{className:`min-h-0 flex-1`,children:A?(0,y.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,y.jsx)(s,{className:`size-5 animate-spin text-primary`})}):M?(0,y.jsx)(`div`,{className:`p-6 text-center text-sm text-destructive`,children:M}):(0,y.jsx)(m,{beforeMount:g,height:`100%`,language:`markdown`,theme:I,value:E,onChange:e=>{let t=e??``;L.current=t,D(t)},options:{readOnly:S,minimap:{enabled:!1},fontSize:13,wordWrap:`on`,scrollBeyondLastLine:!1,lineNumbers:`on`}})})]})}function x({icon:e,tone:t,children:n}){return(0,y.jsxs)(`div`,{className:l(`flex items-start gap-2 px-3 py-2 text-[12px] shrink-0 border-b border-border`,t===`warn`?`bg-amber-500/10 text-amber-300`:`bg-surface-elevated text-text-secondary`),children:[(0,y.jsx)(e,{className:`mt-0.5 size-3.5 shrink-0`}),(0,y.jsx)(`span`,{children:n})]})}export{b as AiResourceEditor};
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{Cn as r,Yr as i,r as a,vr as o,xn as s}from"./icons-C1wDt09O.js";import{k as c}from"./api-client-BnYFnEfK.js";import"./settings-store-CjjbQ_IU.js";import{n as l}from"./utils-D3xTlJyU.js";import{Gn as u,Jn as d,Kn as f,Wn as p,nt as m,qn as h,tt as g}from"./index-DUVlC2ML.js";import{t as _}from"./use-monaco-theme-DJYRkfrb.js";var v=e(t(),1),y=n();function b({metadata:e}){let t=e?.filePath,n=e?.name,l=e?.resourceType??`skill`,b=e?.scope??`user`,S=e?.readOnly===!0,C=e?.shadowed===!0,w=e?.shadowedBy,T=e?.project??``,[E,D]=(0,v.useState)(``),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(!0),[M,N]=(0,v.useState)(null),[P,F]=(0,v.useState)(!1),I=_(),L=(0,v.useRef)(``),R=E!==O;(0,v.useEffect)(()=>{let e=!1;return j(!0),N(null),h(t,T).then(t=>{e||(D(t.content),k(t.content),L.current=t.content)}).catch(t=>{e||N(t.message)}).finally(()=>{e||j(!1)}),()=>{e=!0}},[t,T]);let z=(0,v.useCallback)(async()=>{if(S||P)return;let e=L.current;if(e!==O){F(!0);try{await d(t,e,T),k(e),D(e),c.success(`Saved`),f.getState().reload()}catch(e){c.error(e.message)}finally{F(!1)}}},[t,T,O,S,P]);(0,v.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),z())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[z]);let B=u[l];return(0,y.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,y.jsx)(B,{className:`size-4 text-text-subtle`}),(0,y.jsx)(`span`,{className:`text-sm font-semibold`,children:n}),(0,y.jsx)(p,{scope:b}),R&&!S&&(0,y.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary`,title:`Unsaved changes`}),(0,y.jsx)(`div`,{className:`flex-1`}),(0,y.jsxs)(`span`,{className:`hidden sm:block text-[11px] text-text-subtle`,children:[l,` · markdown`]}),!S&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`button`,{onClick:()=>D(O),disabled:!R||P,className:`flex items-center gap-1 rounded px-2 py-1 text-xs text-text-secondary hover:bg-surface-elevated disabled:opacity-40`,children:[(0,y.jsx)(i,{className:`size-3.5`}),` Revert`]}),(0,y.jsxs)(`button`,{onClick:()=>void z(),disabled:!R||P,className:`flex items-center gap-1 rounded bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-40`,children:[P?(0,y.jsx)(s,{className:`size-3.5 animate-spin`}):(0,y.jsx)(o,{className:`size-3.5`}),` Save`]})]})]}),S&&(0,y.jsx)(x,{icon:r,tone:`muted`,children:`Bundled resource — read-only. Duplicate it (from the AI Resources panel) to make an editable copy.`}),C&&w&&(0,y.jsxs)(x,{icon:a,tone:`warn`,children:[`This `,l,` is overridden by another “`,w.name,`” from a higher-priority source (`,w.source,`). It is currently inactive.`]}),(0,y.jsx)(`div`,{className:`min-h-0 flex-1`,children:A?(0,y.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,y.jsx)(s,{className:`size-5 animate-spin text-primary`})}):M?(0,y.jsx)(`div`,{className:`p-6 text-center text-sm text-destructive`,children:M}):(0,y.jsx)(m,{beforeMount:g,height:`100%`,language:`markdown`,theme:I,value:E,onChange:e=>{let t=e??``;L.current=t,D(t)},options:{readOnly:S,minimap:{enabled:!1},fontSize:13,wordWrap:`on`,scrollBeyondLastLine:!1,lineNumbers:`on`}})})]})}function x({icon:e,tone:t,children:n}){return(0,y.jsxs)(`div`,{className:l(`flex items-start gap-2 px-3 py-2 text-[12px] shrink-0 border-b border-border`,t===`warn`?`bg-amber-500/10 text-amber-300`:`bg-surface-elevated text-text-secondary`),children:[(0,y.jsx)(e,{className:`mt-0.5 size-3.5 shrink-0`}),(0,y.jsx)(`span`,{children:n})]})}export{b as AiResourceEditor};
@@ -1 +1 @@
1
- import"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-C1wDt09O.js";import"./api-client-BnYFnEfK.js";import"./settings-store-CjjbQ_IU.js";import"./portal-container-context-Gepuvxdg.js";import"./window-store-D6EgLSfT.js";import"./panel-store-Cw4-kVsv.js";import"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./session-list-sync-triggers-D9i1FxWd.js";import"./tab-store-Dd4yGD0K.js";import"./chat-preparation-cache-Bzb-T1pm.js";import"./use-is-mobile-CL2I7hLf.js";import"./settings-categories-BY9n3BRr.js";import"./open-settings-CW7OBvT8.js";import"./button-BHGVTbam.js";import"./dialog-DnE192fh.js";import"./mobile-bottom-sheet-RpOWOJpG.js";import"./use-visual-viewport-CgUU5t0c.js";import"./input-DlAmNJA0.js";import"./api-settings-VptFeOUT.js";import{t as e}from"./ai-settings-section--iLVno0Y.js";export{e as AISettingsSection};
1
+ import"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-C1wDt09O.js";import"./api-client-BnYFnEfK.js";import"./settings-store-CjjbQ_IU.js";import"./portal-container-context-Gepuvxdg.js";import"./window-store-D6EgLSfT.js";import"./panel-store-Cw4-kVsv.js";import"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./session-list-sync-triggers-D9i1FxWd.js";import"./tab-store-Dd4yGD0K.js";import"./chat-preparation-cache-Bzb-T1pm.js";import"./use-is-mobile-CL2I7hLf.js";import"./settings-categories-BY9n3BRr.js";import"./open-settings-CW7OBvT8.js";import"./button-BHGVTbam.js";import"./dialog-DnE192fh.js";import"./mobile-bottom-sheet-RpOWOJpG.js";import"./use-visual-viewport-CgUU5t0c.js";import"./input-DlAmNJA0.js";import"./api-settings-VptFeOUT.js";import{t as e}from"./ai-settings-section-Cdiz-9xs.js";export{e as AISettingsSection};
@@ -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{Kr as r,gt as i,hr as a,r as o}from"./icons-C1wDt09O.js";import{r as s}from"./api-client-BnYFnEfK.js";import{t as c}from"./open-settings-CW7OBvT8.js";import{t as l}from"./button-BHGVTbam.js";import{t as u}from"./input-DlAmNJA0.js";import{$n as d,Hn as f,Pr as p,Qn as m,Ri as ee,Xn as h,Yn as g,Zn as _,er as v}from"./index-dfjFhOrF.js";import{a as te,b as ne}from"./api-settings-VptFeOUT.js";import{n as y,t as re}from"./leftover-processes-DYh9O043.js";function b(e){let t=/^claude-([a-z]+)((?:-\d{1,2})+)(?:-\d{8})?$/i.exec(e);if(!t)return e;let n=t[1],r=t[2].slice(1).split(`-`).join(`.`);return`${n[0].toUpperCase()}${n.slice(1)} ${r}`}var x=[`low`,`medium`,`high`,`xhigh`,`max`];function S(e){return typeof e==`string`&&x.includes(e)}function C(e){return x.indexOf(e)}function w(e){if(!e)return null;let t=e.toLowerCase();if(t===`auto`||t===`unset`)return{kind:`auto`};let n=t===`med`?`medium`:t;return S(n)?{kind:`level`,level:n}:Number.isNaN(parseInt(t,10))?null:{kind:`budget`}}function T(e,t){if(!t)return{level:e,reason:null};let n=w(t.env?.value),{observed:r}=t;if(n)return r?{level:r.applied,reason:`env`}:{level:E(n,t),reason:`env`};let i=r&&r.requested===e?r.applied:D(e,t);return i===e?{level:i,reason:null}:{level:i,reason:t.cap&&C(e)>C(t.cap.value)?`cap`:`model`}}function E(e,t){return e.kind===`level`?D(e.level,t):t.cap?e.kind===`budget`?D(`high`,t):t.cap.value===`low`?D(`low`,t):null:null}function D(e,t){if(t.supported?.length===0)return null;let n=t.cap&&C(e)>C(t.cap.value)?t.cap.value:e;return t.supported&&!t.supported.includes(n)&&(n===`xhigh`||n===`max`)?`high`:n}function O(e){if(e.file)return e.file;switch(e.source){case`userSettings`:return`~/.claude/settings.json`;case`projectSettings`:return`.claude/settings.json`;case`localSettings`:return`.claude/settings.local.json`;case`policySettings`:return`managed settings`;case`flagSettings`:return`the settings PPM passes to Claude Code`;case`environment`:return`the environment PPM runs in`}}var k=[{label:`Low`,value:`low`},{label:`Medium`,value:`medium`},{label:`High`,value:`high`,default:!0},{label:`Extra`,value:`xhigh`},{label:`Max`,value:`max`}];function A(e){return e?k.find(t=>t.value===e)?.label??e:``}function j(e,t){let n=A(t);return n?`${e} · ${n}`:e}var M=k.find(e=>e.default).value;function ie(e,t){let n=S(e)?e:M;return{pick:n,...T(n,t)}}function N(e){return e.map(e=>typeof e==`string`?e:e.code).join(``)}var P=`Remove it there to use the effort picked in PPM.`;function F(e,t,n){if(!e.reason||!t)return null;let r=t.observed?.model,i=r?b(r.replace(/\[[^\]]*\]$/,``)):n,a=e.level?A(e.level):null,o=w(t.env?.value);if(e.reason===`env`&&t.env&&o){let n=[{code:`CLAUDE_CODE_EFFORT_LEVEL=${t.env.value}`},` in `,{code:O(t.env)}];if(o.kind===`auto`){let e=t.cap?`Claude Code sends ${i}'s default effort, capped at ${A(t.cap.value)}.`:a?`Claude Code sends ${i}'s default, ${a}.`:`no effort is sent, so ${i}'s default applies.`;return{title:`Effort is left to the model`,detail:[...n,` overrides the effort picked here: ${e} `,P]}}if(o.kind===`budget`)return a?{title:`Effort is set to ${a} outside PPM`,detail:[...n,` overrides the effort picked here; with a maxEffortLevel set, Claude Code runs it as ${a}. `,P]}:{title:`A thinking budget replaces the effort`,detail:[...n,` sets a thinking budget instead of an effort level, so the effort picked here is not sent. `,P]};let r=e.level===o.level?``:a?` ${i} runs it as ${a}.`:` ${i} takes no effort level, so none is sent.`;return{title:`Effort is set to ${A(o.level)} outside PPM`,detail:[...n,` overrides the effort picked here.${r} `,P]}}if(e.reason===`cap`&&t.cap){let n=e.level===t.cap.value||!a?``:` ${i} runs it as ${a}.`;return{title:`Effort is capped at ${A(t.cap.value)}`,detail:[{code:`maxEffortLevel: "${t.cap.value}"`},` in `,{code:O(t.cap)},` lowers any effort picked above it.${n}`]}}return a?{title:`Runs at ${a}`,detail:[`${A(e.pick)} isn't available for ${i}, so Claude Code runs it at ${a}.`]}:{title:`${i} takes no effort level`,detail:[`Claude Code sends no effort with ${i}, so the effort picked here has no effect.`]}}var I=e(t(),1),L=n(),R=[128e3,272e3,4e5,512e3,872e3,1e6],z=[1e5,2e5,23e4,35e4,45e4,75e4,9e5];function B({id:e,label:t,value:n,presets:r,disabled:i,compact:a,onChange:o}){let[s,c]=(0,I.useState)(!!n&&!r.includes(Number(n))),l=a?`text-[11px]`:`text-sm`;return(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(p,{htmlFor:e,className:l,children:t}),(0,L.jsxs)(`select`,{id:e,value:s?`custom`:n||`default`,disabled:i,"aria-describedby":`codex-context-help`,className:`w-full min-h-11 sm:min-h-0 rounded-md border border-input bg-background px-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 ${a?`h-7`:`h-9`} ${l}`,onChange:e=>{let t=e.target.value;c(t===`custom`),t!==`custom`&&o(t===`default`?``:t)},children:[(0,L.jsx)(`option`,{value:`default`,children:`Codex default`}),r.map(e=>(0,L.jsxs)(`option`,{value:String(e),children:[e===1e6?`1M`:`${e/1e3}K`,` tokens`]},e)),(0,L.jsx)(`option`,{value:`custom`,children:`Custom...`})]}),s&&(0,L.jsx)(u,{id:`${e}-custom`,"aria-label":`Custom ${t.toLowerCase()}`,type:`number`,min:1,step:1,required:!0,value:n,disabled:i,placeholder:`Enter tokens`,"aria-describedby":`codex-context-help`,className:`min-h-11 sm:min-h-0 ${a?`h-7 text-[11px]`:``}`,onChange:e=>o(e.target.value)})]})}function ae({config:e,compact:t,saving:n,onSave:r}){let[i,a]=(0,I.useState)(String(e?.model_context_window??``)),[o,s]=(0,I.useState)(String(e?.model_auto_compact_token_limit??``)),[c,l]=(0,I.useState)(null),u=t?`text-[11px]`:`text-sm`,d=t?`text-[9px]`:`text-[11px]`;async function f(e){e.preventDefault();let t=i.trim()?Number(i):null,n=o.trim()?Number(o):null;if([t,n].some(e=>e!==null&&(!Number.isSafeInteger(e)||e<=0))){l(`Enter positive whole numbers of tokens, or leave blank for Codex defaults.`);return}if(t!==null&&n!==null&&n>t){l(`Auto-compact threshold must not exceed the context window.`);return}l(null),await r({model_context_window:t,model_auto_compact_token_limit:n})}return(0,L.jsxs)(`form`,{onSubmit:f,className:`space-y-2 rounded-md border border-border p-3`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,L.jsx)(B,{id:`codex-context-window`,label:`Context window (tokens)`,value:i,presets:R,disabled:n,compact:t,onChange:e=>{a(e),l(null)}}),(0,L.jsx)(B,{id:`codex-compact-threshold`,label:`Auto-compact threshold (tokens)`,value:o,presets:z,disabled:n,compact:t,onChange:e=>{s(e),l(null)}})]}),(0,L.jsx)(`p`,{id:`codex-context-help`,className:`${d} text-muted-foreground`,children:`Choose Codex default to use Codex configuration and model defaults, or Custom to enter a value. Presets are shortcuts, not a list of limits supported by your model; increasing these values does not unlock a larger context window. Applies to new sessions and sessions resumed after a PPM restart.`}),c&&(0,L.jsx)(`p`,{role:`alert`,className:`${u} text-error`,children:c}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsx)(`a`,{href:`https://learn.chatgpt.com/docs/config-file/config-reference`,target:`_blank`,rel:`noreferrer`,className:`${d} text-primary underline`,children:`Codex context documentation`}),(0,L.jsx)(`button`,{type:`submit`,disabled:n,className:`min-h-11 sm:min-h-0 rounded-md border border-border px-3 py-1.5 hover:bg-surface-elevated disabled:opacity-50 ${u}`,children:n?`Saving...`:`Save context settings`})]})]})}var oe=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`xhigh`,label:`Extra`},{value:`max`,label:`Max`}],se=[{value:`bypassPermissions`,label:`Bypass permissions (default)`},{value:`default`,label:`Ask before edits`},{value:`acceptEdits`,label:`Edit automatically`},{value:`plan`,label:`Plan mode`}],V={claude:`Claude`,cursor:`Cursor`,codex:`Codex`,gemini:`Gemini`};function H({compact:e}={}){let[t,n]=(0,I.useState)(null),[r,x]=(0,I.useState)(``),[S,C]=(0,I.useState)([]),[w,T]=(0,I.useState)(!1),[E,D]=(0,I.useState)(!1),[O,k]=(0,I.useState)(null),[A,j]=(0,I.useState)(0),[M,P]=(0,I.useState)([]),[R,z]=(0,I.useState)(!1);(0,I.useEffect)(()=>{te().then(e=>{n(e),x(e.default_provider??`claude`)}).catch(e=>k(e.message))},[]),(0,I.useEffect)(()=>{r&&s.get(`/api/settings/ai/providers/status`).then(P).catch(()=>P([]))},[r]);let B=M.find(e=>e.id===r&&!e.registered);(0,I.useEffect)(()=>{r&&(T(!0),s.get(`/api/settings/ai/providers/${r}/models`).then(C).catch(()=>C([])).finally(()=>T(!1)))},[r,!B]);let[H,U]=(0,I.useState)(null),W=t?.providers[r]?.model;(0,I.useEffect)(()=>{if(U(null),!r)return;let e=!0,t=W?`?model=${encodeURIComponent(W)}`:``;return s.get(`/api/settings/ai/providers/${r}/effort-status${t}`).then(({status:t})=>{e&&U(t)}).catch(()=>{}),()=>{e=!1}},[r,W]);let le=async()=>{z(!0);try{let e=await s.post(`/api/settings/ai/providers/${r}/probe`);P(t=>t.map(t=>t.id===e.id?e:t))}catch(e){k(e.message)}finally{z(!1)}},G=t?Object.keys(t.providers).filter(e=>e!==`mock`).map(e=>({id:e,name:V[e]??e})):[],K=t?.providers[r],q=K?.type===`agent-sdk`||!K?.type&&r===`claude`,J=F(ie(K?.effort,H),H,K?.model?b(K.model):`the model`),Y=async e=>{if(!t)return!1;D(!0),k(null);try{return n(await ne(e)),j(e=>e+1),!0}catch(e){return k(e.message),!1}finally{D(!1)}},X=(e,t)=>Y({providers:{[r]:{[e]:t}}}),Z=e?`text-[11px]`:`text-sm`,Q=e?`text-xs`:`text-sm`,ue=e?`space-y-2`:`space-y-4`,de=e?`space-y-1.5`:`space-y-3`,$=e?`space-y-1`:`space-y-1.5`;if(!t)return(0,L.jsxs)(`div`,{className:de,children:[(0,L.jsx)(`h3`,{className:`${Q} font-medium text-text-secondary`,children:`AI Settings`}),(0,L.jsx)(`p`,{className:`${Z} text-text-subtle`,children:O?`Error: ${O}`:`Loading...`})]});let fe=q?S:[{value:`__default__`,label:`Auto (default)`},...S];return(0,L.jsxs)(`div`,{className:ue,children:[(0,L.jsx)(`h3`,{className:`${Q} font-medium text-text-secondary`,children:`AI Settings`}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-new-chat-provider`,className:e?Z:void 0,children:`New chat provider`}),(0,L.jsxs)(g,{value:t.new_chat_provider_mode??`default`,disabled:E,onValueChange:e=>Y({new_chat_provider_mode:e}),children:[(0,L.jsx)(m,{id:`ai-new-chat-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,L.jsx)(d,{})}),(0,L.jsxs)(h,{children:[(0,L.jsx)(_,{value:`follow-focus`,children:`Follow last focused chat`}),(0,L.jsx)(_,{value:`default`,children:`Always use default provider`})]})]}),(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:t.new_chat_provider_mode===`follow-focus`?`New tabs follow the last chat you focused in this project, across panels. Existing tabs keep their provider.`:`New tabs always use the default provider. Existing tabs keep their provider.`})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-default-provider`,className:e?Z:void 0,children:`Default provider`}),(0,L.jsxs)(g,{value:t.default_provider,disabled:E,onValueChange:e=>Y({default_provider:e}),children:[(0,L.jsx)(m,{id:`ai-default-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,L.jsx)(d,{})}),(0,L.jsx)(h,{children:G.map(e=>(0,L.jsx)(_,{value:e.id,children:e.name},e.id))})]}),t.new_chat_provider_mode===`follow-focus`&&(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Used when no chat has been focused in this project yet.`})]}),(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-md border border-border p-3`,children:[(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-share-provider-context`,className:e?Z:void 0,children:`Share rules and memory between providers`}),(0,L.jsx)(`p`,{id:`ai-share-provider-context-description`,className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Share project rules and memory, plus global instruction files, across providers. Applies from the next project-chat message. Turning off keeps context already sent.`})]}),(0,L.jsx)(v,{id:`ai-share-provider-context`,"aria-describedby":`ai-share-provider-context-description`,checked:t.share_provider_context??!0,disabled:E,onCheckedChange:e=>Y({share_provider_context:e})})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-leftover-idle`,className:e?Z:void 0,children:`Stop leftover processes after (idle minutes, 0 = log only)`}),(0,L.jsx)(u,{id:`ai-leftover-idle`,type:`number`,min:0,max:re,defaultValue:y(t),"aria-describedby":`ai-leftover-idle-description`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let n=parseInt(e.target.value),r=isNaN(n)?null:Math.min(Number(e.target.max),Math.max(Number(e.target.min),n));e.target.value=String(r??y(t)),r!==null&&Y({leftover_processes_idle_minutes:r})}},`leftover-${A}`),(0,L.jsxs)(`p`,{id:`ai-leftover-idle-description`,className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:[`Servers, emulators and other processes a chat's commands started and left running are stopped once the chat has been idle this long, and at once when the chat is deleted. At 0 nothing is stopped: the server log names what `,30,` idle minutes would have stopped. Linux with systemd only.`]})]}),G.length>1&&(0,L.jsx)(`div`,{className:`flex gap-0.5 border-b border-border/50 -mx-1 px-1`,children:G.map(e=>(0,L.jsxs)(`button`,{onClick:()=>x(e.id),className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-t transition-colors ${r===e.id?`text-primary border-b-2 border-primary font-medium`:`text-text-subtle hover:text-text-secondary`}`,children:[(0,L.jsx)(ee,{providerId:e.id}),(0,L.jsx)(`span`,{className:`capitalize`,children:e.name})]},e.id))}),(0,L.jsxs)(`div`,{className:de,children:[B&&(0,L.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-2`,children:[(0,L.jsx)(o,{className:`size-3.5 text-warning shrink-0 mt-0.5`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,L.jsxs)(`p`,{className:`${Z} text-text-secondary`,children:[V[r]??r,` is not available in chat — PPM could not start it.`]}),(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground break-words`,children:B.reason}),B.nextProbeAt&&(0,L.jsxs)(`p`,{className:`text-[11px] text-text-subtle`,children:[`Checking again at `,new Date(B.nextProbeAt).toLocaleTimeString()]}),(0,L.jsxs)(l,{variant:`outline`,size:`sm`,onClick:le,disabled:R,className:`gap-1.5 cursor-pointer min-h-11 md:min-h-8`,children:[(0,L.jsx)(a,{className:`size-3.5 ${R?`animate-spin`:``}`}),R?`Checking...`:`Check again`]})]})]}),r===`codex`&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>c(`accounts`),className:`w-full flex items-center justify-between gap-2 rounded-md border border-border px-2.5 py-2 text-left cursor-pointer hover:bg-surface-elevated transition-colors`,children:[(0,L.jsx)(`span`,{className:`${Z} text-text-secondary`,children:`Codex accounts & login`}),(0,L.jsx)(i,{className:`size-3.5 text-text-subtle shrink-0`})]}),S.length>0&&(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-model`,className:e?Z:void 0,children:`Model`}),(0,L.jsxs)(g,{value:q?K?.model??S[0]?.value:K?.model||`__default__`,onValueChange:e=>X(`model`,e===`__default__`?void 0:e),disabled:w,children:[(0,L.jsx)(m,{id:`ai-model`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,L.jsx)(d,{placeholder:w?`Loading models...`:`Select model`})}),(0,L.jsx)(h,{className:`max-h-[300px]`,children:fe.map(e=>(0,L.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),r===`codex`&&(0,L.jsx)(ae,{config:K,compact:e,saving:E,onSave:e=>Y({providers:{codex:e}})},JSON.stringify([K?.model_context_window,K?.model_auto_compact_token_limit])),q&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-base-url`,className:e?Z:void 0,children:`Base URL`}),(0,L.jsx)(u,{id:`ai-base-url`,type:`url`,defaultValue:K?.base_url??``,placeholder:`https://api.anthropic.com (default)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{X(`base_url`,e.target.value.trim()||void 0)}},`baseurl-${r}-${A}`)]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-api-key`,className:e?Z:void 0,children:`API Key / Token`}),(0,L.jsx)(u,{id:`ai-api-key`,type:`password`,defaultValue:K?.api_key??``,placeholder:`sk-ant-... (optional, overrides accounts)`,className:e?`h-7 text-[11px] font-mono`:`font-mono`,onBlur:e=>{let t=e.target.value.trim();t.startsWith(`••••`)||X(`api_key`,t||void 0)}},`apikey-${r}-${A}`),(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Direct API key or OAuth token. Leave empty to use connected accounts.`})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-effort`,className:e?Z:void 0,children:`Effort`}),(0,L.jsxs)(g,{value:K?.effort??`high`,onValueChange:e=>X(`effort`,e),children:[(0,L.jsx)(m,{id:`ai-effort`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,L.jsx)(d,{})}),(0,L.jsx)(h,{children:oe.map(e=>(0,L.jsx)(_,{value:e.value,children:e.label},e.value))})]}),J&&(0,L.jsxs)(`div`,{role:`note`,className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-2`,children:[(0,L.jsx)(o,{className:`size-3.5 text-warning shrink-0 mt-0.5`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,L.jsx)(`p`,{className:`${Z} text-text-secondary`,children:J.title}),(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground break-words`,children:N(J.detail)})]})]})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-max-turns`,className:e?Z:void 0,children:`Max Turns (up to 1000, 0 = no limit)`}),(0,L.jsx)(u,{id:`ai-max-turns`,type:`number`,min:0,max:1e3,defaultValue:K?.max_turns??100,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value),n=isNaN(t)?null:Math.min(Number(e.target.max),Math.max(Number(e.target.min),t));e.target.value=String(n??K?.max_turns??100),n!==null&&X(`max_turns`,n)}},`turns-${r}-${A}`),(K?.max_turns===0||(K?.max_turns??0)>500)&&(0,L.jsxs)(`p`,{className:`flex items-start gap-1.5 ${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:[(0,L.jsx)(o,{className:`size-3 text-warning shrink-0 mt-px`}),`Every step is a paid model call. With a limit this high, or none, a task left running unattended can go on for hours and run up a large bill.`]})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-budget`,className:e?Z:void 0,children:`Max Budget (USD)`}),(0,L.jsx)(u,{id:`ai-budget`,type:`number`,step:.1,min:.01,max:50,defaultValue:K?.max_budget_usd??``,placeholder:`No limit`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseFloat(e.target.value);X(`max_budget_usd`,isNaN(t)?void 0:t)}},`budget-${r}-${A}`)]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-thinking`,className:e?Z:void 0,children:`Thinking Budget (tokens)`}),(0,L.jsx)(u,{id:`ai-thinking`,type:`number`,min:0,defaultValue:K?.thinking_budget_tokens??``,placeholder:`Adaptive (model decides)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);X(`thinking_budget_tokens`,isNaN(t)?void 0:t)}},`thinking-${r}-${A}`)]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(p,{htmlFor:`ai-agent-teams`,className:e?Z:void 0,children:`Agent Teams`}),(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Experimental. Enables multi-agent collaboration with shared tasks and messaging. Uses ~7x more tokens.`})]}),(0,L.jsx)(v,{id:`ai-agent-teams`,checked:K?.agent_teams??!1,onCheckedChange:e=>X(`agent_teams`,e)})]}),K?.agent_teams&&(0,L.jsx)(ce,{compact:e}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(p,{htmlFor:`ai-context-1m`,className:e?Z:void 0,children:`1M Context Window`}),(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Requires an entitled account (Max/Team/Enterprise) and an Opus 4 / Sonnet 4 model. Other accounts will error.`})]}),(0,L.jsx)(v,{id:`ai-context-1m`,checked:K?.context_1m??!1,onCheckedChange:e=>X(`context_1m`,e)})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(p,{htmlFor:`ai-inherit-mcp`,className:e?Z:void 0,children:`Inherit Claude Code MCP`}),(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Auto-load MCP servers from Claude Code's ~/.claude.json (global + per-project). Your own MCP servers override inherited ones.`})]}),(0,L.jsx)(v,{id:`ai-inherit-mcp`,checked:K?.inherit_claude_mcp??!0,onCheckedChange:e=>X(`inherit_claude_mcp`,e)})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{className:e?Z:void 0,children:`MCP sign-in`}),(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Servers that use OAuth stay unavailable to Claude until someone signs in. Project-scoped servers are listed in the project's AI Resources panel.`}),(0,L.jsx)(`div`,{className:`-mx-2`,children:(0,L.jsx)(f,{showWhenEmpty:!0})})]})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-permission-mode`,className:e?Z:void 0,children:`Default Permission Mode`}),(0,L.jsxs)(g,{value:K?.permission_mode??`bypassPermissions`,onValueChange:e=>X(`permission_mode`,e),children:[(0,L.jsx)(m,{id:`ai-permission-mode`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,L.jsx)(d,{})}),(0,L.jsx)(h,{children:se.map(e=>(0,L.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-system-prompt`,className:e?Z:void 0,children:`Additional Instructions`}),(0,L.jsx)(`textarea`,{id:`ai-system-prompt`,rows:e?3:4,defaultValue:K?.system_prompt??``,placeholder:`Enter additional instructions for ${r}...`,className:`w-full rounded-md border border-input bg-background px-3 py-2 ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${e?`text-[11px]`:`text-sm`}`,onBlur:e=>{X(`system_prompt`,e.target.value.trim()||void 0)}},`sysprompt-${r}-${A}`)]})]}),E&&(0,L.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`Saving...`}),O&&(0,L.jsx)(`p`,{className:`text-xs text-error`,children:O})]})}function ce({compact:e}){let[t,n]=(0,I.useState)([]),[i,o]=(0,I.useState)(!1),[c,l]=(0,I.useState)(null),u=(0,I.useCallback)(async()=>{o(!0);try{n(await s.get(`/api/teams`)??[])}catch{}o(!1)},[]);(0,I.useEffect)(()=>{u()},[u]);let d=async e=>{try{await s.del(`/api/teams/${encodeURIComponent(e)}`),n(t=>t.filter(t=>t.name!==e)),l(null)}catch{}};return t.length===0&&!i?null:(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(p,{className:e?`text-[11px]`:void 0,children:[`Teams (`,t.length,`)`]}),(0,L.jsx)(`button`,{onClick:u,className:`text-text-subtle hover:text-foreground p-1`,"aria-label":`Refresh teams`,children:(0,L.jsx)(a,{className:`size-3 ${i?`animate-spin`:``}`})})]}),t.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between p-2 rounded bg-surface-elevated text-xs`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),e.description&&(0,L.jsx)(`div`,{className:`text-text-subtle truncate`,children:e.description}),(0,L.jsxs)(`div`,{className:`text-text-subtle`,children:[e.members?.length??e.memberCount??0,` members`,e.createdAt?` · ${new Date(e.createdAt).toLocaleDateString()}`:``]})]}),c===e.name?(0,L.jsxs)(`div`,{className:`flex gap-1 shrink-0 ml-2`,children:[(0,L.jsx)(`button`,{onClick:()=>d(e.name),className:`px-2 py-1 bg-error text-white rounded text-[10px]`,children:`Delete`}),(0,L.jsx)(`button`,{onClick:()=>l(null),className:`px-2 py-1 bg-panel-2 text-text rounded text-[10px]`,children:`Cancel`})]}):(0,L.jsx)(`button`,{onClick:()=>l(e.name),className:`shrink-0 text-text-subtle hover:text-error p-1 ml-2`,"aria-label":`Delete team ${e.name}`,children:(0,L.jsx)(r,{className:`size-3.5`})})]},e.name))]})}export{F as a,b as c,A as i,k as n,N as o,j as r,ie as s,H as t};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import{Kr as r,gt as i,hr as a,r as o}from"./icons-C1wDt09O.js";import{r as s}from"./api-client-BnYFnEfK.js";import{t as c}from"./open-settings-CW7OBvT8.js";import{t as l}from"./button-BHGVTbam.js";import{t as u}from"./input-DlAmNJA0.js";import{$n as d,Hn as f,Pr as p,Qn as m,Ri as ee,Xn as h,Yn as g,Zn as _,er as v}from"./index-DUVlC2ML.js";import{a as te,b as ne}from"./api-settings-VptFeOUT.js";import{n as y,t as re}from"./leftover-processes-DYh9O043.js";function b(e){let t=/^claude-([a-z]+)((?:-\d{1,2})+)(?:-\d{8})?$/i.exec(e);if(!t)return e;let n=t[1],r=t[2].slice(1).split(`-`).join(`.`);return`${n[0].toUpperCase()}${n.slice(1)} ${r}`}var x=[`low`,`medium`,`high`,`xhigh`,`max`];function S(e){return typeof e==`string`&&x.includes(e)}function C(e){return x.indexOf(e)}function w(e){if(!e)return null;let t=e.toLowerCase();if(t===`auto`||t===`unset`)return{kind:`auto`};let n=t===`med`?`medium`:t;return S(n)?{kind:`level`,level:n}:Number.isNaN(parseInt(t,10))?null:{kind:`budget`}}function T(e,t){if(!t)return{level:e,reason:null};let n=w(t.env?.value),{observed:r}=t;if(n)return r?{level:r.applied,reason:`env`}:{level:E(n,t),reason:`env`};let i=r&&r.requested===e?r.applied:D(e,t);return i===e?{level:i,reason:null}:{level:i,reason:t.cap&&C(e)>C(t.cap.value)?`cap`:`model`}}function E(e,t){return e.kind===`level`?D(e.level,t):t.cap?e.kind===`budget`?D(`high`,t):t.cap.value===`low`?D(`low`,t):null:null}function D(e,t){if(t.supported?.length===0)return null;let n=t.cap&&C(e)>C(t.cap.value)?t.cap.value:e;return t.supported&&!t.supported.includes(n)&&(n===`xhigh`||n===`max`)?`high`:n}function O(e){if(e.file)return e.file;switch(e.source){case`userSettings`:return`~/.claude/settings.json`;case`projectSettings`:return`.claude/settings.json`;case`localSettings`:return`.claude/settings.local.json`;case`policySettings`:return`managed settings`;case`flagSettings`:return`the settings PPM passes to Claude Code`;case`environment`:return`the environment PPM runs in`}}var k=[{label:`Low`,value:`low`},{label:`Medium`,value:`medium`},{label:`High`,value:`high`,default:!0},{label:`Extra`,value:`xhigh`},{label:`Max`,value:`max`}];function A(e){return e?k.find(t=>t.value===e)?.label??e:``}function j(e,t){let n=A(t);return n?`${e} · ${n}`:e}var M=k.find(e=>e.default).value;function ie(e,t){let n=S(e)?e:M;return{pick:n,...T(n,t)}}function N(e){return e.map(e=>typeof e==`string`?e:e.code).join(``)}var P=`Remove it there to use the effort picked in PPM.`;function F(e,t,n){if(!e.reason||!t)return null;let r=t.observed?.model,i=r?b(r.replace(/\[[^\]]*\]$/,``)):n,a=e.level?A(e.level):null,o=w(t.env?.value);if(e.reason===`env`&&t.env&&o){let n=[{code:`CLAUDE_CODE_EFFORT_LEVEL=${t.env.value}`},` in `,{code:O(t.env)}];if(o.kind===`auto`){let e=t.cap?`Claude Code sends ${i}'s default effort, capped at ${A(t.cap.value)}.`:a?`Claude Code sends ${i}'s default, ${a}.`:`no effort is sent, so ${i}'s default applies.`;return{title:`Effort is left to the model`,detail:[...n,` overrides the effort picked here: ${e} `,P]}}if(o.kind===`budget`)return a?{title:`Effort is set to ${a} outside PPM`,detail:[...n,` overrides the effort picked here; with a maxEffortLevel set, Claude Code runs it as ${a}. `,P]}:{title:`A thinking budget replaces the effort`,detail:[...n,` sets a thinking budget instead of an effort level, so the effort picked here is not sent. `,P]};let r=e.level===o.level?``:a?` ${i} runs it as ${a}.`:` ${i} takes no effort level, so none is sent.`;return{title:`Effort is set to ${A(o.level)} outside PPM`,detail:[...n,` overrides the effort picked here.${r} `,P]}}if(e.reason===`cap`&&t.cap){let n=e.level===t.cap.value||!a?``:` ${i} runs it as ${a}.`;return{title:`Effort is capped at ${A(t.cap.value)}`,detail:[{code:`maxEffortLevel: "${t.cap.value}"`},` in `,{code:O(t.cap)},` lowers any effort picked above it.${n}`]}}return a?{title:`Runs at ${a}`,detail:[`${A(e.pick)} isn't available for ${i}, so Claude Code runs it at ${a}.`]}:{title:`${i} takes no effort level`,detail:[`Claude Code sends no effort with ${i}, so the effort picked here has no effect.`]}}var I=e(t(),1),L=n(),R=[128e3,272e3,4e5,512e3,872e3,1e6],z=[1e5,2e5,23e4,35e4,45e4,75e4,9e5];function B({id:e,label:t,value:n,presets:r,disabled:i,compact:a,onChange:o}){let[s,c]=(0,I.useState)(!!n&&!r.includes(Number(n))),l=a?`text-[11px]`:`text-sm`;return(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(p,{htmlFor:e,className:l,children:t}),(0,L.jsxs)(`select`,{id:e,value:s?`custom`:n||`default`,disabled:i,"aria-describedby":`codex-context-help`,className:`w-full min-h-11 sm:min-h-0 rounded-md border border-input bg-background px-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 ${a?`h-7`:`h-9`} ${l}`,onChange:e=>{let t=e.target.value;c(t===`custom`),t!==`custom`&&o(t===`default`?``:t)},children:[(0,L.jsx)(`option`,{value:`default`,children:`Codex default`}),r.map(e=>(0,L.jsxs)(`option`,{value:String(e),children:[e===1e6?`1M`:`${e/1e3}K`,` tokens`]},e)),(0,L.jsx)(`option`,{value:`custom`,children:`Custom...`})]}),s&&(0,L.jsx)(u,{id:`${e}-custom`,"aria-label":`Custom ${t.toLowerCase()}`,type:`number`,min:1,step:1,required:!0,value:n,disabled:i,placeholder:`Enter tokens`,"aria-describedby":`codex-context-help`,className:`min-h-11 sm:min-h-0 ${a?`h-7 text-[11px]`:``}`,onChange:e=>o(e.target.value)})]})}function ae({config:e,compact:t,saving:n,onSave:r}){let[i,a]=(0,I.useState)(String(e?.model_context_window??``)),[o,s]=(0,I.useState)(String(e?.model_auto_compact_token_limit??``)),[c,l]=(0,I.useState)(null),u=t?`text-[11px]`:`text-sm`,d=t?`text-[9px]`:`text-[11px]`;async function f(e){e.preventDefault();let t=i.trim()?Number(i):null,n=o.trim()?Number(o):null;if([t,n].some(e=>e!==null&&(!Number.isSafeInteger(e)||e<=0))){l(`Enter positive whole numbers of tokens, or leave blank for Codex defaults.`);return}if(t!==null&&n!==null&&n>t){l(`Auto-compact threshold must not exceed the context window.`);return}l(null),await r({model_context_window:t,model_auto_compact_token_limit:n})}return(0,L.jsxs)(`form`,{onSubmit:f,className:`space-y-2 rounded-md border border-border p-3`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,L.jsx)(B,{id:`codex-context-window`,label:`Context window (tokens)`,value:i,presets:R,disabled:n,compact:t,onChange:e=>{a(e),l(null)}}),(0,L.jsx)(B,{id:`codex-compact-threshold`,label:`Auto-compact threshold (tokens)`,value:o,presets:z,disabled:n,compact:t,onChange:e=>{s(e),l(null)}})]}),(0,L.jsx)(`p`,{id:`codex-context-help`,className:`${d} text-muted-foreground`,children:`Choose Codex default to use Codex configuration and model defaults, or Custom to enter a value. Presets are shortcuts, not a list of limits supported by your model; increasing these values does not unlock a larger context window. Applies to new sessions and sessions resumed after a PPM restart.`}),c&&(0,L.jsx)(`p`,{role:`alert`,className:`${u} text-error`,children:c}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsx)(`a`,{href:`https://learn.chatgpt.com/docs/config-file/config-reference`,target:`_blank`,rel:`noreferrer`,className:`${d} text-primary underline`,children:`Codex context documentation`}),(0,L.jsx)(`button`,{type:`submit`,disabled:n,className:`min-h-11 sm:min-h-0 rounded-md border border-border px-3 py-1.5 hover:bg-surface-elevated disabled:opacity-50 ${u}`,children:n?`Saving...`:`Save context settings`})]})]})}var oe=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`xhigh`,label:`Extra`},{value:`max`,label:`Max`}],se=[{value:`bypassPermissions`,label:`Bypass permissions (default)`},{value:`default`,label:`Ask before edits`},{value:`acceptEdits`,label:`Edit automatically`},{value:`plan`,label:`Plan mode`}],V={claude:`Claude`,cursor:`Cursor`,codex:`Codex`,gemini:`Gemini`};function H({compact:e}={}){let[t,n]=(0,I.useState)(null),[r,x]=(0,I.useState)(``),[S,C]=(0,I.useState)([]),[w,T]=(0,I.useState)(!1),[E,D]=(0,I.useState)(!1),[O,k]=(0,I.useState)(null),[A,j]=(0,I.useState)(0),[M,P]=(0,I.useState)([]),[R,z]=(0,I.useState)(!1);(0,I.useEffect)(()=>{te().then(e=>{n(e),x(e.default_provider??`claude`)}).catch(e=>k(e.message))},[]),(0,I.useEffect)(()=>{r&&s.get(`/api/settings/ai/providers/status`).then(P).catch(()=>P([]))},[r]);let B=M.find(e=>e.id===r&&!e.registered);(0,I.useEffect)(()=>{r&&(T(!0),s.get(`/api/settings/ai/providers/${r}/models`).then(C).catch(()=>C([])).finally(()=>T(!1)))},[r,!B]);let[H,U]=(0,I.useState)(null),W=t?.providers[r]?.model;(0,I.useEffect)(()=>{if(U(null),!r)return;let e=!0,t=W?`?model=${encodeURIComponent(W)}`:``;return s.get(`/api/settings/ai/providers/${r}/effort-status${t}`).then(({status:t})=>{e&&U(t)}).catch(()=>{}),()=>{e=!1}},[r,W]);let le=async()=>{z(!0);try{let e=await s.post(`/api/settings/ai/providers/${r}/probe`);P(t=>t.map(t=>t.id===e.id?e:t))}catch(e){k(e.message)}finally{z(!1)}},G=t?Object.keys(t.providers).filter(e=>e!==`mock`).map(e=>({id:e,name:V[e]??e})):[],K=t?.providers[r],q=K?.type===`agent-sdk`||!K?.type&&r===`claude`,J=F(ie(K?.effort,H),H,K?.model?b(K.model):`the model`),Y=async e=>{if(!t)return!1;D(!0),k(null);try{return n(await ne(e)),j(e=>e+1),!0}catch(e){return k(e.message),!1}finally{D(!1)}},X=(e,t)=>Y({providers:{[r]:{[e]:t}}}),Z=e?`text-[11px]`:`text-sm`,Q=e?`text-xs`:`text-sm`,ue=e?`space-y-2`:`space-y-4`,de=e?`space-y-1.5`:`space-y-3`,$=e?`space-y-1`:`space-y-1.5`;if(!t)return(0,L.jsxs)(`div`,{className:de,children:[(0,L.jsx)(`h3`,{className:`${Q} font-medium text-text-secondary`,children:`AI Settings`}),(0,L.jsx)(`p`,{className:`${Z} text-text-subtle`,children:O?`Error: ${O}`:`Loading...`})]});let fe=q?S:[{value:`__default__`,label:`Auto (default)`},...S];return(0,L.jsxs)(`div`,{className:ue,children:[(0,L.jsx)(`h3`,{className:`${Q} font-medium text-text-secondary`,children:`AI Settings`}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-new-chat-provider`,className:e?Z:void 0,children:`New chat provider`}),(0,L.jsxs)(g,{value:t.new_chat_provider_mode??`default`,disabled:E,onValueChange:e=>Y({new_chat_provider_mode:e}),children:[(0,L.jsx)(m,{id:`ai-new-chat-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,L.jsx)(d,{})}),(0,L.jsxs)(h,{children:[(0,L.jsx)(_,{value:`follow-focus`,children:`Follow last focused chat`}),(0,L.jsx)(_,{value:`default`,children:`Always use default provider`})]})]}),(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:t.new_chat_provider_mode===`follow-focus`?`New tabs follow the last chat you focused in this project, across panels. Existing tabs keep their provider.`:`New tabs always use the default provider. Existing tabs keep their provider.`})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-default-provider`,className:e?Z:void 0,children:`Default provider`}),(0,L.jsxs)(g,{value:t.default_provider,disabled:E,onValueChange:e=>Y({default_provider:e}),children:[(0,L.jsx)(m,{id:`ai-default-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,L.jsx)(d,{})}),(0,L.jsx)(h,{children:G.map(e=>(0,L.jsx)(_,{value:e.id,children:e.name},e.id))})]}),t.new_chat_provider_mode===`follow-focus`&&(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Used when no chat has been focused in this project yet.`})]}),(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-md border border-border p-3`,children:[(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-share-provider-context`,className:e?Z:void 0,children:`Share rules and memory between providers`}),(0,L.jsx)(`p`,{id:`ai-share-provider-context-description`,className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Share project rules and memory, plus global instruction files, across providers. Applies from the next project-chat message. Turning off keeps context already sent.`})]}),(0,L.jsx)(v,{id:`ai-share-provider-context`,"aria-describedby":`ai-share-provider-context-description`,checked:t.share_provider_context??!0,disabled:E,onCheckedChange:e=>Y({share_provider_context:e})})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-leftover-idle`,className:e?Z:void 0,children:`Stop leftover processes after (idle minutes, 0 = log only)`}),(0,L.jsx)(u,{id:`ai-leftover-idle`,type:`number`,min:0,max:re,defaultValue:y(t),"aria-describedby":`ai-leftover-idle-description`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let n=parseInt(e.target.value),r=isNaN(n)?null:Math.min(Number(e.target.max),Math.max(Number(e.target.min),n));e.target.value=String(r??y(t)),r!==null&&Y({leftover_processes_idle_minutes:r})}},`leftover-${A}`),(0,L.jsxs)(`p`,{id:`ai-leftover-idle-description`,className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:[`Servers, emulators and other processes a chat's commands started and left running are stopped once the chat has been idle this long, and at once when the chat is deleted. At 0 nothing is stopped: the server log names what `,30,` idle minutes would have stopped. Linux with systemd only.`]})]}),G.length>1&&(0,L.jsx)(`div`,{className:`flex gap-0.5 border-b border-border/50 -mx-1 px-1`,children:G.map(e=>(0,L.jsxs)(`button`,{onClick:()=>x(e.id),className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-t transition-colors ${r===e.id?`text-primary border-b-2 border-primary font-medium`:`text-text-subtle hover:text-text-secondary`}`,children:[(0,L.jsx)(ee,{providerId:e.id}),(0,L.jsx)(`span`,{className:`capitalize`,children:e.name})]},e.id))}),(0,L.jsxs)(`div`,{className:de,children:[B&&(0,L.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-2`,children:[(0,L.jsx)(o,{className:`size-3.5 text-warning shrink-0 mt-0.5`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,L.jsxs)(`p`,{className:`${Z} text-text-secondary`,children:[V[r]??r,` is not available in chat — PPM could not start it.`]}),(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground break-words`,children:B.reason}),B.nextProbeAt&&(0,L.jsxs)(`p`,{className:`text-[11px] text-text-subtle`,children:[`Checking again at `,new Date(B.nextProbeAt).toLocaleTimeString()]}),(0,L.jsxs)(l,{variant:`outline`,size:`sm`,onClick:le,disabled:R,className:`gap-1.5 cursor-pointer min-h-11 md:min-h-8`,children:[(0,L.jsx)(a,{className:`size-3.5 ${R?`animate-spin`:``}`}),R?`Checking...`:`Check again`]})]})]}),r===`codex`&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>c(`accounts`),className:`w-full flex items-center justify-between gap-2 rounded-md border border-border px-2.5 py-2 text-left cursor-pointer hover:bg-surface-elevated transition-colors`,children:[(0,L.jsx)(`span`,{className:`${Z} text-text-secondary`,children:`Codex accounts & login`}),(0,L.jsx)(i,{className:`size-3.5 text-text-subtle shrink-0`})]}),S.length>0&&(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-model`,className:e?Z:void 0,children:`Model`}),(0,L.jsxs)(g,{value:q?K?.model??S[0]?.value:K?.model||`__default__`,onValueChange:e=>X(`model`,e===`__default__`?void 0:e),disabled:w,children:[(0,L.jsx)(m,{id:`ai-model`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,L.jsx)(d,{placeholder:w?`Loading models...`:`Select model`})}),(0,L.jsx)(h,{className:`max-h-[300px]`,children:fe.map(e=>(0,L.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),r===`codex`&&(0,L.jsx)(ae,{config:K,compact:e,saving:E,onSave:e=>Y({providers:{codex:e}})},JSON.stringify([K?.model_context_window,K?.model_auto_compact_token_limit])),q&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-base-url`,className:e?Z:void 0,children:`Base URL`}),(0,L.jsx)(u,{id:`ai-base-url`,type:`url`,defaultValue:K?.base_url??``,placeholder:`https://api.anthropic.com (default)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{X(`base_url`,e.target.value.trim()||void 0)}},`baseurl-${r}-${A}`)]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-api-key`,className:e?Z:void 0,children:`API Key / Token`}),(0,L.jsx)(u,{id:`ai-api-key`,type:`password`,defaultValue:K?.api_key??``,placeholder:`sk-ant-... (optional, overrides accounts)`,className:e?`h-7 text-[11px] font-mono`:`font-mono`,onBlur:e=>{let t=e.target.value.trim();t.startsWith(`••••`)||X(`api_key`,t||void 0)}},`apikey-${r}-${A}`),(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Direct API key or OAuth token. Leave empty to use connected accounts.`})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-effort`,className:e?Z:void 0,children:`Effort`}),(0,L.jsxs)(g,{value:K?.effort??`high`,onValueChange:e=>X(`effort`,e),children:[(0,L.jsx)(m,{id:`ai-effort`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,L.jsx)(d,{})}),(0,L.jsx)(h,{children:oe.map(e=>(0,L.jsx)(_,{value:e.value,children:e.label},e.value))})]}),J&&(0,L.jsxs)(`div`,{role:`note`,className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-2`,children:[(0,L.jsx)(o,{className:`size-3.5 text-warning shrink-0 mt-0.5`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,L.jsx)(`p`,{className:`${Z} text-text-secondary`,children:J.title}),(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground break-words`,children:N(J.detail)})]})]})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-max-turns`,className:e?Z:void 0,children:`Max Turns (up to 1000, 0 = no limit)`}),(0,L.jsx)(u,{id:`ai-max-turns`,type:`number`,min:0,max:1e3,defaultValue:K?.max_turns??100,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value),n=isNaN(t)?null:Math.min(Number(e.target.max),Math.max(Number(e.target.min),t));e.target.value=String(n??K?.max_turns??100),n!==null&&X(`max_turns`,n)}},`turns-${r}-${A}`),(K?.max_turns===0||(K?.max_turns??0)>500)&&(0,L.jsxs)(`p`,{className:`flex items-start gap-1.5 ${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:[(0,L.jsx)(o,{className:`size-3 text-warning shrink-0 mt-px`}),`Every step is a paid model call. With a limit this high, or none, a task left running unattended can go on for hours and run up a large bill.`]})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-budget`,className:e?Z:void 0,children:`Max Budget (USD)`}),(0,L.jsx)(u,{id:`ai-budget`,type:`number`,step:.1,min:.01,max:50,defaultValue:K?.max_budget_usd??``,placeholder:`No limit`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseFloat(e.target.value);X(`max_budget_usd`,isNaN(t)?void 0:t)}},`budget-${r}-${A}`)]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-thinking`,className:e?Z:void 0,children:`Thinking Budget (tokens)`}),(0,L.jsx)(u,{id:`ai-thinking`,type:`number`,min:0,defaultValue:K?.thinking_budget_tokens??``,placeholder:`Adaptive (model decides)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);X(`thinking_budget_tokens`,isNaN(t)?void 0:t)}},`thinking-${r}-${A}`)]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(p,{htmlFor:`ai-agent-teams`,className:e?Z:void 0,children:`Agent Teams`}),(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Experimental. Enables multi-agent collaboration with shared tasks and messaging. Uses ~7x more tokens.`})]}),(0,L.jsx)(v,{id:`ai-agent-teams`,checked:K?.agent_teams??!1,onCheckedChange:e=>X(`agent_teams`,e)})]}),K?.agent_teams&&(0,L.jsx)(ce,{compact:e}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(p,{htmlFor:`ai-context-1m`,className:e?Z:void 0,children:`1M Context Window`}),(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Requires an entitled account (Max/Team/Enterprise) and an Opus 4 / Sonnet 4 model. Other accounts will error.`})]}),(0,L.jsx)(v,{id:`ai-context-1m`,checked:K?.context_1m??!1,onCheckedChange:e=>X(`context_1m`,e)})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(p,{htmlFor:`ai-inherit-mcp`,className:e?Z:void 0,children:`Inherit Claude Code MCP`}),(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Auto-load MCP servers from Claude Code's ~/.claude.json (global + per-project). Your own MCP servers override inherited ones.`})]}),(0,L.jsx)(v,{id:`ai-inherit-mcp`,checked:K?.inherit_claude_mcp??!0,onCheckedChange:e=>X(`inherit_claude_mcp`,e)})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{className:e?Z:void 0,children:`MCP sign-in`}),(0,L.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Servers that use OAuth stay unavailable to Claude until someone signs in. Project-scoped servers are listed in the project's AI Resources panel.`}),(0,L.jsx)(`div`,{className:`-mx-2`,children:(0,L.jsx)(f,{showWhenEmpty:!0})})]})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-permission-mode`,className:e?Z:void 0,children:`Default Permission Mode`}),(0,L.jsxs)(g,{value:K?.permission_mode??`bypassPermissions`,onValueChange:e=>X(`permission_mode`,e),children:[(0,L.jsx)(m,{id:`ai-permission-mode`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,L.jsx)(d,{})}),(0,L.jsx)(h,{children:se.map(e=>(0,L.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),(0,L.jsxs)(`div`,{className:$,children:[(0,L.jsx)(p,{htmlFor:`ai-system-prompt`,className:e?Z:void 0,children:`Additional Instructions`}),(0,L.jsx)(`textarea`,{id:`ai-system-prompt`,rows:e?3:4,defaultValue:K?.system_prompt??``,placeholder:`Enter additional instructions for ${r}...`,className:`w-full rounded-md border border-input bg-background px-3 py-2 ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${e?`text-[11px]`:`text-sm`}`,onBlur:e=>{X(`system_prompt`,e.target.value.trim()||void 0)}},`sysprompt-${r}-${A}`)]})]}),E&&(0,L.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`Saving...`}),O&&(0,L.jsx)(`p`,{className:`text-xs text-error`,children:O})]})}function ce({compact:e}){let[t,n]=(0,I.useState)([]),[i,o]=(0,I.useState)(!1),[c,l]=(0,I.useState)(null),u=(0,I.useCallback)(async()=>{o(!0);try{n(await s.get(`/api/teams`)??[])}catch{}o(!1)},[]);(0,I.useEffect)(()=>{u()},[u]);let d=async e=>{try{await s.del(`/api/teams/${encodeURIComponent(e)}`),n(t=>t.filter(t=>t.name!==e)),l(null)}catch{}};return t.length===0&&!i?null:(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(p,{className:e?`text-[11px]`:void 0,children:[`Teams (`,t.length,`)`]}),(0,L.jsx)(`button`,{onClick:u,className:`text-text-subtle hover:text-foreground p-1`,"aria-label":`Refresh teams`,children:(0,L.jsx)(a,{className:`size-3 ${i?`animate-spin`:``}`})})]}),t.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between p-2 rounded bg-surface-elevated text-xs`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),e.description&&(0,L.jsx)(`div`,{className:`text-text-subtle truncate`,children:e.description}),(0,L.jsxs)(`div`,{className:`text-text-subtle`,children:[e.members?.length??e.memberCount??0,` members`,e.createdAt?` · ${new Date(e.createdAt).toLocaleDateString()}`:``]})]}),c===e.name?(0,L.jsxs)(`div`,{className:`flex gap-1 shrink-0 ml-2`,children:[(0,L.jsx)(`button`,{onClick:()=>d(e.name),className:`px-2 py-1 bg-error text-white rounded text-[10px]`,children:`Delete`}),(0,L.jsx)(`button`,{onClick:()=>l(null),className:`px-2 py-1 bg-panel-2 text-text rounded text-[10px]`,children:`Cancel`})]}):(0,L.jsx)(`button`,{onClick:()=>l(e.name),className:`shrink-0 text-text-subtle hover:text-error p-1 ml-2`,"aria-label":`Delete team ${e.name}`,children:(0,L.jsx)(r,{className:`size-3.5`})})]},e.name))]})}export{F as a,b as c,A as i,k as n,N as o,j as r,ie as s,H as t};