@xopcai/xopc 0.0.467 → 0.0.469

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 (465) hide show
  1. package/dist/browser-ext/dist/sidepanel.js +5 -0
  2. package/dist/browser-ext/manifest.json +1 -1
  3. package/dist/extensions/telegram/xopc.extension.json +1 -1
  4. package/dist/gateway/static/root/assets/{activity-store-CdEua6PR.js → activity-store-DKP2sWTJ.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-l8GQ4I9J.js → agent-avatar-dicebear-BR85bT1W.js} +1 -1
  6. package/dist/gateway/static/root/assets/{agent-avatar-display-BO1bqKlR.js → agent-avatar-display-CIsejg_E.js} +2 -2
  7. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-Dj_H2kDD.js → agent-defaults-settings-panel-CxLUEl0V.js} +1 -1
  8. package/dist/gateway/static/root/assets/{agent-plugin-dialog-BQA2brAU.js → agent-plugin-dialog-Cvj04Ckm.js} +1 -1
  9. package/dist/gateway/static/root/assets/{agents-C5C5l13A.js → agents-DZftplJc.js} +3 -3
  10. package/dist/gateway/static/root/assets/{agents-admin-api-DZ1lLnrj.js → agents-admin-api-BL8lN8gP.js} +1 -1
  11. package/dist/gateway/static/root/assets/{api-DDWYNF7I.js → api-BnS9d0p6.js} +1 -1
  12. package/dist/gateway/static/root/assets/{api-DVXcGKP-.js → api-V4P8zfkJ.js} +1 -1
  13. package/dist/gateway/static/root/assets/{app-link-BkEO3eBe.js → app-link-CauYDM-y.js} +1 -1
  14. package/dist/gateway/static/root/assets/{app-management-settings-panel-B5-7E03Z.js → app-management-settings-panel-CAEry5Vu.js} +1 -1
  15. package/dist/gateway/static/root/assets/{appearance-settings-E_BcjEDM.js → appearance-settings-CphsmJgM.js} +1 -1
  16. package/dist/gateway/static/root/assets/{apps-page-BjB_mjXu.js → apps-page-CXKTWj1s.js} +1 -1
  17. package/dist/gateway/static/root/assets/{archive-plugin-MvSiDvxK.js → archive-plugin-DS6JWBPZ.js} +1 -1
  18. package/dist/gateway/static/root/assets/arrow-down-to-line-C5D8Vt-L.js +1 -0
  19. package/dist/gateway/static/root/assets/{attachment-load-DrVGNxJm.js → attachment-load-C9iZLUHv.js} +1 -1
  20. package/dist/gateway/static/root/assets/attachment-preview-renderer-_6GhoCYk.js +12 -0
  21. package/dist/gateway/static/root/assets/attachment-utils-core-BPYdUI6y.js +1 -0
  22. package/dist/gateway/static/root/assets/{automation-api-24NjW7qG.js → automation-api-GcRQ9wM4.js} +1 -1
  23. package/dist/gateway/static/root/assets/{automation-result-state-C94Q3OEL.js → automation-result-state-Dcp0JX0w.js} +1 -1
  24. package/dist/gateway/static/root/assets/{automation-run-list-BShRirWV.js → automation-run-list-BLejrWpG.js} +1 -1
  25. package/dist/gateway/static/root/assets/{automation-task-card-Bgq5Plux.js → automation-task-card-BNT3n0qu.js} +1 -1
  26. package/dist/gateway/static/root/assets/{automations-page-3WGWLdiW.js → automations-page-DqrAOReO.js} +1 -1
  27. package/dist/gateway/static/root/assets/automations-workspace-BYmFhO8E.js +9 -0
  28. package/dist/gateway/static/root/assets/binary-plugins-CnFVuJtL.js +2 -0
  29. package/dist/gateway/static/root/assets/{block-editor-DAWXPErA.js → block-editor-jy5CCmhH.js} +9 -9
  30. package/dist/gateway/static/root/assets/{browser-settings-page-DI2PYAPC.js → browser-settings-page-Dd2eTtvL.js} +1 -1
  31. package/dist/gateway/static/root/assets/{capabilities-Dyw8xW90.js → capabilities-CaJjMTli.js} +1 -1
  32. package/dist/gateway/static/root/assets/capabilities-YmBD7oK8.js +1 -0
  33. package/dist/gateway/static/root/assets/capabilities-page-XgIRdqCb.js +2 -0
  34. package/dist/gateway/static/root/assets/capabilities-settings-panel-DfyND0IO.js +8 -0
  35. package/dist/gateway/static/root/assets/channels-DwUmMnA1.js +1 -0
  36. package/dist/gateway/static/root/assets/{chat-agents-api-BksS0CNy.js → chat-agents-api-Bim8--J9.js} +1 -1
  37. package/dist/gateway/static/root/assets/{chat-chart-block-aZIklMNN.js → chat-chart-block-B_c5sy7q.js} +1 -1
  38. package/dist/gateway/static/root/assets/chat-page-DfFXhDRv.js +72 -0
  39. package/dist/gateway/static/root/assets/{chat-terminal-dock-B4HoRIzf.js → chat-terminal-dock-Dn7Cm1O4.js} +1 -1
  40. package/dist/gateway/static/root/assets/{command-palette-api-VhBEUFmw.js → command-palette-api-DPtCt8Je.js} +1 -1
  41. package/dist/gateway/static/root/assets/{composer-model-config-control-BhRAbdPW.js → composer-model-config-control-BF9PPSiu.js} +1 -1
  42. package/dist/gateway/static/root/assets/{composer-notifications-nT-U6jcc.js → composer-notifications-B0IZsy8x.js} +1 -1
  43. package/dist/gateway/static/root/assets/{composer-payload-handoff-xEFHDnLo.js → composer-payload-handoff-CRCz17sd.js} +1 -1
  44. package/dist/gateway/static/root/assets/{computer-settings-page-DXlH96m6.js → computer-settings-page-CtfitoMZ.js} +1 -1
  45. package/dist/gateway/static/root/assets/{connected-providers-grid-D8vBFsbY.js → connected-providers-grid-DUHMZjyV.js} +1 -1
  46. package/dist/gateway/static/root/assets/{connection-usage-guide-C8jPm7QO.js → connection-usage-guide-CM5qgMcK.js} +1 -1
  47. package/dist/gateway/static/root/assets/{connector-service-page-B42yWHxS.js → connector-service-page-DLbBblN2.js} +1 -1
  48. package/dist/gateway/static/root/assets/{connectors-api-so2a7xrD.js → connectors-api-BUdH4tZQ.js} +1 -1
  49. package/dist/gateway/static/root/assets/{connectors-page-yhOZIiUZ.js → connectors-page-HHGB3r3Q.js} +1 -1
  50. package/dist/gateway/static/root/assets/constants-D5Z-mUto.js +1 -0
  51. package/dist/gateway/static/root/assets/{date-picker-UEh3JM7r.js → date-picker-DRSq2kDz.js} +1 -1
  52. package/dist/gateway/static/root/assets/{date-time-picker-Dci0LfAU.js → date-time-picker--LGC1D3b.js} +1 -1
  53. package/dist/gateway/static/root/assets/{desktop-pet-BAU_GuBe.js → desktop-pet-1oXlQvjH.js} +1 -1
  54. package/dist/gateway/static/root/assets/{desktop-pet-settings-CYE2eTTf.js → desktop-pet-settings-GdOjz7W9.js} +1 -1
  55. package/dist/gateway/static/root/assets/{dev-view-store-C7v4CIlF.js → dev-view-store-DnQ2nBtV.js} +1 -1
  56. package/dist/gateway/static/root/assets/{device-pairing-wizard-7NDkYmiZ.js → device-pairing-wizard-eWeHH6Ru.js} +1 -1
  57. package/dist/gateway/static/root/assets/{directory-picker-path-field-DmRZY8kg.js → directory-picker-path-field-DBe_paLy.js} +1 -1
  58. package/dist/gateway/static/root/assets/extension-authoritative-grants-BqtUnmq-.js +1 -0
  59. package/dist/gateway/static/root/assets/{extension-debug-page-D8TAJgZ_.js → extension-debug-page-DIAyDA-a.js} +1 -1
  60. package/dist/gateway/static/root/assets/{extension-iframe-host-CjfRKtQ4.js → extension-iframe-host-CCe4R7L7.js} +1 -1
  61. package/dist/gateway/static/root/assets/{extension-marketplace-api-V1oFBxVi.js → extension-marketplace-api-baFXdV56.js} +1 -1
  62. package/dist/gateway/static/root/assets/{extension-message-router-DZahH1Hd.js → extension-message-router-BD0ZamBV.js} +1 -1
  63. package/dist/gateway/static/root/assets/{extension-page-DMuHBIHa.js → extension-page-C09dlV3J.js} +1 -1
  64. package/dist/gateway/static/root/assets/{extension-provider-lqJ1zIkA.js → extension-provider-BhluafoX.js} +1 -1
  65. package/dist/gateway/static/root/assets/{extension-settings-page-D5IfKVff.js → extension-settings-page-CB8KLYoG.js} +1 -1
  66. package/dist/gateway/static/root/assets/file-CStvVK2S.js +1 -0
  67. package/dist/gateway/static/root/assets/{file-BqMS_3DT.js → file-code-corner-byQA1VfD.js} +1 -1
  68. package/dist/gateway/static/root/assets/file-icon-N6WjUhq_.js +1 -0
  69. package/dist/gateway/static/root/assets/{file-preview-surface-B7B9qXm9.js → file-preview-surface-CeFFZo3a.js} +1 -1
  70. package/dist/gateway/static/root/assets/file-tree-CYUkQR1t.js +1 -0
  71. package/dist/gateway/static/root/assets/{gateway-config-swr-Dk3FtNv1.js → gateway-config-swr-DVXDJNCI.js} +1 -1
  72. package/dist/gateway/static/root/assets/{gateway-realtime-DMvo4pAc.js → gateway-realtime-BnwNxbyc.js} +1 -1
  73. package/dist/gateway/static/root/assets/gateway-realtime-store-BpnGXAhi.js +1 -0
  74. package/dist/gateway/static/root/assets/{gateway-restart-C2h5R1eP.js → gateway-restart-Bws2Shaz.js} +1 -1
  75. package/dist/gateway/static/root/assets/{gateway-settings-DGPaikv5.js → gateway-settings-BU5Cp4Bw.js} +1 -1
  76. package/dist/gateway/static/root/assets/{gateway-startup-retry-yZn7ShiP.js → gateway-startup-retry-2jU7zCyx.js} +1 -1
  77. package/dist/gateway/static/root/assets/{global-defaults-api-gsAa0Kj9.js → global-defaults-api-CNyJ0dGb.js} +1 -1
  78. package/dist/gateway/static/root/assets/{home-page-BBTtXpDD.js → home-page-8KwhWlYt.js} +3 -3
  79. package/dist/gateway/static/root/assets/{image-generation-api-DPn1SBMH.js → image-generation-api-CiqQSx5j.js} +1 -1
  80. package/dist/gateway/static/root/assets/{imports-page-Cc48Uq20.js → imports-page-B9JMNXwt.js} +1 -1
  81. package/dist/gateway/static/root/assets/index-CZUfwwLp.css +1 -0
  82. package/dist/gateway/static/root/assets/index-D5hovYIw.js +11 -0
  83. package/dist/gateway/static/root/assets/{install-connector-dialog-QkJMw_uW.js → install-connector-dialog-BZjodnUC.js} +1 -1
  84. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BZXqXuI4.js → keyboard-shortcuts-settings-A37hYJtR.js} +1 -1
  85. package/dist/gateway/static/root/assets/local-app-workbench-page-DmzgjJNj.js +1 -0
  86. package/dist/gateway/static/root/assets/{local-apps-page-D-bRvlZY.js → local-apps-page-Ct8z2B7R.js} +1 -1
  87. package/dist/gateway/static/root/assets/{local-session-drafts-CZ19DRRK.js → local-session-drafts-CgAuYyKi.js} +1 -1
  88. package/dist/gateway/static/root/assets/{locale-store-DIBIYLnI.js → locale-store-Cit_aHqC.js} +1 -1
  89. package/dist/gateway/static/root/assets/logs-page-CH9amuGc.js +2 -0
  90. package/dist/gateway/static/root/assets/{management-api-EG5duPec.js → management-api-DG-yZnHK.js} +1 -1
  91. package/dist/gateway/static/root/assets/{management-settings-B7RWHrwo.js → management-settings-CUQd0FJ3.js} +1 -1
  92. package/dist/gateway/static/root/assets/{markdown-view-C30KvTaE.js → markdown-view-Dm01GIXv.js} +1 -1
  93. package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-BZ1PDTYY.js → mcp-conversation-setup-page-YvPXchDz.js} +1 -1
  94. package/dist/gateway/static/root/assets/{media-plugins-CW5UoTx6.js → media-plugins-jsWNdARw.js} +1 -1
  95. package/dist/gateway/static/root/assets/messages-DQveK9sk.js +3 -0
  96. package/dist/gateway/static/root/assets/{model-selector-COGICRIG.js → model-selector-Cg2kTsE7.js} +1 -1
  97. package/dist/gateway/static/root/assets/models-hub-cache-B2QcrY4n.js +1 -0
  98. package/dist/gateway/static/root/assets/note-detail-panel-DeFb2HEC.js +7 -0
  99. package/dist/gateway/static/root/assets/note-image-lightbox-DUzoWZEe.js +1 -0
  100. package/dist/gateway/static/root/assets/notes-api-BMSPkAm8.js +1 -0
  101. package/dist/gateway/static/root/assets/notes-page-nvqpOeHp.js +8 -0
  102. package/dist/gateway/static/root/assets/{oauth-api-enDU_32p.js → oauth-api-Bz_PU9R_.js} +1 -1
  103. package/dist/gateway/static/root/assets/{oauth-provider-connect-C2pfvPOI.js → oauth-provider-connect-BexlZuZ4.js} +1 -1
  104. package/dist/gateway/static/root/assets/{page-context-capture-button-BaSooYGv.js → page-context-capture-button-Cn4zi3Mt.js} +1 -1
  105. package/dist/gateway/static/root/assets/{page-context-draft-4-3RtO0q.js → page-context-draft-BjbX5zd7.js} +1 -1
  106. package/dist/gateway/static/root/assets/page-header-store-1-lflHAx.js +1 -0
  107. package/dist/gateway/static/root/assets/personal-avatar-CM3vUGhL.js +1 -0
  108. package/dist/gateway/static/root/assets/personal-avatar-DsEp8QJ7.css +1 -0
  109. package/dist/gateway/static/root/assets/personal-page-HFjWZacf.js +1 -0
  110. package/dist/gateway/static/root/assets/{personal-profile-settings-DwMdjQ6H.js → personal-profile-settings-CNI5Eor6.js} +1 -1
  111. package/dist/gateway/static/root/assets/{personal-settings-panel-DiNpP_g3.js → personal-settings-panel-BcrpYRn9.js} +1 -1
  112. package/dist/gateway/static/root/assets/{phone-dependencies-card-DUT-qRLZ.js → phone-dependencies-card-CJ3ovsW1.js} +1 -1
  113. package/dist/gateway/static/root/assets/{phone-model-connection-pvOciDNo.js → phone-model-connection-DKvOEjWH.js} +1 -1
  114. package/dist/gateway/static/root/assets/{phone-model-picker-CD97E6C5.js → phone-model-picker-CNTcpY1A.js} +1 -1
  115. package/dist/gateway/static/root/assets/{phone-settings-page-BUZ1dh7s.js → phone-settings-page-DvX6okzz.js} +1 -1
  116. package/dist/gateway/static/root/assets/{phone-workspace-store-BwilERgv.js → phone-workspace-store-CKOW55gy.js} +1 -1
  117. package/dist/gateway/static/root/assets/playback-coordinator-CWHIf0wr.js +1 -0
  118. package/dist/gateway/static/root/assets/{plugin-details-dialog-C_uOVmJv.js → plugin-details-dialog-BDoSffLO.js} +1 -1
  119. package/dist/gateway/static/root/assets/{preference-select-fields-BSUgcO7-.js → preference-select-fields-BKmzpfHq.js} +1 -1
  120. package/dist/gateway/static/root/assets/presentation-D-Ui_vVA.js +1 -0
  121. package/dist/gateway/static/root/assets/preview-runtime-RnBDP-Lq.js +15 -0
  122. package/dist/gateway/static/root/assets/product-automation-feedback-xAcXeJM2.js +7 -0
  123. package/dist/gateway/static/root/assets/product-delivery-4gEqUIsK.js +1 -0
  124. package/dist/gateway/static/root/assets/{product-open-page-Dy6D5exJ.js → product-open-page-DXwOPgRP.js} +1 -1
  125. package/dist/gateway/static/root/assets/{product-preview-content-DEUPAilo.js → product-preview-content-DiQbeaCK.js} +1 -1
  126. package/dist/gateway/static/root/assets/{product-preview-modal-C4TV9RUd.js → product-preview-modal-BU7Qojpq.js} +2 -2
  127. package/dist/gateway/static/root/assets/project-detail-page-Dr5_WPRB.js +7 -0
  128. package/dist/gateway/static/root/assets/{project-understanding-lOJ5Tz2V.js → project-understanding-Dv26vu9S.js} +1 -1
  129. package/dist/gateway/static/root/assets/{projects-page-B3aGdPHy.js → projects-page-DGATZB23.js} +1 -1
  130. package/dist/gateway/static/root/assets/{providers-api-C26HgxZY.js → providers-api-BXa2Aheb.js} +1 -1
  131. package/dist/gateway/static/root/assets/recording-upload-CQdhrRq3.js +1 -0
  132. package/dist/gateway/static/root/assets/{registry-api-pQ0eInzG.js → registry-api-BEnvt9-6.js} +1 -1
  133. package/dist/gateway/static/root/assets/{remote-access-hub-CjWrYzjf.js → remote-access-hub-_7tmWand.js} +1 -1
  134. package/dist/gateway/static/root/assets/{resource-unavailable-Y9WRHOnz.js → resource-unavailable-fk26VrOL.js} +1 -1
  135. package/dist/gateway/static/root/assets/right-workspace-store-NXMrEuwH.js +1 -0
  136. package/dist/gateway/static/root/assets/route-preload-D-pdVwIK.js +2 -0
  137. package/dist/gateway/static/root/assets/routine-panel-rjq-8nZ8.js +2 -0
  138. package/dist/gateway/static/root/assets/{runtime-tools-api-BoJQ3u5o.js → runtime-tools-api-CL6CG-qq.js} +1 -1
  139. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DB7cfLrX.js → runtime-tools-settings-panel-CdvQRxCR.js} +1 -1
  140. package/dist/gateway/static/root/assets/scan-search-CSIGkseh.js +1 -0
  141. package/dist/gateway/static/root/assets/{service-recommendation-list-_rFmwIwY.js → service-recommendation-list-2UOjV0Mx.js} +1 -1
  142. package/dist/gateway/static/root/assets/{session-api-a6wb0_Gf.js → session-api-CkOliupg.js} +1 -1
  143. package/dist/gateway/static/root/assets/session-manager-BVS3zxRZ.js +22 -0
  144. package/dist/gateway/static/root/assets/{sessions-page-dEupc-3A.js → sessions-page-CN9ESZdY.js} +1 -1
  145. package/dist/gateway/static/root/assets/settings-advanced-gate-BYrXsPjK.js +1 -0
  146. package/dist/gateway/static/root/assets/{settings-advanced-section-CnGJr2xp.js → settings-advanced-section-Zex2dJo7.js} +1 -1
  147. package/dist/gateway/static/root/assets/{settings-mode-store-DWRhupcY.js → settings-mode-store-Dk0bZQgo.js} +1 -1
  148. package/dist/gateway/static/root/assets/{settings-page-D9A2DdJ_.js → settings-page-bCW4rave.js} +1 -1
  149. package/dist/gateway/static/root/assets/{settings-page-header-wL2jvs-y.js → settings-page-header-B9Y_eGcH.js} +1 -1
  150. package/dist/gateway/static/root/assets/{settings-page-layout-BkUQVmyY.js → settings-page-layout-D1MgJ5zP.js} +1 -1
  151. package/dist/gateway/static/root/assets/{setup-interaction-page-D238tuw-.js → setup-interaction-page-BYXDX0F2.js} +1 -1
  152. package/dist/gateway/static/root/assets/{setup-status-panel-DXvYjIu3.js → setup-status-panel-Bhda3jS2.js} +1 -1
  153. package/dist/gateway/static/root/assets/{share-link-dialog-DFDJyl3N.js → share-link-dialog-BxFk4-4u.js} +1 -1
  154. package/dist/gateway/static/root/assets/share-preview-page-nzWjWhqF.js +2 -0
  155. package/dist/gateway/static/root/assets/{shares-api-CfFiW03g.js → shares-api-ChBHTPKN.js} +1 -1
  156. package/dist/gateway/static/root/assets/shares-settings-LB3SYKFS.js +1 -0
  157. package/dist/gateway/static/root/assets/sheet-C2H8iR8Y.js +1 -0
  158. package/dist/gateway/static/root/assets/{skill-api-CWRhFSkA.js → skill-api-TQAyWHGS.js} +1 -1
  159. package/dist/gateway/static/root/assets/{skill-list-api-CmPp2czp.js → skill-list-api-D4eokPXx.js} +1 -1
  160. package/dist/gateway/static/root/assets/{skill-reload-api-BGsSq3dj.js → skill-reload-api-Bm-8vhsQ.js} +1 -1
  161. package/dist/gateway/static/root/assets/{skills-page-DqD0FPeH.js → skills-page-CfhEcU8L.js} +1 -1
  162. package/dist/gateway/static/root/assets/space-api-DaKpHc_7.js +1 -0
  163. package/dist/gateway/static/root/assets/space-page-BXyQdUvp.js +2 -0
  164. package/dist/gateway/static/root/assets/star-BuMAkjC9.js +1 -0
  165. package/dist/gateway/static/root/assets/{system-settings-panel-aw9C86I8.js → system-settings-panel-CvL5G2w1.js} +1 -1
  166. package/dist/gateway/static/root/assets/task-detail-page-gffrDRvW.js +3 -0
  167. package/dist/gateway/static/root/assets/task-header-title-DwtjUOBg.js +1 -0
  168. package/dist/gateway/static/root/assets/{task-result-evidence-C-zIBpzi.js → task-result-evidence-Bmgta9z9.js} +1 -1
  169. package/dist/gateway/static/root/assets/tasks-BIehlq7k.js +1 -0
  170. package/dist/gateway/static/root/assets/{terminal-panel-store-CgPqgrm7.js → terminal-panel-store-B1bAD5Xf.js} +1 -1
  171. package/dist/gateway/static/root/assets/{theme-store-DxF7S6I2.js → theme-store-C1MxmBg7.js} +1 -1
  172. package/dist/gateway/static/root/assets/{tracing-settings-page-Dvlunx28.js → tracing-settings-page-CvXDgIJQ.js} +1 -1
  173. package/dist/gateway/static/root/assets/{tunnel-api-CIte6n0U.js → tunnel-api-BkhCBt38.js} +1 -1
  174. package/dist/gateway/static/root/assets/turn-outcome-BSbEJx8h.js +1 -0
  175. package/dist/gateway/static/root/assets/{understanding-activity-store-C2RHmRo8.js → understanding-activity-store-BYGCmCVb.js} +1 -1
  176. package/dist/gateway/static/root/assets/{understanding-refresh-store-CPeQIXS_.js → understanding-refresh-store-DaLVsdYS.js} +1 -1
  177. package/dist/gateway/static/root/assets/{usage-page-DPUjEj39.js → usage-page-C-NM6vtY.js} +1 -1
  178. package/dist/gateway/static/root/assets/{use-autosave-xX2KrbXw.js → use-autosave-CvjQMyY8.js} +1 -1
  179. package/dist/gateway/static/root/assets/use-composer-attachments-sszsCdh5.js +2 -0
  180. package/dist/gateway/static/root/assets/use-file-preview-expanded-D4b4fDeu.js +1 -0
  181. package/dist/gateway/static/root/assets/use-personal-profile-CNPszzzT.js +1 -0
  182. package/dist/gateway/static/root/assets/use-personal-work-C-rw8XVO.js +1 -0
  183. package/dist/gateway/static/root/assets/{use-realtime-voice-RQW5KnIN.js → use-realtime-voice-cugjs8cK.js} +1 -1
  184. package/dist/gateway/static/root/assets/{use-workspace-tree-B6QFV5gR.js → use-workspace-tree-Crfx5ctU.js} +1 -1
  185. package/dist/gateway/static/root/assets/{user-model-page-hKnsTcMk.js → user-model-page-BvnLbTYx.js} +1 -1
  186. package/dist/gateway/static/root/assets/video-generation-Cec49Jwg.js +1 -0
  187. package/dist/gateway/static/root/assets/{voice-api-key-field-BeEF7Thh.js → voice-api-key-field-M7KB_Gl1.js} +1 -1
  188. package/dist/gateway/static/root/assets/{voice-config-api-vbBoKnqd.js → voice-config-api-BLGbUq3v.js} +1 -1
  189. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-CKn6X3qL.js → voice-input-shortcut-events-CxH3RDXi.js} +1 -1
  190. package/dist/gateway/static/root/assets/voice-player-store-DZGlzjva.js +1 -0
  191. package/dist/gateway/static/root/assets/voice-settings-BzfNK5Jm.js +1 -0
  192. package/dist/gateway/static/root/assets/{work-discovery-overlay-Ddvqu02U.js → work-discovery-overlay-DpEYgcG2.js} +1 -1
  193. package/dist/gateway/static/root/assets/{work-discovery-page-BdBpri6P.js → work-discovery-page-DappIHQq.js} +1 -1
  194. package/dist/gateway/static/root/assets/{working-directory-picker-modal-DStgfCzQ.js → working-directory-picker-modal-W2QiUVjN.js} +1 -1
  195. package/dist/gateway/static/root/assets/workspace-api-g-wCKoQU.js +2 -0
  196. package/dist/gateway/static/root/assets/workspace-editor-agent-store-DwpWKogz.js +1 -0
  197. package/dist/gateway/static/root/assets/workspace-file-preview-dialog-DxaxVC3q.js +1 -0
  198. package/dist/gateway/static/root/assets/{workspace-open-location-menu-CBHFZ2iQ.js → workspace-open-location-menu-Dh0TvTkH.js} +1 -1
  199. package/dist/gateway/static/root/assets/workspace-preview-store-DoIjn_2j.js +1 -0
  200. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Cm0Saa8B.js → xopc-cloud-account-card-DGAGXbGI.js} +1 -1
  201. package/dist/gateway/static/root/index.html +136 -123
  202. package/dist/package.js +1 -1
  203. package/dist/packages/gateway-contract/src/automations.js +7 -0
  204. package/dist/packages/gateway-contract/src/capabilities.js +1 -1
  205. package/dist/packages/gateway-contract/src/clarifications.js +20 -2
  206. package/dist/packages/gateway-contract/src/index.js +6 -4
  207. package/dist/packages/gateway-contract/src/music-generation.js +5 -2
  208. package/dist/packages/gateway-contract/src/space.js +23 -0
  209. package/dist/packages/gateway-contract/src/task-lifecycle.js +1 -0
  210. package/dist/packages/gateway-contract/src/task-result-delivery.js +1 -0
  211. package/dist/packages/gateway-contract/src/task-runs.js +1 -0
  212. package/dist/packages/gateway-contract/src/tasks.js +118 -6
  213. package/dist/packages/gateway-contract/src/turn-outcome.js +16 -2
  214. package/dist/packages/gateway-contract/src/video-generation.js +29 -4
  215. package/dist/src/agent/agent-manager.js +2 -2
  216. package/dist/src/agent/background-review/prompts.js +5 -1
  217. package/dist/src/agent/embedded/agent-profile-context.js +1 -1
  218. package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
  219. package/dist/src/agent/orchestration/delegation-budget.d.ts +2 -2
  220. package/dist/src/agent/orchestration/turn-recovery.d.ts +12 -3
  221. package/dist/src/agent/orchestration/turn-recovery.js +25 -6
  222. package/dist/src/agent/service/process-direct-streaming.js +1 -1
  223. package/dist/src/agent/service/webchat-tts.js +1 -1
  224. package/dist/src/agent/service.js +1 -1
  225. package/dist/src/agent/tasks/task-judge-service.js +1 -1
  226. package/dist/src/agent/tools/apply-patch.js +1 -1
  227. package/dist/src/agent/tools/factory.js +1 -1
  228. package/dist/src/agent/tools/image-generate-tool.js +1 -0
  229. package/dist/src/agent/tools/language-diagnostics.js +1 -1
  230. package/dist/src/agent/tools/personal-memory-tool.js +12 -10
  231. package/dist/src/agent/tools/personal-task-tool.d.ts +1 -0
  232. package/dist/src/agent/tools/personal-task-tool.js +12 -7
  233. package/dist/src/agent/tools/publish-artifacts.js +2 -1
  234. package/dist/src/agent/tools/review-workspace.js +1 -1
  235. package/dist/src/agent/tools/send-media.js +1 -0
  236. package/dist/src/agent/tools/tool-media.d.ts +3 -1
  237. package/dist/src/agent/tools/tool-media.js +2 -0
  238. package/dist/src/agent/tools/video-draft-tool.d.ts +1 -0
  239. package/dist/src/agent/tools/video-draft-tool.js +5 -1
  240. package/dist/src/agent/tools/xopc-use-tool.js +21 -4
  241. package/dist/src/agent-catalog/test-support.js +1 -1
  242. package/dist/src/agent-matching/delegation-service.js +1 -1
  243. package/dist/src/automations/capabilities/drafts.js +1 -1
  244. package/dist/src/automations/capabilities/write.d.ts +30 -6
  245. package/dist/src/automations/capabilities/write.js +2 -2
  246. package/dist/src/automations/configuration-conversation.js +1 -1
  247. package/dist/src/automations/domain/types.d.ts +6 -0
  248. package/dist/src/automations/domain/validation.d.ts +60 -12
  249. package/dist/src/automations/domain/validation.js +7 -0
  250. package/dist/src/automations/draft/automation-draft-validator.d.ts +12 -3
  251. package/dist/src/automations/draft/automation-draft-validator.js +1 -0
  252. package/dist/src/automations/service/action-executor.js +14 -2
  253. package/dist/src/automations/service/automation-service.js +2 -2
  254. package/dist/src/browser/providers/browser-ext-install.js +1 -1
  255. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  256. package/dist/src/computer/diagnostics.d.ts +9 -9
  257. package/dist/src/computer/errors.d.ts +2 -2
  258. package/dist/src/computer/evaluation.d.ts +7 -7
  259. package/dist/src/computer/runtime.d.ts +4 -4
  260. package/dist/src/config/schema.d.ts +2 -2
  261. package/dist/src/discussions/action-tasks.d.ts +2 -2
  262. package/dist/src/execution-environments/local-worktree-manager.js +1 -1
  263. package/dist/src/extensions/agent-plugins/inventory.d.ts +2 -2
  264. package/dist/src/extensions/agent-plugins/setup.d.ts +3 -3
  265. package/dist/src/gateway/hono/routes/commands-skills.js +1 -1
  266. package/dist/src/gateway/hono/routes/connectors.js +2 -2
  267. package/dist/src/gateway/hono/routes/context-sources.js +1 -1
  268. package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
  269. package/dist/src/gateway/hono/routes/memory-learning.js +19 -3
  270. package/dist/src/gateway/hono/routes/models.js +7 -0
  271. package/dist/src/gateway/hono/routes/music-generation.js +26 -3
  272. package/dist/src/gateway/hono/routes/personal-agent.js +214 -5
  273. package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
  274. package/dist/src/gateway/hono/routes/space.d.ts +3 -0
  275. package/dist/src/gateway/hono/routes/space.js +105 -0
  276. package/dist/src/gateway/hono/routes/tasks.js +27 -28
  277. package/dist/src/gateway/hono/routes/video-generation.js +9 -6
  278. package/dist/src/gateway/html-preview-shell.d.ts +1 -1
  279. package/dist/src/gateway/html-preview-shell.js +3 -0
  280. package/dist/src/gateway/media-access.js +2 -2
  281. package/dist/src/gateway/security/gateway-scopes.js +2 -0
  282. package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
  283. package/dist/src/gateway/service.d.ts +1 -0
  284. package/dist/src/gateway/service.js +10 -3
  285. package/dist/src/gateway/session-context-summary.js +1 -1
  286. package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +2 -0
  287. package/dist/src/gateway/xopc-cloud-capability-setup.js +18 -1
  288. package/dist/src/home-intelligence/follow-ups.js +2 -1
  289. package/dist/src/home-intelligence/routines.js +1 -1
  290. package/dist/src/local-apps/automation-proposals.d.ts +54 -12
  291. package/dist/src/local-apps/capabilities/projections.d.ts +7 -7
  292. package/dist/src/local-apps/preview-fixtures.d.ts +1 -1
  293. package/dist/src/media/session-references.d.ts +4 -1
  294. package/dist/src/media/session-references.js +40 -8
  295. package/dist/src/memory-learning/work-capture.js +2 -1
  296. package/dist/src/memory-learning/work-review.d.ts +2 -0
  297. package/dist/src/memory-learning/work-review.js +25 -2
  298. package/dist/src/music-generation/artifact.js +3 -1
  299. package/dist/src/music-generation/mureka.js +1 -1
  300. package/dist/src/music-generation/provider.d.ts +4 -1
  301. package/dist/src/music-generation/provider.js +6 -1
  302. package/dist/src/music-generation/providers.d.ts +3 -1
  303. package/dist/src/music-generation/providers.js +39 -16
  304. package/dist/src/music-generation/repository.d.ts +3 -1
  305. package/dist/src/music-generation/repository.js +12 -3
  306. package/dist/src/music-generation/tencent-mps.d.ts +11 -0
  307. package/dist/src/music-generation/tencent-mps.js +151 -0
  308. package/dist/src/music-generation/worker.js +16 -5
  309. package/dist/src/music-generation/xopc-cloud.d.ts +2 -0
  310. package/dist/src/music-generation/xopc-cloud.js +38 -0
  311. package/dist/src/personal-agent/capability-service.js +1 -1
  312. package/dist/src/personal-agent/proactivity/service.js +1 -1
  313. package/dist/src/personal-agent/prompt-context.js +1 -1
  314. package/dist/src/personal-agent/prompts.js +2 -2
  315. package/dist/src/personal-agent/reply-composer.js +16 -7
  316. package/dist/src/personal-agent/repository.js +1 -1
  317. package/dist/src/personal-agent/request-delivery.js +17 -7
  318. package/dist/src/personal-agent/request-service.js +6 -10
  319. package/dist/src/personal-agent/result-extraction.js +13 -13
  320. package/dist/src/personal-agent/schedules.d.ts +9 -0
  321. package/dist/src/personal-agent/schedules.js +44 -0
  322. package/dist/src/personal-agent/service.js +1 -1
  323. package/dist/src/providers/model-catalog-persistence.js +6 -1
  324. package/dist/src/providers/model-catalog-store.js +1 -0
  325. package/dist/src/providers/model-catalog-types.d.ts +2 -0
  326. package/dist/src/providers/xopc-cloud-media-manifest.d.ts +24 -0
  327. package/dist/src/providers/xopc-cloud-media-manifest.js +28 -0
  328. package/dist/src/providers/xopc-cloud-media.d.ts +28 -0
  329. package/dist/src/providers/xopc-cloud-media.js +67 -0
  330. package/dist/src/providers/xopc-cloud-model-source.js +4 -0
  331. package/dist/src/runtime-tools/archive.js +1 -1
  332. package/dist/src/runtime-tools/manager.js +1 -1
  333. package/dist/src/runtime-tools/phone-dependencies.js +1 -1
  334. package/dist/src/session/client-history.d.ts +4 -1
  335. package/dist/src/session/client-history.js +18 -0
  336. package/dist/src/session/compact-history.js +30 -1
  337. package/dist/src/session/store.js +2 -1
  338. package/dist/src/session/turn-outcome-projector.js +1 -1
  339. package/dist/src/space/ingest.d.ts +36 -0
  340. package/dist/src/space/ingest.js +149 -0
  341. package/dist/src/space/repository.d.ts +39 -0
  342. package/dist/src/space/repository.js +325 -0
  343. package/dist/src/space/worker.d.ts +14 -0
  344. package/dist/src/space/worker.js +199 -0
  345. package/dist/src/storage/sqlite/clarification-wait-repository.js +7 -4
  346. package/dist/src/storage/sqlite/row-mappers.d.ts +1 -0
  347. package/dist/src/storage/sqlite/row-mappers.js +9 -2
  348. package/dist/src/storage/sqlite/schema.d.ts +2 -2
  349. package/dist/src/storage/sqlite/schema.js +8 -7
  350. package/dist/src/storage/sqlite/schema.sql +104 -0
  351. package/dist/src/storage/sqlite/transcript-repository.js +8 -0
  352. package/dist/src/storage/sqlite/upgrades/278_music_job_error_code.sql +6 -0
  353. package/dist/src/storage/sqlite/upgrades/279_task_model_cutover.sql +288 -0
  354. package/dist/src/storage/sqlite/upgrades/280_space.sql +61 -0
  355. package/dist/src/tasks/capabilities/management.d.ts +15 -2
  356. package/dist/src/tasks/capabilities/management.js +8 -2
  357. package/dist/src/tasks/capabilities/read.js +14 -2
  358. package/dist/src/tasks/capabilities/relations.d.ts +13 -7
  359. package/dist/src/tasks/capabilities/write.d.ts +118 -2
  360. package/dist/src/tasks/capabilities/write.js +2 -0
  361. package/dist/src/tasks/home-query-service.js +7 -9
  362. package/dist/src/tasks/task-allocation-service.js +2 -2
  363. package/dist/src/tasks/task-application-service.d.ts +8 -2
  364. package/dist/src/tasks/task-application-service.js +94 -27
  365. package/dist/src/tasks/task-collaboration-repository.js +12 -1
  366. package/dist/src/tasks/task-context-assembler.js +9 -3
  367. package/dist/src/tasks/task-contract-planner.js +1 -3
  368. package/dist/src/tasks/task-conversation-summary.d.ts +33 -2
  369. package/dist/src/tasks/task-conversation-summary.js +3 -1
  370. package/dist/src/tasks/task-criterion-review-repository.d.ts +31 -2
  371. package/dist/src/tasks/task-criterion-review-repository.js +70 -23
  372. package/dist/src/tasks/task-deliverables.d.ts +7 -0
  373. package/dist/src/tasks/task-deliverables.js +112 -0
  374. package/dist/src/tasks/task-handoff-service.js +1 -1
  375. package/dist/src/tasks/task-instruction-sequence.js +10 -3
  376. package/dist/src/tasks/task-json-acceptance.js +3 -5
  377. package/dist/src/tasks/task-origin-repository.d.ts +99 -1
  378. package/dist/src/tasks/task-origin-repository.js +67 -5
  379. package/dist/src/tasks/task-read-model-projector.d.ts +4 -1
  380. package/dist/src/tasks/task-read-model-projector.js +123 -9
  381. package/dist/src/tasks/task-repository.d.ts +4 -1
  382. package/dist/src/tasks/task-repository.js +34 -11
  383. package/dist/src/tasks/task-research-repair.d.ts +2 -2
  384. package/dist/src/tasks/task-research-result.d.ts +1 -0
  385. package/dist/src/tasks/task-research-result.js +13 -3
  386. package/dist/src/tasks/task-result-delivery-repository.d.ts +4 -3
  387. package/dist/src/tasks/task-result-delivery-repository.js +35 -17
  388. package/dist/src/tasks/task-result-delivery-service.js +22 -7
  389. package/dist/src/tasks/task-result-versions.d.ts +11 -0
  390. package/dist/src/tasks/task-result-versions.js +34 -0
  391. package/dist/src/tasks/task-run-coordinator.js +28 -15
  392. package/dist/src/tasks/task-run-dispatcher.js +29 -4
  393. package/dist/src/tasks/task-run-repository.d.ts +2 -0
  394. package/dist/src/tasks/task-run-repository.js +62 -19
  395. package/dist/src/tasks/task-workspace-verification.d.ts +16 -0
  396. package/dist/src/tasks/task-workspace-verification.js +95 -0
  397. package/dist/src/tui/backends/embedded-backend.js +2 -2
  398. package/dist/src/user-model/action-rule-suggestions.js +4 -3
  399. package/dist/src/user-model/capture/evidence-policy.d.ts +7 -1
  400. package/dist/src/user-model/capture/evidence-policy.js +68 -2
  401. package/dist/src/user-model/capture/executor.js +62 -14
  402. package/dist/src/video-generation/artifact.js +3 -1
  403. package/dist/src/video-generation/drafts.d.ts +1 -0
  404. package/dist/src/video-generation/drafts.js +6 -0
  405. package/dist/src/video-generation/providers.d.ts +1 -0
  406. package/dist/src/video-generation/providers.js +37 -5
  407. package/dist/src/video-generation/repository.d.ts +5 -3
  408. package/dist/src/video-generation/repository.js +30 -8
  409. package/dist/src/video-generation/settings.d.ts +1 -0
  410. package/dist/src/video-generation/settings.js +10 -4
  411. package/dist/src/voice/realtime/runtime.js +1 -1
  412. package/package.json +1 -1
  413. package/dist/gateway/static/root/assets/attachment-preview-renderer-DdOEgexg.js +0 -12
  414. package/dist/gateway/static/root/assets/attachment-utils-core-BIOUBrpT.js +0 -1
  415. package/dist/gateway/static/root/assets/automations-workspace-CH9gYqIK.js +0 -9
  416. package/dist/gateway/static/root/assets/binary-plugins-MFVtTdvy.js +0 -2
  417. package/dist/gateway/static/root/assets/capabilities-CFWTer_v.js +0 -1
  418. package/dist/gateway/static/root/assets/capabilities-page-C2RB9fzC.js +0 -2
  419. package/dist/gateway/static/root/assets/capabilities-settings-panel-BjaLTd6i.js +0 -8
  420. package/dist/gateway/static/root/assets/channels-DiDfjON8.js +0 -1
  421. package/dist/gateway/static/root/assets/chat-page-BtMkdtxJ.js +0 -71
  422. package/dist/gateway/static/root/assets/constants-Bg1wM2nv.js +0 -1
  423. package/dist/gateway/static/root/assets/extension-authoritative-grants-DIeg1mg8.js +0 -1
  424. package/dist/gateway/static/root/assets/file-tree-CFlZnV3Y.js +0 -1
  425. package/dist/gateway/static/root/assets/gateway-realtime-store-CJf-qaHZ.js +0 -1
  426. package/dist/gateway/static/root/assets/index-BJj-uZNl.js +0 -11
  427. package/dist/gateway/static/root/assets/index-DiWUK4sJ.css +0 -1
  428. package/dist/gateway/static/root/assets/local-app-workbench-page-wekatwet.js +0 -1
  429. package/dist/gateway/static/root/assets/local-apps-DeqzkJiF.js +0 -1
  430. package/dist/gateway/static/root/assets/logs-page-CukseY3k.js +0 -2
  431. package/dist/gateway/static/root/assets/messages-BDBGlBKh.js +0 -3
  432. package/dist/gateway/static/root/assets/models-hub-cache-aRYHi2dh.js +0 -1
  433. package/dist/gateway/static/root/assets/note-detail-panel-D5BtgBxy.js +0 -7
  434. package/dist/gateway/static/root/assets/note-image-lightbox-CxXu_Tkh.js +0 -1
  435. package/dist/gateway/static/root/assets/notes-api-BXevQivV.js +0 -1
  436. package/dist/gateway/static/root/assets/notes-page-DyM-3O_9.js +0 -8
  437. package/dist/gateway/static/root/assets/page-header-store-C2ydtnXa.js +0 -1
  438. package/dist/gateway/static/root/assets/personal-avatar-BPQpvC34.js +0 -1
  439. package/dist/gateway/static/root/assets/personal-avatar-BUCb7OiW.css +0 -1
  440. package/dist/gateway/static/root/assets/personal-page-BB4Sv68K.js +0 -1
  441. package/dist/gateway/static/root/assets/phone-DdhTnt6X.js +0 -1
  442. package/dist/gateway/static/root/assets/product-automation-feedback-BlwtlUY7.js +0 -7
  443. package/dist/gateway/static/root/assets/product-delivery-CnvCn9L-.js +0 -1
  444. package/dist/gateway/static/root/assets/project-detail-page-BG2nDt98.js +0 -7
  445. package/dist/gateway/static/root/assets/recording-upload-BJkXktA-.js +0 -1
  446. package/dist/gateway/static/root/assets/right-workspace-store-DHHyicqQ.js +0 -1
  447. package/dist/gateway/static/root/assets/route-preload-BYqg1BYz.js +0 -2
  448. package/dist/gateway/static/root/assets/routine-panel-Coh2B0j7.js +0 -2
  449. package/dist/gateway/static/root/assets/session-manager-D5g6LOU-.js +0 -25
  450. package/dist/gateway/static/root/assets/settings-advanced-gate-DjyibJZ1.js +0 -1
  451. package/dist/gateway/static/root/assets/share-preview-page-CyCv69rh.js +0 -2
  452. package/dist/gateway/static/root/assets/shares-settings-B85XIDFv.js +0 -1
  453. package/dist/gateway/static/root/assets/star-CnYNmpLd.js +0 -1
  454. package/dist/gateway/static/root/assets/task-detail-page-DgsLOz6h.js +0 -3
  455. package/dist/gateway/static/root/assets/tasks-BTLabOMp.js +0 -1
  456. package/dist/gateway/static/root/assets/use-composer-attachments-C9GpCJQR.js +0 -2
  457. package/dist/gateway/static/root/assets/use-file-preview-expanded-Daf-LmiF.js +0 -15
  458. package/dist/gateway/static/root/assets/use-personal-profile-BJgaheR4.js +0 -1
  459. package/dist/gateway/static/root/assets/video-generation-D08uZbsu.js +0 -1
  460. package/dist/gateway/static/root/assets/voice-settings-BUrk4mwV.js +0 -1
  461. package/dist/gateway/static/root/assets/with-selector-xonYxPoM.js +0 -1
  462. package/dist/gateway/static/root/assets/workspace-api-CscTRODe.js +0 -2
  463. package/dist/gateway/static/root/assets/workspace-editor-agent-store-CyPjTDSx.js +0 -1
  464. package/dist/gateway/static/root/assets/workspace-file-preview-dialog-JSGIA79T.js +0 -1
  465. package/dist/gateway/static/root/assets/workspace-preview-store-DNLnuHlf.js +0 -1
@@ -1,4 +1,4 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i,u as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a as o,i as s,l as c,n as l,o as u}from"./locale-store-DIBIYLnI.js";import{t as d}from"./messages-BDBGlBKh.js";import{t as f}from"./chevron-down-ccbiQQz_.js";import{t as p}from"./popover-select-CLsphyzA.js";import{t as m}from"./circle-check-C23XjkUj.js";import{t as h}from"./cpu-B247669f.js";import{t as g}from"./download-Dk-ZjtO6.js";import{t as _}from"./external-link-DjqjBmc3.js";import{t as v}from"./eye-CABVeTq0.js";import{t as y}from"./folder-open-CyzJ19I9.js";import{t as b}from"./gauge-C78eD2BA.js";import{t as x}from"./globe-DSSGFWFn.js";import{t as S}from"./info-CDrmIZhb.js";import{t as C}from"./loader-circle-CifKLtgG.js";import{t as w}from"./lock-keyhole-DEK5kH0u.js";import{t as T}from"./plug-zap-L8NMe3Sv.js";import{t as E}from"./refresh-cw-BRlGaq2w.js";import{t as D}from"./settings-2-D-csvaET.js";import{t as O}from"./triangle-alert-2JXFNNKU.js";import{t as k}from"./skeleton-DzdOeGYz.js";import{i as A}from"./vendor-swr-CdRzEUwF.js";import{n as j,r as ee}from"./gateway-config-swr-Dk3FtNv1.js";import{t as M}from"./button-Cc4hUNTt.js";import{n as te,t as N}from"./settings-form-draft-Dy10ldo8.js";import{n as P}from"./settings-loading-skeleton-CAoOV17i.js";import{t as ne}from"./number-input-El7Szeln.js";import{n as F,t as re}from"./settings-page-header-wL2jvs-y.js";import"./settings-page-layout-BkUQVmyY.js";import{n as I,t as L}from"./use-autosave-xX2KrbXw.js";var R=n(),z=e(t(),1),B=r();function V(e){let t=(0,R.c)(31),{name:n,title:r,summary:a,icon:o,inset:s,children:c}=e,l=s!==void 0&&s,[u,d]=i(),p=(0,z.useId)(),m=`browser-${n}`,h;t[0]!==m||t[1]!==u?(h=u.get(m),t[0]=m,t[1]=u,t[2]=h):h=t[2];let g=h===`1`,_=l?`border-t border-edge-subtle`:`rounded-2xl border border-edge bg-surface-panel`,v;t[3]!==m||t[4]!==g||t[5]!==d?(v=()=>d(e=>{let t=new URLSearchParams(e);return t.set(m,g?`0`:`1`),t}),t[3]=m,t[4]=g,t[5]=d,t[6]=v):v=t[6];let y;t[7]===o?y=t[8]:(y=o&&(0,B.jsx)(`span`,{className:`shrink-0 text-fg-muted`,"aria-hidden":!0,children:o}),t[7]=o,t[8]=y);let b;t[9]===r?b=t[10]:(b=(0,B.jsx)(`span`,{className:`min-w-0 flex-1 text-sm font-semibold text-fg`,children:r}),t[9]=r,t[10]=b);let x;t[11]===a?x=t[12]:(x=a&&(0,B.jsx)(`span`,{className:`max-w-[40%] truncate text-xs font-normal text-fg-muted`,title:a,children:a}),t[11]=a,t[12]=x);let S=`size-4 shrink-0 text-fg-muted ${g?`rotate-180`:``}`,C;t[13]===S?C=t[14]:(C=(0,B.jsx)(f,{className:S,"aria-hidden":!0}),t[13]=S,t[14]=C);let w;t[15]!==p||t[16]!==g||t[17]!==v||t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==C?(w=(0,B.jsx)(`h2`,{children:(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":g,"aria-controls":p,className:`flex min-h-16 w-full items-center gap-3 rounded-2xl p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:p-5`,onClick:v,children:[y,b,x,C]})}),t[15]=p,t[16]=g,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=C,t[22]=w):w=t[22];let T=!g,E=g&&c,D;t[23]!==p||t[24]!==T||t[25]!==E?(D=(0,B.jsx)(`div`,{id:p,hidden:T,className:`space-y-4 border-t border-edge-subtle p-4 sm:p-5`,children:E}),t[23]=p,t[24]=T,t[25]=E,t[26]=D):D=t[26];let O;return t[27]!==w||t[28]!==D||t[29]!==_?(O=(0,B.jsxs)(`section`,{className:_,children:[w,D]}),t[27]=w,t[28]=D,t[29]=_,t[30]=O):O=t[30],O}function ie(){return u(s(`/api/browser/status`))}function H(){return u(s(`/api/browser/test`),{method:`POST`})}function ae(e=!1){return u(s(`/api/browser/extension/install`),{method:`POST`,body:JSON.stringify({force:e})})}function U(e){return u(s(`/api/browser/extension/open`),{method:`POST`,body:JSON.stringify({action:e})})}async function oe(e,t){let n=await o(s(`/api/browser/playwright/install/stream`),{method:`POST`,headers:{Accept:`text/event-stream`},signal:t});if(!n.ok||!n.body)throw Error(`Chromium install request failed (HTTP ${n.status}).`);let r=n.body.getReader(),i=new TextDecoder,a=``,c;try{for(;!c;){let t=await r.read();if(t.done)break;a+=i.decode(t.value,{stream:!0}),a=a.replace(/\r\n/g,`
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i,u as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a as o,i as s,l as c,n as l,o as u}from"./locale-store-Cit_aHqC.js";import{t as d}from"./messages-DQveK9sk.js";import{t as f}from"./chevron-down-ccbiQQz_.js";import{t as p}from"./popover-select-CLsphyzA.js";import{t as m}from"./circle-check-C23XjkUj.js";import{t as h}from"./cpu-B247669f.js";import{t as g}from"./download-Dk-ZjtO6.js";import{t as _}from"./external-link-DjqjBmc3.js";import{t as v}from"./eye-CABVeTq0.js";import{t as y}from"./folder-open-CyzJ19I9.js";import{t as b}from"./gauge-C78eD2BA.js";import{t as x}from"./globe-DSSGFWFn.js";import{t as S}from"./info-CDrmIZhb.js";import{t as C}from"./loader-circle-CifKLtgG.js";import{t as w}from"./lock-keyhole-DEK5kH0u.js";import{t as T}from"./plug-zap-L8NMe3Sv.js";import{t as E}from"./refresh-cw-BRlGaq2w.js";import{t as D}from"./settings-2-D-csvaET.js";import{t as O}from"./triangle-alert-2JXFNNKU.js";import{t as k}from"./skeleton-DzdOeGYz.js";import{i as A}from"./vendor-swr-CdRzEUwF.js";import{n as j,r as ee}from"./gateway-config-swr-DVXDJNCI.js";import{t as M}from"./button-Cc4hUNTt.js";import{n as te,t as N}from"./settings-form-draft-Dy10ldo8.js";import{n as P}from"./settings-loading-skeleton-CAoOV17i.js";import{t as ne}from"./number-input-El7Szeln.js";import{n as F,t as re}from"./settings-page-header-B9Y_eGcH.js";import"./settings-page-layout-D1MgJ5zP.js";import{n as I,t as L}from"./use-autosave-CvjQMyY8.js";var R=n(),z=e(t(),1),B=r();function V(e){let t=(0,R.c)(31),{name:n,title:r,summary:a,icon:o,inset:s,children:c}=e,l=s!==void 0&&s,[u,d]=i(),p=(0,z.useId)(),m=`browser-${n}`,h;t[0]!==m||t[1]!==u?(h=u.get(m),t[0]=m,t[1]=u,t[2]=h):h=t[2];let g=h===`1`,_=l?`border-t border-edge-subtle`:`rounded-2xl border border-edge bg-surface-panel`,v;t[3]!==m||t[4]!==g||t[5]!==d?(v=()=>d(e=>{let t=new URLSearchParams(e);return t.set(m,g?`0`:`1`),t}),t[3]=m,t[4]=g,t[5]=d,t[6]=v):v=t[6];let y;t[7]===o?y=t[8]:(y=o&&(0,B.jsx)(`span`,{className:`shrink-0 text-fg-muted`,"aria-hidden":!0,children:o}),t[7]=o,t[8]=y);let b;t[9]===r?b=t[10]:(b=(0,B.jsx)(`span`,{className:`min-w-0 flex-1 text-sm font-semibold text-fg`,children:r}),t[9]=r,t[10]=b);let x;t[11]===a?x=t[12]:(x=a&&(0,B.jsx)(`span`,{className:`max-w-[40%] truncate text-xs font-normal text-fg-muted`,title:a,children:a}),t[11]=a,t[12]=x);let S=`size-4 shrink-0 text-fg-muted ${g?`rotate-180`:``}`,C;t[13]===S?C=t[14]:(C=(0,B.jsx)(f,{className:S,"aria-hidden":!0}),t[13]=S,t[14]=C);let w;t[15]!==p||t[16]!==g||t[17]!==v||t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==C?(w=(0,B.jsx)(`h2`,{children:(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":g,"aria-controls":p,className:`flex min-h-16 w-full items-center gap-3 rounded-2xl p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:p-5`,onClick:v,children:[y,b,x,C]})}),t[15]=p,t[16]=g,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=C,t[22]=w):w=t[22];let T=!g,E=g&&c,D;t[23]!==p||t[24]!==T||t[25]!==E?(D=(0,B.jsx)(`div`,{id:p,hidden:T,className:`space-y-4 border-t border-edge-subtle p-4 sm:p-5`,children:E}),t[23]=p,t[24]=T,t[25]=E,t[26]=D):D=t[26];let O;return t[27]!==w||t[28]!==D||t[29]!==_?(O=(0,B.jsxs)(`section`,{className:_,children:[w,D]}),t[27]=w,t[28]=D,t[29]=_,t[30]=O):O=t[30],O}function ie(){return u(s(`/api/browser/status`))}function H(){return u(s(`/api/browser/test`),{method:`POST`})}function ae(e=!1){return u(s(`/api/browser/extension/install`),{method:`POST`,body:JSON.stringify({force:e})})}function U(e){return u(s(`/api/browser/extension/open`),{method:`POST`,body:JSON.stringify({action:e})})}async function oe(e,t){let n=await o(s(`/api/browser/playwright/install/stream`),{method:`POST`,headers:{Accept:`text/event-stream`},signal:t});if(!n.ok||!n.body)throw Error(`Chromium install request failed (HTTP ${n.status}).`);let r=n.body.getReader(),i=new TextDecoder,a=``,c;try{for(;!c;){let t=await r.read();if(t.done)break;a+=i.decode(t.value,{stream:!0}),a=a.replace(/\r\n/g,`
2
2
  `);let n=a.split(`
3
3
 
4
4
  `);a=n.pop()??``;for(let t of n){let n=t.split(`
@@ -1 +1 @@
1
- import{i as e,o as t}from"./locale-store-DIBIYLnI.js";import{n}from"./capabilities-CFWTer_v.js";async function r(r,i){let a=n[r],o=a.input.parse(i),s=`/api/capabilities/operations/${encodeURIComponent(r)}`,c=await t(e(s)),l=await t(e(`${s}/invocations`),{method:`POST`,body:JSON.stringify({majorVersion:c.majorVersion,descriptorDigest:c.descriptorDigest,input:o})});return a.output.parse(l.data)}export{r as t};
1
+ import{i as e,o as t}from"./locale-store-Cit_aHqC.js";import{n}from"./capabilities-YmBD7oK8.js";async function r(r,i){let a=n[r],o=a.input.parse(i),s=`/api/capabilities/operations/${encodeURIComponent(r)}`,c=await t(e(s)),l=await t(e(`${s}/invocations`),{method:`POST`,body:JSON.stringify({majorVersion:c.majorVersion,descriptorDigest:c.descriptorDigest,input:o})});return a.output.parse(l.data)}export{r as t};
@@ -0,0 +1 @@
1
+ import{_ as e,a as t,c as n,d as r,f as i,g as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,u as m,y as h}from"./schemas-CCWMleym.js";import{a as g,o as _}from"./turn-outcome-BSbEJx8h.js";import{l as ee,s as te,u as ne}from"./product-delivery-4gEqUIsK.js";import{_ as re,c as ie,l as v,m as y,n as b,o as x,p as S,u as C,y as w}from"./tasks-BIehlq7k.js";import{_ as ae,g as oe}from"./local-session-drafts-CgAuYyKi.js";var T=l([`pr_review`,`issue_digest`,`work_summary`]),se=r({kind:T,topicIds:o(c()).min(1).max(8),requestCount:m().int().min(2),previews:o(c()).max(2)});d({kind:T,topicIds:o(c().min(1)).min(1).max(8),expectedRevision:m().int().positive(),idempotencyKey:c().min(1).max(120),locale:l([`zh`,`en`])});var ce={pr_review:{zh:{deliverables:[`相关 PR 和原始链接`,`每个 PR 建议核查的内容`,`还缺哪些代码或资料`],title:`PR 审查准备清单`,output:`把近期要审的 PR、需要核查的点和缺少的资料整理成一份清单。`,criteria:[`每个 PR 附上原始请求或链接`,`区分待核查项与已验证结论,未读取代码时不得给出审查通过结论`]},en:{deliverables:[`Related PRs and original links`,`Suggested checks for each PR`,`Code or source material still needed`],title:`PR review preparation`,output:`A checklist of requested PR reviews, points to inspect and missing source material.`,criteria:[`Link each PR to its original request or URL`,`Distinguish suggested checks from verified findings; never approve code that has not been read`]}},issue_digest:{zh:{deliverables:[`相关问题和原始线索`,`已知信息与待确认的判断`,`下一步排查需要的日志或资料`],title:`问题排查摘要`,output:`把近期的问题线索、已知事实和待补充的信息整理好,方便继续排查。`,criteria:[`每条问题线索标明来源`,`区分用户描述、已证实事实和假设,不把缺少日志的问题说成已经解决`]},en:{deliverables:[`Issues and their original reports`,`Known information and open questions`,`Logs or material needed for the next step`],title:`Issue investigation brief`,output:`A brief of recent issue reports, known facts and information needed for investigation.`,criteria:[`Cite the source of every issue report`,`Separate user reports, verified facts and hypotheses; do not claim a fix without evidence`]}},work_summary:{zh:{deliverables:[`按项目归类的工作条目`,`已确认进展和仍待确认的事项`,`待办与阻塞`],title:`工作进展草稿`,output:`按项目归纳近期工作、待办和阻塞,生成一份可修改的进展草稿。`,criteria:[`工作条目附来源,缺少项目归属时明确标注`,`区分工作请求与完成结果,不把用户提出的任务当作已经完成`]},en:{deliverables:[`Work items grouped by project`,`Confirmed progress and items needing confirmation`,`Pending work and blockers`],title:`Work progress draft`,output:`An editable draft grouping recent work, pending items and blockers by project.`,criteria:[`Cite work items and flag unknown project ownership`,`Distinguish requested tasks from completed outcomes; requests alone do not prove completion`]}}},E=u(`kind`,[r({kind:n(`once`),at:c()}),r({kind:n(`interval`),everyMs:m().positive(),anchorMs:m().optional()}),r({kind:n(`cron`),expr:c(),tz:c().optional()})]),D=u(`kind`,[r({kind:n(`manual`)}),r({kind:n(`schedule`),schedule:E}),r({kind:n(`webhook`),secretId:c().optional()}),r({kind:n(`event`),eventType:c(),source:c().optional(),payloadMatch:i(c(),a([c(),m(),t(),f()])).optional()})]),O=u(`kind`,[r({kind:n(`routine`),routineId:c(),version:m().int().positive(),hash:c()}),r({kind:n(`agent`),agentId:c().optional(),instruction:c(),mcpSourceId:c().max(200).optional(),workingDirectory:c().optional(),model:c().optional(),timeoutSeconds:m().positive().optional()}),r({kind:n(`task_command`),taskId:c(),command:b}),r({kind:n(`personal_task`),conversationId:c(),agentId:c(),instruction:c(),locale:l([`zh`,`en`])}),r({kind:n(`system`),capability:l([`home.advisor.refresh`,`personal.proactivity.tick`,`memory.temporal_sweep`,`memory.daily_reconciliation`,`memory.weekly_knowledge`])})]),k=l([`queued`,`running`,`cancelling`,`succeeded`,`failed`,`cancelled`,`timeout`]),le=u(`kind`,[r({key:c(),kind:n(`gateway_event`)}),r({key:c(),kind:n(`weixin`),conversationId:c().uuid(),principalId:c().min(1)}),r({key:c(),kind:n(`webhook`),endpoint:c().url().startsWith(`https://`),secretId:c()}),r({key:c(),kind:n(`file`),targetId:c(),pathTemplate:c()}),r({key:c(),kind:n(`card`),channelId:c(),templateId:c()})]),A=r({id:c(),name:c(),description:c().optional(),projectId:c().optional(),enabled:t(),trigger:D,action:O,safety:r({mode:l([`suggest_only`,`ask_before_apply`,`auto_apply`])}).optional(),conversationMode:l([`new_session`,`continuous`]).optional(),delivery:r({notificationPolicy:l([`attention`,`all`,`none`]),destinations:o(le)}),reliability:r({executionTimeoutSeconds:m().positive().optional(),retryCount:m().int().nonnegative().optional(),maxConcurrentRuns:m().int().positive().optional(),disableAfterConsecutiveFailures:m().int().positive().optional()}).optional(),management:r({owner:c(),editable:o(l([`enabled`,`trigger`])),runnable:t(),deletable:t()}).optional(),state:r({nextRunAtMs:m().optional(),runningRunId:c().optional(),lastRunAtMs:m().optional(),lastRunStatus:k.optional(),lastError:c().optional(),consecutiveFailures:m().int().nonnegative().optional()}),createdAtMs:m(),updatedAtMs:m()}),j=r({id:c(),automationId:c(),automationName:c(),status:k,triggerSnapshot:D,actionSnapshot:O,manual:t(),createdAtMs:m(),startedAtMs:m().optional(),endedAtMs:m().optional(),durationMs:m().optional(),summary:c().optional(),error:c().optional(),conversationId:c().optional(),conversationShared:t().optional(),model:c().optional(),deadlineAtMs:m().optional(),currentPhase:l([`queued`,`action`,`cancelling`,`completed`]).optional(),cancelRequestedAtMs:m().optional(),cancelConfirmedAtMs:m().optional(),termination:r({reason:l([`completed`,`failed`,`user_cancelled`,`deadline_exceeded`]),component:l([`automation`,`agent_turn`,`tool`,`mcp`,`process`]).optional(),componentName:c().optional(),cancellationConfirmed:t()}).optional(),heartbeatAtMs:m().optional(),leaseOwner:c().optional(),leaseExpiresAtMs:m().optional(),attemptNumber:m().int().positive().optional(),rootRunId:c().optional()}),M=r({id:c(),runId:c(),automationId:c(),type:l([`run.queued`,`run.started`,`run.deadline_resolved`,`run.cancel_requested`,`run.cancel_confirmed`,`run.cancellation_unconfirmed`,`run.recovered`,`action.started`,`action.retry_scheduled`,`action.completed`,`action.failed`,`run.completed`]),message:c(),data:e().optional(),createdAtMs:m()}),N=r({totalAutomations:m().int().nonnegative(),enabledAutomations:m().int().nonnegative(),runningRuns:m().int().nonnegative(),failedLastHour:m().int().nonnegative(),nextRun:r({automationId:c(),name:c(),runAtMs:m()}).optional(),pendingEvents:m().int().nonnegative(),oldestPendingEventAgeMs:m().int().nonnegative(),projectionDeadLetters:m().int().nonnegative(),pendingRunDeliveries:m().int().nonnegative(),runDeliveryDeadLetters:m().int().nonnegative(),pendingResultDeliveries:m().int().nonnegative(),resultDeliveryDeadLetters:m().int().nonnegative(),activeExecutions:m().int().nonnegative(),activeDeliveryLeases:m().int().nonnegative()}),P=r({version:m(),baseVersion:m().nullable(),additions:o(c()),status:l([`candidate`,`validating`,`validated`,`approved`,`rejected`]),validationTaskId:c().nullable(),validation:l([`unverified`,`passed`,`failed`])}),F=r({id:c(),topicId:c(),title:c(),status:l([`active`,`paused`,`ended`]),revision:m(),adoptedVersion:m(),automationId:c(),validUntil:m(),schedule:E.nullable(),methods:o(P),executions:o(r({taskId:c(),runId:c(),version:m(),status:c(),verdict:c().nullable()}))});d({topicId:c().min(1),trialTaskId:c().min(1),expectedTaskVersion:m().int().positive(),idempotencyKey:c().min(1).max(200),schedule:E,validUntil:m().int().positive()}),d({expectedRevision:m().int().positive(),idempotencyKey:c().min(1).max(200),command:u(`kind`,[d({kind:n(`pause`)}),d({kind:n(`resume`)}),d({kind:n(`end`)}),d({kind:n(`configure`),schedule:E,validUntil:m().int().positive()}),d({kind:n(`validate`),version:m().int().positive()}),d({kind:n(`adopt_method`),version:m().int().positive()}),d({kind:n(`rollback`),version:m().int().positive()}),d({kind:n(`reject_method`),version:m().int().positive()})])});var I=r({id:c(),text:c(),scope:l([`once`,`project`,`similar`]),status:l([`active`,`retracted`]),createdAt:m()}),L=r({id:c(),title:c(),projectId:c().optional(),revision:m(),entries:o(r({id:c(),kind:c(),text:c(),sourceRef:c().nullish(),createdAt:m()})),feedback:o(I),trials:o(r({taskId:c(),title:c(),phase:c(),resolution:c().nullable(),taskVersion:m().optional()})),routine:F.optional()}),R=r({id:c().optional(),status:l([`disabled`,`active`,`paused`]),revision:m(),analyzedRevision:m(),lastProcessedAt:m().nullable(),starters:o(se).optional(),followUps:o(_).optional(),followUpCandidates:o(g).optional(),topics:o(L)}),z=u(`kind`,[d({kind:n(`start`),backfillDays:m().int().min(0).max(30).default(30)}),d({kind:n(`pause`)}),d({kind:n(`resume`),mode:l([`catch_up`,`new_only`])}),d({kind:n(`feedback`),topicId:c().min(1),text:c().trim().min(1).max(1e3),scope:l([`once`,`project`,`similar`])}),d({kind:n(`retract`),topicId:c().min(1),feedbackId:c().min(1)}),d({kind:n(`forget`),topicId:c().min(1)})]);d({idempotencyKey:c().min(1).max(200),expectedRevision:m().int().nonnegative(),command:z}),d({topicId:c().min(1),opportunityId:c().min(1),expectedRevision:m().int().positive(),expectedOpportunityRevision:m().int().positive(),idempotencyKey:c().min(1).max(200)});var B=r({id:c(),kind:l([`task`,`connector_approval`]),title:c(),detail:c().optional(),reason:l([`needs_input`,`blocked`,`user_input`,`user_approval`,`dependency`,`external`,`scheduled`,`retry`,`paused`,`overdue`,`due_soon`,`decision_needed`,`approval_required`]),urgency:l([`now`,`soon`]),href:c(),projectId:c().optional(),projectName:c().optional(),dueAt:m().int().nonnegative().optional(),updatedAt:m(),response:u(`kind`,[r({kind:n(`connector_approval`),approvalId:c()}),r({kind:n(`task`),taskId:c(),canRetry:t()})]).optional()});r({id:c(),kind:l([`automation_run`]),runId:c(),title:c(),detail:c(),reason:l([`run_failed`,`run_timeout`]),href:c(),updatedAt:m(),conversationId:c().optional()});var V=u(`type`,[r({type:n(`task_review`),label:c(),taskId:c()}),r({type:n(`retry_task`),label:c(),taskId:c()}),r({type:n(`open`),label:c(),href:c()}),r({type:n(`connector_decision`),label:c(),approvalId:c(),decision:l([`approve`,`deny`])}),r({type:n(`retry_run`),label:c(),subjectKind:l([`automation_run`]),runId:c()}),r({type:n(`acknowledge_run`),label:c(),subjectKind:l([`automation_run`]),runId:c()})]),H=r({id:c(),kind:l([`decision`,`failure`,`running`,`scheduled`]),title:c(),summary:c(),projectName:c().optional(),recommendation:c().optional(),dueAt:m().int().nonnegative().optional(),statusLabel:c().optional(),backgroundState:l([`waiting`,`paused`]).optional(),updatedAt:m(),openAction:V.optional(),primaryAction:V.optional(),secondaryActions:o(V).max(2).default([])}),U=r({conversationId:c(),runId:c(),title:c().optional(),agentId:c().optional(),updatedAt:m()}),W=d({id:c().trim().min(1).max(300),sourceType:l([`project`,`task`,`conversation`,`calendar`,`mail`,`communication`,`file`,`user_model`]),sourceRef:c().trim().min(1).max(1e3),revision:c().trim().min(1).max(300),observation:c().trim().min(1).max(1e3),observedAt:m().int().nonnegative(),freshUntil:m().int().nonnegative(),href:c().trim().min(1).max(2e3).optional()}),ue=d({kind:l([`connector`,`skill`,`agent`]),capability:c().trim().min(1).max(200),resolvedId:c().trim().min(1).max(300).optional(),readiness:l([`ready`,`needs_setup`,`unavailable`]),required:t(),recoveryPath:c().trim().min(1).max(2e3).optional(),reason:c().trim().min(1).max(500).optional()}),de=d({kind:l([`connector`,`skill`,`agent`]),capability:c().trim().min(1).max(200),code:l([`not_installed`,`disabled`,`agent_not_allowed`,`scope_too_narrow`,`connection_missing`,`account_selection_required`,`reauthorization_required`,`requirements_unmet`,`model_invocation_disabled`,`tool_gated`,`agent_unavailable`]),message:c().trim().min(1).max(500),recoveryPath:c().trim().min(1).max(2e3)}),fe=u(`state`,[d({state:n(`ready`)}),d({state:n(`needs_setup`),blockers:o(de).min(1).max(12),recoveryActions:o(d({capability:c().trim().min(1).max(200),href:c().trim().min(1).max(2e3)})).min(1).max(12),degradedAction:d({mode:n(`degraded_start`)}).optional()})]),pe=d({summary:c().trim().min(1).max(300),evidenceIds:o(c().trim().min(1).max(300)).min(1).max(8)}),me=d({version:n(1),locale:l([`zh`,`en`]),groups:o(pe).min(1).max(8)}),G=d({id:c().trim().min(1).max(200),revision:m().int().positive(),kind:l([`project_next_step`,`delivery_risk`,`meeting_prep`,`commitment_follow_up`,`automation_candidate`]),projectId:c().trim().min(1).max(200).optional(),title:c().trim().min(1).max(160),outcome:c().trim().min(1).max(1e3),rationale:c().trim().min(1).max(1500),evidence:o(W).min(1).max(8),evidencePresentation:me.optional(),confidence:l([`high`,`medium`,`low`]),urgency:l([`now`,`today`,`this_week`]),estimatedMinutes:m().int().min(1).max(480).optional(),risk:l([`analysis`,`external_read`,`file_write`,`external_write`]),proposedSteps:o(c().trim().min(1).max(500)).min(1).max(6),capabilities:o(ue).max(12),verification:o(c().trim().min(1).max(500)).max(8),actionPrompt:c().trim().min(1).max(4e3),degradedActionPrompt:c().trim().min(1).max(4e3).optional(),continuation:u(`kind`,[d({kind:n(`automation`),reason:n(`repeated_success`),href:c().trim().min(1).max(4e3),successCount:m().int().min(2)})]).optional(),actions:d({canStart:t(),canDiscuss:t(),degradedStartAvailable:t()}),generatedAt:m().int().nonnegative(),expiresAt:m().int().nonnegative()}),he=d({id:c().trim().min(1).max(200),revision:m().int().positive(),question:c().trim().min(1).max(500),options:o(d({id:c().trim().min(1).max(100),label:c().trim().min(1).max(200)})).min(2).max(3),evidenceIds:o(c().trim().min(1).max(300)).min(1).max(8)}),ge=u(`state`,[d({state:n(`disabled`)}),d({state:n(`quiet`),reason:l([`no_change`,`insufficient_value`,`model_unavailable`,`generation_failed`,`budget_exhausted`])}),d({state:n(`refreshing`),previous:G.optional(),requestedAt:m().int().nonnegative()}),d({state:n(`clarification`),question:he,generatedAt:m().int().nonnegative(),expiresAt:m().int().nonnegative()}),d({state:n(`ready`),primary:G,alternatives:o(G).max(2),placement:l([`primary`,`compact`]),generatedAt:m().int().nonnegative(),expiresAt:m().int().nonnegative(),stale:t()})]);d({idempotencyKey:c().trim().min(1).max(200),locale:c().trim().max(30).optional()}),d({idempotencyKey:c().trim().min(1).max(200),expectedRevision:m().int().positive(),kind:l([`already_done`,`irrelevant`,`too_early`,`source_incorrect`,`less_like_this`,`snoozed`]),reasonCode:c().trim().min(1).max(100).optional(),note:c().trim().min(1).max(1e3).optional(),snoozedUntil:m().int().nonnegative().optional()}),d({idempotencyKey:c().trim().min(1).max(200)});var _e=d({items:o(d({opportunity:G,status:l([`available`,`started`,`discussing`,`completed`,`snoozed`,`dismissed`,`expired`,`superseded`]),feedbackKind:l([`started`,`discussed`,`already_done`,`irrelevant`,`too_early`,`source_incorrect`,`less_like_this`,`snoozed`]).optional(),updatedAt:m().int().nonnegative(),snoozedUntil:m().int().nonnegative().optional(),href:c().trim().min(1).max(2e3).optional()})).max(100)});d({idempotencyKey:c().trim().min(1).max(200),expectedRevision:m().int().positive(),mode:l([`start`,`degraded_start`,`discuss`])});var ve=u(`outcome`,[d({outcome:n(`task`),taskId:c(),href:c()}),d({outcome:n(`chat_draft`),href:c()}),d({outcome:n(`needs_setup`),preflight:fe})]),ye=r({observation:R.optional(),runningConversations:o(U).default([]),recentDeliveries:o(r({id:c(),kind:l([`task`,`automation`]),subjectId:c(),projectId:c().optional(),title:c(),summary:c(),completedAt:m(),read:t(),href:c()})).default([]),resumable:o(r({id:c(),kind:l([`task`,`conversation`]),title:c(),summary:c().optional(),projectName:c().optional(),updatedAt:m(),href:c()})).default([]),needsUser:o(H),background:o(H),backgroundCount:m().int().nonnegative(),decisions:o(B),advisor:ge,attentionPolicy:r({visibleDecisionCount:m().int().nonnegative(),suppressedDecisionCount:m().int().nonnegative(),visibleAttentionCount:m().int().nonnegative(),suppressedAttentionCount:m().int().nonnegative()}).default({visibleDecisionCount:0,suppressedDecisionCount:0,visibleAttentionCount:0,suppressedAttentionCount:0})});d({window:d({since:m().int().nonnegative(),until:m().int().nonnegative()}),currentStrategyVersion:c().trim().min(1).max(100),generations:d({total:m().int().nonnegative(),succeeded:m().int().nonnegative(),quiet:m().int().nonnegative(),failed:m().int().nonnegative(),estimatedCostUsd:m().nonnegative()}),outcomes:d({opportunities:m().int().nonnegative(),started:m().int().nonnegative(),discussed:m().int().nonnegative(),completed:m().int().nonnegative(),corrected:m().int().nonnegative(),expired:m().int().nonnegative()}),rates:d({start:m().min(0).max(1),completionFromStarted:m().min(0).max(1),correction:m().min(0).max(1)}),feedback:d({alreadyDone:m().int().nonnegative(),irrelevant:m().int().nonnegative(),tooEarly:m().int().nonnegative(),sourceIncorrect:m().int().nonnegative(),lessLikeThis:m().int().nonnegative()}),strategies:o(d({version:c().trim().min(1).max(100),generations:m().int().nonnegative(),opportunities:m().int().nonnegative(),started:m().int().nonnegative(),completed:m().int().nonnegative()}))});var be=r({northStar:r({weeklyTrustedProgress:m(),weeklyActiveUsers:m(),trustedProgressPerWeeklyActiveUser:m()}),tasks:r({total:m(),achieved:m(),partial:m(),notAchieved:m(),userCorrected:m(),achievementRate:m(),correctionRate:m(),trusted:m(),trustedRate:m()})});function xe(e){return ye.parse(e)}l([`http`,`agent`,`cli`,`automation`,`mcp`,`extension`]);var Se=a([l(`overview.imports.sessions.tracing.usage.logs.computer-use.phone-use.agent-browser.extensions/debug.connector-service.appearance.keyboard-shortcuts.system.desktop-pet.desktop-app.agent-defaults.gateway.runtimes.devices.remote-access.shares.capabilities/models.capabilities/image.capabilities/voice.capabilities/search`.split(`.`)),c().regex(/^ext\/[a-z0-9_-]+(?:\/[a-z0-9_-]+)?$/i).max(512)]);l([`INVALID_INPUT`,`FORBIDDEN`,`NOT_FOUND`,`REVISION_CONFLICT`,`CONTRACT_CHANGED`,`APPROVAL_REQUIRED`,`IN_PROGRESS`,`UNAVAILABLE`,`OUTCOME_UNKNOWN`,`CANCELLED`,`INTERNAL`]);var Ce=d({majorVersion:m().int().positive(),descriptorDigest:c().regex(/^[a-f0-9]{64}$/),input:p(),idempotencyKey:c().min(1).max(200).optional()}),we=r({triggerSummary:c(),actionSummary:c(),safetyNotes:o(c()),requiredConfirmations:o(c()),canRunNow:t(),runNowBlockedReason:c().optional()});d({agentId:c().trim().min(1).max(64).optional(),language:l([`en`,`zh`]).default(`en`)}),r({draftId:c(),explanation:c(),assumptions:o(c()),risks:o(c()),automation:s({name:c(),trigger:p(),action:p()}),simulation:we,repairAttempts:m().int().nonnegative()}),r({draftId:c(),patch:i(c(),p()),explanation:c(),expectedEffect:c(),risks:o(c()),requiresApproval:t(),repairAttempts:m().int().nonnegative()});var Te=d({eventId:c().min(1),kind:l([`note`,`task`,`project`,`automation`,`local_app`]),id:c().min(1),revision:m().int().nonnegative(),operation:l([`created`,`updated`,`deleted`]),operationId:c().optional()}),K=d({id:c().trim().min(1).max(512)});K.extend({expectedVersion:m().int().positive(),reason:c().trim().min(1).max(4096).default(`TaskRun cancelled`)}),K.extend({rating:l([`helpful`,`not_helpful`]),reason:c().trim().max(4096).optional()}),r({ok:n(!0),feedback:r({id:c(),runId:c(),rating:l([`helpful`,`not_helpful`]),reason:c().optional(),createdAt:m()})}),r({ok:n(!0),run:y,receipt:C,model:x.pick({task:!0,operationalState:!0,attention:!0,allowedCommands:!0}),executionStopConfirmed:n(!1)}),K.extend({enabled:t(),expectedRevision:m().int().nonnegative()}),r({ok:n(!0),automation:A.loose()}).extend({run:j.loose()}),r({ok:n(!0),cancelled:t(),confirmed:t()}),r({ok:n(!0),marked:n(!0)}),d({projectId:c().trim().min(1).max(512).optional()}),r({ok:n(!0),count:m().int().nonnegative()}),K.extend({reason:c().trim().min(1).max(2e3)}),d({runId:c().trim().min(1).max(200),destinationKey:c().trim().min(1).max(100),reason:c().trim().min(1).max(2e3)}),r({ok:n(!0),accepted:n(!0)}),K.extend({expectedRevision:m().int().nonnegative().nullable()}),r({ok:n(!0),removed:t(),automation:A.loose().optional(),cancelRunId:c().optional()});var Ee=d({status:l([`inbox`,`processed`,`archived`,`trashed`]).optional(),kind:l([`thought`,`todo`,`voice`,`media`,`bookmark`,`mixed`,`task`]).optional(),tag:c().max(512).optional(),projectId:c().min(1).max(512).optional(),unassigned:t().optional(),agentEdited:t().optional(),search:c().max(4096).optional(),pinned:t().optional(),limit:m().int().min(1).max(100).default(20),offset:m().int().min(0).default(0),sortBy:l([`createdAt`,`updatedAt`,`lastOpenedAt`]).optional(),sortOrder:l([`asc`,`desc`]).optional()}),q=s({id:c().min(1),markdown:c(),kind:l([`thought`,`todo`,`voice`,`media`,`bookmark`,`mixed`,`task`]),status:l([`inbox`,`processed`,`archived`,`trashed`]),createdAt:m(),updatedAt:m(),title:c().optional(),localVersion:m().optional()}),De=r({note:q});K.extend({expectedRevision:m().int().positive(),revokeShares:t().default(!0)}),r({deleted:n(!0),revokedShares:m().int().nonnegative()});var Oe=d({title:c().max(1e3).optional(),markdown:c().max(2e6).default(``),kind:q.shape.kind.optional(),tags:o(c().max(512)).max(100).optional(),capturedVia:d({channel:l([`app`,`web`,`electron`,`tui`,`telegram`,`wechat`,`feishu`]),platform:l([`ios`,`android`,`harmonyos`]).optional()}).default({channel:`web`}),pinned:t().default(!1),projectId:c().min(1).optional()});d({id:c().min(1),expectedRevision:m().int().positive(),trigger:l([`edit`,`ai_edit`,`sync`,`restore`]).optional(),patch:d({title:c().max(1e3).optional(),markdown:c().max(2e6).optional(),tags:o(c().max(512)).max(100).optional(),pinned:t().optional(),kind:q.shape.kind.optional(),status:q.shape.status.optional(),localVersion:m().int().positive().optional(),ai:i(c(),p()).optional(),aiDeep:s({processedAt:m()}).optional()})}),d({text:c().trim().min(1).max(2e6),capturedVia:Oe.shape.capturedVia}),d({id:c().min(1),expectedRevision:m().int().positive().optional(),content:c().trim().min(1).max(2e6),heading:c().trim().min(1).max(1e3).default(`AI 讨论沉淀`)}),d({id:c().min(1),timestamp:m().int().positive(),expectedRevision:m().int().positive()});var J=s({items:o(s({id:c().min(1)})),total:m().int().nonnegative()}),ke=d({phase:re.optional(),priority:v.optional(),projectId:c().min(1).max(512).optional(),search:c().max(4096).optional(),limit:m().int().min(1).max(200).default(50),offset:m().int().nonnegative().default(0)}),Y=s({id:c().min(1),name:c(),slug:c(),status:l([`planned`,`active`,`paused`,`completed`,`cancelled`,`archived`]),executionMode:l([`local_checkout`,`managed_worktree`]),successCriteria:o(c()),scope:i(c(),e()),nonGoals:o(c()),health:l([`unknown`,`on_track`,`at_risk`,`off_track`]),version:m().int().positive(),createdAt:m(),updatedAt:m(),workspaceRoot:c().optional(),defaultAgentId:c().optional()}),Ae=d({id:c().trim().min(1),expectedVersion:m().int().positive(),pinned:t()});r({ok:n(!0),project:Y}),d({workspacePath:c().trim().min(1).max(4096),agentId:c().trim().min(1).max(512).optional(),defaultAgentId:c().trim().max(512).optional(),projectKind:l([`auto`,`coding`,`general`,`unknown`]).optional(),autoCreate:t().default(!1),conversationId:h().optional()}),r({ok:n(!0),project:Y.nullable(),reason:l([`exact`,`contained`,`auto_created`]).optional(),created:t().optional()}),Ae.omit({pinned:!0}),r({ok:n(!0),deleted:n(!0),executionStopConfirmed:n(!1)});var X={name:c().trim().min(1).max(1e3).optional(),description:c().max(2e4).optional(),defaultAgentId:c().trim().max(512).optional(),workspaceRoot:c().trim().min(1).max(4096).optional(),createWorkspaceRoot:t().optional(),executionMode:Y.shape.executionMode.optional(),brief:c().max(2e4).optional(),instructions:c().max(1e5).optional(),outcome:c().max(2e4).optional(),successCriteria:o(c().max(4096)).max(100).optional(),scope:i(c(),p()).optional(),nonGoals:o(c().max(4096)).max(100).optional(),health:Y.shape.health.optional(),ownerId:c().max(512).optional(),targetAt:m().finite().optional()};d({...X,projectKind:l([`auto`,`coding`,`general`,`unknown`]).optional(),autoUnderstand:t().default(!1)}).refine(e=>!!(e.name||e.workspaceRoot),`name or workspaceRoot is required`),d({id:c().trim().min(1),expectedVersion:m().int().positive(),patch:d({...X,status:Y.shape.status.optional(),description:X.description.unwrap().nullable().optional(),defaultAgentId:X.defaultAgentId.unwrap().nullable().optional(),workspaceRoot:c().trim().max(4096).nullable().optional(),brief:X.brief.unwrap().nullable().optional(),instructions:X.instructions.unwrap().nullable().optional(),outcome:X.outcome.unwrap().nullable().optional(),ownerId:X.ownerId.unwrap().nullable().optional(),targetAt:X.targetAt.unwrap().nullable().optional()}).refine(e=>Object.values(e).some(e=>e!==void 0),`Empty project patch`)});var je=d({status:Y.shape.status.optional(),search:c().max(4096).optional(),sortBy:l([`updatedAt`,`createdAt`,`name`]).optional(),sortOrder:l([`asc`,`desc`]).optional(),limit:m().int().min(1).max(500).default(50),offset:m().int().nonnegative().default(0)}),Z=s({id:c(),projectId:c(),title:c(),status:l([`planned`,`active`,`completed`,`cancelled`]),sortOrder:m(),createdAt:m(),updatedAt:m()}),Q=s({id:c(),projectId:c(),summary:c(),health:Y.shape.health,createdAt:m()}),$={title:c().trim().min(1).max(1e3),description:c().max(2e4).optional(),status:Z.shape.status.optional(),targetAt:m().int().nonnegative().optional(),sortOrder:m().int().optional()};d({projectId:c().trim().min(1),...$}),d({projectId:c().trim().min(1),id:c().trim().min(1),expectedRevision:m().int().nonnegative(),patch:d({...$,description:c().max(2e4).nullable().optional(),targetAt:m().int().nonnegative().nullable().optional()}).partial().refine(e=>Object.values(e).some(e=>e!==void 0),`Empty milestone patch`)}).omit({patch:!0}),r({ok:n(!0),milestone:Z,project:Y}),r({ok:n(!0),deleted:n(!0)}),d({projectId:c().trim().min(1),expectedVersion:m().int().positive(),health:Y.shape.health,summary:c().trim().min(1).max(2e4),progress:o(c().max(1e4)).max(100).default([]),risks:o(c().max(1e4)).max(100).default([]),nextSteps:o(c().max(1e4)).max(100).default([])}),r({ok:n(!0),update:Q,project:Y});var Me={"xopc.context.resolve":{input:oe,output:ae},"xopc.notes.preview_edit":{input:K.extend({instruction:c().trim().min(1).max(16e3),markdown:c().max(2e6).optional(),context:s({type:l([`selection`,`section`,`block`,`note`]),range:d({start:m().int().nonnegative(),end:m().int().nonnegative()})}).optional()}),output:r({message:c(),patch:r({id:c(),summary:c(),operations:o(r({type:n(`replaceRange`),from:m().int().nonnegative(),to:m().int().nonnegative(),markdown:c()}))})})},"xopc.automations.get_run":{input:K.extend({waitMs:m().int().min(0).max(3e4).optional()}),output:r({ok:n(!0),run:j.loose()})},"xopc.automations.run_events":{input:K,output:r({ok:n(!0),events:o(M.loose())})},"xopc.automations.metrics":{input:d({}),output:r({ok:n(!0),metrics:N})},"xopc.automations.events":{input:d({type:c().trim().min(1).max(512).optional(),source:c().trim().min(1).max(512).optional(),limit:m().int().min(1).max(200).default(50)}),output:r({ok:n(!0),items:o(r({event:r({id:c(),type:c(),schemaVersion:m().int(),source:c(),subject:r({kind:c(),id:c()}).optional(),payload:i(c(),e()),occurredAtMs:m(),ingestedAtMs:m(),correlationId:c(),causationId:c().optional(),rootEventId:c(),chainDepth:m().int(),dedupeKey:c().optional(),trust:l([`system`,`user`,`connector`,`untrusted_webhook`])}),projectionStatus:l([`pending`,`projecting`,`retrying`,`projected`,`dead_letter`]),projectionAttempts:m().int(),projectionError:c().optional(),deliveries:o(r({automationId:c(),status:l([`pending`,`retrying`,`queued`,`completed`,`failed`,`cancelled`,`skipped`,`dead_letter`]),runId:c().optional(),attempts:m().int(),lastError:c().optional()}))}))})},"xopc.automations.deliveries":{input:d({runId:c().trim().min(1).max(200).optional(),status:l([`pending`,`delivering`,`retrying`,`delivered`,`dead_letter`]).optional(),limit:m().int().min(1).max(200).default(50)}),output:r({ok:n(!0),items:o(r({runId:c(),destinationKey:c(),kind:c(),status:l([`pending`,`delivering`,`retrying`,`delivered`,`dead_letter`]),attempts:m().int(),nextAttemptAtMs:m(),lastError:c().optional(),createdAtMs:m(),updatedAtMs:m()}))})},"xopc.automations.product_events":{input:d({eventType:c().trim().min(1).max(512),source:c().trim().min(1).max(512).optional(),payloadKey:c().trim().min(1).max(512).optional(),payloadValue:c().max(4096).optional(),limit:m().int().min(1).max(100).default(10)}).refine(e=>e.payloadKey===void 0==(e.payloadValue===void 0),`payloadKey and payloadValue must be supplied together`),output:r({ok:n(!0),items:o(r({run:j.loose(),triggerEvent:M.loose()}))})},"xopc.automations.list":{input:d({projectId:c().trim().min(1).optional()}),output:r({ok:n(!0),items:o(A.loose()),projectId:c().optional(),executionSummaries:i(c(),r({unreadCount:m().int().nonnegative()})).optional()})},"xopc.automations.get":{input:K,output:r({ok:n(!0),automation:A.loose()})},"xopc.automations.history":{input:d({automationId:c().trim().min(1).optional(),projectId:c().trim().min(1).optional(),cursor:c().max(1024).optional(),limit:m().int().min(1).max(200).default(50)}),output:r({ok:n(!0),items:o(j.loose()),projectId:c().optional(),hasMore:t().optional(),nextCursor:c().optional()})},"xopc.settings.open":{input:d({section:c().trim().pipe(Se).default(`overview`),title:c().trim().min(1).max(512).default(`Settings`),summary:c().trim().max(4096).optional()}),output:r({ok:n(!0),settings:r({section:c(),title:c(),summary:c().optional()})})},"xopc.local_apps.list":{input:d({}),output:r({apps:o(ee)})},"xopc.local_apps.get":{input:K,output:r({app:te})},"xopc.local_apps.validate":{input:K,output:r({validation:ne})},"xopc.projects.get":{input:K,output:r({ok:n(!0),project:Y})},"xopc.projects.list":{input:je,output:s({ok:n(!0),items:o(Y),total:m().int().nonnegative()})},"xopc.projects.list_milestones":{input:K,output:r({ok:n(!0),projectId:c(),items:o(Z)})},"xopc.projects.list_updates":{input:K.extend({limit:m().int().min(1).max(500).default(20)}),output:r({ok:n(!0),projectId:c(),items:o(Q)})},"xopc.task_runs.get":{input:K,output:r({ok:n(!0),run:y,receipt:C.optional(),events:o(S),activeWaits:o(w)})},"xopc.task_runs.list":{input:d({taskId:c().trim().min(1),limit:m().int().min(1).max(200).default(20)}),output:r({ok:n(!0),taskId:c(),items:o(y),receipts:o(C),activeWaits:o(w)})},"xopc.notes.project_summaries":{input:d({}),output:r({items:o(r({id:c(),name:c(),description:c().optional(),noteCount:m().int().nonnegative(),updatedAt:m().optional()}))})},"xopc.notes.history":{input:K,output:r({entries:o(r({timestamp:m().int().nonnegative(),trigger:l([`edit`,`ai_edit`,`sync`,`restore`]),snippet:c().optional()}))})},"xopc.notes.snapshot":{input:K.extend({timestamp:m().int().nonnegative()}),output:r({snapshot:r({noteId:c(),timestamp:m().int().nonnegative(),trigger:l([`edit`,`ai_edit`,`sync`,`restore`]),title:c().optional(),markdown:c(),tags:o(c()).optional(),kind:q.shape.kind,status:q.shape.status})})},"xopc.notes.get":{input:K,output:De},"xopc.notes.list":{input:Ee,output:J},"xopc.tasks.metrics":{input:d({}),output:r({ok:n(!0),metrics:be})},"xopc.tasks.get":{input:K,output:x},"xopc.tasks.list":{input:ke,output:ie.extend({total:m().int().nonnegative()})}};export{_e as a,F as c,ve as i,ce as l,Me as n,xe as o,Te as r,R as s,Ce as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/skills-page-CfhEcU8L.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/locale-store-Cit_aHqC.js","assets/messages-DQveK9sk.js","assets/dist-CY7CS_D3.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.js","assets/briefcase-business-BsoCaI_t.js","assets/createLucideIcon-DPHK1VkS.js","assets/popover-select-CLsphyzA.js","assets/check-DUBLcKHA.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/skeleton-DzdOeGYz.js","assets/dist-GJ8-1PAx.js","assets/dist-BuHnPloF.js","assets/floating-ui.dom-seOukHzT.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/code-xml-DJtYhZUF.js","assets/download-Dk-ZjtO6.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/file-archive-DanfQJNe.js","assets/file-text-D12HbeVy.js","assets/layers-mJW7JJKm.js","assets/loader-circle-CifKLtgG.js","assets/markdown-view-Dm01GIXv.js","assets/diagnostics-Bo0Z42P_.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/app-link-CauYDM-y.js","assets/product-delivery-4gEqUIsK.js","assets/schemas-CCWMleym.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-DG8DDkEA.css","assets/palette-CDI0VweW.js","assets/refresh-cw-BRlGaq2w.js","assets/sparkles-DHlfQFAF.js","assets/trash-2-DusmjVPV.js","assets/triangle-alert-2JXFNNKU.js","assets/wrench-DFb4r8bH.js","assets/vendor-swr-CdRzEUwF.js","assets/gateway-config-swr-DVXDJNCI.js","assets/chat-agents-api-Bim8--J9.js","assets/button-Cc4hUNTt.js","assets/interaction-BdhHBbYa.js","assets/page-tabs-oeTY7z3_.js","assets/sliding-indicator-hwz0sx3h.js","assets/page-header-store-1-lflHAx.js","assets/use-async-resource-BHFGZCY2.js","assets/index.module-Cd9ENXfk.js","assets/dist-ZrL34Ps4.js","assets/command-palette-api-DPtCt8Je.js","assets/local-session-drafts-CgAuYyKi.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/skill-list-api-D4eokPXx.js","assets/skill-api-utils-C7V4JVXM.js","assets/capability-links-MZdYfPKx.js","assets/connection-usage-BhdQRWgQ.js","assets/capability-icon-CmvCZOJX.js","assets/capability-header-actions-BxMYfQ8y.js","assets/search-DA7gz22f.js","assets/use-media-query-ady-FgjK.js","assets/skill-reload-api-Bm-8vhsQ.js","assets/skill-api-TQAyWHGS.js","assets/connectors-page-HHGB3r3Q.js","assets/service-recommendation-list-2UOjV0Mx.js","assets/chevron-down-ccbiQQz_.js","assets/working-directory-picker-modal-W2QiUVjN.js","assets/form-field-width-DJw_jULe.js","assets/settings-form-draft-Dy10ldo8.js","assets/circle-check-C23XjkUj.js","assets/key-round-DWbpyU2U.js","assets/install-connector-dialog-BZjodnUC.js","assets/secret-input-DsjfQmDn.js","assets/copy-Dv6d4Dvw.js","assets/eye-CABVeTq0.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-BUdH4tZQ.js","assets/electron-env-DHOGevH3.js","assets/oauth-provider-connect-BexlZuZ4.js","assets/cloud-C4-yfnnk.js","assets/models-hub-cache-B2QcrY4n.js","assets/registry-api-BEnvt9-6.js","assets/gateway-startup-retry-2jU7zCyx.js","assets/oauth-api-Bz_PU9R_.js","assets/connection-usage-guide-CM5qgMcK.js","assets/package-wATCyihJ.js","assets/server-BlHCBjiE.js","assets/agent-plugin-dialog-Cvj04Ckm.js","assets/arrow-left-D880xG-P.js","assets/circle-alert-BEjgurr2.js","assets/circle-BoO4YvTx.js","assets/folder-open-CyzJ19I9.js","assets/shield-check-BU58siTV.js","assets/upload-rrb46c3c.js","assets/browser-BLJWD7WI.js","assets/extension-marketplace-api-baFXdV56.js","assets/chevron-right-BweFrslA.js","assets/circle-pause-CN9jYH2s.js","assets/connector-filters-Cfcx9EA2.js","assets/clock-3-DnrAnuyZ.js","assets/database-CjjeZfRG.js","assets/plug-DKYPEgkR.js","assets/save-DRDABU--.js","assets/settings-uiTATseT.js","assets/store-SzD1Jvgm.js","assets/terminal-oKqqZdiG.js","assets/extension-provider-BhluafoX.js","assets/gateway-realtime-BnwNxbyc.js","assets/gateway-realtime-store-BpnGXAhi.js","assets/theme-store-C1MxmBg7.js","assets/middleware-Pd0e8Igk.js","assets/extension-message-router-BD0ZamBV.js","assets/session-manager-BVS3zxRZ.js","assets/turn-outcome-BSbEJx8h.js","assets/session-api-CkOliupg.js","assets/tool-activity-BtJkgjFf.js","assets/attachment-utils-core-BPYdUI6y.js","assets/agents-admin-api-BL8lN8gP.js","assets/capabilities-YmBD7oK8.js","assets/tasks-BIehlq7k.js","assets/specialists-xbB3xL9e.js","assets/activity-store-DKP2sWTJ.js","assets/sliding-tab-list-CmcrqRzN.js","assets/confirm-dialog-DrA5mTQp.js","assets/connector-service-page-DLbBblN2.js","assets/number-input-El7Szeln.js","assets/plugin-details-dialog-BDoSffLO.js","assets/plugin-presentation-CO5BFDGW.js","assets/apps-page-CXKTWj1s.js","assets/box-DvYoGszj.js","assets/extension-paths-DvuaZJuy.js","assets/agents-DZftplJc.js","assets/bot-DjLkhyZL.js","assets/heart-Cp4rgrqn.js","assets/message-square-plus-XP0tGdlV.js","assets/pencil-DmIY3Oa-.js","assets/rotate-ccw-JM1TBLpp.js","assets/sliders-horizontal-DqsYor6I.js","assets/new-session-preferences-gb411vZP.js","assets/new-chat-navigation-DXYDldT_.js","assets/use-personal-profile-CNPszzzT.js","assets/agent-avatar-display-CIsejg_E.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/composer-handoff-params-DBpzHuNo.js","assets/agent-display-names-Bje7vfSn.js","assets/model-selector-Cg2kTsE7.js","assets/settings-2-D-csvaET.js","assets/open-capability-settings-DQsmJxI7.js","assets/model-sort-_Tz8s_4N.js","assets/agents-app-path-ciChvpCS.js","assets/settings-advanced-section-Zex2dJo7.js","assets/settings-mode-store-Dk0bZQgo.js","assets/settings-page-header-B9Y_eGcH.js","assets/settings-page-layout-D1MgJ5zP.js","assets/phone-model-picker-CNTcpY1A.js","assets/directory-picker-path-field-DBe_paLy.js","assets/use-directory-picker-C4p7AgWY.js","assets/image-generation-api-CiqQSx5j.js","assets/channels-DwUmMnA1.js","assets/channels-routes-r2g-9DdC.js","assets/stethoscope-DRqTAtjD.js","assets/session-channel-icon-COynhpeK.js","assets/git-branch-Dh9uxTot.js","assets/message-circle-Badhj-4D.js","assets/message-square-fVE7Ghj1.js","assets/panels-top-left-BKvp2Dag.js","assets/zap-dximCGjy.js","assets/secret-input-labels-B5Jl5HqK.js","assets/navigation-ByOzYT0t.js","assets/refresh-button-DiWdGAaX.js","assets/extension-iframe-host-CCe4R7L7.js","assets/extension-authoritative-grants-BqtUnmq-.js","assets/settings-loading-skeleton-CAoOV17i.js","assets/schema-form-DXHzZPMr.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{f as a,m as ee,r as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as c}from"./locale-store-Cit_aHqC.js";import{t as l}from"./messages-DQveK9sk.js";import{t as te}from"./cn-0WouolD0.js";import{t as u}from"./skeleton-DzdOeGYz.js";import{r as ne,t as d}from"./product-navigation-Dp-adLY_.js";import{t as f}from"./page-header-store-1-lflHAx.js";import{t as re}from"./capability-links-MZdYfPKx.js";import{t as ie}from"./capability-header-actions-BxMYfQ8y.js";var p=n(),m=e(t(),1),h=r(),ae=(0,m.lazy)(()=>i(()=>import(`./skills-page-CfhEcU8L.js`).then(e=>({default:e.SkillsPage})),__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,68,69,70]))),g=(0,m.lazy)(()=>i(()=>import(`./connectors-page-HHGB3r3Q.js`).then(e=>({default:e.ConnectorsPage})),__vite__mapDeps([71,1,2,4,3,5,6,7,8,9,72,11,73,74,25,28,14,15,50,51,75,76,77,78,79,12,13,16,17,18,19,20,24,80,81,82,37,83,33,84,48,47,85,86,87,88,89,90,91,92,43,64,93,32,94,95,96,97,98,99,100,101,63,102,65,103,104,105,106,107,108,23,109,42,110,111,112,113,44,46,52,53,54,114,115,36,116,117,118,119,35,120,30,121,122,59,123,124,125,126,127,128,129,130,131,57,66,67,68,132,133]))),_=(0,m.lazy)(()=>i(()=>import(`./plugin-details-dialog-BDoSffLO.js`).then(e=>({default:e.PluginDetailsDialog})),__vite__mapDeps([134,1,2,4,3,5,6,7,8,9,93,11,33,16,14,15,47,50,92,43,64,95,96,73,74,25,28,51,75,76,97,77,98,99,100,101,63,102,65,135]))),oe=(0,m.lazy)(()=>i(()=>import(`./apps-page-CXKTWj1s.js`).then(e=>({default:e.ExtensionsPage})),__vite__mapDeps([136,1,2,4,3,5,6,7,8,9,96,11,137,138,23,24,28,29,30,22,31,32,33,14,15,34,35,36,37,38,39,40,93,111,100,44,45,16,47,115,116,50,51,52,53,54,114,117,118,119,120,121,122,90,59,123,124,89,125,48,126,127,128,129,76,57,18,19,95,73,74,25,75,97,77,98,99,101,63,64,102,65,103,66,67,17,68,135]))),v=(0,m.lazy)(()=>i(()=>import(`./agents-DZftplJc.js`).then(e=>({default:e.AgentsSettingsPanel})),__vite__mapDeps([139,1,2,3,4,5,6,7,8,9,140,11,10,104,12,13,14,15,16,17,18,19,20,21,23,82,141,29,30,22,31,32,33,34,35,36,37,38,39,40,142,143,144,67,111,145,45,101,128,146,47,48,89,90,125,50,51,117,118,52,53,147,148,149,150,151,152,60,153,130,131,57,154,155,156,75,157,158,159,160,68,133,161,24,43,162,163,164,74,25,28,76,165,166]))),y=(0,m.lazy)(()=>i(()=>import(`./channels-DwUmMnA1.js`).then(e=>({default:e.ChannelsSettingsPanel})),__vite__mapDeps([167,1,2,4,3,5,6,7,8,9,12,11,13,14,15,16,17,18,19,20,97,77,24,78,28,168,144,155,111,169,45,33,170,107,171,172,173,174,109,113,175,36,47,49,48,50,37,51,176,177,149,150,151,153,178,42,179,117,118,114,115,116,119,35,120,30,121,122,90,59,123,124,89,125,126,127,128,129,76,180,181,102,159,160,161,43,162,182,80,81,82,75,83,133])));function b(e){return d.includes(e)?e:null}function x(e){let t=(0,p.c)(3),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Array.from({length:6},S),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,h.jsx)(`div`,{className:`mx-auto grid w-full max-w-7xl gap-4 px-4 pb-7 pt-3 sm:grid-cols-2 sm:px-6 lg:grid-cols-3 lg:px-8 lg:pb-9 lg:pt-4`,"aria-label":n,"aria-busy":!0,children:r}),t[1]=n,t[2]=i),i}function S(e,t){return(0,h.jsx)(u,{className:`h-40 rounded-xl`},t)}function C(){let e=(0,p.c)(68),t=c(le),n;e[0]===t?n=e[1]:(n=l(t),e[0]=t,e[1]=n);let r=n,i=r.capabilitiesHub,{section:u,detailId:S}=a(),[C]=ee(),w=s(),T;e[2]===C?T=e[3]:(T=C.get(`plugin`),e[2]=C,e[3]=T);let E=T,D;e[4]!==w||e[5]!==C?(D=()=>{let e=new URLSearchParams(C);e.delete(`plugin`),e.delete(`connect`),w({search:e.toString()},{replace:!0,preventScrollReset:!0})},e[4]=w,e[5]=C,e[6]=D):D=e[6];let O=D,k;e[7]===u?k=e[8]:(k=b(u),e[7]=u,e[8]=k);let A=k,j=A??d[0],M=r.productNavigation.sections[`capabilities-${j}`],N=f(ce),P=f(se),F;e[9]===j?F=e[10]:(F={section:j,value:null},e[9]=j,e[10]=F);let[I,L]=(0,m.useState)(F),R=j===`extensions`&&S?null:I.section===j?I.value:null,z;e[11]===j?z=e[12]:(z=e=>{L({section:j,value:e})},e[11]=j,e[12]=z);let B=z,V,H;if(e[13]!==P||e[14]!==R||e[15]!==M||e[16]!==N?(V=()=>(N({startExtra:null,main:(0,h.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:M}),end:(0,h.jsx)(ie,{contribution:R})}),()=>P()),H=[P,R,M,N],e[13]=P,e[14]=R,e[15]=M,e[16]=N,e[17]=V,e[18]=H):(V=e[17],H=e[18]),(0,m.useLayoutEffect)(V,H),j===`extensions`&&S){let t;e[19]===C?t=e[20]:(t=C.get(`from`)===`connections`?`connections`:C.get(`from`)===`skills`?`skills`:`installed`,e[19]=C,e[20]=t);let n;e[21]===C?n=e[22]:(n=C.get(`connect`),e[21]=C,e[22]=n);let r=n===`1`,i;e[23]!==S||e[24]!==C||e[25]!==r||e[26]!==t?(i=re(S,t,r,C.get(`returnTo`)??void 0),e[23]=S,e[24]=C,e[25]=r,e[26]=t,e[27]=i):i=e[27];let a;return e[28]===i?a=e[29]:(a=(0,h.jsx)(o,{replace:!0,to:i}),e[28]=i,e[29]=a),a}if(!A){let t;return e[30]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsx)(o,{to:ne(d[0]),replace:!0}),e[30]=t):t=e[30],t}let U=j===`channels`?`bg-surface-base`:`bg-surface-panel`,W;e[31]===U?W=e[32]:(W=te(`flex min-h-0 min-w-0 flex-1 flex-col`,U),e[31]=U,e[32]=W);let G;e[33]===i.discoverLoading?G=e[34]:(G=(0,h.jsx)(x,{label:i.discoverLoading}),e[33]=i.discoverLoading,e[34]=G);let K;e[35]!==S||e[36]!==B||e[37]!==j?(K=j===`agents`?(0,h.jsx)(v,{agentId:S,onHeaderActionChange:B}):null,e[35]=S,e[36]=B,e[37]=j,e[38]=K):K=e[38];let q;e[39]!==B||e[40]!==j?(q=j===`skills`?(0,h.jsx)(ae,{embedded:!0,onHeaderActionChange:B}):null,e[39]=B,e[40]=j,e[41]=q):q=e[41];let J;e[42]!==B||e[43]!==j?(J=j===`connectors`?(0,h.jsx)(g,{embedded:!0,onHeaderActionChange:B}):null,e[42]=B,e[43]=j,e[44]=J):J=e[44];let Y;e[45]!==S||e[46]!==B||e[47]!==j?(Y=j===`channels`?(0,h.jsx)(y,{channelId:S,onHeaderActionChange:B}):null,e[45]=S,e[46]=B,e[47]=j,e[48]=Y):Y=e[48];let X;e[49]!==B||e[50]!==j?(X=j===`extensions`?(0,h.jsx)(oe,{embedded:!0,onHeaderActionChange:B}):null,e[49]=B,e[50]=j,e[51]=X):X=e[51];let Z;e[52]!==j||e[53]!==G||e[54]!==K||e[55]!==q||e[56]!==J||e[57]!==Y||e[58]!==X?(Z=(0,h.jsxs)(m.Suspense,{fallback:G,children:[K,q,J,Y,X]},j),e[52]=j,e[53]=G,e[54]=K,e[55]=q,e[56]=J,e[57]=Y,e[58]=X,e[59]=Z):Z=e[59];let Q;e[60]!==O||e[61]!==E||e[62]!==C?(Q=E?(0,h.jsx)(m.Suspense,{fallback:null,children:(0,h.jsx)(_,{pluginId:E,initialConnect:C.get(`connect`)===`1`,onClose:O},E)}):null,e[60]=O,e[61]=E,e[62]=C,e[63]=Q):Q=e[63];let $;return e[64]!==Z||e[65]!==Q||e[66]!==W?($=(0,h.jsxs)(`div`,{className:W,children:[Z,Q]}),e[64]=Z,e[65]=Q,e[66]=W,e[67]=$):$=e[67],$}function se(e){return e.clearPageHeader}function ce(e){return e.setPageHeader}function le(e){return e.language}export{C as CapabilitiesPage};
@@ -0,0 +1,8 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-swr-CdRzEUwF.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{f as a,l as o,m as s,r as c,t as l}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a as u,i as d,l as f,n as p,o as m}from"./locale-store-Cit_aHqC.js";import{t as h}from"./messages-DQveK9sk.js";import{a as g,i as _,n as v,o as y,r as b,s as x,t as S}from"./dist-CY7CS_D3.js";import{t as C}from"./arrow-right-DSSvoX71.js";import{a as w,i as T,n as E,t as D}from"./video-generation-Cec49Jwg.js";import{t as O}from"./chevron-right-BweFrslA.js";import{n as k,r as A,t as j}from"./popover-select-CLsphyzA.js";import{t as M}from"./circle-check-C23XjkUj.js";import{C as N,S as ee,T as P,_ as F,a as I,b as L,c as R,d as z,f as B,g as V,h as H,i as U,l as te,m as W,n as ne,o as G,p as re,r as ie,s as K,t as ae,u as oe,v as se,w as ce,x as le,y as q}from"./connected-providers-grid-DUHMZjyV.js";import{t as ue}from"./cloud-C4-yfnnk.js";import{t as de}from"./external-link-DjqjBmc3.js";import{t as fe}from"./secret-input-DsjfQmDn.js";import{t as pe}from"./eye-CABVeTq0.js";import{t as me}from"./image-Cwyalflz.js";import{t as he}from"./key-round-DWbpyU2U.js";import{t as ge}from"./loader-circle-CifKLtgG.js";import{t as _e}from"./pencil-DmIY3Oa-.js";import{t as ve}from"./plug-DKYPEgkR.js";import{t as ye}from"./plus-Q2yW6OE7.js";import{t as be}from"./refresh-cw-BRlGaq2w.js";import{t as xe}from"./settings-2-D-csvaET.js";import{t as Se}from"./shield-check-BU58siTV.js";import{t as Ce}from"./sliders-horizontal-DqsYor6I.js";import{t as we}from"./trash-2-DusmjVPV.js";import{t as Te}from"./triangle-alert-2JXFNNKU.js";import{t as Ee}from"./wrench-DFb4r8bH.js";import{t as De}from"./x-B_N4OPjy.js";import{t as J}from"./cn-0WouolD0.js";import{t as Y}from"./skeleton-DzdOeGYz.js";import{t as Oe}from"./voice-CDlC6XMH.js";import{n as ke}from"./cloud-credits-B-nbtkqv.js";import{a as Ae,i as X}from"./vendor-swr-CdRzEUwF.js";import{n as je,r as Me}from"./gateway-config-swr-DVXDJNCI.js";import{n as Ne,t as Pe}from"./registry-api-BEnvt9-6.js";import{t as Z}from"./button-Cc4hUNTt.js";import{i as Fe,o as Ie}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as Le}from"./open-capability-settings-DQsmJxI7.js";import{n as Re,t as ze}from"./interaction-BdhHBbYa.js";import{n as Be,t as Ve}from"./voice-settings-BzfNK5Jm.js";import{a as He,o as Ue,s as We}from"./form-field-width-DJw_jULe.js";import{n as Ge}from"./is-masked-secret-DOkL5b_X.js";import{n as Ke,t as qe}from"./secret-input-labels-B5Jl5HqK.js";import{a as Je}from"./navigation-ByOzYT0t.js";import{t as Ye}from"./electron-env-DHOGevH3.js";import{n as Xe,t as Ze}from"./settings-form-draft-Dy10ldo8.js";import{t as Qe}from"./sliding-tab-list-CmcrqRzN.js";import{t as $e}from"./confirm-dialog-DrA5mTQp.js";import{n as et,t as tt}from"./model-sort-_Tz8s_4N.js";import{n as nt,r as rt}from"./model-selector-Cg2kTsE7.js";import{n as it}from"./agents-app-path-ciChvpCS.js";import{n as at,t as ot}from"./global-defaults-api-CNyJ0dGb.js";import{t as st}from"./settings-loading-skeleton-CAoOV17i.js";import{i as ct,n as lt,r as ut,t as dt}from"./capability-navigation-CZbCI5C2.js";import{a as ft,i as pt,o as mt,r as ht,t as gt}from"./models-hub-cache-B2QcrY4n.js";import{a as _t,r as vt,s as yt,t as bt}from"./providers-api-BXa2Aheb.js";import{a as xt,i as St,n as Ct,o as wt,r as Tt,t as Et}from"./oauth-api-Bz_PU9R_.js";import{t as Dt}from"./settings-advanced-section-Zex2dJo7.js";import{n as Ot,r as kt,t as At}from"./oauth-authorization-window-o6URRos4.js";import{t as jt}from"./number-input-El7Szeln.js";import{n as Mt,t as Nt}from"./settings-page-header-B9Y_eGcH.js";import"./settings-page-layout-D1MgJ5zP.js";import{n as Pt,t as Ft}from"./settings-form-section-num14vSv.js";import{n as It,t as Lt}from"./use-autosave-CvjQMyY8.js";import{c as Rt,h as zt,l as Bt,n as Vt,o as Ht,t as Ut}from"./voice-config-api-BLGbUq3v.js";import{a as Wt,i as Gt,n as Kt,o as qt,r as Jt,s as Yt,t as Xt}from"./image-generation-api-CiqQSx5j.js";import{t as Zt}from"./xopc-cloud-account-card-DGAGXbGI.js";var Qt=`tencent-mps`,$t=n(),Q=e(t(),1),$=r(),en={en:{addTitle:`Add image service`,editTitle:`Manage image service`,intro:`Connect an endpoint that implements the OpenAI Images protocol.`,connection:`Connection`,providerId:`Provider ID`,providerIdHint:`Lowercase letters, numbers, hyphens, or underscores.`,name:`Display name`,baseUrl:`Base URL`,auth:`Authentication`,bearer:`Bearer token`,header:`Custom API key header`,none:`No authentication`,headerName:`Header name`,apiKey:`API key`,apiKeyHint:`Stored in the local credential store, separate from models.json.`,apiKeyUrl:`API key page (optional)`,docsUrl:`Documentation page (optional)`,openKeyPage:`Create API key`,paths:`Protocol and network`,generationsPath:`Generations path`,editsPath:`Edits path`,allowedHosts:`Allowed private hosts (optional)`,allowedHostsHint:`One exact hostname or IP per line. Private endpoints stay blocked unless listed here.`,staticHeaders:`Static headers (optional)`,staticHeadersHint:`One per line: X-Tenant: value. Credential headers are rejected.`,models:`Image models`,addModel:`Add model`,modelId:`Model ID`,modelName:`Name (optional)`,defaultModel:`Default model`,maxCount:`Max images`,defaultCount:`Default count`,defaultSize:`Default size`,format:`Output format`,supportsSize:`Supports size`,edit:`Supports edits`,remove:`Remove`,cancel:`Cancel`,save:`Save service`,saving:`Saving…`,test:`Test generation`,testing:`Generating…`,delete:`Delete service`,confirmDelete:`Delete permanently`,saved:`Image service saved.`,deleted:`Image service deleted.`,testReady:`Test image generated.`,show:`Show key`,hide:`Hide key`,copy:`Copy key`,copied:`Copied`,revealFailed:`Unable to reveal the saved key.`,notRevealable:`No revealable key is stored locally.`,required:`Complete the required connection and model fields.`,duplicateModels:`Model IDs must be unique.`,invalidHeaders:`Static headers must use “Name: value”, one per line.`},zh:{addTitle:`添加图片服务`,editTitle:`管理图片服务`,intro:`连接一个严格实现 OpenAI Images 协议的服务端点。`,connection:`连接信息`,providerId:`Provider ID`,providerIdHint:`仅支持小写字母、数字、连字符和下划线。`,name:`显示名称`,baseUrl:`Base URL`,auth:`认证方式`,bearer:`Bearer Token`,header:`自定义 API Key Header`,none:`无需认证`,headerName:`Header 名称`,apiKey:`API Key`,apiKeyHint:`密钥单独保存在本机凭据存储,不写入 models.json。`,apiKeyUrl:`API Key 创建页面(可选)`,docsUrl:`协议文档页面(可选)`,openKeyPage:`去创建 API Key`,paths:`协议与网络`,generationsPath:`生成路径`,editsPath:`编辑路径`,allowedHosts:`允许访问的私有主机(可选)`,allowedHostsHint:`每行一个精确主机名或 IP;未列出的私网端点保持阻止。`,staticHeaders:`静态 Headers(可选)`,staticHeadersHint:`每行一个:X-Tenant: value。认证 Header 会被拒绝。`,models:`图片模型`,addModel:`添加模型`,modelId:`模型 ID`,modelName:`名称(可选)`,defaultModel:`默认模型`,maxCount:`单次最大张数`,defaultCount:`默认张数`,defaultSize:`默认尺寸`,format:`输出格式`,supportsSize:`支持尺寸参数`,edit:`支持图片编辑`,remove:`移除`,cancel:`取消`,save:`保存服务`,saving:`保存中…`,test:`测试生成`,testing:`生成中…`,delete:`删除服务`,confirmDelete:`确认永久删除`,saved:`图片服务已保存。`,deleted:`图片服务已删除。`,testReady:`测试图片生成成功。`,show:`显示密钥`,hide:`隐藏密钥`,copy:`复制密钥`,copied:`已复制`,revealFailed:`无法查看已保存的密钥。`,notRevealable:`本机没有可查看的密钥。`,required:`请补全必填的连接和模型信息。`,duplicateModels:`模型 ID 不能重复。`,invalidHeaders:`静态 Header 必须使用“名称: 值”格式,每行一个。`}},tn=`mt-1.5 h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`;function nn(e){let t=e??{id:``,capabilities:{generate:{maxCount:1,supportsSize:!0},edit:{enabled:!1}}};return{original:t,id:t.id,name:t.name??``,maxCount:String(t.capabilities.generate?.maxCount??1),defaultCount:t.defaults?.count?String(t.defaults.count):``,defaultSize:t.defaults?.size??``,outputFormat:t.defaults?.outputFormat??``,supportsSize:t.capabilities.generate?.supportsSize??!1,editEnabled:t.capabilities.edit?.enabled??!1}}function rn(e){let t=e.split(`
3
+ `).map(e=>e.trim()).filter(Boolean);if(t.length===0)return;let n=t.map(e=>{let t=e.indexOf(`:`);if(t<=0||!e.slice(t+1).trim())throw Error(`invalid_headers`);return[e.slice(0,t).trim(),e.slice(t+1).trim()]});return Object.fromEntries(n)}function an({open:e,onOpenChange:t,provider:n,configured:r,language:i,onSaved:a,portalContainer:o,onPendingChange:s}){let c=en[i],[l,u]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(``),[h,C]=(0,Q.useState)(`bearer`),[T,E]=(0,Q.useState)(`x-api-key`),[D,O]=(0,Q.useState)(``),[k,A]=(0,Q.useState)(``),[M,N]=(0,Q.useState)(``),[ee,P]=(0,Q.useState)(`/images/generations`),[F,I]=(0,Q.useState)(`/images/edits`),[L,R]=(0,Q.useState)(``),[z,B]=(0,Q.useState)(``),[V,H]=(0,Q.useState)([nn()]),[U,te]=(0,Q.useState)(``),[W,ne]=(0,Q.useState)(),[G,re]=(0,Q.useState)(!1),[ie,K]=(0,Q.useState)(),[ae,oe]=(0,Q.useState)(),[se,ce]=(0,Q.useState)();(0,Q.useEffect)(()=>(s?.(!!W),()=>s?.(!1)),[W,s]),(0,Q.useEffect)(()=>{if(!e)return;let t=n?.imageGeneration;u(n?.providerId??``),f(t?.name??``),m(n?.baseUrl??``),C(t?.auth.type??`bearer`),E(t?.auth.type===`header`?t.auth.headerName:`x-api-key`),O(r?`••••••••••••`:``),A(t?.apiKeyUrl??``),N(t?.documentationUrl??``),P(t?.paths?.generations??`/images/generations`),I(t?.paths?.edits??`/images/edits`),R(t?.network?.allowedHosts.join(`
4
+ `)??``),B(Object.entries(n?.headers??{}).map(([e,t])=>`${e}: ${t}`).join(`
5
+ `)),H(t?.models.map(nn)??[nn()]),te(t?.defaultModel??``),oe(void 0),ne(void 0),re(!1),K(void 0),ce(void 0)},[r,e,n]);let le=(0,Q.useMemo)(()=>V.filter(e=>e.id.trim()).sort(et).map(e=>({value:e.id.trim(),label:e.name.trim()||e.id.trim()})),[V]),q=(e,t)=>{H(n=>n.map((n,r)=>r===e?{...n,...t}:n))},ue=()=>{let e=l.trim(),t=V.map(e=>({...e,id:e.id.trim(),name:e.name.trim()}));if(!e||!d.trim()||!p.trim()||t.some(e=>!e.id))throw Error(c.required);if(new Set(t.map(e=>e.id)).size!==t.length)throw Error(c.duplicateModels);let n=U||t[0]?.id;if(!n||!t.some(e=>e.id===n))throw Error(c.required);let r;try{r=rn(z)}catch{throw Error(c.invalidHeaders)}return{providerId:e,input:{baseUrl:p.trim(),...r?{headers:r}:{},imageGeneration:{api:`openai-images`,name:d.trim(),...M.trim()?{documentationUrl:M.trim()}:{},...k.trim()?{apiKeyUrl:k.trim()}:{},defaultModel:n,auth:h===`header`?{type:`header`,headerName:T.trim()}:{type:h},paths:{...ee.trim()?{generations:ee.trim()}:{},...F.trim()?{edits:F.trim()}:{}},...L.trim()?{network:{allowedHosts:L.split(`
6
+ `).map(e=>e.trim()).filter(Boolean)}}:{},models:t.map(e=>({...e.original,id:e.id,...e.name?{name:e.name}:{name:void 0},capabilities:{...e.original.capabilities,generate:{...e.original.capabilities.generate,maxCount:Math.max(1,Number.parseInt(e.maxCount,10)||1),supportsSize:e.supportsSize},edit:{...e.original.capabilities.edit,enabled:e.editEnabled}},defaults:{...e.original.defaults,...e.defaultCount?{count:Math.max(1,Number.parseInt(e.defaultCount,10)||1)}:{count:void 0},...e.defaultSize.trim()?{size:e.defaultSize.trim()}:{size:void 0},...e.outputFormat?{outputFormat:e.outputFormat}:{outputFormat:void 0}}}))}}}},de=async()=>{let e=ue();return await Gt(e.providerId,e.input),h!==`none`&&D.trim()&&!Ge(D)&&await Wt(e.providerId,D.trim()),await a(e.providerId),e},me=async()=>{ne(`save`),K(void 0),oe(void 0);try{await de(),O(h===`none`?``:`••••••••••••`),oe(c.saved)}catch(e){K(e instanceof Error?e.message:String(e))}finally{ne(void 0)}},he=async()=>{ne(`test`),K(void 0),oe(void 0),ce(void 0);try{let e=await de(),t=await qt(e.providerId,e.input.imageGeneration.defaultModel);ce(t.images[0]?.dataUrl),oe(c.testReady)}catch(e){K(e instanceof Error?e.message:String(e))}finally{ne(void 0)}},_e=async()=>{if(n){if(!G){re(!0);return}ne(`delete`),K(void 0);try{await Xt(n.providerId),await a(),t(!1)}catch(e){K(e instanceof Error?e.message:String(e))}finally{ne(void 0)}}};return(0,$.jsx)(S,{open:e,onOpenChange:e=>{W||t(e)},children:(0,$.jsxs)(y,{container:o,children:[(0,$.jsx)(g,{className:J(`xopc-dialog-overlay fixed inset-0 bg-scrim`,Ie)}),(0,$.jsxs)(b,{className:J(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(88vh,760px)] w-[min(calc(100%-2rem),52rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover`,Fe),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,$.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(x,{className:`font-semibold text-fg`,children:n?c.editTitle:c.addTitle}),(0,$.jsx)(_,{className:`mt-1 text-sm text-fg-muted`,children:c.intro})]}),(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,disabled:!!W,className:`rounded-md p-1 text-fg-muted hover:bg-surface-inset hover:text-fg`,"aria-label":c.cancel,children:(0,$.jsx)(De,{className:`size-5`})})})]}),(0,$.jsxs)(`fieldset`,{disabled:!!W,className:`min-h-0 min-w-0 flex-1 space-y-6 overflow-y-auto px-5 py-4`,children:[(0,$.jsxs)(`section`,{className:`space-y-4`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:c.connection}),(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.providerId,(0,$.jsx)(`input`,{value:l,disabled:!!n,onChange:e=>u(e.target.value),placeholder:`my-image-service`,className:tn}),(0,$.jsx)(`span`,{className:`mt-1 block font-normal text-fg-subtle`,children:c.providerIdHint})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.name,(0,$.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:`My Image Service`,className:tn})]})]}),(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[c.baseUrl,(0,$.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),placeholder:`https://api.example.com/v1`,className:tn})]}),(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.auth,(0,$.jsx)(j,{value:h,options:[{value:`bearer`,label:c.bearer},{value:`header`,label:c.header},{value:`none`,label:c.none}],placeholder:c.auth,allowEmpty:!1,onChange:e=>C(e),triggerClassName:`mt-1.5`})]}),h===`header`?(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.headerName,(0,$.jsx)(`input`,{value:T,onChange:e=>E(e.target.value),className:tn})]}):null]}),h===`none`?null:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,$.jsx)(`label`,{htmlFor:`custom-image-api-key`,className:`text-xs font-medium text-fg-muted`,children:c.apiKey}),k.trim()?(0,$.jsxs)(`a`,{href:k.trim(),target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-accent hover:underline`,children:[c.openKeyPage,(0,$.jsx)(w,{className:`size-3.5`})]}):null]}),(0,$.jsx)(fe,{id:`custom-image-api-key`,value:D,onChange:e=>O(Ge(D)?e.replace(/^•+/,``):e),labels:{show:c.show,hide:c.hide,copy:c.copy,copied:c.copied},reveal:()=>yt(l).then(e=>e.apiKey),loadFailedLabel:c.revealFailed,notInConfigFile:c.notRevealable}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:c.apiKeyHint})]}),(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.apiKeyUrl,(0,$.jsx)(`input`,{value:k,onChange:e=>A(e.target.value),placeholder:`https://…`,className:tn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.docsUrl,(0,$.jsx)(`input`,{value:M,onChange:e=>N(e.target.value),placeholder:`https://…`,className:tn})]})]}),(0,$.jsxs)(`details`,{className:`rounded-lg border border-edge bg-surface-inset px-3 py-2.5`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted`,children:c.paths}),(0,$.jsxs)(`div`,{className:`mt-3 grid gap-4 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.generationsPath,(0,$.jsx)(`input`,{value:ee,onChange:e=>P(e.target.value),className:tn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.editsPath,(0,$.jsx)(`input`,{value:F,onChange:e=>I(e.target.value),className:tn})]})]}),(0,$.jsxs)(`label`,{className:`mt-4 block text-xs font-medium text-fg-muted`,children:[c.allowedHosts,(0,$.jsx)(`textarea`,{value:L,onChange:e=>R(e.target.value),rows:2,placeholder:`127.0.0.1
7
+ image-server.lan`,className:`mt-1.5 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 font-mono text-xs text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,$.jsx)(`span`,{className:`mt-1 block font-normal text-fg-subtle`,children:c.allowedHostsHint})]}),(0,$.jsxs)(`label`,{className:`mt-4 block text-xs font-medium text-fg-muted`,children:[c.staticHeaders,(0,$.jsx)(`textarea`,{value:z,onChange:e=>B(e.target.value),rows:3,className:`mt-1.5 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 font-mono text-xs text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,$.jsx)(`span`,{className:`mt-1 block font-normal text-fg-subtle`,children:c.staticHeadersHint})]})]})]}),(0,$.jsxs)(`section`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:c.models}),(0,$.jsxs)(Z,{variant:`secondary`,className:`px-2.5 py-1.5 text-xs`,onClick:()=>H(e=>[...e,nn()]),children:[(0,$.jsx)(ye,{className:`size-4`}),c.addModel]})]}),(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[c.defaultModel,(0,$.jsx)(j,{value:U||V.find(e=>e.id.trim())?.id.trim()||``,options:le,placeholder:c.defaultModel,allowEmpty:!1,onChange:te,triggerClassName:`mt-1.5 max-w-sm`})]}),V.map((e,t)=>(0,$.jsxs)(`div`,{className:`rounded-lg border border-edge bg-surface-base p-3`,children:[(0,$.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.modelId,(0,$.jsx)(`input`,{value:e.id,onChange:e=>q(t,{id:e.target.value}),placeholder:`image-1`,className:tn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.modelName,(0,$.jsx)(`input`,{value:e.name,onChange:e=>q(t,{name:e.target.value}),className:tn})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.maxCount,(0,$.jsx)(`input`,{type:`number`,min:1,value:e.maxCount,onChange:e=>q(t,{maxCount:e.target.value}),className:tn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.defaultCount,(0,$.jsx)(`input`,{type:`number`,min:1,value:e.defaultCount,onChange:e=>q(t,{defaultCount:e.target.value}),className:tn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.defaultSize,(0,$.jsx)(`input`,{value:e.defaultSize,onChange:e=>q(t,{defaultSize:e.target.value}),placeholder:`1024x1024`,className:tn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.format,(0,$.jsx)(j,{value:e.outputFormat,options:[{value:`png`,label:`PNG`},{value:`jpeg`,label:`JPEG`},{value:`webp`,label:`WebP`}],placeholder:c.format,allowEmpty:!0,onChange:e=>q(t,{outputFormat:e}),triggerClassName:`mt-1.5`})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-4`,children:[(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:e.supportsSize,onChange:e=>q(t,{supportsSize:e.target.checked})}),c.supportsSize]}),(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:e.editEnabled,onChange:e=>q(t,{editEnabled:e.target.checked})}),c.edit]}),(0,$.jsxs)(`button`,{type:`button`,disabled:V.length===1,onClick:()=>H(e=>e.filter((e,n)=>n!==t)),className:`ml-auto inline-flex items-center gap-1 text-xs text-red-600 disabled:opacity-40 dark:text-red-400`,children:[(0,$.jsx)(we,{className:`size-3.5`}),c.remove]})]})]},t))]}),se?(0,$.jsxs)(`section`,{className:`rounded-lg border border-edge bg-surface-base p-3`,children:[(0,$.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,$.jsx)(pe,{className:`size-4`}),c.testReady]}),(0,$.jsx)(`img`,{src:se,alt:`Generated provider test`,className:`max-h-72 rounded-lg object-contain`})]}):null,ae?(0,$.jsx)(`p`,{className:`rounded-lg bg-emerald-500/10 px-3 py-2 text-sm text-emerald-700 dark:text-emerald-300`,role:`status`,children:ae}):null,ie?(0,$.jsx)(`p`,{className:`rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-400`,children:ie}):null]}),(0,$.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-edge px-5 py-3`,children:[n?(0,$.jsxs)(Z,{variant:`secondary`,className:`border-red-500/30 text-red-600 hover:bg-red-500/10 dark:text-red-400`,disabled:!!W,onClick:()=>void _e(),children:[W===`delete`?(0,$.jsx)(ge,{className:`size-4 animate-spin`}):(0,$.jsx)(we,{className:`size-4`}),G?c.confirmDelete:c.delete]}):null,(0,$.jsxs)(`div`,{className:`ml-auto flex gap-2`,children:[(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{variant:`secondary`,disabled:!!W,children:c.cancel})}),(0,$.jsxs)(Z,{variant:`secondary`,disabled:!!W,onClick:()=>void he(),children:[W===`test`?(0,$.jsx)(ge,{className:`size-4 animate-spin`}):null,W===`test`?c.testing:c.test]}),(0,$.jsxs)(Z,{variant:`primary`,disabled:!!W,onClick:()=>void me(),children:[W===`save`?(0,$.jsx)(ge,{className:`size-4 animate-spin`}):null,W===`save`?c.saving:c.save]})]})]})]})]})})}var on=`••••••••••••`,sn={en:{title:`Image generation`,intro:`Configure the default image model and service. Agents inherit this setting unless overridden in Agent settings.`,provider:`Provider`,model:`Model`,apiKey:`API key`,getApiKey:`Get API key`,apiKeyHint:`Stored in the local credential store, never in xopc.json.`,existingKey:`A credential or environment variable is already available. Leave this blank to reuse it.`,savedKey:`A credential is saved. Use the eye button to view it, or type a new key to replace it.`,revealFailed:`Unable to load the saved API key.`,keyNotRevealable:`This credential comes from an environment variable or another non-revealable source.`,advanced:`Provider settings`,enable:`Enable image generation`,enabling:`Verifying and enabling…`,enabled:`Image generation is ready.`,addService:`Add image service`,manageService:`Manage service`,custom:`Custom`,current:`Current`,configured:`Credential ready`,needsKey:`API key required`,connect:`Connect to a gateway to continue.`,loadError:`Unable to load image generation settings.`,selectModel:`Select a model`,show:`Show key`,hide:`Hide key`,copy:`Copy key`,copied:`Copied`},zh:{title:`图片生成`,intro:`配置全局图片生成模型和服务。各智能体默认继承此设置,也可在智能体详情中单独覆盖。`,provider:`Provider`,model:`模型`,apiKey:`API Key`,getApiKey:`获取 API Key`,apiKeyHint:`密钥只保存在本机凭据存储中,不会写入 xopc.json。`,existingKey:`已有凭据或环境变量;留空即可继续使用。`,savedKey:`凭据已保存。点击眼睛可查看,直接输入新密钥可替换。`,revealFailed:`无法读取已保存的 API Key。`,keyNotRevealable:`当前凭据来自环境变量或其他不可查看的来源。`,advanced:`服务商设置`,enable:`启用图片生成`,enabling:`正在验证并启用…`,enabled:`图片生成已可用。`,addService:`添加图片服务`,manageService:`管理服务`,custom:`自定义`,current:`当前使用`,configured:`凭据已就绪`,needsKey:`需要 API Key`,connect:`请先连接网关。`,loadError:`无法加载图片生成设置。`,selectModel:`选择模型`,show:`显示密钥`,hide:`隐藏密钥`,copy:`复制密钥`,copied:`已复制`}};async function cn(){let e=await m(d(`/api/image-generation/default`));if(!e.payload)throw Error(`Invalid default image generation response`);return e.payload}function ln(e){let t=e?.indexOf(`/`)??-1;return t>0?e.slice(0,t):void 0}function un(e){let t=e?.indexOf(`/`)??-1;return t>0?e.slice(t+1):void 0}function dn(e){return Object.fromEntries(e.configFields.map(t=>[t.key,e.config[t.key]??(t.required?t.options?.[0]?.value??``:``)]))}function fn(e){let t=(0,$t.c)(11),{field:n,value:r,onChange:i}=e,a;t[0]!==n.label||t[1]!==n.options||t[2]!==n.placeholder||t[3]!==n.required||t[4]!==n.type||t[5]!==i||t[6]!==r?(a=n.type===`select`?(0,$.jsx)(j,{value:r,options:(n.options??[]).map(pn),placeholder:n.placeholder??n.label,allowEmpty:!n.required,onChange:i,triggerClassName:`mt-1.5`}):(0,$.jsx)(`input`,{type:`url`,value:r,required:n.required,onChange:e=>i(e.target.value),placeholder:n.placeholder,className:`mt-1.5 h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),t[0]=n.label,t[1]=n.options,t[2]=n.placeholder,t[3]=n.required,t[4]=n.type,t[5]=i,t[6]=r,t[7]=a):a=t[7];let o;return t[8]!==n.label||t[9]!==a?(o=(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[n.label,a]}),t[8]=n.label,t[9]=a,t[10]=o):o=t[10],o}function pn(e){return{value:e.value,label:e.label}}function mn(){let e=(0,$t.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Y,{className:`h-24 rounded-xl`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`grid gap-4`,"aria-hidden":`true`,children:[t,(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:Array.from({length:5}).map(hn)}),(0,$.jsx)(Y,{className:`h-64 rounded-xl`})]}),e[1]=n):n=e[1],n}function hn(e,t){return(0,$.jsx)(Y,{className:`h-24 rounded-xl`},t)}function gn({connectOnly:e=!1,onConnected:t,onPendingChange:n}={}){let r=p(e=>e.language),a=sn[r],o=!!f(e=>e.conversationId),[s,c]=(0,Q.useState)(``),[l,u]=(0,Q.useState)(``),[h,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)({}),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1),[C,T]=(0,Q.useState)(null);(0,Q.useEffect)(()=>(n?.(y||x),()=>n?.(!1)),[y,x,n]);let[E,D]=(0,Q.useState)(),[O,k]=(0,Q.useState)(!1),[A,N]=(0,Q.useState)(!1),[ee,P]=(0,Q.useState)(),{data:F,isLoading:I,error:L,mutate:R}=X(o?d(`/api/image-generation/catalog`):null,Jt,{revalidateOnFocus:!1}),{data:z,isLoading:B,error:V,mutate:H}=X(o?d(`/api/image-generation/custom-providers`):null,Kt,{revalidateOnFocus:!1}),{data:U,isLoading:te,error:W,mutate:ne}=X(o?`default-image-generation`:null,cn,{revalidateOnFocus:!1});(0,Q.useEffect)(()=>{if(!F||!U)return;let e=ln(U.model?.primary),t=F.find(t=>t.id===e)??F.find(e=>e.configured)??F[0];t&&(c(t.id),u(t.id===e&&un(U.model?.primary)||t.defaultModel),g(t.configured?on:``),v(dn(t)))},[U,F]);let G=F?.find(e=>e.id===s),re=G?G.apiKeyUrl??q(G.id,r)[0]?.href:void 0,ie=(0,Q.useMemo)(()=>[...G?.models??[]].sort(tt).map(e=>({value:e,label:e})),[G?.models]),K=U?.model?.primary,ae=!!(G&&l&&(G.credentialMode!==`api-key`||G.configured||h.trim())&&G.configFields.every(e=>!e.required||_[e.key]?.trim()));if(!o)return(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a.connect});if(I||B||te)return(0,$.jsx)(mn,{});if(L||V||W||!F||!z)return(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:a.loadError});let oe=e=>{c(e.id),u(e.defaultModel),g(e.configured?on:``),v(dn(e)),D(void 0)},se=()=>{P(void 0),N(!0)},ce=()=>{let e=z.find(e=>e.providerId===G?.id);e&&(P(e),N(!0))},le=async n=>{let[r,i]=await Promise.all([H(),R()]);if(n&&i?.some(e=>e.id===n)){let a=i.find(e=>e.id===n);c(a.id),u(a.defaultModel),g(a.configured?on:``),v(dn(a)),P(r?.find(e=>e.providerId===n)),e&&a.configured&&t?.()}},ue=async()=>{if(!(!G||!ae)){b(!0),D(void 0),k(!1);try{if(e){h.trim()&&!Ge(h)&&await Wt(G.id,h.trim()),Object.keys(_).length&&await m(d(`/api/config`),{method:`PATCH`,body:JSON.stringify({providersConfig:{[G.id]:_}})});let[e]=await Promise.all([R(),je()]);if(!e?.find(e=>e.id===G.id)?.configured)throw Error(r===`zh`?`连接尚未就绪,请先完成对应服务的授权或凭据设置。`:`Connection is not ready. Complete authorization or credentials first.`);k(!0),t?.();return}let n=await m(d(`/api/image-generation/default/setup`),{method:`POST`,body:JSON.stringify({providerId:G.id,modelId:l,...h.trim()&&!Ge(h)?{apiKey:h.trim()}:{},providerConfig:Object.fromEntries(Object.entries(_).filter(([,e])=>e.trim()))})});if(!n.payload)throw Error(`Invalid setup response`);await Promise.all([ne(n.payload.default,{revalidate:!1}),R(n.payload.providers,{revalidate:!1}),i(async()=>{let{mutate:e}=await import(`./vendor-swr-CdRzEUwF.js`).then(e=>e.r);return{mutate:e}},__vite__mapDeps([0,1,2])).then(({mutate:e})=>Promise.all([e(`settings-agent-defaults`),e(`settings-gateway-agents`)])),je()]),g(on),k(!0)}catch(e){D(e instanceof Error?e.message:String(e))}finally{b(!1)}}};return(0,$.jsxs)(`div`,{ref:T,className:`flex flex-col gap-4`,children:[(0,$.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`div`,{className:`rounded-lg bg-accent/10 p-2 text-accent`,children:(0,$.jsx)(me,{className:`size-5`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:a.title}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:e?r===`zh`?`连接图片来源,不修改默认模型,也不发送生成测试请求。`:`Connect image sources without changing defaults or sending generation tests.`:a.intro})]})]})}),(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:a.provider}),(0,$.jsxs)(Z,{variant:`secondary`,className:`px-2.5 py-1.5 text-xs`,onClick:se,children:[(0,$.jsx)(ye,{className:`size-4`}),a.addService]})]}),(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:F.map(e=>{let t=e.id===s,n=e.id===ln(K);return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>oe(e),className:`min-h-24 rounded-xl p-4 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${t?`bg-accent-soft shadow-surface`:`bg-surface-base/55 hover:bg-surface-hover`}`,children:[(0,$.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate font-medium text-fg`,children:e.label}),e.source===`custom`?(0,$.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2 py-0.5 text-[10px] text-fg-subtle`,children:a.custom}):null]}),(0,$.jsx)(`span`,{"aria-hidden":!n,className:`shrink-0 rounded-full bg-accent/10 px-2 py-0.5 text-[11px] font-medium text-accent ${n?``:`invisible`}`,children:a.current})]}),(0,$.jsxs)(`span`,{className:`mt-2 flex items-center gap-1.5 text-xs ${e.configured?`text-emerald-600 dark:text-emerald-400`:`text-fg-muted`}`,children:[e.configured||e.credentialMode!==`api-key`?(0,$.jsx)(M,{className:`size-3.5`}):(0,$.jsx)(he,{className:`size-3.5`}),e.configured||e.credentialMode!==`api-key`?a.configured:a.needsKey]})]},e.id)})})]}),G?(0,$.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[e?null:(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a.model,(0,$.jsx)(j,{value:l,options:ie,placeholder:a.selectModel,allowEmpty:!1,onChange:u,triggerClassName:`mt-1.5`})]}),G.configFields.filter(e=>e.required).map(e=>(0,$.jsx)(fn,{field:e,value:_[e.key]??``,onChange:t=>v(n=>({...n,[e.key]:t}))},e.key))]}),G.source===`custom`?(0,$.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,$.jsxs)(Z,{variant:`secondary`,onClick:ce,children:[(0,$.jsx)(xe,{className:`size-4`}),a.manageService]})}):null,G.credentialMode===`api-key`?(0,$.jsxs)(`div`,{className:`mt-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`label`,{htmlFor:`image-generation-api-key`,className:`text-xs font-medium text-fg-muted`,children:a.apiKey}),re?(0,$.jsxs)(`a`,{href:re,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs font-medium text-accent hover:underline`,children:[a.getApiKey,(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":`true`})]}):null]}),(0,$.jsx)(fe,{id:`image-generation-api-key`,value:h,onChange:e=>g(Ge(h)?e.replace(/^•+/,``):e),placeholder:G.configured?a.existingKey:a.needsKey,labels:{show:a.show,hide:a.hide,copy:a.copy,copied:a.copied},reveal:()=>yt(G.id).then(e=>e.apiKey),loadFailedLabel:a.revealFailed,notInConfigFile:a.keyNotRevealable,className:`mt-1.5`,autoComplete:`new-password`},G.id),(0,$.jsx)(`span`,{className:`mt-1.5 block font-normal leading-relaxed text-fg-subtle`,children:G.configured?a.savedKey:a.apiKeyHint})]}):null,G.configFields.some(e=>!e.required)?(0,$.jsxs)(`details`,{className:`mt-4 rounded-lg bg-surface-base/55 px-3 py-2.5`,children:[(0,$.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 text-sm font-medium text-fg-muted`,children:[(0,$.jsx)(Ce,{className:`size-4`}),a.advanced]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-3 md:grid-cols-2`,children:G.configFields.filter(e=>!e.required).map(e=>(0,$.jsx)(fn,{field:e,value:_[e.key]??``,onChange:t=>v(n=>({...n,[e.key]:t}))},e.key))})]}):null,O?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-emerald-500/10 px-3 py-2 text-sm text-emerald-700 dark:text-emerald-300`,role:`status`,children:e?r===`zh`?`连接已保存`:`Connection saved`:a.enabled}):null,E?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-400`,children:E}):null,(0,$.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,$.jsxs)(Z,{variant:`primary`,disabled:!ae||y,onClick:()=>void ue(),children:[y?(0,$.jsx)(ge,{className:`size-4 animate-spin`}):(0,$.jsx)(M,{className:`size-4`}),(0,$.jsxs)(`span`,{className:`grid`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:a.enable}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:a.enabling}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:e?y?r===`zh`?`保存中…`:`Saving…`:r===`zh`?`保存图片连接`:`Save image connection`:y?a.enabling:a.enable})]})]})})]}):null,(0,$.jsx)(an,{portalContainer:C?.closest(`[role="dialog"]`),onPendingChange:S,open:A,onOpenChange:N,provider:ee,configured:!!(ee&&F.find(e=>e.id===ee.providerId)?.configured),language:r,onSaved:le})]})}function _n(e){return e.some(e=>e.disabled?!1:e.type===`searxng`?e.url.trim().length>0:e.apiKey.trim().length>0)}function vn(e){let t=e&&typeof e==`object`&&`tools`in e?e.tools:void 0,n=t&&typeof t==`object`&&`web`in t?t.web:void 0,r=n&&typeof n==`object`&&`region`in n?n.region:void 0,i=r===`cn`||r===`global`?r:`auto`,a=n&&typeof n==`object`&&`search`in n?n.search:void 0,o=a&&typeof a==`object`?a:{},s=typeof o.maxResults==`number`&&Number.isFinite(o.maxResults)?Math.floor(o.maxResults):5,c=n&&typeof n==`object`&&`blocklist`in n?n.blocklist:void 0,l=c&&typeof c==`object`?c:{},u=Array.isArray(l.domains)?l.domains.filter(e=>typeof e==`string`&&e.trim().length>0):[],d=o.providers;return{regionMode:i,maxResults:s,providers:Array.isArray(d)?d.map((e,t)=>{let n=e&&typeof e==`object`?e:{},r=n.type,i=r===`brave`||r===`tavily`||r===`bing`||r===`searxng`||r===`deepseek`?r:`brave`;return{clientKey:`search-provider-${t}`,type:i,apiKey:typeof n.apiKey==`string`?n.apiKey:``,url:typeof n.url==`string`?n.url:``,disabled:n.disabled===!0}}):[],blocklistEnabled:l.enabled===!0,blocklistDomains:u}}async function yn(e){let t=e.regionMode===`auto`?`auto`:e.regionMode===`cn`?`cn`:`global`,n={maxResults:e.maxResults,providers:e.providers.map(e=>{let t={type:e.type,apiKey:e.apiKey};return(e.type===`searxng`||e.type===`deepseek`)&&e.url.trim()&&(t.url=e.url.trim().replace(/\/+$/,``)),e.disabled&&(t.disabled=!0),t})};await m(d(`/api/config`),{method:`PATCH`,body:JSON.stringify({tools:{web:{region:t,search:n,blocklist:{enabled:e.blocklistEnabled,domains:e.blocklistDomains}}}})}),je()}async function bn(e){let t=await m(d(`/api/tools/web/reveal-search-api-key`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({index:e})});if(!t.ok||!t.payload)throw Error(t.error?.message??`Reveal failed`);return t.payload}function xn(e){let t=(0,$t.c)(8),{label:n,description:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-subtle`,children:r}),t[2]=r,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[a,i,o]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Sn(){return J(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,We,`dark:border-edge`)}function Cn(){return J(Ue,He)}var wn=[`brave`,`tavily`,`bing`,`searxng`,`deepseek`];function Tn(){return{clientKey:crypto.randomUUID(),type:`brave`,apiKey:``,url:``,disabled:!1}}var En=Ze();function Dn(){let e=h(p(e=>e.language)),t=e.webSearchSettings,n=e.logs,r=!!f(e=>e.conversationId),[i,a]=(0,Q.useReducer)(En,{form:null,baseline:null}),o=i.form,s=i.baseline,c=(0,Q.useRef)(!1),l=(0,Q.useRef)(o);l.current=o;let u=(0,Q.useRef)(null),{data:d,error:m,isLoading:g,mutate:_}=Me(r);Xe({enabled:r,parsed:(0,Q.useMemo)(()=>d?.payload?.config===void 0?null:vn(d.payload.config),[d]),dirty:c.current,trackedParsedRef:u,dispatch:a,onResetDirty:()=>{c.current=!1}});let v=!!(r&&g&&d===void 0&&!m),y=m instanceof Error?m.message:m?String(m):null,b=(0,Q.useMemo)(()=>!o||!s?!1:JSON.stringify(o)!==JSON.stringify(s),[o,s]),x=(0,Q.useCallback)(e=>{c.current=!0,a({type:`patch`,patch:e})},[]),S=Lt({value:o,dirty:b,onSave:(0,Q.useCallback)(async e=>{try{await yn(e),a({type:`saved`,value:e}),c.current=!!(l.current&&JSON.stringify(l.current)!==JSON.stringify(e))}catch(e){throw Error(e instanceof Error?e.message:t.saveError)}},[t.saveError])});if(!r)return(0,$.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.needToken})});if(v)return(0,$.jsx)(st,{rows:3});if(!o)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:y??t.loadError}),(0,$.jsx)(Z,{type:`button`,variant:`secondary`,onClick:()=>void _(),children:n.refresh})]});let C=_n(o.providers);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,onBlurCapture:S.onBlurCapture,children:[S.error?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:S.error}):null,(0,$.jsxs)(Ft,{children:[(0,$.jsx)(Pt,{icon:ve,title:t.sectionSearch,subtitle:t.sectionSearchHint,trailing:(0,$.jsx)(It,{status:S.status,error:S.error})}),(0,$.jsxs)(`div`,{className:`flex max-w-2xl flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-edge bg-surface-base/55 px-4 py-3`,children:[(0,$.jsx)(ue,{className:`mt-0.5 size-5 shrink-0 text-accent`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:t.cloudProvider}),(0,$.jsx)(`span`,{className:J(`rounded-full px-2 py-0.5 text-[11px] font-medium`,C?`bg-surface-panel text-fg-muted`:`bg-accent-soft text-accent`),children:C?t.cloudOverridden:t.cloudAutomatic})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-subtle`,children:C?t.cloudOverriddenHint:t.cloudAutomaticHint})]})]}),(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:t.providersTitle}),o.providers.map((n,r)=>(0,$.jsx)(On,{row:n,providerIndex:r,labels:t,secretLabels:Ke(e.providersSettings),onChange:e=>{let t=[...o.providers];t[r]=e,x({providers:t})},onRemove:()=>{x({providers:o.providers.filter((e,t)=>t!==r)})}},n.clientKey??r)),(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,className:`w-fit gap-1.5 text-sm`,onClick:()=>x({providers:[...o.providers,Tn()]}),children:[(0,$.jsx)(ye,{className:`size-4`}),t.addProvider]})]})]}),(0,$.jsxs)(Ft,{children:[(0,$.jsx)(Pt,{icon:Ce,title:t.sectionPreferences}),(0,$.jsxs)(`div`,{className:`grid max-w-2xl gap-4 sm:grid-cols-2`,children:[(0,$.jsx)(xn,{label:t.regionLabel,description:t.regionDesc,children:(0,$.jsxs)(k,{className:Cn(),value:o.regionMode,onChange:e=>x({regionMode:e.target.value}),children:[(0,$.jsx)(A,{value:`auto`,children:t.regionAuto}),(0,$.jsx)(A,{value:`cn`,children:t.regionCn}),(0,$.jsx)(A,{value:`global`,children:t.regionGlobal})]})}),(0,$.jsx)(Dt,{title:t.maxResultsLabel,summary:o.maxResults,children:(0,$.jsx)(xn,{label:t.maxResultsLabel,description:t.maxResultsDesc,children:(0,$.jsx)(jt,{type:`number`,min:1,max:50,className:Sn(),value:o.maxResults,onChange:e=>x({maxResults:Math.max(1,Math.min(50,Number(e.target.value)||5))})})})})]})]}),(0,$.jsxs)(`details`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,$.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:[t.sectionBlocklist,` · `,o.blocklistEnabled?o.blocklistDomains.length:0]}),(0,$.jsxs)(Ft,{children:[(0,$.jsx)(Pt,{icon:Se,title:t.sectionBlocklist,subtitle:t.sectionBlocklistHint}),(0,$.jsxs)(`div`,{className:`flex max-w-2xl flex-col gap-4`,children:[(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:o.blocklistEnabled,onChange:e=>x({blocklistEnabled:e.target.checked})}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:t.blocklistEnabled}),(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-subtle`,children:t.blocklistEnabledDesc})]})]}),o.blocklistEnabled?(0,$.jsx)(xn,{label:t.blocklistDomains,description:t.blocklistDomainsDesc,children:(0,$.jsx)(`textarea`,{className:J(Sn(),`min-h-[6rem] font-mono text-xs`),value:o.blocklistDomains.join(`
8
+ `),placeholder:t.blocklistDomainsPlaceholder,onChange:e=>{let t=e.target.value.split(/\r?\n/).flatMap(e=>{let t=e.trim().toLowerCase();return t?[t]:[]});x({blocklistDomains:t})}})}):null]})]})]})]})}function On(e){let t=(0,$t.c)(56),{row:n,providerIndex:r,labels:i,secretLabels:a,onChange:o,onRemove:s}=e,c;t[0]===r?c=t[1]:(c=()=>bn(r).then(kn),t[0]=r,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=J(Cn(),`min-w-[8rem]`),t[2]=u):u=t[2];let d=n.type,f;t[3]!==o||t[4]!==n?(f=e=>o({...n,type:e.target.value,url:``,apiKey:``}),t[3]=o,t[4]=n,t[5]=f):f=t[5];let p;t[6]===i.providerTypes?p=t[7]:(p=wn.map(e=>(0,$.jsx)(A,{value:e,children:i.providerTypes[e]},e)),t[6]=i.providerTypes,t[7]=p);let m;t[8]!==n.type||t[9]!==f||t[10]!==p?(m=(0,$.jsx)(k,{className:u,value:d,onChange:f,children:p}),t[8]=n.type,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==o||t[13]!==n?(h=e=>o({...n,disabled:e.target.checked}),t[12]=o,t[13]=n,t[14]=h):h=t[14];let g;t[15]!==n.disabled||t[16]!==h?(g=(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:n.disabled,onChange:h}),t[15]=n.disabled,t[16]=h,t[17]=g):g=t[17];let _;t[18]!==i.disabled||t[19]!==g?(_=(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-xs text-fg-muted`,children:[g,i.disabled]}),t[18]=i.disabled,t[19]=g,t[20]=_):_=t[20];let v;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(we,{className:`size-4`}),t[21]=v):v=t[21];let y;t[22]===s?y=t[23]:(y=(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-fg-muted`,onClick:s,children:v}),t[22]=s,t[23]=y);let b;t[24]!==y||t[25]!==_?(b=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,y]}),t[24]=y,t[25]=_,t[26]=b):b=t[26];let x;t[27]!==b||t[28]!==m?(x=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[m,b]}),t[27]=b,t[28]=m,t[29]=x):x=t[29];let S;t[30]!==i.deepseekUrlDesc||t[31]!==i.deepseekUrlLabel||t[32]!==i.urlDesc||t[33]!==i.urlLabel||t[34]!==o||t[35]!==n?(S=n.type===`searxng`||n.type===`deepseek`?(0,$.jsx)(xn,{label:n.type===`deepseek`?i.deepseekUrlLabel:i.urlLabel,description:n.type===`deepseek`?i.deepseekUrlDesc:i.urlDesc,children:(0,$.jsx)(`input`,{type:`url`,className:Sn(),value:n.url,placeholder:n.type===`deepseek`?`https://api.deepseek.com`:`http://localhost:8080`,onChange:e=>o({...n,url:e.target.value})})}):null,t[30]=i.deepseekUrlDesc,t[31]=i.deepseekUrlLabel,t[32]=i.urlDesc,t[33]=i.urlLabel,t[34]=o,t[35]=n,t[36]=S):S=t[36];let C;t[37]!==o||t[38]!==n?(C=e=>o({...n,apiKey:e}),t[37]=o,t[38]=n,t[39]=C):C=t[39];let w;t[40]!==i.keyPlaceholder||t[41]!==i.keyPlaceholderMasked||t[42]!==i.saveError||t[43]!==l||t[44]!==n.apiKey||t[45]!==a||t[46]!==C?(w=(0,$.jsx)(fe,{value:n.apiKey,onChange:C,placeholder:i.keyPlaceholder,labels:a,reveal:l,loadFailedLabel:i.saveError,notInConfigFile:i.keyPlaceholderMasked}),t[40]=i.keyPlaceholder,t[41]=i.keyPlaceholderMasked,t[42]=i.saveError,t[43]=l,t[44]=n.apiKey,t[45]=a,t[46]=C,t[47]=w):w=t[47];let T;t[48]!==i.apiKeyDesc||t[49]!==i.apiKeyLabel||t[50]!==w?(T=(0,$.jsx)(xn,{label:i.apiKeyLabel,description:i.apiKeyDesc,children:w}),t[48]=i.apiKeyDesc,t[49]=i.apiKeyLabel,t[50]=w,t[51]=T):T=t[51];let E;return t[52]!==x||t[53]!==S||t[54]!==T?(E=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl bg-surface-panel/60 p-4`,children:[x,S,T]}),t[52]=x,t[53]=S,t[54]=T,t[55]=E):E=t[55],E}function kn(e){return e.apiKey??null}function An(e,t,n=[]){return e.filter(e=>!n.includes(e.providerId)&&e.uses.some(e=>e.id===t&&e.choices.length>0))}function jn(e){let t=(0,$t.c)(75),{use:n,data:r,language:i,labels:a,onSaved:o,inline:s,onPendingChange:c,onEditingChange:l}=e,u=s!==void 0&&s,d=i===`zh`,[f,p]=(0,Q.useState)(),[m,h]=(0,Q.useState)(!1),g;t[0]===c?g=t[1]:(g=e=>{h(e),c?.(e)},t[0]=c,t[1]=g);let _=g,v=n===`transcription`?`stt`:n===`speech`?`tts`:void 0,y,b,x;if(t[2]!==r.builtinRows||t[3]!==r.cards||t[4]!==r.customConfig?.providers||t[5]!==r.loading||t[6]!==n){let e=new Set(r.cards.filter(e=>!re(e.id)||!!r.customConfig?.providers?.[e.id]).map(Bn));y=[...new Set([...r.builtinRows.map(zn),...e])].filter(t=>!re(t)||e.has(t)).sort(),b=X,x=r.loading?null:[`capability-service-connections`,n,y.join(`,`)],t[2]=r.builtinRows,t[3]=r.cards,t[4]=r.customConfig?.providers,t[5]=r.loading,t[6]=n,t[7]=y,t[8]=b,t[9]=x}else y=t[7],b=t[8],x=t[9];let S;t[10]!==y||t[11]!==n||t[12]!==v?(S=async()=>{let e=v===`stt`?await Rt():v===`tts`?await Ht():void 0,t=e?.providers.filter(Rn).map(Ln),r=e?.providers.filter(In).map(Fn)??[],i=t?y.filter(e=>t.includes(e)):y,a=await Promise.allSettled(i.map(ee));return{services:An(a.flatMap(Pn),n,r),failed:a.some(Nn)}},t[10]=y,t[11]=n,t[12]=v,t[13]=S):S=t[13];let C;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(C={revalidateOnFocus:!1},t[14]=C):C=t[14];let{data:w,error:T,isLoading:E,mutate:D}=b(x,S,C),O;t[15]===w?.services?O=t[16]:(O=new Set(w?.services.map(Mn)),t[15]=w?.services,t[16]=O);let k=O,A,j;if(t[17]!==l||t[18]!==f?(A=()=>(l?.(!!f),()=>l?.(!1)),j=[f,l],t[17]=l,t[18]=f,t[19]=A,t[20]=j):(A=t[19],j=t[20]),(0,Q.useEffect)(A,j),f&&u){let e;if(t[21]!==r.builtinRows||t[22]!==f){let n;t[24]===f?n=t[25]:(n=e=>e.id===f,t[24]=f,t[25]=n),e=r.builtinRows.find(n),t[21]=r.builtinRows,t[22]=f,t[23]=e}else e=t[23];let a;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>p(void 0),t[26]=a):a=t[26];let s;t[27]!==D||t[28]!==o?(s=()=>{D(),p(void 0),o()},t[27]=D,t[28]=o,t[29]=s):s=t[29];let c;return t[30]!==i||t[31]!==f||t[32]!==_||t[33]!==e||t[34]!==s||t[35]!==n?(c=(0,$.jsx)(`section`,{className:`overflow-hidden rounded-xl border border-edge`,children:(0,$.jsx)(I,{inline:!0,providerId:f,row:e,targetUse:n,language:i,onPendingChange:_,onDone:a,onApplied:s},f)}),t[30]=i,t[31]=f,t[32]=_,t[33]=e,t[34]=s,t[35]=n,t[36]=c):c=t[36],c}let M=d?`选择服务`:`Choose a service`,N;t[37]===M?N=t[38]:(N=(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:M}),t[37]=M,t[38]=N);let P;t[39]!==r.loading||t[40]!==E?(P=r.loading||E?(0,$.jsx)(Y,{className:`h-24 w-full`}):null,t[39]=r.loading,t[40]=E,t[41]=P):P=t[41];let F;t[42]!==w?.failed||t[43]!==T||t[44]!==D||t[45]!==d?(F=T||w?.failed?(0,$.jsxs)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:[d?`部分服务目录暂时不可用。`:`Some service catalogs are unavailable.`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void D(),children:d?`重试`:`Retry`})]}):null,t[42]=w?.failed,t[43]=T,t[44]=D,t[45]=d,t[46]=F):F=t[46];let L;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(L=[!0,!1],t[47]=L):L=t[47];let R;t[48]!==m||t[49]!==w?.services||t[50]!==d?(R=L.map(e=>{let t=w?.services.filter(t=>t.configured===e)??[];return t.length?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:e?d?`已连接`:`Connected`:d?`添加服务`:`Add a service`}),t.map(t=>(0,$.jsxs)(`button`,{type:`button`,disabled:m,onClick:()=>p(t.providerId),className:`flex min-h-14 w-full items-center justify-between gap-3 rounded-lg px-3 py-3 text-left transition-colors hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,children:[(0,$.jsx)(`span`,{className:`min-w-0 text-sm font-medium text-fg`,children:te(t.providerId,t.profile.name,d)}),(0,$.jsx)(`span`,{className:`shrink-0 text-sm text-accent-fg`,children:e?d?`选择`:`Choose`:d?`连接`:`Connect`})]},t.providerId))]},String(e)):null}),t[48]=m,t[49]=w?.services,t[50]=d,t[51]=R):R=t[51];let z;t[52]!==w||t[53]!==d?(z=w&&!w.services.length&&!w.failed?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`暂无支持此能力的模型服务。`:`No model services currently support this capability.`}):null,t[52]=w,t[53]=d,t[54]=z):z=t[54];let B=d?`仅列出支持${lt[n][0]}的服务。`:`Only compatible services are shown. Reuse saved credentials, then return to select a model.`,V;t[55]===B?V=t[56]:(V=(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:B}),t[55]=B,t[56]=V);let H;t[57]!==r.builtinRows||t[58]!==r.customConfig||t[59]!==k||t[60]!==a||t[61]!==i||t[62]!==D||t[63]!==o||t[64]!==f||t[65]!==n?(H=f?(0,$.jsx)(ie,{open:!0,initialProviderId:f,initialUse:n,connectOnly:!0,onOpenChange:e=>{e||p(void 0)},builtinRows:r.builtinRows.filter(e=>k.has(e.id)),customConfig:r.customConfig,labels:a,language:i,onSaved:()=>{D(),p(void 0),o()}},f):null,t[57]=r.builtinRows,t[58]=r.customConfig,t[59]=k,t[60]=a,t[61]=i,t[62]=D,t[63]=o,t[64]=f,t[65]=n,t[66]=H):H=t[66];let U;return t[67]!==N||t[68]!==P||t[69]!==F||t[70]!==R||t[71]!==z||t[72]!==V||t[73]!==H?(U=(0,$.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-edge p-4`,children:[N,P,F,R,z,V,H]}),t[67]=N,t[68]=P,t[69]=F,t[70]=R,t[71]=z,t[72]=V,t[73]=H,t[74]=U):U=t[74],U}function Mn(e){return e.providerId}function Nn(e){return e.status===`rejected`}function Pn(e){return e.status===`fulfilled`?[e.value]:[]}function Fn(e){return e.id}function In(e){return e.diagnostics.requiresApiKey}function Ln(e){return e.id}function Rn(e){return!e.diagnostics.requiresApiKey}function zn(e){return e.id}function Bn(e){return e.id}function Vn({zh:e,kind:t,modelServiceIds:n,onSaved:r,onPendingChange:i}){let{data:a,error:o,mutate:s}=X([`native-voice-connections`,t??`all`,n.join(`,`)],async()=>{let[e,r]=await Promise.all([t===`tts`?Promise.resolve({providers:[]}):Rt(),t===`stt`?Promise.resolve({providers:[]}):Ht()]);return[...e.providers.map(e=>({...e,kind:`stt`})),...r.providers.map(e=>({...e,kind:`tts`}))].filter(e=>e.diagnostics.requiresApiKey||!n.includes(e.id))}),[c,l]=(0,Q.useState)(``),[u,f]=(0,Q.useState)({}),[p,h]=(0,Q.useState)(!1),g=(0,Q.useRef)(!1),[_,v]=(0,Q.useState)(``);(0,Q.useEffect)(()=>(i?.(p),()=>i?.(!1)),[p,i]);let y=a?.find(e=>`${e.kind}:${e.id}`===c),b=y?.fields.filter(e=>e.secret||e.type===`password`||[`baseUrl`,`region`,`groupId`].includes(e.key))??[],x=async()=>{if(!(!y||g.current)){g.current=!0,h(!0),v(``);try{let t=Object.fromEntries(Object.entries(u).filter(([,e])=>e.trim()).map(([e,t])=>[e,t.trim()]));Object.keys(t).length&&await m(d(`/api/config`),{method:`PATCH`,body:JSON.stringify({[y.kind]:{providers:{[y.id]:t}}})});let[n]=await Promise.all([s(),pt()]);if(!n?.find(e=>e.kind===y.kind&&e.id===y.id)?.configured)throw Error(e?`连接尚未就绪,请补齐所需凭据。`:`Connection is not ready. Complete the required credentials.`);f({}),r()}catch(e){v(e instanceof Error?e.message:String(e))}finally{g.current=!1,h(!1)}}};return a&&!a.length?null:(0,$.jsxs)(`details`,{className:`rounded-xl border border-edge p-4`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:e?`其他语音服务与本地语音`:`Other voice services and local speech`}),(0,$.jsxs)(`section`,{className:`mt-4 space-y-4`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t===`stt`?e?`其他识别服务`:`Other recognition services`:t===`tts`?e?`其他合成服务与本地语音`:`Other synthesis services and local speech`:e?`语音 API 与本地语音`:`Voice APIs and local speech`}),!a&&!o?(0,$.jsx)(Y,{className:`h-20 w-full`}):null,o?(0,$.jsxs)(`p`,{role:`alert`,children:[e?`语音服务加载失败`:`Could not load voice services`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void s(),children:e?`重试`:`Retry`})]}):null,(0,$.jsxs)(k,{value:c,disabled:p,"aria-label":e?`语音服务接入`:`Connect voice service`,onChange:e=>{l(e.target.value),f({}),v(``)},children:[(0,$.jsx)(A,{value:``,children:e?`选择语音来源`:`Choose a voice source`}),a?.map(n=>(0,$.jsxs)(A,{value:`${n.kind}:${n.id}`,children:[n.displayName,t?``:` · ${n.kind.toUpperCase()}`,n.configured?e?` · 已连接`:` · Connected`:``]},`${n.kind}:${n.id}`))]}),y?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:y.diagnostics.requiresApiKey?e?`此服务使用独立的 API Key。保存连接后,可在“模型与参数”中选用。`:`This service uses its own API key. Save the connection, then choose it in Model and parameters.`:e?`此来源无需 API Key,可返回能力设置选择。`:`No API key needed. Choose this source in capability settings.`}),b.map(t=>(0,$.jsxs)(`label`,{className:`block space-y-1 text-sm text-fg`,children:[(0,$.jsx)(`span`,{children:t.label}),t.secret||t.type===`password`?(0,$.jsx)(fe,{labels:qe,value:u[t.key]??``,onChange:e=>f(n=>({...n,[t.key]:e})),disabled:p}):t.options?.length?(0,$.jsxs)(k,{value:u[t.key]??``,disabled:p,onChange:e=>f(n=>({...n,[t.key]:e.target.value})),children:[(0,$.jsx)(A,{value:``,children:e?`保留现有值`:`Keep existing`}),(t.key===`model`?[...t.options].sort(et):t.options).map(e=>(0,$.jsx)(A,{value:e.id,children:e.name},e.id))]}):(0,$.jsx)(`input`,{className:`w-full rounded-lg border border-edge bg-surface-panel p-2`,value:u[t.key]??``,disabled:p,placeholder:t.placeholder,onChange:e=>f(n=>({...n,[t.key]:e.target.value}))})]},t.key)),_?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:_}):null,(0,$.jsx)(Z,{disabled:p||!y.configured&&y.diagnostics.requiresApiKey&&!Object.values(u).some(e=>e.trim()),onClick:()=>void x(),children:p?e?`保存中…`:`Saving…`:e?`保存连接`:`Save connection`})]}):null]})]})}function Hn(e){let t=(0,$t.c)(8),{section:n,title:r,children:i}=e,a;t[0]===r?a=t[1]:(a=(0,$.jsx)(`h3`,{className:`border-b border-edge-subtle bg-surface-inset/40 px-4 py-1.5 text-xs font-medium text-fg-muted`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle px-4`,children:i}),t[2]=i,t[3]=o);let s;return t[4]!==n||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`section`,{"data-model-section":n,className:`min-w-0 border-t border-edge first:border-t-0`,children:[a,o]}),t[4]=n,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Un(e){let t=(0,$t.c)(10),{name:n,manageLabel:r,onManage:i,disabled:a}=e;if(!i){let e;return t[0]===n?e=t[1]:(e=n?(0,$.jsx)(`p`,{className:`px-1 text-xs text-fg-muted`,children:n}):null,t[0]=n,t[1]=e),e}let o=n?`${r} · ${n}`:r,s=n||r,c;t[2]===s?c=t[3]:(c=(0,$.jsx)(`span`,{className:`truncate`,children:s}),t[2]=s,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(O,{className:`size-3 shrink-0`,"aria-hidden":!0}),t[4]=l):l=t[4];let u;return t[5]!==a||t[6]!==i||t[7]!==o||t[8]!==c?(u=(0,$.jsxs)(Z,{variant:`ghost`,disabled:a,"aria-label":o,className:`min-h-8 max-w-full justify-start gap-1 rounded-md px-1 py-1 text-xs font-normal`,onClick:i,children:[c,l]}),t[5]=a,t[6]=i,t[7]=o,t[8]=c,t[9]=u):u=t[9],u}function Wn(e){let t=(0,$t.c)(13),{description:n,picker:r,actions:i,inline:a,actionColumn:o}=e;if(a){let e;return t[0]===r?e=t[1]:(e=(0,$.jsx)(`div`,{className:`min-w-0 space-y-1 py-2`,children:r}),t[0]=r,t[1]=e),e}let s=`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-1 py-2.5 @min-[40rem]:gap-x-4 ${o?`@min-[40rem]:grid-cols-[minmax(0,1fr)_minmax(0,1.35fr)_4.5rem]`:`@min-[40rem]:grid-cols-[minmax(0,1fr)_minmax(0,1.35fr)]`}`,c;t[2]===n?c=t[3]:(c=(0,$.jsx)(`div`,{className:`col-start-1 row-start-1 min-w-0`,children:n}),t[2]=n,t[3]=c);let l;t[4]===r?l=t[5]:(l=(0,$.jsx)(`div`,{className:`col-span-2 row-start-2 w-full min-w-0 @min-[40rem]:col-span-1 @min-[40rem]:col-start-2 @min-[40rem]:row-start-1`,children:r}),t[4]=r,t[5]=l);let u;t[6]===i?u=t[7]:(u=i&&(0,$.jsx)(`div`,{className:`col-start-2 row-start-1 flex justify-end @min-[40rem]:col-start-3`,children:i}),t[6]=i,t[7]=u);let d;return t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,$.jsxs)(`div`,{className:s,children:[c,l,u]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}var Gn=`clear-natural-model`;function Kn({label:e,value:t,currentLabel:n,options:r,loading:i,disabled:a,zh:o,onConnect:s,onManage:c,onSelect:l}){let[u,d]=(0,Q.useState)(``),f=u.trim().toLowerCase().split(/\s+/).filter(Boolean),p=[...r].sort((e,t)=>(e.group??``).localeCompare(t.group??``,`en`,{numeric:!0,sensitivity:`base`})||tt(e.label,t.label)||tt(e.value,t.value)).filter(e=>{let t=`${e.label} ${e.group} ${e.value} ${e.searchText??``}`.toLowerCase();return f.every(e=>t.includes(e))}),m=r.find(e=>e.value===t),h=m?.group??r.find(e=>e.value.split(`/`)[0]===t?.split(`/`)[0])?.group,g=m?.label??(t?.endsWith(`/default`)?o?`默认模型`:`Default model`:n??t),_=h?`${g} · ${h}`:g;return!i&&!r.length?(0,$.jsx)(Z,{variant:`secondary`,className:`min-h-11 w-full sm:justify-start`,"aria-label":`${o?`连接`:`Connect`} ${e}`,disabled:a,onClick:s,children:o?`连接服务以启用`:`Connect a service to enable`}):(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(j,{value:t??``,options:p,selectedLabel:g,title:_,placeholder:o?`选择模型`:`Choose a model`,ariaLabel:`${o?`选择`:`Select`} ${e}`,allowEmpty:!1,disabled:a,loading:i,onChange:l,searchPlaceholder:o?`搜索模型或服务`:`Search models or services`,searchValue:u,onSearchChange:d,statusMessage:p.length?void 0:o?`没有可用模型`:`No available models`,triggerClassName:`min-h-11`}),(0,$.jsx)(Un,{name:h,manageLabel:o?`管理服务`:`Manage services`,onManage:c,disabled:a})]})}function qn({data:e,zh:t,onChange:n,onSettings:r,onlyUse:i,disabled:a=!1,onPendingChange:o,videoRow:s,musicRow:c}){let{data:l,error:u,mutate:f}=X(`settings-agent-defaults`,ot),{data:p}=Me(!0),{data:m,mutate:h}=X(!i||i===`conversation`?d(Ut):null,Vt),{data:g,isLoading:_,error:v,mutate:y}=X(`model-capability-media-sources`,async()=>{let e=await Promise.allSettled([Ht(),Rt(),Jt()]);return{ids:[...new Set(e.flatMap(e=>e.status===`fulfilled`?(Array.isArray(e.value)?e.value:e.value.providers).filter(e=>e.configured).map(e=>e.id):[]))],failed:e.some(e=>e.status===`rejected`)}}),b=[...new Set([...e.cards.filter(t=>t.configured&&(!re(t.id)||!!e.customConfig?.providers?.[t.id])).map(e=>e.id),...g?.ids??[]])].sort(),{data:x,isLoading:S,mutate:C}=X(e.loading?null:[`model-use-choices`,...b],async()=>{let e=await Promise.allSettled(b.map(ee));return{previews:e.flatMap(e=>e.status===`fulfilled`&&e.value.configured?[e.value]:[]),failed:e.some(e=>e.status===`rejected`)}},{revalidateOnFocus:!1}),[w,T]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(null),O=(0,Q.useRef)(!1),k=(0,Q.useRef)(null);(0,Q.useEffect)(()=>()=>o?.(!1),[o]);let A=async(e,t)=>{if(O.current||a)return;let n=x?.previews.find(n=>n.uses.some(n=>n.id===e&&n.choices.some(e=>e.id===t))),r=e===`conversation`&&(t===`boson/higgs-realtime`||t===Gn);if(!n&&!r)return;O.current=!0,o?.(!0),T(e),D(null);let i={mode:`replace`,selected:[e],overrides:{[e]:t}};try{if(r)await h(await zt({defaultForNatural:t===Oe}),{revalidate:!1}),await je();else if(n){let t=await N(n.providerId,i);await le(n.providerId,i,t.revision),await Promise.all([f(),C(),...e===`conversation`?[h(),je()]:[]])}D({use:e})}catch(t){D({use:e,error:t instanceof Error?t.message:String(t)}),Promise.allSettled([f(),C()])}finally{O.current=!1,T(null),o?.(!1),requestAnimationFrame(()=>k.current?.querySelector(`[data-capability="${e}"] button[aria-label]`)?.focus())}},j=p?.payload?.config?Bt(p.payload.config):void 0;if(!l&&!u)return(0,$.jsx)(Y,{className:`h-48 w-full rounded-xl`});if(u)return(0,$.jsxs)(`div`,{role:`alert`,className:`text-sm text-danger`,children:[t?`模型用途加载失败`:`Could not load model uses`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void f(),children:t?`重试`:`Retry`})]});let M=l.defaults.models,P=j?.voice.realtime,F=P?.enabled&&P.omni?`${P.omni.provider}/${P.omni.model}`:void 0,I=m?.defaultForNatural??P?.boson?.defaultForNatural?Oe:F,L=M.background?.primary??M.chat.primary,z=e.builtinRows.find(e=>e.id===L.split(`/`)[0])?.setupProfile?.interactiveOnly!==!0,B=x?.previews[0]?.uses.find(e=>e.id===`background`),V=B?B.current:z?L:void 0,H=[{id:`chat`,label:t?`对话与任务`:`Chat and tasks`,ref:M.chat.primary},{id:`vision`,label:t?`看图`:`Image understanding`,ref:M.imageUnderstanding?.primary},{id:`image`,label:t?`画图`:`Image generation`,ref:M.imageGeneration?.primary},{id:`background`,label:t?`后台任务`:`Background tasks`,ref:V,inherited:!M.background&&!!V},{id:`transcription`,label:t?`录音与听写`:`Recording and dictation`,ref:j?.stt.enabled?`${j.stt.provider}/${j.stt.providers?.[j.stt.provider]?.model??`default`}`:void 0},{id:`speech`,label:t?`语音合成`:`Speech synthesis`,ref:j?.tts.enabled?`${j.tts.provider}/${j.tts.providers?.[j.tts.provider]?.model??`default`}`:void 0},{id:`conversation`,label:t?`自然语音模型`:`Natural voice model`,ref:I}];return(0,$.jsxs)(`section`,{ref:k,className:`@container min-w-0`,children:[(0,$.jsx)(`h2`,{className:i?`mb-2 text-sm font-semibold text-fg`:`sr-only`,children:i?t?`当前模型`:`Current model`:t?`能力总览`:`Capabilities`}),(0,$.jsx)(`div`,{className:i?`space-y-4`:`overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:dt.filter(e=>!i||e.uses.includes(i)).map(o=>{let l=o.uses.filter(e=>!i||e===i).map(o=>{let s=H.find(e=>e.id===o),c=Jn(x?.previews??[],s.id,t);s.id===`conversation`&&((m?.credentialSource||s.ref===`boson/higgs-realtime`)&&c.push({value:Oe,label:`Higgs Realtime`,group:`Boson AI`,disabled:!m?.credentialSource}),s.ref===`boson/higgs-realtime`&&!c.some(e=>e.value!==`boson/higgs-realtime`)&&c.push({value:Gn,label:t?`取消默认模型`:`Clear default model`}));let l=s.ref?e.allModels.find(e=>e.id===s.ref):void 0,u=l?rt(l,t?`zh`:`en`):s.ref;return(0,$.jsx)(`div`,{"data-capability":s.id,children:(0,$.jsx)(Wn,{inline:!!i,actionColumn:!!r,description:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:lt[s.id][+!t]}),(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:s.ref?c.some(e=>e.value===s.ref||s.ref?.endsWith(`/default`)&&e.value.split(`/`)[0]===s.ref.split(`/`)[0])?null:t?`待连接`:`Connection needed`:t?`未配置`:`Not set up`})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:R[s.id][+!t]}),s.inherited?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t?`继承默认对话`:`Inherits chat default`}):null]}),picker:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Kn,{label:s.id===`conversation`?s.label:lt[s.id][+!t],value:s.ref,currentLabel:u,options:c,loading:e.loading||S||_,disabled:w!==null||a,zh:t,onConnect:()=>n(s.id),onManage:r?()=>n(s.id):void 0,onSelect:e=>{e!==s.ref&&A(s.id,e)}}),w===s.id?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:t?`正在切换…`:`Switching…`}):null,E?.use===s.id?(0,$.jsx)(`div`,{role:E.error?`alert`:`status`,className:`text-xs text-fg-muted`,children:E.error?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-danger`,children:t?`未能切换模型,请重试。`:`Could not switch models. Please retry.`}),(0,$.jsxs)(`details`,{className:`mt-1`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:t?`查看详情`:`Show details`}),(0,$.jsx)(`p`,{className:`mt-1 break-words`,children:E.error})]})]}):t?`已切换`:`Model changed`}):null]}),actions:r&&(s.id===`conversation`||c.length>0||S||_)?(0,$.jsx)(Z,{variant:`ghost`,className:`min-h-11`,disabled:w!==null||a,onClick:()=>r(s.id),children:t?`设置`:`Settings`}):null})},s.id)});return i?(0,$.jsx)(`div`,{className:`min-w-0 divide-y divide-edge-subtle`,children:l},o.uses[0]):(0,$.jsxs)(Hn,{section:o.uses[0],title:o.label[+!t],children:[l,o.uses.includes(`vision`)&&s,o.uses.includes(`vision`)&&c]},o.uses[0])})}),(!r||i)&&(x?.failed||g?.failed||v)?(0,$.jsxs)(`p`,{role:`alert`,className:`mt-2 text-xs text-danger`,children:[t?`部分服务的模型加载失败`:`Some model services could not be loaded`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void Promise.all([y(),C()]),children:t?`重试`:`Retry`})]}):null,i||r?null:(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t?`快速与复杂任务模型随对话配置;音色、流式听写及电脑操作可在详细设置中调整。`:`Fast and complex task models follow chat setup. Voices, streaming dictation and Computer Use have detailed settings.`})]})}function Jn(e,t,n=!1){return e.flatMap(e=>e.uses.find(e=>e.id===t)?.choices.map(t=>({value:t.id,label:t.name,group:te(e.providerId,e.profile.name,n),searchText:e.profile.name}))??[])}var Yn={id:`services`,label:[`服务账户`,`Service accounts`]},Xn=[...dt.map(e=>({id:e.uses[0],label:e.label})),Yn];function Zn(e){let t=e.parentElement;for(;t&&!/^(auto|scroll|overlay)$/.test(getComputedStyle(t).overflowY);)t=t.parentElement;return t}function Qn(){return window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`}function $n(e){let t=(0,$t.c)(37),{zh:n,children:r}=e,i=(0,Q.useRef)(null),a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),s=(0,Q.useRef)(null),[c,l]=(0,Q.useState)(Xn[0].id),u,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{let e=i.current,t=a.current;if(!e||!t)return;let n=Zn(e);if(!n)return;let r=0,o=()=>{if(r=0,s.current!==null){Math.abs(n.scrollTop-s.current)<=1&&(s.current=null);return}let i=[...e.querySelectorAll(`[data-model-section]`)],a=t.getBoundingClientRect().bottom+9,o=n.scrollHeight-n.clientHeight,c=(o>1&&n.scrollTop>=o-1?i.at(-1):i.findLast(e=>e.getBoundingClientRect().top<=a))??i[0];c?.dataset.modelSection&&l(c.dataset.modelSection)},c=()=>{r||=requestAnimationFrame(o)},u=()=>{s.current=null},d=()=>{s.current===null||Math.abs(n.scrollTop-s.current)<=1||(u(),c())},f=e=>{[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(e.key)&&u()};n.addEventListener(`scroll`,c,{passive:!0}),n.addEventListener(`scrollend`,d),n.addEventListener(`wheel`,u,{passive:!0}),n.addEventListener(`touchstart`,u,{passive:!0}),n.addEventListener(`pointerdown`,u),n.addEventListener(`keydown`,f);let p=typeof ResizeObserver>`u`?null:new ResizeObserver(c);return p?.observe(e),p?.observe(n),c(),()=>{cancelAnimationFrame(r),p?.disconnect(),n.removeEventListener(`scroll`,c),n.removeEventListener(`scrollend`,d),n.removeEventListener(`wheel`,u),n.removeEventListener(`touchstart`,u),n.removeEventListener(`pointerdown`,u),n.removeEventListener(`keydown`,f)}},d=[],t[0]=u,t[1]=d):(u=t[0],d=t[1]),(0,Q.useEffect)(u,d);let f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=o.current,t=e?.querySelector(`[aria-current="location"]`);if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.left<n.left?r.left-n.left:Math.max(0,r.right-n.right);i&&e.scrollBy({left:i,behavior:Qn()})},t[2]=f):f=t[2];let p;t[3]===c?p=t[4]:(p=[c],t[3]=c,t[4]=p),(0,Q.useEffect)(f,p);let m,h,g,_,v,y,b,x,S,C,w,T;if(t[5]!==c||t[6]!==n){let e=function(e){let t=i.current,n=a.current,r=t?.querySelector(`[data-model-section="${e}"]`);if(!t||!n||!r)return;l(e);let o=Zn(t);if(!o){r.scrollIntoView?.({block:`start`,behavior:Qn()});return}let c=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,o.scrollTop+r.getBoundingClientRect().top-o.getBoundingClientRect().top-o.clientTop-n.getBoundingClientRect().height-8));if(Math.abs(o.scrollTop-c)<1){s.current!==null&&o.scrollTo({top:c,behavior:`instant`}),s.current=null;return}s.current=c,o.scrollTo({top:c,behavior:Qn()})};y=i,b=`flex min-w-0 flex-col gap-5`,_=a,v=`sticky top-0 z-10 min-w-0 bg-surface-panel py-1`,m=Qe,x=`nav`,S=o,C=n?`模型配置分区`:`Model settings sections`,w=!1,T=`flex w-full gap-0.5 overflow-x-auto rounded-xl bg-surface-inset p-1`,h=`rounded-lg bg-surface-panel ring-1 ring-edge-subtle motion-reduce:transition-none`,g=Xn.map(t=>(0,$.jsx)(`button`,{type:`button`,"aria-current":c===t.id?`location`:void 0,"aria-pressed":c===t.id,className:J(`touch-target relative z-10 min-h-9 min-w-max flex-1 whitespace-nowrap rounded-lg px-3 text-xs font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,c===t.id?`text-fg`:`text-fg-muted hover:text-fg`),onClick:()=>e(t.id),children:t.label[+!n]},t.id)),t[5]=c,t[6]=n,t[7]=m,t[8]=h,t[9]=g,t[10]=_,t[11]=v,t[12]=y,t[13]=b,t[14]=x,t[15]=S,t[16]=C,t[17]=w,t[18]=T}else m=t[7],h=t[8],g=t[9],_=t[10],v=t[11],y=t[12],b=t[13],x=t[14],S=t[15],C=t[16],w=t[17],T=t[18];let E;t[19]!==m||t[20]!==h||t[21]!==g||t[22]!==x||t[23]!==S||t[24]!==C||t[25]!==w||t[26]!==T?(E=(0,$.jsx)(m,{as:x,ref:S,"aria-label":C,scrollFocusedItemIntoView:w,className:T,indicatorClassName:h,children:g}),t[19]=m,t[20]=h,t[21]=g,t[22]=x,t[23]=S,t[24]=C,t[25]=w,t[26]=T,t[27]=E):E=t[27];let D;t[28]!==_||t[29]!==v||t[30]!==E?(D=(0,$.jsx)(`div`,{ref:_,className:v,children:E}),t[28]=_,t[29]=v,t[30]=E,t[31]=D):D=t[31];let O;return t[32]!==r||t[33]!==y||t[34]!==b||t[35]!==D?(O=(0,$.jsxs)(`div`,{ref:y,className:b,children:[D,r]}),t[32]=r,t[33]=y,t[34]=b,t[35]=D,t[36]=O):O=t[36],O}function er(e){let t=(0,$t.c)(208),{model:n,isNew:r,providerId:i,onSave:a,onClose:o,m:s}=e,c=p(nr)===`zh`,l;t[0]===n?l=t[1]:(l=()=>n?{...n}:V(``),t[0]=n,t[1]=l);let[u,d]=(0,Q.useState)(l),[f,m]=(0,Q.useState)(tr),h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(e,t)=>{d(n=>({...n,[e]:t})),m(t=>{let n=new Map(t);return n.delete(e),n})},t[2]=h):h=t[2];let g=h,_;t[3]!==u.computerUse||t[4]!==u.contextWindow||t[5]!==u.id||t[6]!==u.input||t[7]!==u.maxTokens||t[8]!==s.modelIdRequired||t[9]!==s.mustBePositive||t[10]!==c?(_=()=>{let e=new Map;return(u.id||``).trim()||e.set(`id`,s.modelIdRequired),u.contextWindow!==void 0&&u.contextWindow<=0&&e.set(`contextWindow`,s.mustBePositive),u.maxTokens!==void 0&&u.maxTokens<=0&&e.set(`maxTokens`,s.mustBePositive),u.computerUse&&!u.input?.includes(`image`)&&e.set(`computerUse`,c?`电脑控制模型必须支持图片输入`:`Computer Use requires image input`),m(e),e.size===0},t[3]=u.computerUse,t[4]=u.contextWindow,t[5]=u.id,t[6]=u.input,t[7]=u.maxTokens,t[8]=s.modelIdRequired,t[9]=s.mustBePositive,t[10]=c,t[11]=_):_=t[11];let y=_,b;t[12]!==u||t[13]!==o||t[14]!==a||t[15]!==y?(b=()=>{if(!y())return;let e=(u.id||``).trim(),t={...u,id:e,name:u.name?.trim()||e,reasoning:u.reasoning||!1,input:u.input||[`text`],contextWindow:u.contextWindow??128e3,maxTokens:u.maxTokens??16384,cost:{input:u.cost?.input??0,output:u.cost?.output??0,cacheRead:u.cost?.cacheRead??0,cacheWrite:u.cost?.cacheWrite??0}};a(t),o()},t[12]=u,t[13]=o,t[14]=a,t[15]=y,t[16]=b):b=t[16];let S=b,C=u,w;t[17]===C?w=t[18]:(w=W(C),t[17]=C,t[18]=w);let T=w,E=r?s.addModelTitle:s.editModelTitle,D;t[19]===E?D=t[20]:(D=(0,$.jsx)(x,{className:`text-base font-semibold text-fg`,children:E}),t[19]=E,t[20]=D);let O;t[21]!==s.modelProviderLabel||t[22]!==i?(O=i?(0,$.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[s.modelProviderLabel,`: `,i]}):null,t[21]=s.modelProviderLabel,t[22]=i,t[23]=O):O=t[23];let j;t[24]!==D||t[25]!==O?(j=(0,$.jsxs)(`div`,{children:[D,O]}),t[24]=D,t[25]=O,t[26]=j):j=t[26];let M;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(M=J(ze,`p-1.5 hover:bg-surface-base`),t[27]=M):M=t[27];let N;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(De,{className:`size-4`}),t[28]=N):N=t[28];let ee;t[29]===s.close?ee=t[30]:(ee=(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:M,"aria-label":s.close,children:N})}),t[29]=s.close,t[30]=ee);let P;t[31]!==j||t[32]!==ee?(P=(0,$.jsxs)(`div`,{className:`mb-3 flex shrink-0 items-start justify-between gap-2`,children:[j,ee]}),t[31]=j,t[32]=ee,t[33]=P):P=t[33];let F;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`span`,{className:`text-red-600 dark:text-red-400`,children:` *`}),t[34]=F):F=t[34];let I;t[35]===s.modelId?I=t[36]:(I=(0,$.jsxs)(`label`,{className:`mb-1 block text-xs font-medium text-fg`,children:[s.modelId,F]}),t[35]=s.modelId,t[36]=I);let L;t[37]===f?L=t[38]:(L=J(z(),f.has(`id`)&&`border-red-500`),t[37]=f,t[38]=L);let R=u.id||``,U;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>g(`id`,e.target.value),t[39]=U):U=t[39];let te=!r,ne;t[40]!==L||t[41]!==R||t[42]!==te?(ne=(0,$.jsx)(`input`,{className:L,value:R,onChange:U,placeholder:`e.g. llama3.1:8b`,disabled:te}),t[40]=L,t[41]=R,t[42]=te,t[43]=ne):ne=t[43];let G;t[44]===f?G=t[45]:(G=f.has(`id`)?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:f.get(`id`)}):null,t[44]=f,t[45]=G);let re;t[46]!==I||t[47]!==ne||t[48]!==G?(re=(0,$.jsxs)(`div`,{children:[I,ne,G]}),t[46]=I,t[47]=ne,t[48]=G,t[49]=re):re=t[49];let ie;t[50]===s.displayName?ie=t[51]:(ie=(0,$.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-fg-muted`,children:s.displayName}),t[50]=s.displayName,t[51]=ie);let K;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(K=z(),t[52]=K):K=t[52];let ae=u.name||``,se;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>g(`name`,e.target.value),t[53]=se):se=t[53];let ce;t[54]===ae?ce=t[55]:(ce=(0,$.jsx)(`input`,{className:K,value:ae,onChange:se}),t[54]=ae,t[55]=ce);let le;t[56]!==ie||t[57]!==ce?(le=(0,$.jsxs)(`div`,{children:[ie,ce]}),t[56]=ie,t[57]=ce,t[58]=le):le=t[58];let q;t[59]===s.inputTypes?q=t[60]:(q=(0,$.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-fg-muted`,children:s.inputTypes}),t[59]=s.inputTypes,t[60]=q);let ue;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(ue=H(),t[61]=ue):ue=t[61];let de;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>g(`input`,B(e.target.value)),t[62]=de):de=t[62];let fe;t[63]===s?fe=t[64]:(fe=oe.map(e=>(0,$.jsx)(A,{value:e.value,children:s[e.labelKey]},e.value)),t[63]=s,t[64]=fe);let pe;t[65]!==T||t[66]!==fe?(pe=(0,$.jsx)(k,{className:ue,value:T,onChange:de,children:fe}),t[65]=T,t[66]=fe,t[67]=pe):pe=t[67];let me;t[68]!==q||t[69]!==pe?(me=(0,$.jsxs)(`div`,{children:[q,pe]}),t[68]=q,t[69]=pe,t[70]=me):me=t[70];let he=u.reasoning||!1,ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=e=>g(`reasoning`,e.target.checked),t[71]=ge):ge=t[71];let _e;t[72]===he?_e=t[73]:(_e=(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:he,onChange:ge}),t[72]=he,t[73]=_e);let ve;t[74]!==s.reasoning||t[75]!==_e?(ve=(0,$.jsxs)(`label`,{className:`mt-6 flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[_e,s.reasoning]}),t[74]=s.reasoning,t[75]=_e,t[76]=ve):ve=t[76];let ye;t[77]!==me||t[78]!==ve?(ye=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[me,ve]}),t[77]=me,t[78]=ve,t[79]=ye):ye=t[79];let be;t[80]===s.contextWindow?be=t[81]:(be=(0,$.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-fg-muted`,children:s.contextWindow}),t[80]=s.contextWindow,t[81]=be);let xe;t[82]===f?xe=t[83]:(xe=J(z(),f.has(`contextWindow`)&&`border-red-500`),t[82]=f,t[83]=xe);let Se=u.contextWindow??128e3,Ce;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=e=>g(`contextWindow`,parseInt(e.target.value,10)||0),t[84]=Ce):Ce=t[84];let we;t[85]!==xe||t[86]!==Se?(we=(0,$.jsx)(jt,{type:`number`,min:1,className:xe,value:Se,onChange:Ce}),t[85]=xe,t[86]=Se,t[87]=we):we=t[87];let Te;t[88]===f?Te=t[89]:(Te=f.has(`contextWindow`)?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:f.get(`contextWindow`)}):null,t[88]=f,t[89]=Te);let Ee;t[90]!==be||t[91]!==we||t[92]!==Te?(Ee=(0,$.jsxs)(`div`,{children:[be,we,Te]}),t[90]=be,t[91]=we,t[92]=Te,t[93]=Ee):Ee=t[93];let Y;t[94]===s.maxOutputTokens?Y=t[95]:(Y=(0,$.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-fg-muted`,children:s.maxOutputTokens}),t[94]=s.maxOutputTokens,t[95]=Y);let Oe;t[96]===f?Oe=t[97]:(Oe=J(z(),f.has(`maxTokens`)&&`border-red-500`),t[96]=f,t[97]=Oe);let ke=u.maxTokens??16384,Ae;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=e=>g(`maxTokens`,parseInt(e.target.value,10)||0),t[98]=Ae):Ae=t[98];let X;t[99]!==Oe||t[100]!==ke?(X=(0,$.jsx)(jt,{type:`number`,min:1,className:Oe,value:ke,onChange:Ae}),t[99]=Oe,t[100]=ke,t[101]=X):X=t[101];let je;t[102]===f?je=t[103]:(je=f.has(`maxTokens`)?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:f.get(`maxTokens`)}):null,t[102]=f,t[103]=je);let Me;t[104]!==Y||t[105]!==X||t[106]!==je?(Me=(0,$.jsxs)(`div`,{children:[Y,X,je]}),t[104]=Y,t[105]=X,t[106]=je,t[107]=Me):Me=t[107];let Ne;t[108]!==Ee||t[109]!==Me?(Ne=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Ee,Me]}),t[108]=Ee,t[109]=Me,t[110]=Ne):Ne=t[110];let Pe;t[111]===s.costSection?Pe=t[112]:(Pe=(0,$.jsx)(`p`,{className:`mb-2 text-xs font-semibold text-fg`,children:s.costSection}),t[111]=s.costSection,t[112]=Pe);let Fe;t[113]===s.costInput?Fe=t[114]:(Fe=(0,$.jsx)(`label`,{className:`mb-1 block text-xs text-fg-muted`,children:s.costInput}),t[113]=s.costInput,t[114]=Fe);let Ie;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=z(),t[115]=Ie):Ie=t[115];let Le=u.cost?.input??0,Re;t[116]===u.cost?Re=t[117]:(Re=e=>g(`cost`,{...u.cost,input:parseFloat(e.target.value)||0,output:u.cost?.output??0,cacheRead:u.cost?.cacheRead??0,cacheWrite:u.cost?.cacheWrite??0}),t[116]=u.cost,t[117]=Re);let Be;t[118]!==Le||t[119]!==Re?(Be=(0,$.jsx)(jt,{type:`number`,step:`any`,min:0,className:Ie,value:Le,onChange:Re}),t[118]=Le,t[119]=Re,t[120]=Be):Be=t[120];let Ve;t[121]!==Fe||t[122]!==Be?(Ve=(0,$.jsxs)(`div`,{children:[Fe,Be]}),t[121]=Fe,t[122]=Be,t[123]=Ve):Ve=t[123];let He;t[124]===s.costOutput?He=t[125]:(He=(0,$.jsx)(`label`,{className:`mb-1 block text-xs text-fg-muted`,children:s.costOutput}),t[124]=s.costOutput,t[125]=He);let Ue;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=z(),t[126]=Ue):Ue=t[126];let We=u.cost?.output??0,Ge;t[127]===u.cost?Ge=t[128]:(Ge=e=>g(`cost`,{...u.cost,input:u.cost?.input??0,output:parseFloat(e.target.value)||0,cacheRead:u.cost?.cacheRead??0,cacheWrite:u.cost?.cacheWrite??0}),t[127]=u.cost,t[128]=Ge);let Ke;t[129]!==We||t[130]!==Ge?(Ke=(0,$.jsx)(jt,{type:`number`,step:`any`,min:0,className:Ue,value:We,onChange:Ge}),t[129]=We,t[130]=Ge,t[131]=Ke):Ke=t[131];let qe;t[132]!==He||t[133]!==Ke?(qe=(0,$.jsxs)(`div`,{children:[He,Ke]}),t[132]=He,t[133]=Ke,t[134]=qe):qe=t[134];let Je;t[135]!==Ve||t[136]!==qe?(Je=(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[Ve,qe]}),t[135]=Ve,t[136]=qe,t[137]=Je):Je=t[137];let Ye;t[138]!==Pe||t[139]!==Je?(Ye=(0,$.jsxs)(`div`,{className:`border-t border-edge-subtle pt-2 dark:border-edge`,children:[Pe,Je]}),t[138]=Pe,t[139]=Je,t[140]=Ye):Ye=t[140];let Xe;t[141]!==re||t[142]!==le||t[143]!==ye||t[144]!==Ne||t[145]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[re,le,ye,Ne,Ye]}),t[141]=re,t[142]=le,t[143]=ye,t[144]=Ne,t[145]=Ye,t[146]=Xe):Xe=t[146];let Ze=c?`高级:手机操作协议`:`Advanced: Phone Use protocol`,Qe;t[147]===Ze?Qe=t[148]:(Qe=(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:Ze}),t[147]=Ze,t[148]=Qe);let $e=c?`手机操作协议`:`Phone Use protocol`,et=u.phoneUse?.profile??``,tt;t[149]===Symbol.for(`react.memo_cache_sentinel`)?(tt=e=>g(`phoneUse`,e.target.value?{profile:e.target.value}:void 0),t[149]=tt):tt=t[149];let nt=c?`自动识别`:`Automatic`,rt;t[150]===nt?rt=t[151]:(rt=(0,$.jsx)(A,{value:``,children:nt}),t[150]=nt,t[151]=rt);let it,at,ot,st,ct;t[152]===Symbol.for(`react.memo_cache_sentinel`)?(it=(0,$.jsx)(A,{value:`autoglm-phone-v1`,children:`AutoGLM Phone`}),at=(0,$.jsx)(A,{value:`structured-phone-v1`,children:`Structured Phone`}),ot=(0,$.jsx)(A,{value:`structured-tools-phone-v1`,children:`Visual function tools`}),st=(0,$.jsx)(A,{value:`doubao-seed-phone-v1`,children:`Doubao Seed GUI`}),ct=(0,$.jsx)(A,{value:`gui-owl-phone-v1`,children:`GUI-Owl 1.5`}),t[152]=it,t[153]=at,t[154]=ot,t[155]=st,t[156]=ct):(it=t[152],at=t[153],ot=t[154],st=t[155],ct=t[156]);let lt;t[157]!==$e||t[158]!==et||t[159]!==rt?(lt=(0,$.jsxs)(k,{"aria-label":$e,value:et,onChange:tt,children:[rt,it,at,ot,st,ct]}),t[157]=$e,t[158]=et,t[159]=rt,t[160]=lt):lt=t[160];let ut=c?`通用视觉模型支持图片输入和工具调用时会自动显示;也可指定专用手机协议。`:`Visual models with image input and function tools appear automatically. Dedicated phone protocols can also be selected.`,dt;t[161]===ut?dt=t[162]:(dt=(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:ut}),t[161]=ut,t[162]=dt);let ft;t[163]!==lt||t[164]!==dt?(ft=(0,$.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[lt,dt]}),t[163]=lt,t[164]=dt,t[165]=ft):ft=t[165];let pt;t[166]!==Qe||t[167]!==ft?(pt=(0,$.jsxs)(`details`,{className:`mt-4 rounded-lg border border-edge p-3 text-sm text-fg`,children:[Qe,ft]}),t[166]=Qe,t[167]=ft,t[168]=pt):pt=t[168];let mt=c?`高级:电脑控制协议`:`Advanced: Computer Use protocol`,ht;t[169]===mt?ht=t[170]:(ht=(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:mt}),t[169]=mt,t[170]=ht);let gt=c?`电脑控制协议`:`Computer Use protocol`,_t=u.computerUse?.profile??``,vt;t[171]===Symbol.for(`react.memo_cache_sentinel`)?(vt=e=>g(`computerUse`,e.target.value?{profile:e.target.value}:void 0),t[171]=vt):vt=t[171];let yt=c?`自动识别`:`Automatic`,bt;t[172]===yt?bt=t[173]:(bt=(0,$.jsx)(A,{value:``,children:yt}),t[172]=yt,t[173]=bt);let xt,St,Ct;t[174]===Symbol.for(`react.memo_cache_sentinel`)?(xt=(0,$.jsx)(A,{value:`gui-plus-2026-02-26`,children:`GUI-Plus (2026-02-26)`}),St=(0,$.jsx)(A,{value:`structured-tools-v1`,children:`structured-tools-v1`}),Ct=(0,$.jsx)(A,{value:`openai-responses-computer-v1`,children:`OpenAI Responses Computer`}),t[174]=xt,t[175]=St,t[176]=Ct):(xt=t[174],St=t[175],Ct=t[176]);let wt;t[177]!==gt||t[178]!==_t||t[179]!==bt?(wt=(0,$.jsxs)(k,{"aria-label":gt,value:_t,onChange:vt,children:[bt,xt,St,Ct]}),t[177]=gt,t[178]=_t,t[179]=bt,t[180]=wt):wt=t[180];let Tt=c?`协议必须与模型 API 匹配。声明协议不代表模型已通过效果验证。`:`The protocol must match the model API. Declaring a protocol does not certify model quality.`,Et;t[181]===Tt?Et=t[182]:(Et=(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:Tt}),t[181]=Tt,t[182]=Et);let Dt;t[183]===f?Dt=t[184]:(Dt=f.has(`computerUse`)&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:f.get(`computerUse`)}),t[183]=f,t[184]=Dt);let Ot;t[185]!==Et||t[186]!==Dt||t[187]!==wt?(Ot=(0,$.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[wt,Et,Dt]}),t[185]=Et,t[186]=Dt,t[187]=wt,t[188]=Ot):Ot=t[188];let kt;t[189]!==Ot||t[190]!==ht?(kt=(0,$.jsxs)(`details`,{className:`mt-4 rounded-lg border border-edge p-3 text-sm text-fg`,children:[ht,Ot]}),t[189]=Ot,t[190]=ht,t[191]=kt):kt=t[191];let At;t[192]!==kt||t[193]!==Xe||t[194]!==pt?(At=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-1`,children:[Xe,pt,kt]}),t[192]=kt,t[193]=Xe,t[194]=pt,t[195]=At):At=t[195];let Mt;t[196]===s.cancel?Mt=t[197]:(Mt=(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{type:`button`,variant:`secondary`,children:s.cancel})}),t[196]=s.cancel,t[197]=Mt);let Nt=r?s.addModelConfirm:s.saveModelConfirm,Pt;t[198]!==S||t[199]!==Nt?(Pt=(0,$.jsx)(Z,{type:`button`,variant:`primary`,className:`hover:bg-accent/90`,onClick:S,children:Nt}),t[198]=S,t[199]=Nt,t[200]=Pt):Pt=t[200];let Ft;t[201]!==Mt||t[202]!==Pt?(Ft=(0,$.jsxs)(`div`,{className:`mt-4 flex shrink-0 justify-end gap-2 border-t border-edge-subtle pt-3 dark:border-edge`,children:[Mt,Pt]}),t[201]=Mt,t[202]=Pt,t[203]=Ft):Ft=t[203];let It;return t[204]!==At||t[205]!==Ft||t[206]!==P?(It=(0,$.jsxs)($.Fragment,{children:[P,At,Ft]}),t[204]=At,t[205]=Ft,t[206]=P,t[207]=It):It=t[207],It}function tr(){return new Map}function nr(e){return e.language}function rr(e){let t=(0,$t.c)(16),{open:n,onOpenChange:r,providerId:i,model:a,isNew:o,onSave:s,m:c}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(g,{className:J(`xopc-dialog-overlay fixed inset-0 bg-scrim`,Ie)}),t[0]=l):l=t[0];let u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=J(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(90vh,720px)] w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2 flex-col`,Fe,`overflow-hidden rounded-xl border border-edge bg-surface-overlay p-4 shadow-popover dark:border-edge`),t[1]=u):u=t[1];let d;t[2]!==o||t[3]!==c||t[4]!==a||t[5]!==r||t[6]!==s||t[7]!==n||t[8]!==i?(d=n?(0,$.jsx)(er,{model:a,isNew:o,providerId:i,onSave:s,onClose:()=>r(!1),m:c},`${i??`none`}-${a?.id??`new`}`):null,t[2]=o,t[3]=c,t[4]=a,t[5]=r,t[6]=s,t[7]=n,t[8]=i,t[9]=d):d=t[9];let f;t[10]===d?f=t[11]:(f=(0,$.jsxs)(y,{children:[l,(0,$.jsx)(b,{className:u,onOpenAutoFocus:ir,children:d})]}),t[10]=d,t[11]=f);let p;return t[12]!==r||t[13]!==n||t[14]!==f?(p=(0,$.jsx)(S,{open:n,onOpenChange:r,children:f}),t[12]=r,t[13]=n,t[14]=f,t[15]=p):p=t[15],p}function ir(e){return e.preventDefault()}function ar(e){let t=(0,$t.c)(14),{providerId:n,inputId:r,value:i,onChange:a,labels:o}=e,s;t[0]===n?s=t[1]:(s=()=>yt(n).then(or),t[0]=n,t[1]=s);let c=s,l;t[2]!==r||t[3]!==o.apiKeyLabel?(l=(0,$.jsx)(`label`,{htmlFor:r,className:`text-sm font-medium text-fg`,children:o.apiKeyLabel}),t[2]=r,t[3]=o.apiKeyLabel,t[4]=l):l=t[4];let u;t[5]!==r||t[6]!==o||t[7]!==a||t[8]!==c||t[9]!==i?(u=(0,$.jsx)(fe,{id:r,value:i,onChange:a,placeholder:o.apiKeyPlaceholder,labels:o,reveal:c,loadFailedLabel:o.loadFailed,maskedHelp:o.maskedHelp,notInConfigFile:o.notInConfigFile}),t[5]=r,t[6]=o,t[7]=a,t[8]=c,t[9]=i,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function or(e){return e.apiKey??null}function sr(e){let t=(0,$t.c)(23),{open:n,onOpenChange:r,providerId:i,isCustom:a,builtinRows:o,customConfig:s,allModels:c,labels:l,language:u,onSaved:d}=e,f=(0,Q.useRef)(null),[p,m]=(0,Q.useState)(!1),[h,_]=(0,Q.useState)(null),v;t[0]===r?v=t[1]:(v=e=>{e||(_(null),m(!1)),r(e)},t[0]=r,t[1]=v);let x=v,C;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(g,{className:J(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,Ie)}),t[2]=C):C=t[2];let w,T,E;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>{f.current=document.activeElement instanceof HTMLElement?document.activeElement:null},T=e=>{f.current?.isConnected&&(e.preventDefault(),f.current.focus({preventScroll:!0}))},E=J(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(85vh,720px)] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,Fe),t[3]=w,t[4]=T,t[5]=E):(w=t[3],T=t[4],E=t[5]);let D;t[6]!==c||t[7]!==o||t[8]!==s||t[9]!==x||t[10]!==a||t[11]!==l||t[12]!==u||t[13]!==r||t[14]!==d||t[15]!==i||t[16]!==p||t[17]!==h?(D=(0,$.jsxs)(y,{children:[C,(0,$.jsx)(b,{onOpenAutoFocus:w,onCloseAutoFocus:T,className:E,children:h?(0,$.jsx)(U,{target:h,zh:u===`zh`,onDone:()=>x(!1)}):!a&&p?(0,$.jsx)(I,{providerId:i,existingConnection:!0,row:o.find(e=>e.id===i),language:u,onApplied:d,onBack:()=>m(!1),onDone:()=>x(!1)}):a?(0,$.jsx)(lr,{providerId:i,customConfig:s,labels:l,language:u,onClose:()=>r(!1),onSaved:d,onModelAdded:e=>_({providerId:i,modelIds:[e]})}):(0,$.jsx)(cr,{providerId:i,builtinRows:o,allModels:c,labels:l,language:u,onClose:()=>r(!1),onSaved:d,onQuickSetup:()=>m(!0)},i)})]}),t[6]=c,t[7]=o,t[8]=s,t[9]=x,t[10]=a,t[11]=l,t[12]=u,t[13]=r,t[14]=d,t[15]=i,t[16]=p,t[17]=h,t[18]=D):D=t[18];let O;return t[19]!==x||t[20]!==n||t[21]!==D?(O=(0,$.jsx)(S,{open:n,onOpenChange:x,children:D}),t[19]=x,t[20]=n,t[21]=D,t[22]=O):O=t[22],O}function cr({providerId:e,builtinRows:t,allModels:n,labels:r,language:i,onClose:a,onSaved:o,onQuickSetup:s}){let c=t.find(t=>t.id===e),u=se[e],d=n.filter(t=>t.provider===e),[f,p]=(0,Q.useState)(!1),[m,g]=(0,Q.useState)(c?.apiKey??``),[_,y]=(0,Q.useState)(!1),[b,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(null),[T,E]=(0,Q.useState)(!1),D=h(i).providersSettings,O=c?.supportsApiKey!==!1,k=c?.supportsOAuth===!0,[A,j]=(0,Q.useState)(c?.authMode===`oauth`||!O?`oauth`:`api-key`),N=c?.authMode===`oauth`&&c.authStatus===`connected`,ee=c?.configured===!0&&c.authMode!==`oauth`&&c.activeKeySource!==`env`&&c.activeKeySource!==`extension`&&c.activeKeySource!==`models_json`,[P,F]=(0,Q.useState)(null),[I,R]=(0,Q.useState)(null),[z,B]=(0,Q.useState)(`idle`),[V,H]=(0,Q.useState)(null),[U,te]=(0,Q.useState)(null),[W,ne]=(0,Q.useState)(null),[re,ie]=(0,Q.useState)(``),ae=(0,Q.useRef)(null),oe=(0,Q.useRef)(null),le=z===`waiting`||z===`waiting_code`,ue=(0,Q.useMemo)(()=>q(e,i),[e,i]),fe=m!==(c?.apiKey??``),pe=async()=>{let t=m.trim();if(!(!t||!O||vt(t))){y(!0),w(null);try{await _t({[e]:t}),S(!0),window.setTimeout(()=>{o(),a()},600)}catch(e){w(e instanceof Error?e.message:r.saveError)}finally{y(!1)}}};(0,Q.useEffect)(()=>{if(!P||!le)return;let e=window.setInterval(()=>{(async()=>{try{let t=await Tt(P);t.status===`waiting_auth`||t.status===`waiting_code`?(B(t.status===`waiting_code`?`waiting_code`:`waiting`),R(t.message??null),H(t.authUrl??null),te(t.instructions??null),ne(t.deviceCode??null),t.authUrl&&t.authUrl!==oe.current&&(oe.current=t.authUrl,Ot(t.authUrl,ae.current).catch(()=>{}))):t.status===`completed`?(window.clearInterval(e),At(ae.current),ae.current=null,B(`success`),R(t.message??D.saved),window.setTimeout(()=>{o(),a()},600)):(t.status===`failed`||t.status===`cancelled`)&&(window.clearInterval(e),At(ae.current),ae.current=null,B(`error`),R(t.error??t.message??D.revokeFailed))}catch{}})()},1e3);return()=>window.clearInterval(e)},[P,le,a,o,D.revokeFailed,D.saved]),(0,Q.useEffect)(()=>()=>{P&&Ct(P).catch(()=>{})},[P]),(0,Q.useEffect)(()=>()=>{At(ae.current),ae.current=null},[]);let me=async()=>{try{await bt(e),o(),a()}catch{}},he=async()=>{At(ae.current),ae.current=kt(),oe.current=null,B(`waiting`),R(D.oauthStarting),H(null),te(null),ne(null),w(null);try{let t=await xt(e);F(t.sessionId)}catch(e){At(ae.current),ae.current=null,B(`error`),R(e instanceof Error?e.message:D.revokeFailed)}},_e=async()=>{if(P){try{await Et(P)}catch{}At(ae.current),ae.current=null,oe.current=null,B(`idle`),R(null),F(null),H(null),te(null),ne(null)}},ve=async()=>{if(!(!P||!re.trim()))try{await wt(P,re.trim()),ie(``),R(D.oauthProcessingCode)}catch(e){B(`error`),R(e instanceof Error?e.message:D.revokeFailed)}},ye=async()=>{try{await St(e),o(),a()}catch(e){w(e instanceof Error?e.message:D.revokeFailed)}};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge-subtle px-5 py-4`,children:[(0,$.jsx)(x,{className:`text-base font-semibold text-fg`,children:c?.name??e}),(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:J(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,Re.press),children:(0,$.jsx)(De,{className:`size-4`,"aria-hidden":!0})})})]}),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-5 py-4`,children:[u?.description?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:u.description}):null,(0,$.jsx)(K,{row:c,language:i}),O&&k?(0,$.jsx)(G,{value:A,onChange:j,language:i,disabled:le||_}):null,O&&A===`api-key`?(0,$.jsx)(ar,{providerId:e,inputId:`manage-api-key`,value:m,onChange:e=>{g(e),S(!1)},labels:{apiKeyLabel:r.apiKeyLabel,apiKeyPlaceholder:r.apiKeyPlaceholder,maskedHelp:r.maskedHelp,copy:r.copy,copied:r.copied,show:r.showKey,hide:r.hideKey,notInConfigFile:r.notInConfigFile,loadFailed:r.loadFailed}}):!O&&c?.category===`extension`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{children:r.extensionKeyHint}),c?.extensionId?(0,$.jsxs)(l,{to:`/settings/ext/${encodeURIComponent(c.extensionId)}`,className:`inline-flex w-fit items-center gap-1 font-medium text-accent hover:underline`,title:r.extensionSettingsLinkTitle,onClick:a,children:[r.openExtensionSettings,(0,$.jsx)(de,{className:`size-3`,"aria-hidden":!0})]}):null]}):null,k&&A===`oauth`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-panel/60 p-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:D.oauth}),(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:N?i===`zh`?`账号已连接`:`Account connected`:c?.authMode===`oauth`&&c.authStatus===`expired`?i===`zh`?`授权已过期,请重新登录`:`Authorization expired. Sign in again.`:i===`zh`?`通过浏览器授权连接账号`:`Authorize your account in the browser`})]}),N?(0,$.jsx)(Z,{type:`button`,variant:`secondary`,className:`gap-1.5 text-red-600 dark:text-red-400`,onClick:()=>void ye(),children:D.revoke}):(0,$.jsxs)(Z,{type:`button`,variant:`primary`,className:`gap-1.5`,disabled:le,onClick:()=>void he(),children:[le?(0,$.jsx)(ge,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),D.oauth]})]}),I?(0,$.jsx)(`p`,{className:J(`text-xs`,z===`error`?`text-red-600 dark:text-red-400`:`text-fg-muted`),children:I}):null,z===`waiting`||z===`waiting_code`?(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[V?(0,$.jsxs)(`a`,{href:V,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-sm font-medium text-on-accent hover:bg-accent-hover`,children:[(0,$.jsx)(de,{className:`size-4`,"aria-hidden":!0}),D.openAuthPage]}):null,(0,$.jsx)(Z,{type:`button`,variant:`secondary`,onClick:()=>void _e(),children:D.cancelOAuth})]}):null,U?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:U}):null,W?(0,$.jsxs)(`div`,{className:`rounded-lg border border-edge-subtle bg-surface-panel px-3 py-2`,children:[(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:D.deviceCodeLabel}),(0,$.jsx)(`code`,{className:`mt-1 block select-all font-mono text-lg font-semibold tracking-widest text-fg`,children:W}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:D.deviceCodeHint})]}):null,z===`waiting_code`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,$.jsx)(`input`,{type:`text`,value:re,onChange:e=>ie(e.target.value),onKeyDown:e=>e.key===`Enter`&&void ve(),"aria-label":D.pasteRedirectUrl,placeholder:D.pasteRedirectUrl,className:J(`min-w-0 flex-1 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,We)}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,onClick:()=>void ve(),children:D.submitCode})]}):null]}):null,ue.length>0&&O&&A===`api-key`?(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ue.map(({kind:e,href:t})=>(0,$.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-accent hover:underline`,children:[L(e,r),(0,$.jsx)(de,{className:`size-3`,"aria-hidden":!0})]},e))}):null,A===`api-key`&&c?.baseUrl?(0,$.jsxs)(`details`,{className:`rounded-lg border border-edge-subtle p-3`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:i===`zh`?`高级设置`:`Advanced settings`}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:r.apiUrlLabel}),(0,$.jsx)(`code`,{className:`break-all font-mono text-xs text-fg-muted`,children:c.baseUrl})]})]}):c?.category===`extension`?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.apiUrlExtensionHint}):null,d.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsxs)(`span`,{className:`text-sm font-medium text-fg`,children:[i===`zh`?`模型目录`:`Model catalog`,` (`,d.length,`)`]}),(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i===`zh`?`此服务的模型目录;实际访问权限取决于当前生效的凭据和账号。`:`Models registered for this provider. Access depends on the active credentials and account.`}),(0,$.jsxs)(`label`,{className:`mb-2 flex items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:f,onChange:e=>p(e.target.checked)}),i===`zh`?`仅电脑控制模型`:`Computer Use only`]}),(0,$.jsx)(`div`,{className:`max-h-40 overflow-y-auto rounded-lg border border-edge-subtle bg-surface-panel/40 p-2`,children:(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:d.filter(e=>!f||e.computerUse).map(e=>(0,$.jsxs)(`span`,{className:`inline-block rounded-md bg-surface-hover px-2 py-1 text-xs text-fg-muted`,children:[rt(e,i),e.computerUse?` · Computer Use`:``]},e.id))})})]}):(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:r.noModels}),s?(0,$.jsx)(Z,{variant:`secondary`,disabled:fe||le||c?.authStatus!==`connected`,onClick:s,children:i===`zh`?`配置模型用途`:`Configure model uses`}):null,C?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:C}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-t border-edge-subtle px-5 py-3`,children:[ee?(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`gap-1.5 text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300`,onClick:()=>E(!0),children:[(0,$.jsx)(we,{className:`size-3.5`,"aria-hidden":!0}),i===`zh`?`移除 API Key`:`Remove API key`]}):(0,$.jsx)(`span`,{}),(0,$.jsx)(`div`,{className:`flex items-center gap-2`,children:O&&A===`api-key`&&fe&&!vt(m.trim())?(0,$.jsx)(Z,{type:`button`,variant:`primary`,disabled:!m.trim()||_||b,onClick:()=>void pe(),children:b?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(M,{className:`size-3.5`,"aria-hidden":!0}),r.saved]}):_?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(ge,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),r.saving]}):r.save}):null})]}),(0,$.jsx)($e,{open:T,title:r.removeConfirmTitle,description:r.removeConfirmDescription.replace(`{{provider}}`,c?.name??e),confirmLabel:r.removeConfirmAction,cancelLabel:r.cancel,destructive:!0,onConfirm:()=>void me(),onCancel:()=>E(!1)})]})}function lr({providerId:e,customConfig:t,labels:n,language:r,onClose:i,onSaved:a,onModelAdded:o}){let s=h(r).modelsSettings,c=t?.providers[e],[l,u]=(0,Q.useState)(c?.baseUrl??``),[d,f]=(0,Q.useState)(c?.apiKey??``),[p,m]=(0,Q.useState)(c?.models??[]),[g,_]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(c?.modelDiscovery?.enabled===!0),[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(null),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(null),ee=n=>{if(!t)return null;let r=d.trim(),i={...c,baseUrl:l.trim()||void 0,apiKey:vt(r)?c?.apiKey:r||void 0,...n};return{providers:{...t.providers,[e]:i}}},P=async()=>{let e=ee({models:p,modelDiscovery:{enabled:y}});if(e){C(!0),T(null);try{await F(e),a(),i()}catch(e){T(e instanceof Error?e.message:n.saveError)}finally{C(!1)}}},I=async()=>{if(t)try{let{[e]:n,...r}=t.providers;await F({providers:r}),a(),i()}catch{}},L=(e,t)=>{N({model:e,isNew:t}),j(!0)},R=async e=>{if(!M)return;let t=M.isNew&&!p.some(t=>t.id===e.id),r=M.isNew?[...p,e]:p.map(t=>t.id===e.id?e:t);m(r);let i=ee({models:r});if(i)try{await F(i),a(),t&&!e.computerUse&&o(e.id)}catch(e){T(e instanceof Error?e.message:n.saveError)}},z=async e=>{let t=p.filter(t=>t.id!==e);m(t),k(null);let r=ee({models:t});if(r)try{await F(r),a()}catch(e){T(e instanceof Error?e.message:n.saveError)}};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(x,{className:`text-base font-semibold text-fg`,children:e}),(0,$.jsx)(`span`,{className:`rounded bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium text-fg-subtle`,children:n.custom})]}),(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:J(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,Re.press),children:(0,$.jsx)(De,{className:`size-4`,"aria-hidden":!0})})})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 overflow-y-auto px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`label`,{htmlFor:`manage-base-url`,className:`text-sm font-medium text-fg`,children:n.baseUrlLabel}),(0,$.jsx)(`input`,{id:`manage-base-url`,type:`url`,autoComplete:`off`,value:l,onChange:e=>u(e.target.value),className:J(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,We)})]}),(0,$.jsx)(ar,{providerId:e,inputId:`manage-custom-api-key`,value:d,onChange:f,labels:{apiKeyLabel:n.apiKeyLabel,apiKeyPlaceholder:n.apiKeyPlaceholder,maskedHelp:n.maskedHelp,copy:n.copy,copied:n.copied,show:n.showKey,hide:n.hideKey,notInConfigFile:n.notInConfigFile,loadFailed:n.loadFailed}}),(0,$.jsxs)(`label`,{className:`flex items-start gap-3 rounded-xl border border-edge-subtle bg-surface-panel/40 p-3`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:y,onChange:e=>b(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-accent`}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r===`zh`?`自动同步模型目录`:`Automatically sync model catalog`}),(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-muted`,children:r===`zh`?`启动时及定时从此服务的 /models 接口更新模型。`:`Update models from this service’s /models endpoint at startup and on schedule.`})]})]}),(0,$.jsxs)(`div`,{className:`border-t border-edge-subtle pt-3`,children:[(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`span`,{className:`text-sm font-semibold text-fg`,children:[s.modelsSection,p.length>0?` (${p.length})`:``]}),(0,$.jsxs)(Z,{type:`button`,variant:`primary`,className:`gap-1.5 px-2 py-1 text-xs`,onClick:()=>L(null,!0),children:[(0,$.jsx)(ye,{className:`size-3.5`,"aria-hidden":!0}),s.addModel]})]}),(0,$.jsxs)(`label`,{className:`mb-2 flex items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:g,onChange:e=>_(e.target.checked)}),r===`zh`?`仅电脑控制模型`:`Computer Use only`]}),p.filter(e=>!g||e.computerUse).length===0?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:s.modelsEmpty}):(0,$.jsx)(`ul`,{className:`space-y-2`,children:p.filter(e=>!g||e.computerUse).map(e=>(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-lg border border-edge-subtle bg-surface-panel/40 px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.id}),e.computerUse&&(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:`Computer Use`}),e.name&&e.name!==e.id?(0,$.jsx)(`div`,{className:`truncate text-xs text-fg-muted`,children:e.name}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,$.jsx)(`button`,{type:`button`,className:J(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,Re.press),onClick:()=>L(e,!1),"aria-label":s.editModel,children:(0,$.jsx)(_e,{className:`size-3.5`,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,className:J(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-red-600 dark:hover:text-red-400`,Re.press),onClick:()=>k(e.id),"aria-label":s.removeModel,children:(0,$.jsx)(we,{className:`size-3.5`,"aria-hidden":!0})})]})]},e.id))})]}),w?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:w}):null]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-t border-edge-subtle px-5 py-3`,children:[(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`gap-1.5 text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300`,onClick:()=>D(!0),children:[(0,$.jsx)(we,{className:`size-3.5`,"aria-hidden":!0}),n.remove]}),(0,$.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,$.jsx)(Z,{type:`button`,variant:`primary`,disabled:S,onClick:()=>void P(),children:S?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(ge,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),n.saving]}):n.save})})]}),(0,$.jsx)($e,{open:E,title:n.removeConfirmTitle,description:n.removeConfirmDescription.replace(`{{provider}}`,e),confirmLabel:n.removeConfirmAction,cancelLabel:n.cancel,destructive:!0,onConfirm:()=>void I(),onCancel:()=>D(!1)}),(0,$.jsx)($e,{open:O!==null,title:s.removeModel,description:s.removeModelConfirm.replace(`{{id}}`,O??``),confirmLabel:n.removeConfirmAction,cancelLabel:n.cancel,destructive:!0,onConfirm:()=>{O&&z(O)},onCancel:()=>k(null)}),(0,$.jsx)(rr,{open:A,onOpenChange:e=>{j(e),e||N(null)},providerId:e,model:M?.model??null,isNew:M?.isNew??!1,onSave:e=>void R(e),m:s})]})}var ur=[`fast`,`reasoning`,`coding`,`review`,`vision`,`understanding`],dr=`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/15`,fr={en:{fast:[`Fast tasks`,`Short, low-latency work`],reasoning:[`Complex reasoning`,`Planning and multi-step analysis`],coding:[`Coding`,`Implementation and debugging`],review:[`Review`,`Critique and verification`],vision:[`Vision`,`Image and visual analysis`],understanding:[`Understanding`,`Long-form content comprehension`]},zh:{fast:[`快速任务`,`简短、低延迟的工作`],reasoning:[`复杂推理`,`规划和多步骤分析`],coding:[`编程`,`实现、调试和代码修改`],review:[`审查`,`检查、批评和验证`],vision:[`视觉任务`,`图片和视觉内容分析`],understanding:[`内容理解`,`长内容阅读和理解`]}};function pr(e,t){return{primary:t,fallbacks:e?.fallbacks??[]}}function mr(e){let t=(0,$t.c)(38),{draft:n,setDraft:r,zh:i,capability:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={revalidateOnFocus:!1},t[0]=o):o=t[0];let s=X(Pe,Ne,o),c;t[1]===s.data?c=t[2]:(c=s.data??[],t[1]=s.data,t[2]=c);let l=c,u=i?fr.zh:fr.en,d;t[3]!==n||t[4]!==r?(d=(e,t)=>{let i={...n.models.intents};t?i[e]=pr(i[e],t):delete i[e],r({...n,models:{...n.models,intents:i}})},t[3]=n,t[4]=r,t[5]=d):d=t[5];let f=d,p;t[6]!==a||t[7]!==n||t[8]!==l||t[9]!==s.error||t[10]!==s.isLoading||t[11]!==r||t[12]!==i?(p=a===`chat`?(0,$.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:(0,$.jsx)(Dt,{title:i?`模型回退`:`Model fallbacks`,summary:i?`已配置 ${n.models.chat.fallbacks.length} 个备用模型。`:`${n.models.chat.fallbacks.length} fallback models configured.`,children:(0,$.jsx)(`div`,{className:`mt-6 rounded-xl bg-surface-base/45 p-4`,children:(0,$.jsx)(Yt,{primary:n.models.chat.primary,value:n.models.chat.fallbacks,models:l,loading:s.isLoading,error:s.error,zh:i,onChange:e=>r({...n,models:{...n.models,chat:{...n.models.chat,fallbacks:e}}})})})})}):null,t[6]=a,t[7]=n,t[8]=l,t[9]=s.error,t[10]=s.isLoading,t[11]=r,t[12]=i,t[13]=p):p=t[13];let m;t[14]!==a||t[15]!==n||t[16]!==r||t[17]!==i?(m=a===`image`?(0,$.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:n.models.imageGeneration?(0,$.jsx)(Dt,{title:i?`图片执行策略`:`Image execution policy`,summary:i?`当前超时与回退策略继续生效。`:`The current timeout and fallback policy remains active.`,children:(0,$.jsxs)(`div`,{className:`mt-5 grid gap-4 rounded-xl bg-surface-base/45 p-4 sm:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[i?`生成超时(毫秒)`:`Generation timeout (ms)`,(0,$.jsx)(jt,{allowEmpty:!0,type:`number`,min:1,className:`${dr} mt-2`,value:n.models.imageGeneration.timeoutMs??``,onChange:e=>r({...n,models:{...n.models,imageGeneration:{...n.models.imageGeneration,timeoutMs:e.target.value?Number(e.target.value):void 0}}})})]}),(0,$.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,$.jsx)(`span`,{children:i?`服务商自动回退`:`Automatic provider fallback`}),(0,$.jsx)(Qe,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,role:`group`,"aria-label":i?`服务商自动回退`:`Automatic provider fallback`,children:[!0,!1].map(e=>(0,$.jsx)(Z,{"aria-pressed":n.models.imageGeneration?.autoProviderFallback===e,variant:n.models.imageGeneration?.autoProviderFallback===e?`secondary`:`ghost`,className:`flex-1 py-1.5 text-xs`,onClick:()=>r({...n,models:{...n.models,imageGeneration:{...n.models.imageGeneration,autoProviderFallback:e}}}),children:e?i?`开启`:`On`:i?`关闭`:`Off`},String(e)))})]})]})}):null}):null,t[14]=a,t[15]=n,t[16]=r,t[17]=i,t[18]=m):m=t[18];let h;t[19]!==a||t[20]!==n||t[21]!==l||t[22]!==s.error||t[23]!==s.isLoading||t[24]!==r||t[25]!==i?(h=a===`vision`&&n.models.imageUnderstanding?(0,$.jsx)(Dt,{title:i?`模型回退`:`Model fallbacks`,summary:i?`主模型不可用时使用已配置的备用模型。`:`Use configured fallback models when the primary is unavailable.`,children:(0,$.jsx)(Yt,{primary:n.models.imageUnderstanding.primary,value:n.models.imageUnderstanding.fallbacks,models:l.filter(hr),loading:s.isLoading,error:s.error,zh:i,onChange:e=>r({...n,models:{...n.models,imageUnderstanding:{...n.models.imageUnderstanding,fallbacks:e}}})})}):null,t[19]=a,t[20]=n,t[21]=l,t[22]=s.error,t[23]=s.isLoading,t[24]=r,t[25]=i,t[26]=h):h=t[26];let g;t[27]!==a||t[28]!==u||t[29]!==n||t[30]!==f||t[31]!==i?(g=a===`chat`?(0,$.jsx)(Dt,{title:i?`任务模型路由`:`Task model routing`,summary:i?`已配置 ${Object.keys(n.models.intents).length} 类任务路由;其他任务使用默认模型。`:`${Object.keys(n.models.intents).length} task routes configured; other tasks use the default model.`,children:(0,$.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:i?`按任务选择模型`:`Route by task`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:i?`仅在确实需要不同模型时设置;否则保持“使用默认对话模型”。`:`Set a route only when a task genuinely needs another model; otherwise keep the default.`}),(0,$.jsx)(`div`,{className:`mt-5 grid gap-3 lg:grid-cols-2`,children:ur.map(e=>(0,$.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:u[e][0]}),(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:u[e][1]})]}),(0,$.jsx)(nt,{value:n.models.intents[e]?.primary??``,placeholder:i?`使用默认对话模型`:`Use default conversation model`,searchPlaceholder:i?`搜索模型或服务商`:`Search models or providers`,noMatches:i?`没有匹配的模型`:`No matching models`,allowEmpty:!0,emptyLabel:i?`使用默认对话模型`:`Use default conversation model`,showProviderInTrigger:!1,contentAlign:`start`,className:`w-full`,ariaLabel:i?`${u[e][0]}模型`:`${u[e][0]} model`,onChange:t=>f(e,t)})]},e))})]})}):null,t[27]=a,t[28]=u,t[29]=n,t[30]=f,t[31]=i,t[32]=g):g=t[32];let _;return t[33]!==p||t[34]!==m||t[35]!==h||t[36]!==g?(_=(0,$.jsxs)(`div`,{className:`space-y-5`,children:[p,m,h,g]}),t[33]=p,t[34]=m,t[35]=h,t[36]=g,t[37]=_):_=t[37],_}function hr(e){return e.vision}function gr(e){let t=(0,$t.c)(9),{data:n,error:r}=X(`settings-agent-defaults`,ot);if(r&&!n){let e=String(r),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:e}),t[0]=e,t[1]=n),n}if(!n){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Y,{className:`h-32 rounded-xl`}),t[2]=e):e=t[2],e}let i;t[3]===n.defaults.models?i=t[4]:(i=JSON.stringify(n.defaults.models),t[3]=n.defaults.models,t[4]=i);let a;return t[5]!==n.defaults||t[6]!==e||t[7]!==i?(a=(0,$.jsx)(_r,{...e,initial:n.defaults},i),t[5]=n.defaults,t[6]=e,t[7]=i,t[8]=a):a=t[8],a}function _r(e){let t=(0,$t.c)(36),{initial:n,capability:r,zh:i,disabled:a,onPendingChange:o}=e,s;t[0]===n?s=t[1]:(s=()=>structuredClone(n),t[0]=n,t[1]=s);let[c,l]=(0,Q.useState)(s),u;t[2]===n?u=t[3]:(u=()=>structuredClone(n),t[2]=n,t[3]=u);let[d,f]=(0,Q.useState)(u),p;t[4]===c.models?p=t[5]:(p=JSON.stringify(c.models),t[4]=c.models,t[5]=p);let m;t[6]===d.models?m=t[7]:(m=JSON.stringify(d.models),t[6]=d.models,t[7]=m);let h=p!==m,g;t[8]!==n.models||t[9]!==i?(g=async e=>{let t=await ot();if(JSON.stringify(t.defaults.models)!==JSON.stringify(n.models))throw Error(i?`模型设置已变化,请刷新后重试。`:`Model settings changed. Refresh before retrying.`);let r=await at({...t.defaults,models:e.models},{scope:`models`,expectedModels:n.models});f(r.defaults),await pt()},t[8]=n.models,t[9]=i,t[10]=g):g=t[10];let _=g,v;t[11]!==h||t[12]!==c||t[13]!==_?(v={value:c,dirty:h,onSave:_,delayMs:0},t[11]=h,t[12]=c,t[13]=_,t[14]=v):v=t[14];let y=Lt(v),b=h||y.status===`saving`||!!y.error,x,S;t[15]!==o||t[16]!==b?(x=()=>(o(b),()=>o(!1)),S=[b,o],t[15]=o,t[16]=b,t[17]=x,t[18]=S):(x=t[17],S=t[18]),(0,Q.useEffect)(x,S);let C=a||y.status===`saving`,w;t[19]!==y.error||t[20]!==y.status?(w=(0,$.jsx)(It,{status:y.status,error:y.error}),t[19]=y.error,t[20]=y.status,t[21]=w):w=t[21];let T;t[22]!==y.error||t[23]!==y.retry||t[24]!==i?(T=y.error?(0,$.jsx)(Z,{variant:`secondary`,onClick:y.retry,children:i?`重试保存`:`Retry saving`}):null,t[22]=y.error,t[23]=y.retry,t[24]=i,t[25]=T):T=t[25];let E;t[26]!==r||t[27]!==c||t[28]!==i?(E=(0,$.jsx)(mr,{capability:r,draft:c,setDraft:l,zh:i}),t[26]=r,t[27]=c,t[28]=i,t[29]=E):E=t[29];let D;return t[30]!==y.onBlurCapture||t[31]!==w||t[32]!==T||t[33]!==E||t[34]!==C?(D=(0,$.jsxs)(`fieldset`,{disabled:C,onBlurCapture:y.onBlurCapture,className:`min-w-0 space-y-3`,children:[w,T,E]}),t[30]=y.onBlurCapture,t[31]=w,t[32]=T,t[33]=E,t[34]=C,t[35]=D):D=t[35],D}function vr(e){return e.status===`ready`?`ready`:e.status===`disabled`?`off`:e.status===`degraded`?`degraded`:e.rejected?.length?`misconfigured`:`not-configured`}function yr(e,t){if(e.startsWith(`agentCatalog.defaults.models`))return{label:t?`模型与能力`:`Models and capabilities`,href:`/settings/capabilities/models`};let n=e.match(/^agentCatalog\.agents\.([^.]+)\.models/);return n?.[1]?{label:t?`智能体 ${n[1]}`:`Agent ${n[1]}`,href:it(n[1])}:e.startsWith(`sessions.`)?{label:t?`会话模型覆盖`:`Session model override`,href:`/settings/sessions`}:{label:e,href:`/settings/agent-defaults`}}function br(e,t){switch(e){case`computer-use`:return{guidance:t?`选择兼容的电脑控制模型;本机权限需单独授权`:`Select a compatible computer model; local access requires separate approval`,action:t?`配置电脑控制`:`Configure computer use`};case`vision`:return{guidance:t?`接入支持图片理解的模型服务`:`Connect a model service that supports vision`,action:t?`去接入模型`:`Connect model`};case`image-generation`:return{guidance:t?`选择图片模型并配置所需凭据`:`Choose an image model and configure its credentials`,action:t?`去配置图片生成`:`Configure image generation`};case`stt`:return{guidance:t?`选择语音识别服务,或安装自管 STT 插件`:`Choose a speech-to-text service or install a self-managed STT plugin`,action:t?`去配置语音识别`:`Configure speech-to-text`};case`tts`:return{guidance:t?`选择语音合成服务并完成凭据配置`:`Choose a text-to-speech service and configure its credentials`,action:t?`去配置语音合成`:`Configure text-to-speech`}}}async function xr(){let e=await u(d(`/api/models/catalog`)),t=await e.json().catch(()=>null);if(!e.ok||!t?.ok||!t.payload)throw Error(t?.error?.message??`HTTP ${e.status}`);return t.payload}async function Sr(){let e=await u(d(`/api/capabilities/readiness`)),t=await e.json().catch(()=>null);if(!e.ok||!t?.ok||!t.payload)throw Error(t?.error?.message??`HTTP ${e.status}`);return t.payload}function Cr({showCapabilities:e=!0,embedded:t=!1}={}){let n=p(e=>e.language)===`zh`,{data:r,error:i,isLoading:a}=X(ht,xr,{revalidateOnFocus:!0,refreshInterval:6e4}),{data:o}=X(gt,Sr,{revalidateOnFocus:!1}),[s,c]=(0,Q.useState)(!1),[f,m]=(0,Q.useState)(null),h=Object.values(r?.sources??{}),g=h.reduce((e,t)=>e+t.models.filter(e=>e.availability===`available`).length,0),_=(r?.references??[]).filter(e=>e.availability===`unavailable`),v=r?.sync.lastSuccessAt??Math.max(0,...h.map(e=>e.lastSuccessAt)),y=!!i,b=r?.sync.sourceErrors??{},x=[...r?.sync.lastError?[[`catalog`,r.sync.lastError]]:[],...Object.entries(b),...f?[[`refresh`,f]]:[],...i instanceof Error?[[`load`,i.message]]:[]],S=r?.sync.lastAttemptAt??v,w=Object.entries(o?.capabilities??{}).filter(([e])=>e!==`computer-use`||Ye()),T=w.some(([,e])=>{let t=vr(e);return t===`degraded`||t===`misconfigured`}),E=w.filter(([,e])=>vr(e)===`ready`).length,D=(0,Q.useRef)(null);if((0,Q.useEffect)(()=>{T&&!a&&D.current?.setAttribute(`open`,``)},[T,a]),a)return(0,$.jsx)(Y,{className:`h-24 w-full rounded-2xl`});let k=async()=>{c(!0),m(null);try{let e=await u(d(`/api/models/catalog/refresh`),{method:`POST`});if(!e.ok)throw Error(`HTTP ${e.status}`);await pt()}catch(e){m(e instanceof Error?e.message:String(e))}finally{c(!1)}},A=(0,$.jsx)(`div`,{className:`mt-2 space-y-1 rounded-lg bg-surface-base/45 p-2 font-mono text-[11px] leading-5`,"aria-label":n?`同步错误详情`:`Sync error details`,children:x.map(([e,t],n)=>(0,$.jsxs)(`p`,{className:`break-words`,children:[e,`: `,t]},`${e}-${n}`))}),j=(0,$.jsxs)(`div`,{className:`mt-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 text-xs text-fg-muted`,children:[(0,$.jsx)(`p`,{children:n?`${h.length} 个来源,${g} 个可用模型${v?` · 最近同步 ${new Date(v).toLocaleString()}`:``}`:`${h.length} sources, ${g} available models${v?` · Last synced ${new Date(v).toLocaleString()}`:``}`}),x.length>0?t?(0,$.jsxs)(`details`,{className:`mt-2 rounded-lg bg-surface-base/45 p-2`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer rounded text-xs font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:n?`高级诊断`:`Advanced diagnostics`}),A]}):A:null]}),(0,$.jsxs)(Z,{className:`shrink-0`,type:`button`,variant:`secondary`,disabled:s,onClick:()=>void k(),children:[s?(0,$.jsx)(ge,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(be,{className:`size-4`,"aria-hidden":!0}),s?n?`刷新中…`:`Refreshing…`:n?`刷新目录`:`Refresh catalog`]})]});return(0,$.jsxs)(`section`,{className:t?`mt-4 border-t border-edge-subtle pt-1`:`rounded-xl bg-surface-hover/25 p-4 sm:p-5`,children:[e?(0,$.jsxs)(`details`,{ref:D,className:`group`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer list-none rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsxs)(`div`,{className:`flex min-h-10 items-center gap-2`,children:[T?(0,$.jsx)(Te,{className:`size-4 text-amber-500`,"aria-hidden":!0}):E===w.length&&w.length>0?(0,$.jsx)(M,{className:`size-4 text-emerald-500`,"aria-hidden":!0}):(0,$.jsx)(P,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-semibold text-fg`,children:n?`可选能力`:`Optional capabilities`}),(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs font-normal text-fg-muted`,children:n?`${E}/${w.length} 项已配置,不影响基础聊天功能`:`${E} of ${w.length} configured · Not required for chat`})]}),(0,$.jsx)(O,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-open:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]})}),o?(0,$.jsx)(`div`,{className:`mt-3 grid gap-1 sm:grid-cols-2`,children:Object.entries(o.capabilities).map(([e,t])=>{if(e===`computer-use`&&!Ye())return null;let r=e===`vision`?n?`图片理解`:`Vision`:e===`image-generation`?n?`图片生成`:`Image generation`:e===`computer-use`?n?`电脑控制模型`:`Computer use model`:e.toUpperCase(),i=t.selectionSource!==`explicit-config`,a=vr(t),o=a===`degraded`||a===`misconfigured`,s=br(e,n),c=(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`min-w-0 text-xs font-medium text-fg`,children:r}),(0,$.jsx)(`span`,{className:a===`ready`?`shrink-0 text-xs text-emerald-600 dark:text-emerald-400`:a===`off`||a===`not-configured`?`shrink-0 text-xs text-fg-muted`:`shrink-0 text-xs text-amber-600 dark:text-amber-400`,children:a===`ready`?e===`computer-use`?n?`已配置`:`Configured`:n?`可用`:`Ready`:a===`off`?n?`已关闭`:`Off`:a===`not-configured`?n?`未配置`:`Not configured`:a===`degraded`?n?`正在使用备用方案`:`Using fallback`:n?`需处理`:`Needs attention`})]}),(0,$.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted`,title:t.primary?`${t.primary.provider}/${t.primary.model}`:void 0,children:t.primary?`${i?n?`自动`:`Auto`:n?`显式`:`Explicit`} · ${t.primary.provider}/${t.primary.model}`:a===`not-configured`?n?`可稍后按需配置`:`Set up later if needed`:n?`已配置的模型不可用`:`The configured model is unavailable`}),o?(0,$.jsxs)(`div`,{className:`mt-2 rounded-lg bg-amber-500/10 p-2`,children:[(0,$.jsx)(`p`,{className:`text-xs leading-5 text-amber-700 dark:text-amber-300`,children:t.status===`degraded`?n?`当前配置不可用,正在使用备用方案。${s.guidance}`:`The current configuration is unavailable, so a fallback is in use. ${s.guidance}.`:s.guidance}),(0,$.jsxs)(`span`,{className:`mt-1 inline-flex items-center gap-1 text-xs font-medium text-accent`,children:[s.action,(0,$.jsx)(C,{className:`size-3.5`,"aria-hidden":!0})]})]}):null]}),u={"aria-label":o?`${r}:${s.action}`:`${n?`配置`:`Configure`} ${r}`,className:J(`rounded-lg bg-surface-base/45 px-3 py-3 text-left transition-colors`,o?`bg-amber-500/5 hover:bg-amber-500/10`:`hover:bg-surface-hover/30`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`)};if(e===`computer-use`)return(0,$.jsx)(l,{to:`/settings/computer-use`,...u,children:c},e);let d={vision:`vision`,"image-generation":`image`,stt:`transcription`,tts:`speech`}[e];return(0,$.jsx)(`button`,{type:`button`,"aria-haspopup":`dialog`,...u,onClick:()=>Le(d,o?`services`:`settings`),children:c},e)})}):null]}):null,_.length>0?(0,$.jsx)(`div`,{className:`mt-3 space-y-2`,"aria-live":`polite`,children:_.map(e=>(0,$.jsx)(`div`,{className:`rounded-lg border border-amber-500/25 bg-amber-500/5 p-3`,children:(()=>{let t=e.ref.split(`/`)[0]??``,r=!!b[t],i=yr(e.locations[0]??``,n);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(Te,{className:`mt-0.5 size-4 shrink-0 text-amber-500`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`p`,{className:`break-words text-sm font-medium text-fg`,children:[e.ref,(0,$.jsx)(`span`,{className:`ml-2 font-normal text-amber-700 dark:text-amber-300`,children:r?n?`暂时无法验证`:`Temporarily unverified`:n?`不可用`:`Unavailable`})]}),(0,$.jsxs)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:[r?n?`模型目录同步暂时失败,当前状态可能已过期;不会影响其他可用模型。`:`Catalog sync temporarily failed, so this status may be stale. Other available models are unaffected.`:n?`此模型已无法从当前配置中解析,使用它的功能可能失败。`:`This model no longer resolves from the current configuration. Features using it may fail.`,S?` · ${n?`最近检测`:`Last checked`} ${new Date(S).toLocaleString()}`:``]}),e.suggestedRef?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[n?`可替换为`:`Suggested replacement`,`:`,(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:e.suggestedRef})]}):null]})]}),(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1`,children:[(0,$.jsxs)(Z,{className:`px-2.5 py-1.5 text-xs`,variant:`ghost`,disabled:s,onClick:()=>void k(),children:[s?(0,$.jsx)(ge,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(be,{className:`size-3.5`,"aria-hidden":!0}),s?n?`检测中…`:`Checking…`:n?`重新检测`:`Check again`]}),(0,$.jsx)(Z,{asChild:!0,className:`px-2.5 py-1.5 text-xs`,variant:`ghost`,children:(0,$.jsxs)(l,{to:i.href,children:[(0,$.jsx)(Ee,{className:`size-3.5`,"aria-hidden":!0}),e.suggestedRef?n?`更换模型`:`Replace model`:n?`调整配置`:`Adjust configuration`]})}),(0,$.jsxs)(`details`,{className:`group/references`,children:[(0,$.jsxs)(`summary`,{className:`touch-target inline-flex cursor-pointer list-none items-center gap-1 rounded-xl px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[n?`查看 ${e.locations.length} 处引用`:`View ${e.locations.length} ${e.locations.length===1?`reference`:`references`}`,(0,$.jsx)(O,{className:`size-3.5 transition-transform group-open/references:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 pl-2 text-xs text-fg-muted`,children:e.locations.map(e=>{let t=yr(e,n);return(0,$.jsx)(`li`,{children:(0,$.jsx)(l,{className:`inline-flex rounded px-1.5 py-1 text-accent hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,to:t.href,title:e,children:t.label})},e)})})]})]})]})})()},e.ref))}):null,y||f?(0,$.jsx)(`p`,{className:`mt-3 text-sm text-danger`,role:`alert`,children:y?n?`暂时无法读取模型状态,请重新检测;详细信息可在高级诊断中查看。`:`Model status is temporarily unavailable. Check again; details are available in Advanced diagnostics.`:n?`重新检测失败,请稍后重试;详细信息可在高级诊断中查看。`:`The check failed. Try again later; details are available in Advanced diagnostics.`}):null,t?j:(0,$.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:[(0,$.jsx)(`summary`,{className:`min-h-8 cursor-pointer rounded-md py-1.5 text-xs font-medium text-fg-muted hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:n?`高级诊断`:`Advanced diagnostics`}),j]})]})}var wr=()=>d(`/api/music-generation/settings`),Tr=new Map([[`mureka-cn`,`https://platform.mureka.cn/`],[`mureka-global`,`https://platform.mureka.ai/`]]),Er={secretId:`SecretId`,secretKey:`SecretKey`},Dr=[`secretId`,`secretKey`];function Or(e,t){return e===`mureka-cn`?t?`Mureka 中国站`:`Mureka China`:e===`mureka-global`?t?`Mureka 国际站`:`Mureka Global`:e===`tencent-mps`?t?`腾讯云媒体处理(MPS)`:`Tencent Cloud MPS`:e===`xopc-cloud`?`XOPC Cloud`:e}function kr({zh:e,disabled:t,onManageCloud:n}){let{data:r,error:i,mutate:a}=X(wr(),m),{mutate:o}=Ae(),[s,c]=(0,Q.useState)(),[l,u]=(0,Q.useState)(),[f,p]=(0,Q.useState)(),[h,C]=(0,Q.useState)({}),[T,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(``),M=r?.models.find(e=>e.ref===r.modelRef),N=r?.models.find(e=>e.ref===l?.modelRef),ee=t=>t===`song`?e?`歌曲`:`Song`:e?`纯音乐`:`Instrumental`,P=s?r?.credentials[s]:void 0,F=s?Tr.get(s):void 0,I=s===Qt,L=s?`${wr()}/credentials/${encodeURIComponent(s)}`:``,R=f??(P===`saved`?`••••••••••••`:``),z=f?.trim()??``,B=I?Dr.every(e=>{let t=h[e]?.trim()??``;return t&&!Ge(t)}):!!(z&&!Ge(z)),V=t=>t===`saved`?e?`已保存密钥`:`Credentials saved`:t===`oauth`?e?`已连接`:`Connected`:t===`environment`?e?`使用环境变量`:`Using environment variables`:e?`待连接`:`Connection needed`;async function H(e,n,r){if(t||T)return!1;E(!0),O(``);try{let t=await m(e,{method:n,body:r&&JSON.stringify(r)});return await a(t,{revalidate:!1}),o(e=>typeof e==`string`&&e.startsWith(d(`/api/music-generation/sessions/`))),!0}catch(e){return O(e instanceof Error?e.message:String(e)),!1}finally{E(!1)}}function U(){c(void 0),u(void 0),p(void 0),C({}),O(``)}return(0,$.jsxs)(`div`,{"data-capability":`music`,children:[(0,$.jsx)(Wn,{actionColumn:!0,description:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e?`创作音乐`:`Music generation`}),M&&(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:V(r?.credentials[M.providerId])})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:e?`生成带歌词的歌曲和纯音乐`:`Generate songs with lyrics and instrumental tracks`})]}),picker:r&&M?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{placeholder:e?`选择模型`:`Choose a model`,ariaLabel:e?`选择音乐生成模型`:`Select music generation model`,value:r.modelRef,allowEmpty:!1,triggerClassName:`min-h-11`,disabled:t||T,onChange:e=>{e!==r.modelRef&&H(wr(),`PUT`,{modelRef:e})},options:r.models.map(t=>({value:t.ref,label:t.name,group:Or(t.providerId,e)}))}),(0,$.jsx)(Un,{name:Or(M.providerId,e),manageLabel:e?`管理服务`:`Manage services`,disabled:t||T,onManage:M.providerId===`xopc-cloud`?n:()=>{O(``),c(M.providerId)}}),M.creditMicroPerTrack&&(0,$.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[ke(String(M.creditMicroPerTrack)),` `,e?`Credits / 首`:`Credits / track`]}),T&&!s&&!l&&(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:e?`正在切换…`:`Switching…`}),!s&&!l&&D&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:D})]}):i?(0,$.jsxs)(`div`,{role:`alert`,className:`text-sm text-danger`,children:[e?`音乐模型加载失败`:`Could not load music models`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void a(),children:e?`重试`:`Retry`})]}):(0,$.jsx)(Y,{className:`h-11 w-full rounded-xl`}),actions:r&&M&&(0,$.jsx)(Z,{variant:`ghost`,className:`min-h-11`,disabled:t||T,onClick:()=>{O(``),u({modelRef:r.modelRef,mode:r.defaults?.mode??M.modes[0]??`song`})},children:e?`设置`:`Settings`})}),(0,$.jsx)(S,{open:!!l,onOpenChange:e=>{!e&&!T&&U()},children:(0,$.jsxs)(y,{children:[(0,$.jsx)(g,{className:`fixed inset-0 z-[150] bg-scrim`}),(0,$.jsxs)(b,{className:`fixed left-1/2 top-1/2 z-[151] flex h-[min(20rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,children:[(0,$.jsxs)(`header`,{className:`border-b border-edge px-5 py-4`,children:[(0,$.jsx)(x,{className:`font-semibold text-fg`,children:e?`音乐生成设置`:`Music generation settings`}),(0,$.jsx)(_,{className:`mt-1 text-sm text-fg-muted`,children:N&&[Or(N.providerId,e),N.name].join(` · `)})]}),l&&N&&(0,$.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:async e=>{e.preventDefault(),await H(wr(),`PATCH`,l)&&U()},children:[(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto px-5 py-4 text-sm`,children:[(0,$.jsx)(`label`,{htmlFor:`music-default-mode`,className:`block font-medium text-fg`,children:e?`默认创作类型`:`Default creation type`}),(0,$.jsx)(k,{id:`music-default-mode`,value:l.mode,disabled:T,onChange:e=>u({...l,mode:e.target.value}),children:N.modes.map(e=>(0,$.jsx)(A,{value:e,children:ee(e)},e))}),(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`聊天中未指定类型时使用。`:`Used when the chat request does not specify a type.`}),D&&(0,$.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-danger`,children:D})]}),(0,$.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge px-5 py-3`,children:[(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{variant:`ghost`,disabled:T,children:e?`取消`:`Cancel`})}),(0,$.jsx)(Z,{type:`submit`,variant:`primary`,disabled:t||T,children:T?e?`正在保存…`:`Saving…`:e?`保存`:`Save`})]})]})]})]})}),(0,$.jsx)(S,{open:!!s,onOpenChange:e=>{!e&&!T&&U()},children:(0,$.jsxs)(y,{children:[(0,$.jsx)(g,{className:`fixed inset-0 z-[150] bg-scrim`}),(0,$.jsxs)(b,{className:`fixed left-1/2 top-1/2 z-[151] flex h-[min(23rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,children:[(0,$.jsxs)(`header`,{className:`border-b border-edge px-5 py-4`,children:[(0,$.jsx)(x,{className:`font-semibold text-fg`,children:s&&Or(s,e)}),(0,$.jsx)(_,{className:`mt-1 text-sm text-fg-muted`,children:V(P)})]}),s&&(0,$.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:async e=>{e.preventDefault(),B&&await H(L,`PUT`,I?h:{apiKey:z})&&U()},children:[(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto px-5 py-4`,children:[I?(0,$.jsxs)($.Fragment,{children:[Dr.map(n=>{let r=h[n]??(P===`saved`?`••••••••••••`:``),i=Er[n];return(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{htmlFor:`music-provider-${n}`,className:`block text-sm font-medium text-fg`,children:i}),(0,$.jsx)(fe,{id:`music-provider-${n}`,autoComplete:`new-password`,value:r,disabled:t||T,onChange:e=>C(t=>({...t,[n]:Ge(r)?e.replace(/^•+/,``):e})),labels:e?{show:`显示 ${i}`,hide:`隐藏 ${i}`,copy:`复制 ${i}`,copied:`已复制`}:{show:`Show ${i}`,hide:`Hide ${i}`,copy:`Copy ${i}`,copied:`Copied`},reveal:P===`saved`?()=>m(L,{method:`POST`,body:JSON.stringify({field:n})}).then(e=>e.value):void 0,allowUnrevealedCopy:!0,loadFailedLabel:e?`无法读取已保存的密钥。`:`Could not load the saved credential.`})]},n)}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs`,children:[(0,$.jsxs)(`a`,{href:`https://console.cloud.tencent.com/mps`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-accent-fg hover:underline`,children:[e?`开通腾讯云 MPS`:`Activate Tencent Cloud MPS`,(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":!0})]}),(0,$.jsxs)(`a`,{href:`https://console.cloud.tencent.com/cam/capi`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-accent-fg hover:underline`,children:[e?`管理腾讯云 API 密钥`:`Manage Tencent Cloud API keys`,(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":!0})]})]}),(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`请填写同一对密钥。更新时需重新填写两项。`:`Enter a matching pair. Fill in both fields when replacing credentials.`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 gap-y-1`,children:[(0,$.jsx)(`label`,{className:`text-sm font-medium text-fg`,htmlFor:`music-provider-api-key`,children:`API Key`}),F&&(0,$.jsxs)(`a`,{href:F,target:`_blank`,rel:`noreferrer`,className:`inline-flex min-h-8 items-center gap-1 rounded-sm text-xs text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[e?`获取 API Key`:`Get an API key`,(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":!0})]})]}),(0,$.jsx)(fe,{id:`music-provider-api-key`,autoComplete:`new-password`,value:R,disabled:t||T,onChange:e=>p(Ge(R)?e.replace(/^•+/,``):e),placeholder:e?`粘贴 API Key`:`Paste your API key`,labels:e?{show:`显示密钥`,hide:`隐藏密钥`,copy:`复制密钥`,copied:`已复制`}:{show:`Show key`,hide:`Hide key`,copy:`Copy key`,copied:`Copied`},reveal:P===`saved`?()=>yt(s).then(e=>e.apiKey):void 0,allowUnrevealedCopy:!0,loadFailedLabel:e?`无法读取已保存的 API Key。`:`Could not load the saved API key.`,notInConfigFile:e?`网关中没有可查看的密钥。`:`No saved key is available to show.`},s),F&&(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:e?`登录对应站点的 Mureka 开放平台,在「API Keys」创建密钥,然后粘贴到这里并保存。`:`Sign in to this region’s Mureka API platform, create a key under API Keys, then paste it here and save.`})]}),D&&(0,$.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-danger`,children:D})]}),(0,$.jsxs)(`footer`,{className:`flex items-center justify-end gap-2 border-t border-edge px-5 py-3`,children:[P===`saved`&&(0,$.jsx)(Z,{variant:`ghost`,type:`button`,className:`mr-auto`,disabled:T,onClick:async()=>{await H(L,`DELETE`)&&U()},children:e?`移除密钥`:`Remove key`}),(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{variant:`ghost`,disabled:T,children:e?`取消`:`Cancel`})}),(0,$.jsx)(Z,{type:`submit`,variant:`primary`,disabled:t||T||!B,children:T?e?`正在保存…`:`Saving…`:e?`保存`:`Save`})]})]})]})]})})]})}function Ar({zh:e,disabled:t,onManage:n}){let{data:r,error:i,mutate:a}=ft(),{mutate:o}=Ae(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(``),[f,p]=(0,Q.useState)(null),h=r&&E[r.modelRef],C=h&&r?.configured[h.provider],w=t=>t===`dashscope-cn`?e?`阿里云百炼`:`Alibaba Cloud Bailian`:t===`xopc-cloud`?`XOPC Cloud`:e?`火山方舟`:`Volcengine Ark`;async function O(e,n){if(t||s)return!1;c(!0),u(``);try{let t=await m(d(mt),{method:e,body:JSON.stringify(n)});return await a(t,{revalidate:!1}),o(e=>typeof e==`string`&&e.startsWith(d(`/api/video-generation/sessions/`))),!0}catch(e){return u(e instanceof Error?e.message:String(e)),!1}finally{c(!1)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{"data-capability":`video`,children:(0,$.jsx)(Wn,{actionColumn:!0,description:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e?`生成视频`:`Video generation`}),h&&!C&&(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:e?`待连接`:`Connection needed`})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:e?`文生视频和图生视频`:`Text-to-video and image-to-video`})]}),picker:r&&h?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{placeholder:e?`选择模型`:`Choose a model`,ariaLabel:e?`选择视频生成模型`:`Select video generation model`,value:r.modelRef,triggerClassName:`min-h-11`,allowEmpty:!1,disabled:t||s,onChange:e=>{e!==r.modelRef&&O(`PUT`,{modelRef:e})},options:(r.modelRefs??D).map(e=>{let t=E[e];return{value:e,label:t.name,group:w(t.provider)}})}),(0,$.jsx)(Un,{name:w(h.provider),manageLabel:e?`管理服务`:`Manage services`,onManage:()=>n(h.provider),disabled:t||s}),s&&(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:e?`正在切换…`:`Switching…`}),!f&&l&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:l})]}):i?(0,$.jsxs)(`div`,{role:`alert`,className:`text-sm text-danger`,children:[e?`视频模型加载失败`:`Could not load video models`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void a(),children:e?`重试`:`Retry`})]}):(0,$.jsx)(Y,{className:`h-11 w-full rounded-xl`}),actions:r&&h&&(0,$.jsx)(Z,{variant:`ghost`,className:`min-h-11`,disabled:t||s,onClick:()=>{u(``),p({modelRef:r.modelRef,...r.defaults})},children:e?`设置`:`Settings`})})}),(0,$.jsx)(S,{open:!!f,onOpenChange:e=>{!e&&!s&&(p(null),u(``))},children:(0,$.jsxs)(y,{children:[(0,$.jsx)(g,{className:`fixed inset-0 z-[150] bg-scrim`}),(0,$.jsxs)(b,{className:`fixed left-1/2 top-1/2 z-[151] flex h-[min(22rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,children:[(0,$.jsxs)(`header`,{className:`border-b border-edge px-5 py-4`,children:[(0,$.jsx)(x,{className:`font-semibold text-fg`,children:e?`视频生成设置`:`Video generation settings`}),(0,$.jsxs)(_,{className:`mt-1 text-sm text-fg-muted`,children:[f&&E[f.modelRef].name,` · `,e?`新任务的默认参数`:`Defaults for new jobs`]})]}),f&&(0,$.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:async e=>{e.preventDefault(),await O(`PATCH`,f)&&p(null)},children:[(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4 text-sm`,children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`p`,{children:e?`默认时长`:`Default duration`}),(0,$.jsx)(k,{"aria-label":e?`默认时长`:`Default duration`,value:String(f.duration),disabled:s,onChange:e=>p({...f,duration:Number(e.target.value)}),children:T(E[f.modelRef]).map(t=>(0,$.jsx)(A,{value:String(t),children:t===-1?e?`自动`:`Auto`:`${t}s`},t))})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`p`,{children:e?`默认分辨率`:`Default resolution`}),(0,$.jsx)(k,{"aria-label":e?`默认分辨率`:`Default resolution`,value:f.resolution,disabled:s,onChange:e=>p({...f,resolution:e.target.value}),children:E[f.modelRef].resolutions.map(e=>(0,$.jsx)(A,{value:e,children:e.toLowerCase()},e))})]}),l&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:l})]}),(0,$.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge px-5 py-3`,children:[(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{variant:`ghost`,disabled:s,children:e?`取消`:`Cancel`})}),(0,$.jsx)(Z,{type:`submit`,variant:`primary`,disabled:s,children:s?e?`正在保存…`:`Saving…`:e?`保存`:`Save`})]})]})]})]})})]})}function jr(e){let t=(0,$t.c)(183),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{inlineUse:r,inlineView:i,onViewChange:u,onPendingChange:d}=n,f=i===void 0?`settings`:i,m=p(Fr),g=m===`zh`,_;t[2]===m?_=t[3]:(_=h(m),t[2]=m,t[3]=_);let v=_.capabilitiesSettings,{capability:y}=a(),[b,x]=s(),{state:S}=o(),C;t[4]===b?C=t[5]:(C=ut(b.get(`returnTo`)),t[4]=b,t[5]=C);let w=C,[T,E]=(0,Q.useState)(),[D,O]=(0,Q.useState)(!1),[k,A]=(0,Q.useState)(!1),[j,M]=(0,Q.useState)(!1),[N,ee]=(0,Q.useState)(!1),P=j||N||k,[F,I]=(0,Q.useState)(!1),[L,R]=(0,Q.useState)(null),z=ne(),B;t[6]===z.cards?B=t[7]:(B=z.cards.some(Pr),t[6]=z.cards,t[7]=B);let V=B,H=Nr,U,te;t[8]!==d||t[9]!==P?(U=()=>(d?.(P),()=>d?.(!1)),te=[P,d],t[8]=d,t[9]=P,t[10]=U,t[11]=te):(U=t[10],te=t[11]),(0,Q.useEffect)(U,te);let W,G;t[12]!==y||t[13]!==r||t[14]!==S||t[15]!==b||t[16]!==x?(W=()=>{if(r||y!==`models`)return;let e=ct(b.get(`configure`));if(!e&&b.get(`add`)!==`1`)return;let t=window.setTimeout(()=>{e?Le(e,b.get(`tab`)===`services`?`services`:`settings`):I(!0);let t=new URLSearchParams(b);t.delete(`configure`),t.delete(`tab`),t.delete(`add`),x(t,{replace:!0,state:S})},0);return()=>window.clearTimeout(t)},G=[y,r,b,x,S],t[12]=y,t[13]=r,t[14]=S,t[15]=b,t[16]=x,t[17]=W,t[18]=G):(W=t[17],G=t[18]),(0,Q.useEffect)(W,G);let re;t[19]!==r||t[20]!==u||t[21]!==P?(re=e=>{if(!P){if(!r){Le(e,`services`);return}u?.(`services`),E(void 0)}},t[19]=r,t[20]=u,t[21]=P,t[22]=re):re=t[22];let K=re,oe;t[23]===u?oe=t[24]:(oe=e=>{H(),u?.(`settings`),E(e)},t[23]=u,t[24]=oe);let se=oe;if(r){let e=f===`services`,n=N||k,i;t[25]!==r||t[26]!==K||t[27]!==z||t[28]!==n||t[29]!==g?(i=(0,$.jsx)(qn,{data:z,zh:g,onlyUse:r,disabled:n,onPendingChange:M,onChange:K}),t[25]=r,t[26]=K,t[27]=z,t[28]=n,t[29]=g,t[30]=i):i=t[30];let a;t[31]!==e||t[32]!==i?(a=(0,$.jsx)(`div`,{hidden:e,children:i}),t[31]=e,t[32]=i,t[33]=a):a=t[33];let o;t[34]!==T||t[35]!==r||t[36]!==f||t[37]!==g?(o=T===r&&f===`settings`?(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:g?`服务设置已保存`:`Service settings saved`}):null,t[34]=T,t[35]=r,t[36]=f,t[37]=g,t[38]=o):o=t[38];let s=f!==`services`,c;t[39]!==se||t[40]!==r?(c=()=>se(r),t[39]=se,t[40]=r,t[41]=c):c=t[41];let l;t[42]!==v.addProviderDialog||t[43]!==r||t[44]!==m||t[45]!==z||t[46]!==c?(l=(0,$.jsx)(jn,{inline:!0,onEditingChange:O,use:r,data:z,language:m,labels:v.addProviderDialog,onPendingChange:A,onSaved:c},r),t[42]=v.addProviderDialog,t[43]=r,t[44]=m,t[45]=z,t[46]=c,t[47]=l):l=t[47];let d;t[48]!==se||t[49]!==D||t[50]!==r||t[51]!==z.builtinRows||t[52]!==g?(d=r===`transcription`||r===`speech`?(0,$.jsx)(`div`,{hidden:D,children:(0,$.jsx)(Vn,{kind:r===`transcription`?`stt`:`tts`,modelServiceIds:z.builtinRows.map(Mr),zh:g,onPendingChange:A,onSaved:()=>se(r)},r)}):null,t[48]=se,t[49]=D,t[50]=r,t[51]=z.builtinRows,t[52]=g,t[53]=d):d=t[53];let p;t[54]!==D||t[55]!==r||t[56]!==u||t[57]!==g?(p=r===`conversation`&&!D&&(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-lg border border-edge p-3`,children:[(0,$.jsx)(`span`,{className:`text-sm text-fg`,children:`Boson AI · Higgs Realtime`}),(0,$.jsx)(Z,{variant:`secondary`,onClick:()=>u?.(`settings`),children:g?`配置 Boson`:`Configure Boson`})]}),t[54]=D,t[55]=r,t[56]=u,t[57]=g,t[58]=p):p=t[58];let h;t[59]!==se||t[60]!==r?(h=r===`image`?(0,$.jsx)(gn,{connectOnly:!0,onPendingChange:A,onConnected:()=>se(r)}):null,t[59]=se,t[60]=r,t[61]=h):h=t[61];let _;t[62]!==k||t[63]!==s||t[64]!==l||t[65]!==d||t[66]!==p||t[67]!==h?(_=(0,$.jsxs)(`fieldset`,{hidden:s,disabled:k,className:`min-w-0 space-y-3`,children:[l,d,p,h]}),t[62]=k,t[63]=s,t[64]=l,t[65]=d,t[66]=p,t[67]=h,t[68]=_):_=t[68];let y=f===`services`,b;t[69]!==k||t[70]!==r||t[71]!==j?(b=r===`transcription`||r===`speech`||r===`conversation`?(0,$.jsx)(Ve,{capability:r,onPendingChange:ee,disabled:j||k},r):null,t[69]=k,t[70]=r,t[71]=j,t[72]=b):b=t[72];let x;t[73]!==k||t[74]!==r||t[75]!==j||t[76]!==g?(x=r===`chat`||r===`vision`||r===`image`?(0,$.jsx)(gr,{capability:r,zh:g,disabled:j||k,onPendingChange:ee}):null,t[73]=k,t[74]=r,t[75]=j,t[76]=g,t[77]=x):x=t[77];let S;t[78]!==r||t[79]!==g?(S=r===`background`?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:g?`使用所选模型执行自动化、定时和无人值守任务。此设置不会启用任务,也不会自动改用其他计费服务。`:`Use the selected model for automations, schedules and unattended tasks. This does not enable tasks or automatically switch billing services.`}):null,t[78]=r,t[79]=g,t[80]=S):S=t[80];let C;t[81]!==y||t[82]!==b||t[83]!==x||t[84]!==S?(C=(0,$.jsxs)(`div`,{hidden:y,className:`space-y-4`,children:[b,x,S]}),t[81]=y,t[82]=b,t[83]=x,t[84]=S,t[85]=C):C=t[85];let w;t[86]!==K||t[87]!==o||t[88]!==_||t[89]!==C?(w=(0,$.jsxs)(Be.Provider,{value:K,children:[o,_,C]}),t[86]=K,t[87]=o,t[88]=_,t[89]=C,t[90]=w):w=t[90];let E;return t[91]!==a||t[92]!==w?(E=(0,$.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[a,w]}),t[91]=a,t[92]=w,t[93]=E):E=t[93],E}if(y===`search`){let e;t[94]===m?e=t[95]:(e=h(m),t[94]=m,t[95]=e);let n;t[96]===e.nav.settingsSearch?n=t[97]:(n=(0,$.jsx)(Nt,{title:e.nav.settingsSearch}),t[96]=e.nav.settingsSearch,t[97]=n);let r;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(Dn,{}),t[98]=r):r=t[98];let i;return t[99]===n?i=t[100]:(i=(0,$.jsxs)(Mt,{children:[n,r]}),t[99]=n,t[100]=i),i}if(y!==`models`){let e;return t[101]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(c,{to:`/settings/capabilities/models`,replace:!0}),t[101]=e):e=t[101],e}let ce=g?`模型与能力`:`Models and capabilities`,le=g?`按用途选择模型,点击服务商名称管理连接。`:`Choose models by purpose. Select a provider name to manage its connection.`,q;t[102]===m?q=t[103]:(q=Je(m,`configuration`),t[102]=m,t[103]=q);let ue;t[104]!==v.docsLink||t[105]!==q?(ue=(0,$.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,$.jsx)(`a`,{href:q,target:`_blank`,rel:`noreferrer`,className:`inline-flex min-h-11 items-center rounded-lg px-2 text-xs text-fg-muted hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:v.docsLink})}),t[104]=v.docsLink,t[105]=q,t[106]=ue):ue=t[106];let de;t[107]!==ce||t[108]!==le||t[109]!==ue?(de=(0,$.jsx)(Nt,{title:ce,subtitle:le,actions:ue}),t[107]=ce,t[108]=le,t[109]=ue,t[110]=de):de=t[110];let fe;t[111]!==w||t[112]!==g?(fe=w?(0,$.jsx)(l,{to:w,className:`text-sm text-accent-fg hover:underline`,children:w===`/settings/phone-use`?g?`返回手机控制并测试模型`:`Return to phone control and test the model`:g?`返回原来的工作`:`Return to your work`}):null,t[111]=w,t[112]=g,t[113]=fe):fe=t[113];let pe;t[114]!==w||t[115]!==g?(pe=w?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:w===`/settings/phone-use`?g?`正在为手机控制连接模型服务;此处保存服务设置后,还需返回选择并测试手机模型。`:`Connect a model service for phone control, then return to select and test the phone model.`:g?`正在为原来的工作配置模型。服务保存、模型选择和实际运行验证分别生效。`:`Configure models for your work. Saving a service, choosing a model and verifying a run are separate steps.`}):null,t[114]=w,t[115]=g,t[116]=pe):pe=t[116];let me;t[117]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>R({providerId:e,isCustom:!1}),t[117]=me):me=t[117];let he;t[118]!==P||t[119]!==g?(he=(0,$.jsx)(Ar,{zh:g,disabled:P,onManage:me}),t[118]=P,t[119]=g,t[120]=he):he=t[120];let ge;t[121]===Symbol.for(`react.memo_cache_sentinel`)?(ge=()=>R({providerId:`xopc-cloud`,isCustom:!1}),t[121]=ge):ge=t[121];let _e;t[122]!==P||t[123]!==g?(_e=(0,$.jsx)(kr,{zh:g,disabled:P,onManageCloud:ge}),t[122]=P,t[123]=g,t[124]=_e):_e=t[124];let ve;t[125]===P?ve=t[126]:(ve=e=>{P||Le(e)},t[125]=P,t[126]=ve);let ye;t[127]!==K||t[128]!==z||t[129]!==P||t[130]!==he||t[131]!==_e||t[132]!==ve||t[133]!==g?(ye=(0,$.jsx)(qn,{data:z,zh:g,videoRow:he,musicRow:_e,disabled:P,onPendingChange:M,onChange:K,onSettings:ve}),t[127]=K,t[128]=z,t[129]=P,t[130]=he,t[131]=_e,t[132]=ve,t[133]=g,t[134]=ye):ye=t[134];let be=g?`连接的服务`:`Connected services`,xe;t[135]===be?xe=t[136]:(xe=(0,$.jsx)(`h2`,{id:`model-services-heading`,className:`text-base font-semibold text-fg`,children:be}),t[135]=be,t[136]=xe);let Se=g?`在这里管理账户和密钥;各项能力的模型与参数在上方调整。`:`Manage accounts and keys here. Choose models and adjust capability settings above.`,Ce;t[137]===Se?Ce=t[138]:(Ce=(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:Se}),t[137]=Se,t[138]=Ce);let we;t[139]!==xe||t[140]!==Ce?(we=(0,$.jsxs)(`div`,{children:[xe,Ce]}),t[139]=xe,t[140]=Ce,t[141]=we):we=t[141];let Te;t[142]!==v.xopcCloudAccount||t[143]!==V?(Te=V?(0,$.jsx)(Zt,{labels:v.xopcCloudAccount,children:(0,$.jsx)(Cr,{showCapabilities:!1,embedded:!0})}):null,t[142]=v.xopcCloudAccount,t[143]=V,t[144]=Te):Te=t[144];let Ee,De;t[145]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=()=>I(!0),De=(e,t)=>R({providerId:e,isCustom:t}),t[145]=Ee,t[146]=De):(Ee=t[145],De=t[146]);let J;t[147]!==v.connectedProviders||t[148]!==z?(J=(0,$.jsx)(ae,{labels:v.connectedProviders,data:z,onAdd:Ee,onManage:De}),t[147]=v.connectedProviders,t[148]=z,t[149]=J):J=t[149];let Y;t[150]!==V||t[151]!==z.cards.length?(Y=!V&&z.cards.length>0?(0,$.jsx)(Cr,{showCapabilities:!1}):null,t[150]=V,t[151]=z.cards.length,t[152]=Y):Y=t[152];let Oe;t[153]!==we||t[154]!==Te||t[155]!==J||t[156]!==Y?(Oe=(0,$.jsxs)(`section`,{"data-model-section":`services`,"aria-labelledby":`model-services-heading`,className:`space-y-4 scroll-mt-4 rounded-xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[we,Te,J,Y]}),t[153]=we,t[154]=Te,t[155]=J,t[156]=Y,t[157]=Oe):Oe=t[157];let ke;t[158]!==ye||t[159]!==Oe||t[160]!==g?(ke=(0,$.jsxs)($n,{zh:g,children:[ye,Oe]}),t[158]=ye,t[159]=Oe,t[160]=g,t[161]=ke):ke=t[161];let Ae;t[162]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=()=>{H(),I(!1)},t[162]=Ae):Ae=t[162];let X;t[163]!==F||t[164]!==v.addProviderDialog||t[165]!==m||t[166]!==z.builtinRows||t[167]!==z.customConfig?(X=(0,$.jsx)(ie,{open:F,connectOnly:!0,onOpenChange:I,builtinRows:z.builtinRows,customConfig:z.customConfig,labels:v.addProviderDialog,language:m,onSaved:Ae}),t[163]=F,t[164]=v.addProviderDialog,t[165]=m,t[166]=z.builtinRows,t[167]=z.customConfig,t[168]=X):X=t[168];let je;t[169]!==v.manageProviderDialog||t[170]!==m||t[171]!==L||t[172]!==z.allModels||t[173]!==z.builtinRows||t[174]!==z.customConfig?(je=L?(0,$.jsx)(sr,{open:!0,onOpenChange:e=>{e||R(null)},providerId:L.providerId,isCustom:L.isCustom,builtinRows:z.builtinRows,customConfig:z.customConfig,allModels:z.allModels,labels:v.manageProviderDialog,language:m,onSaved:H}):null,t[169]=v.manageProviderDialog,t[170]=m,t[171]=L,t[172]=z.allModels,t[173]=z.builtinRows,t[174]=z.customConfig,t[175]=je):je=t[175];let Me;return t[176]!==de||t[177]!==fe||t[178]!==pe||t[179]!==ke||t[180]!==X||t[181]!==je?(Me=(0,$.jsxs)(Mt,{children:[de,fe,pe,ke,X,je]}),t[176]=de,t[177]=fe,t[178]=pe,t[179]=ke,t[180]=X,t[181]=je,t[182]=Me):Me=t[182],Me}function Mr(e){return e.id}function Nr(){pt()}function Pr(e){return e.id===`xopc-cloud`&&!e.isCustom}function Fr(e){return e.language}export{jr as CapabilitiesSettingsPanel};