@xopcai/xopc 0.0.476 → 0.0.477
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.
- package/dist/browser-ext/dist/assets/{auth-CKIyOA1a.js → auth-B658Oa_i.js} +2 -1
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/dingtalk/xopc.extension.json +10 -4
- package/dist/extensions/discord/xopc.extension.json +9 -3
- package/dist/extensions/slack/xopc.extension.json +10 -4
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/wecom/xopc.extension.json +10 -4
- package/dist/gateway/server/chunks.bin +739 -686
- package/dist/gateway/server/chunks.json +1 -1
- package/dist/gateway/static/root/assets/af-CYmDZ4fF-CZxsvT2y.js +1 -0
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-Bicuh10_.js → agent-defaults-settings-panel-rc9N1-Xr.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-hRZYhcLp.js → agent-plugin-dialog-D8zi6y5l.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-C2DH8M4z.js → agents-D3Kx5DCA.js} +3 -3
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BrO0gY6b.js → app-management-settings-panel-CGIFJmRj.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-h82Or0g-.js → appearance-settings-CNy2QkvT.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-B9Ho8S53.js → apps-page-BWSZCO1g.js} +1 -1
- package/dist/gateway/static/root/assets/as-Hwl1DGzz-F6qyW8uH.js +1 -0
- package/dist/gateway/static/root/assets/{automation-run-list-CLjSIujK.js → automation-run-list-BzKslhcr.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-BS-RT312.js → automation-task-card-f5_tNbzB.js} +2 -2
- package/dist/gateway/static/root/assets/{automations-page-BL6ASYrU.js → automations-page-DT6lvXDX.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-BFk-AF43.js → automations-workspace-uq7eZeoX.js} +4 -4
- package/dist/gateway/static/root/assets/be-BgqsjH7X-BYVdQd18.js +1 -0
- package/dist/gateway/static/root/assets/bg-Dr9AqrKw-B5xv6TfF.js +1 -0
- package/dist/gateway/static/root/assets/{block-editor-Dtz8JtrO.js → block-editor-BIAtRF39.js} +1 -1
- package/dist/gateway/static/root/assets/bn-CSXZX5iN-BGS6_hxH.js +1 -0
- package/dist/gateway/static/root/assets/{browser-settings-page-CDUHHu0n.js → browser-settings-page-C2Jx09LX.js} +3 -3
- package/dist/gateway/static/root/assets/{button-ChmVQg9O.js → button-C5tRaJxt.js} +1 -1
- package/dist/gateway/static/root/assets/ca-IXHA7IHe-DrduLk3W.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-DgQ9OosE.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-ComYXaP1.js → capabilities-settings-panel-BjiHKpmd.js} +2 -2
- package/dist/gateway/static/root/assets/{capability-header-actions-BfLcB3Kh.js → capability-header-actions-Ck3ILShB.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-Aa2Iun4r.js → channels-C9AQ0m77.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-DA2S21y2.js → chat-chart-block-BNmGrz2N.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-CJiXMjMM.js +72 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BALrP7_l.js → chat-terminal-dock-Bndihzyb.js} +1 -1
- package/dist/gateway/static/root/assets/{chunk-KS7C4IRE-BPb7KheU.js → chunk-KS7C4IRE-DbzE-1bp.js} +1 -1
- package/dist/gateway/static/root/assets/composer-attachment-handoff-LTJZHQTE.js +1 -0
- package/dist/gateway/static/root/assets/{composer-model-config-control-BFC8jNyK.js → composer-model-config-control-Bnx68cDQ.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-CVWaJ3L8.js → computer-settings-page-MMiCgCEw.js} +1 -1
- package/dist/gateway/static/root/assets/{confirm-dialog-DkviAS5j.js → confirm-dialog-MHCmEEUZ.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-NZP4qb6S.js → connected-providers-grid-BPydj2zS.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-BNoFtMol.js → connection-usage-guide-CHGPjgHg.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-CzrdJ4JY.js → connector-service-page-CjH7WEIw.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-BUqNvStL.js → connectors-page-aIaFZHw3.js} +1 -1
- package/dist/gateway/static/root/assets/cop-B5tK6J-Z-Dw82IjCr.js +1 -0
- package/dist/gateway/static/root/assets/{copy-text-row-BnSoJ0FX.js → copy-text-row-gqdh0Bg1.js} +1 -1
- package/dist/gateway/static/root/assets/cs-5GDhZ_Ce-BI5q4aVA.js +1 -0
- package/dist/gateway/static/root/assets/cu-BSm1hoGS-BRCy0UAr.js +1 -0
- package/dist/gateway/static/root/assets/cy-C9DIxPZF-Cag4snSk.js +1 -0
- package/dist/gateway/static/root/assets/da-BsG0TGcE-BWliw5hZ.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-DgTDENzF.js → date-picker-BWrSxZf1.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-Gw4oSOk9.js → date-time-picker-Zhl9Yyzk.js} +1 -1
- package/dist/gateway/static/root/assets/de-1901-qqf2iWLB-BlgpCKr2.js +1 -0
- package/dist/gateway/static/root/assets/de-1996-LtGglqob-BjfWxQKM.js +1 -0
- package/dist/gateway/static/root/assets/de-ch-1901-COn1CKDv-_Xg3_np3.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-BJDpQtKY.js → dependency-picker-clYjcOx9.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BbIPYbvc.js → desktop-pet-CGRfEFeD.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Cqzplufb.js → desktop-pet-settings-CUVZPqVA.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-DXFZiWMi.js → device-pairing-wizard-C62Ooz-T.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DVFEzTAJ.js → directory-picker-path-field-3z5dHj8K.js} +1 -1
- package/dist/gateway/static/root/assets/{dist-GJ8-1PAx.js → dist-BSVQC3i_.js} +1 -1
- package/dist/gateway/static/root/assets/{dist-CxGUk8J-.js → dist-CDSvxjOh.js} +1 -1
- package/dist/gateway/static/root/assets/dist-DSRLZhL9.js +1 -0
- package/dist/gateway/static/root/assets/dist-DaFr5KMw.js +1 -0
- package/dist/gateway/static/root/assets/{dist-CY7CS_D3.js → dist-DlirbHVs.js} +1 -1
- package/dist/gateway/static/root/assets/el-monoton-pORtlC9P-CuqNQIvE.js +1 -0
- package/dist/gateway/static/root/assets/el-polyton-CDXn9JCY-B5J5pGHR.js +1 -0
- package/dist/gateway/static/root/assets/en-gb-BGHhUzDC-COWGBqwJ.js +1 -0
- package/dist/gateway/static/root/assets/es-PSvYPNjB-CnHE1eri.js +1 -0
- package/dist/gateway/static/root/assets/es2015-CFqg57eW.js +41 -0
- package/dist/gateway/static/root/assets/et-CYUTaVWy-H7jVbiHv.js +1 -0
- package/dist/gateway/static/root/assets/eu-CRNA9JLT-D1jw9zt8.js +1 -0
- package/dist/gateway/static/root/assets/{extension-authoritative-grants-DAfeCx4B.js → extension-authoritative-grants-DIZxVVMM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-gW4GEEcj.js → extension-debug-page-D_-TPLjn.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-DOPywUKI.js → extension-iframe-host-DQOKplxT.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-TTAx3dPv.js → extension-message-router-Ccwjadyk.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Iq7vFC-g.js → extension-page-CmntX-Iw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-BNnLkq95.js → extension-provider-niliLEmM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-C0oLjaz6.js → extension-settings-page-Doi9Trxg.js} +1 -1
- package/dist/gateway/static/root/assets/fi-DNiE_U0X-mParSSSy.js +1 -0
- package/dist/gateway/static/root/assets/{floating-ui.dom-seOukHzT.js → floating-ui.dom-CiMnRY5O.js} +1 -1
- package/dist/gateway/static/root/assets/floating-ui.react-dom-Gx6CM22l.js +1 -0
- package/dist/gateway/static/root/assets/fr-BIgh4Hkw-Dc1KqFHa.js +1 -0
- package/dist/gateway/static/root/assets/fur-CoXvgQfx-tJv2icDr.js +1 -0
- package/dist/gateway/static/root/assets/ga-D54K6YtG-CDuqe3gr.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-realtime-CfceJ5WX.js → gateway-realtime-BoJ3r2zr.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-restart-Dsg95Dwt.js → gateway-restart-L0ri15AO.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CMgry8RK.js → gateway-settings--jcl4PYh.js} +1 -1
- package/dist/gateway/static/root/assets/gl-Cx_3wrqA-D9_oxkqv.js +1 -0
- package/dist/gateway/static/root/assets/grc-gFF6GbE6-DANBReIg.js +1 -0
- package/dist/gateway/static/root/assets/gu-9bPoO3RA-COW9d1dt.js +1 -0
- package/dist/gateway/static/root/assets/hi-GilZHMjg-CiihDo6Q.js +1 -0
- package/dist/gateway/static/root/assets/{home-page-pT-lEQsu.js → home-page-DbLvAmzw.js} +4 -4
- package/dist/gateway/static/root/assets/hr-DowcKODH-D_vEJhf2.js +1 -0
- package/dist/gateway/static/root/assets/hsb-D_AuBPC_-kb5QeNH1.js +1 -0
- package/dist/gateway/static/root/assets/hu-DghCDVxq-Ct1fysVO.js +1 -0
- package/dist/gateway/static/root/assets/hy-UUaeTG5g-Cjfrs2ZM.js +1 -0
- package/dist/gateway/static/root/assets/ia-CvHYTdA2-B1i9kDPT.js +1 -0
- package/dist/gateway/static/root/assets/id-Dpxs7amD-C3Hzl2m4.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DDHOD0Nx.js → image-generation-api-D63Vak-S.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BxRXNvQx.js → imports-page-CWr0KA9K.js} +1 -1
- package/dist/gateway/static/root/assets/index-CEXEV_TY.css +1 -0
- package/dist/gateway/static/root/assets/{index-DdEh8KeB.js → index-DynjhZRv.js} +7 -7
- package/dist/gateway/static/root/assets/{install-connector-dialog-Rox2_5eU.js → install-connector-dialog-DyscHGNB.js} +1 -1
- package/dist/gateway/static/root/assets/is-CJ1vxS9j-DWEBuJpb.js +1 -0
- package/dist/gateway/static/root/assets/it-CpWMQzhA-HiFRunf5.js +1 -0
- package/dist/gateway/static/root/assets/ka-CCxCVfU6-BU45urC7.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-D7xlV7xT.js → keyboard-shortcuts-settings-BNxKXzTr.js} +1 -1
- package/dist/gateway/static/root/assets/kmr-dEjewOAw-DfPyPgkK.js +1 -0
- package/dist/gateway/static/root/assets/kn-Bjy8QS2v-BuXzi7S-.js +1 -0
- package/dist/gateway/static/root/assets/la-AGdXyFmb-Bwiuou7l.js +1 -0
- package/dist/gateway/static/root/assets/la-x-classic-DcM9aTVI-aO_2QO0y.js +1 -0
- package/dist/gateway/static/root/assets/la-x-liturgic-DZCmbwFj-BpDOy20C.js +1 -0
- package/dist/gateway/static/root/assets/{local-app-workbench-page-ReBczGac.js → local-app-workbench-page-BB-y__CE.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Ct07GT0V.js → local-apps-page-kllqJoU6.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CtEv5J4C.js → logs-page-DALkj_7O.js} +1 -1
- package/dist/gateway/static/root/assets/lt-CN8ITi7t-B3cgXplB.js +1 -0
- package/dist/gateway/static/root/assets/lv-C-JuXj31-CLjYDJHB.js +1 -0
- package/dist/gateway/static/root/assets/{management-settings-BjvQ4WiZ.js → management-settings-DVjgxWhD.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-C7kqotD-.js → markdown-view-BpBBv9Gr.js} +2 -2
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-DfbMmlmC.js → mcp-conversation-setup-page-Cr7uXvcG.js} +1 -1
- package/dist/gateway/static/root/assets/ml-BM2UBzMU-Ct0js8Am.js +1 -0
- package/dist/gateway/static/root/assets/mn-cyrl-CyRDZzA3-DN6sz9R4.js +1 -0
- package/dist/gateway/static/root/assets/mn-cyrl-x-lmc-DbCWj2Po-BJqn49ay.js +1 -0
- package/dist/gateway/static/root/assets/{model-selector-BP-t33vd.js → model-selector-RNPw-Mz4.js} +1 -1
- package/dist/gateway/static/root/assets/mr-BrkCTYf9-DGtESPcG.js +1 -0
- package/dist/gateway/static/root/assets/mul-ethi-D9YZ9OXl-D6ioGuYP.js +1 -0
- package/dist/gateway/static/root/assets/nb-DgKeJnSd-BfDSp4tN.js +1 -0
- package/dist/gateway/static/root/assets/{new-chat-navigation-BA1IB3hy.js → new-chat-navigation-DM_HUSZ1.js} +1 -1
- package/dist/gateway/static/root/assets/nl-BIDJBXRA-8_OIBsy0.js +1 -0
- package/dist/gateway/static/root/assets/nn-C4Gas4NI-BWT83oy8.js +1 -0
- package/dist/gateway/static/root/assets/no-CSP8-4c2-Cjg1mxae.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-DAhIT6xP.js → note-detail-panel-DQOIB0cU.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-BQyXXJCE.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-B3Kc4909.js → notes-api-ChV_6O5I.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-BBUD12wy.js +8 -0
- package/dist/gateway/static/root/assets/{oauth-provider-connect-3QGibJMl.js → oauth-provider-connect-BgWyUbhu.js} +1 -1
- package/dist/gateway/static/root/assets/oc-CyJ2Q9k9-W5_I63nO.js +1 -0
- package/dist/gateway/static/root/assets/or-DUhKxVse-Cf5-bcl5.js +1 -0
- package/dist/gateway/static/root/assets/pa-NDvVySYt-Bj-XExX_.js +1 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-Bd__UBi9.js → page-context-capture-button-CNyjLpFG.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-DHik8uj6.js → personal-page-dGPy_J7M.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-profile-settings-Cd2xUVbw.js → personal-profile-settings-BlsS-2z3.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-CHRra9hc.js → personal-settings-panel-D1W09VMR.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-CREmmRxI.js → phone-dependencies-card-CRABVjt1.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-BDzr9jXL.js → phone-model-connection-DtBRZXUN.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-DSQF-RxW.js → phone-model-picker-D3U9iAQo.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-gP5kr3VO.js → phone-settings-page-ClS7YSnU.js} +1 -1
- package/dist/gateway/static/root/assets/pi-znB0BT6g-o9084kBf.js +1 -0
- package/dist/gateway/static/root/assets/pl-CaFvP4tu-Bv_p-a9x.js +1 -0
- package/dist/gateway/static/root/assets/{plugin-details-dialog-43jCnG5n.js → plugin-details-dialog-DGW2QQJC.js} +1 -1
- package/dist/gateway/static/root/assets/pms-92V70vZ4-DfOt2RSi.js +1 -0
- package/dist/gateway/static/root/assets/{popover-select-CLsphyzA.js → popover-select-hRG1EzAY.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-VqtR_pOy.js → preference-select-fields-PZsYT8Db.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-runtime-MJUo7XlD.js → preview-runtime-D9y0frrZ.js} +2 -2
- package/dist/gateway/static/root/assets/{product-automation-feedback-D43XiQq6.js → product-automation-feedback-W6rFx449.js} +1 -1
- package/dist/gateway/static/root/assets/product-open-page-CcJ0dC84.js +1 -0
- package/dist/gateway/static/root/assets/{product-preview-content-CkQebfi-.js → product-preview-content-CsdXwIxP.js} +1 -1
- package/dist/gateway/static/root/assets/product-preview-modal-CIe5WW9E.js +2 -0
- package/dist/gateway/static/root/assets/{project-detail-page-BBF8eVJa.js → project-detail-page-b6pU7eLQ.js} +2 -2
- package/dist/gateway/static/root/assets/{project-understanding-BScfv1pD.js → project-understanding-ClhKlj0g.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BCMWrLGf.js → projects-page-Bi9Ke76p.js} +1 -1
- package/dist/gateway/static/root/assets/pt-BKB_-X0N-CrkeeQaZ.js +1 -0
- package/dist/gateway/static/root/assets/{recording-upload-Yy9r6kHe.js → recording-upload-BjZ5SwXZ.js} +1 -1
- package/dist/gateway/static/root/assets/{refresh-button-D6ihZgH3.js → refresh-button-DX7bULU5.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BeG8Bgy0.js → remote-access-hub-aSIeyTxn.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-Dccp_uis.js → resource-unavailable-BZVJxGR8.js} +1 -1
- package/dist/gateway/static/root/assets/rm-C1letx81-CNhvXnnG.js +1 -0
- package/dist/gateway/static/root/assets/ro-BUzliR9z-Bov_DAVD.js +1 -0
- package/dist/gateway/static/root/assets/route-preload-D36bLXpD.js +2 -0
- package/dist/gateway/static/root/assets/routine-panel-lfYWKBuW.js +2 -0
- package/dist/gateway/static/root/assets/ru-B591x1qT-DLdM0nWP.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-C7sHr-Lm.js → runtime-tools-settings-panel-DxYZLgVT.js} +1 -1
- package/dist/gateway/static/root/assets/sa-JnsT9B1R-CvBCyoRG.js +1 -0
- package/dist/gateway/static/root/assets/{schema-form-DXHzZPMr.js → schema-form-DkuIsCBU.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-Bz9QWUZc.js → service-recommendation-list-BjuL2TaI.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-fvJusKsK.js → session-manager-1UFhZMpv.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-DS-OExY1.js → sessions-page-CeCaW2FJ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-advanced-section-BsqgVQL3.js → settings-advanced-section-YRzA9yeq.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-DKgbD0Bc.js → settings-page-header-C9xiCwzq.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BE3vLWp_.js → settings-page-layout-DTOBegnh.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B_8kxJQW.js → settings-page-ngcjiqfd.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-DLpGv0yp.js → setup-interaction-page-CnC-hC-A.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BMaFUPnt.js → setup-status-panel-lAyDbUa1.js} +1 -1
- package/dist/gateway/static/root/assets/sh-cyrl-CLuomLGP-UY09gie6.js +1 -0
- package/dist/gateway/static/root/assets/sh-latn-DdZKFFaE-De-tA-2J.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-3RNzFIH3.js → share-link-dialog-QvDZwWwI.js} +1 -1
- package/dist/gateway/static/root/assets/share-preview-page-7PohUauw.js +2 -0
- package/dist/gateway/static/root/assets/{shares-settings-C_ITdQqP.js → shares-settings-DpIh1naz.js} +1 -1
- package/dist/gateway/static/root/assets/sk-A3STIA2C-DC8Al4lF.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-B30SsJL6.js → skills-page-CRrTQOth.js} +1 -1
- package/dist/gateway/static/root/assets/sl-DjmW7S7C-B8FnrXi1.js +1 -0
- package/dist/gateway/static/root/assets/space-BPnfqDsQ.js +1 -0
- package/dist/gateway/static/root/assets/space-api-D4zPeS-a.js +1 -0
- package/dist/gateway/static/root/assets/space-page-DV-4mGaH.js +2 -0
- package/dist/gateway/static/root/assets/space-workbook-CtUQSd5l.js +291 -0
- package/dist/gateway/static/root/assets/space-workbook-CvOADsEJ.css +1 -0
- package/dist/gateway/static/root/assets/space-workbook-format-D1PqIvbd.js +1 -0
- package/dist/gateway/static/root/assets/space-workbook-import.worker-Bw2gfMG9.js +68 -0
- package/dist/gateway/static/root/assets/sr-cyrl-DzA2myNl-yGc0Jz1j.js +1 -0
- package/dist/gateway/static/root/assets/sv-B01JFt6B-DeQDoAsB.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-KXLPpyOW.js → system-settings-panel-jgzBYOji.js} +1 -1
- package/dist/gateway/static/root/assets/ta-biPP5NX3-B5_ztYXp.js +1 -0
- package/dist/gateway/static/root/assets/{task-detail-page-DHYm_bsg.js → task-detail-page-qTnkErT0.js} +3 -3
- package/dist/gateway/static/root/assets/{task-header-title-Buwr7WTV.js → task-header-title-CRfK-rhR.js} +1 -1
- package/dist/gateway/static/root/assets/{task-result-evidence-DpV1mZJA.js → task-result-evidence-C2gEC9Hr.js} +1 -1
- package/dist/gateway/static/root/assets/te-DdPqCRaf-BjTOzs5s.js +1 -0
- package/dist/gateway/static/root/assets/th-C4s1cxFT-CFfNau1h.js +1 -0
- package/dist/gateway/static/root/assets/{time-picker-C1PXAXZF.js → time-picker-otHjbob1.js} +1 -1
- package/dist/gateway/static/root/assets/tk-BfqDjfTh-UHPz-lif.js +1 -0
- package/dist/gateway/static/root/assets/tr-C2sIij-w-DvQDK0dA.js +1 -0
- package/dist/gateway/static/root/assets/{tracing-settings-page-CcyPoojp.js → tracing-settings-page-7DxhxIp3.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-D713CJ9R.js → tunnel-api-CZJEfJym.js} +1 -1
- package/dist/gateway/static/root/assets/uk-DBx0redY-DGVpthWV.js +1 -0
- package/dist/gateway/static/root/assets/{usage-page-DN1TcxWS.js → usage-page-CVJBXy2I.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-4FKbf6PB.js → use-composer-attachments-Cs9sRfEz.js} +1 -1
- package/dist/gateway/static/root/assets/use-file-preview-expanded-B7Kp4Y1f.js +1 -0
- package/dist/gateway/static/root/assets/use-generated-media-UvehLoUl.js +1 -0
- package/dist/gateway/static/root/assets/{use-personal-work-srLCZOam.js → use-personal-work-eUnPoS9h.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-tyo85cre.js → use-realtime-voice-CJD_ABL6.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-VwHdfiR8.js → use-workspace-tree-BYrp8lL7.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-D-F5GO3T.js → user-model-page-s8sYPQwS.js} +2 -2
- package/dist/gateway/static/root/assets/{voice-player-store-DyuAAbk0.js → voice-player-store-DwAnvFVJ.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-DOajN2ay.js → voice-settings-WIooh0DA.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CTLp1-tu.js → work-discovery-overlay-WGm3tfRV.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-B-UzFKIr.js → work-discovery-page-DLXUm21d.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-DvVtUxHW.js → working-directory-picker-modal-BwmhPsrY.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-CIfedJeG.js → workspace-api-DEPruUJB.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-file-preview-dialog-iAz_WyiN.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-sbOva_RI.js → workspace-open-location-menu-CbQ5vUV7.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-BYuMOGaK.js → xopc-cloud-account-card-ClAhPUT1.js} +1 -1
- package/dist/gateway/static/root/assets/zh-latn-pinyin-CIit9tZA-CW52gdb_.js +1 -0
- package/dist/gateway/static/root/dependency-records.json +1251 -205
- package/dist/gateway/static/root/index.html +65 -62
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/space.js +5 -2
- package/dist/packages/gateway-contract/src/user-message-display.js +6 -1
- package/dist/packages/realtime-protocol/src/index.js +4 -2
- package/dist/src/agent/inbound/attachment-pipeline.js +15 -6
- package/dist/src/agent/mcp/conversation-setup.js +9 -6
- package/dist/src/agent/skills/marketplace/search.d.ts +1 -0
- package/dist/src/agent/skills/marketplace/search.js +1 -0
- package/dist/src/agent/tools/capability-catalog-tool.js +1 -1
- package/dist/src/agent/tools/factory.js +3 -3
- package/dist/src/capabilities/capability-catalog.d.ts +4 -0
- package/dist/src/capabilities/capability-catalog.js +46 -15
- package/dist/src/channels/catalog/channel-catalog-service.js +2 -3
- package/dist/src/endpoint-tools/registry.d.ts +2 -1
- package/dist/src/endpoint-tools/registry.js +5 -3
- package/dist/src/endpoint-tools/runtime.d.ts +1 -1
- package/dist/src/endpoint-tools/runtime.js +2 -2
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +15 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -1
- package/dist/src/gateway/hono/routes/mobile-capability-actions.d.ts +1 -1
- package/dist/src/gateway/hono/routes/mobile-capability-actions.js +20 -10
- package/dist/src/gateway/hono/routes/mobile-capability-panels.d.ts +20 -0
- package/dist/src/gateway/hono/routes/mobile-capability-panels.js +1523 -0
- package/dist/src/gateway/hono/routes/space.js +18 -0
- package/dist/src/gateway/security/gateway-scopes.js +5 -1
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/session/session-title.js +4 -5
- package/dist/src/space/budget-workbook.d.ts +47 -0
- package/dist/src/space/budget-workbook.js +210 -0
- package/dist/src/space/repository.d.ts +1 -1
- package/dist/src/space/repository.js +24 -5
- package/dist/src/tunnel/tunnel-service.d.ts +5 -0
- package/dist/src/tunnel/tunnel-service.js +131 -30
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-D9EpUcuB.js +0 -2
- package/dist/gateway/static/root/assets/chat-page-BbahuZ59.js +0 -72
- package/dist/gateway/static/root/assets/dist-BuHnPloF.js +0 -1
- package/dist/gateway/static/root/assets/dist-ZrL34Ps4.js +0 -1
- package/dist/gateway/static/root/assets/es2015-DBLcMg5B.js +0 -41
- package/dist/gateway/static/root/assets/index-BtHMU5k4.css +0 -1
- package/dist/gateway/static/root/assets/note-image-lightbox-DrVGs1eQ.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-zAJJ2OiQ.js +0 -8
- package/dist/gateway/static/root/assets/product-open-page-CQMoDCO1.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-modal-DToUA1EF.js +0 -2
- package/dist/gateway/static/root/assets/route-preload-Bl10PwKS.js +0 -2
- package/dist/gateway/static/root/assets/routine-panel-BjqenuXU.js +0 -2
- package/dist/gateway/static/root/assets/share-preview-page-C49EIXte.js +0 -2
- package/dist/gateway/static/root/assets/space-page-DmvjU1jc.js +0 -2
- package/dist/gateway/static/root/assets/use-file-preview-expanded-CRBn6UTd.js +0 -1
- package/dist/gateway/static/root/assets/use-generated-media-CEJ5BBxX.js +0 -1
- package/dist/gateway/static/root/assets/workspace-file-preview-dialog-Xi5feqPq.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
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"./chunk-KS7C4IRE-
|
|
1
|
+
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"./chunk-KS7C4IRE-DbzE-1bp.js";import{i as a,n as o,o as ee}from"./locale-store-B4o4aDCg.js";import{a as te,i as ne,n as s,o as re,r as ie,s as ae,t as c}from"./dist-DlirbHVs.js";import{t as l}from"./package-wATCyihJ.js";import{t as u}from"./x-B_N4OPjy.js";import{t as d}from"./skeleton-DzdOeGYz.js";import{a as f,i as p}from"./vendor-swr-CdRzEUwF.js";import{t as m}from"./button-C5tRaJxt.js";import{t as h}from"./connection-usage-guide-CHGPjgHg.js";import{r as g,t as _}from"./agent-plugin-dialog-D8zi6y5l.js";import{n as oe}from"./capability-links-MZdYfPKx.js";import{t as se}from"./capability-icon-CmvCZOJX.js";import{n as ce,t as v}from"./plugin-presentation-CO5BFDGW.js";var le=n(),y=e(t(),1),b=r();function x(e){let t=(0,le.c)(63),{pluginId:n,initialConnect:r,onClose:x}=e,S=r!==void 0&&r,C=o(ue).startsWith(`zh`),{mutate:w}=f(),[de,T]=(0,y.useState)(!1),E=(0,y.useRef)(document.activeElement instanceof HTMLElement?document.activeElement:null),D;t[0]===n?D=t[1]:(D=async()=>{let e=await ee(a(`/api/extensions/agent-plugins/${encodeURIComponent(n)}`));if(!e.ok)throw Error(e.error??`Plugin not found`);return e.payload},t[0]=n,t[1]=D);let O;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(O={revalidateOnFocus:!0},t[2]=O):O=t[2];let{data:k,error:A,mutate:j}=p(`plugin-details:${n}`,D,O),M=k?ce(k,C):C?`插件详情`:`Plugin details`,N=k?.localizations?.[C?`zh-CN`:`en`]?.description??k?.description;if(de&&k){let e;t[3]!==j||t[4]!==T?(e=()=>{T(!1),j()},t[3]=j,t[4]=T,t[5]=e):e=t[5];let n;return t[6]!==k||t[7]!==x||t[8]!==e?(n=(0,b.jsx)(_,{extension:k,onUninstalled:x,onClose:e}),t[6]=k,t[7]=x,t[8]=e,t[9]=n):n=t[9],n}let P;t[10]===x?P=t[11]:(P=e=>{e||x()},t[10]=x,t[11]=P);let F;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,b.jsx)(te,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[12]=F):F=t[12];let I;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>{E.current?.isConnected&&(e.preventDefault(),E.current.focus({preventScroll:!0}))},t[13]=I):I=t[13];let L=k?.branding?.iconUrl,R;t[14]===L?R=t[15]:(R=(0,b.jsx)(se,{iconUrl:L,fallback:l}),t[14]=L,t[15]=R);let z;t[16]===M?z=t[17]:(z=(0,b.jsx)(ae,{className:`truncate text-base font-semibold text-fg`,children:M}),t[16]=M,t[17]=z);let B;t[18]===k?B=t[19]:(B=k?(0,b.jsxs)(`p`,{className:`mt-0.5 truncate text-xs text-fg-muted`,children:[k.version,` · `,k.name]}):null,t[18]=k,t[19]=B);let V;t[20]!==B||t[21]!==z?(V=(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[z,B]}),t[20]=B,t[21]=z,t[22]=V):V=t[22];let H=C?`关闭插件详情`:`Close plugin details`,U;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,b.jsx)(u,{className:`size-5`,"aria-hidden":!0}),t[23]=U):U=t[23];let W;t[24]===H?W=t[25]:(W=(0,b.jsx)(s,{asChild:!0,children:(0,b.jsx)(m,{variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":H,children:U})}),t[24]=H,t[25]=W);let G;t[26]!==V||t[27]!==W||t[28]!==R?(G=(0,b.jsxs)(`header`,{className:`flex shrink-0 items-center gap-3 border-b border-edge px-5 py-4`,children:[R,V,W]}),t[26]=V,t[27]=W,t[28]=R,t[29]=G):G=t[29];let K=C?`查看插件能力、管理账号连接与授权。关闭后返回原来的列表。`:`View plugin capabilities and manage account connections. Close to return to the list.`,q;t[30]===K?q=t[31]:(q=(0,b.jsx)(ne,{className:`sr-only`,children:K}),t[30]=K,t[31]=q);let J;t[32]!==k||t[33]!==N||t[34]!==A||t[35]!==S||t[36]!==w||t[37]!==M||t[38]!==x||t[39]!==n||t[40]!==j||t[41]!==C?(J=(0,b.jsx)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-5`,children:A?(0,b.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:String(A)}):k?(0,b.jsxs)(b.Fragment,{children:[N?(0,b.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:N}):null,(0,b.jsx)(g,{initialConnect:S,extension:k,zh:C,onChanged:async()=>{await j(),await w(`gateway-extensions-list`)}},n),v(k)?(0,b.jsx)(h,{target:{kind:`plugin`,id:n,name:M},showAction:!1,onStart:x}):null,k.components?.skills.length?(0,b.jsxs)(`section`,{className:`space-y-3 border-t border-edge pt-5`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium`,children:C?`技能(${k.components.skills.length})`:`Skills (${k.components.skills.length})`}),(0,b.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:k.components.skills.map(e=>(0,b.jsx)(i,{onClick:x,to:`/capabilities/skills?${new URLSearchParams({tab:`installed`,source:`plugin`,q:k.dialect===`portable`?e.name:`${n}.${e.name}`})}`,className:`max-w-full break-words rounded-lg border border-edge px-3 py-2 text-sm text-accent hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:e.name},e.name))})]}):null]}):(0,b.jsxs)(`div`,{className:`space-y-4`,"aria-busy":`true`,children:[(0,b.jsx)(d,{className:`h-14 w-full`}),(0,b.jsx)(d,{className:`h-28 w-full`}),(0,b.jsx)(d,{className:`h-40 w-full`})]})}),t[32]=k,t[33]=N,t[34]=A,t[35]=S,t[36]=w,t[37]=M,t[38]=x,t[39]=n,t[40]=j,t[41]=C,t[42]=J):J=t[42];let Y;t[43]!==k||t[44]!==T||t[45]!==C?(Y=k?(0,b.jsx)(m,{variant:`ghost`,onClick:()=>T(!0),children:C?`管理插件`:`Manage plugin`}):(0,b.jsx)(`span`,{}),t[43]=k,t[44]=T,t[45]=C,t[46]=Y):Y=t[46];let X;t[47]!==k||t[48]!==M||t[49]!==n||t[50]!==C?(X=k&&v(k)?(0,b.jsx)(m,{asChild:!0,children:(0,b.jsx)(i,{to:oe(M,C,n),children:C?`开始使用`:`Start using`})}):(0,b.jsx)(s,{asChild:!0,children:(0,b.jsx)(m,{variant:`secondary`,children:C?`完成`:`Done`})}),t[47]=k,t[48]=M,t[49]=n,t[50]=C,t[51]=X):X=t[51];let Z;t[52]!==Y||t[53]!==X?(Z=(0,b.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-3 border-t border-edge px-5 py-4`,children:[Y,X]}),t[52]=Y,t[53]=X,t[54]=Z):Z=t[54];let Q;t[55]!==G||t[56]!==q||t[57]!==J||t[58]!==Z?(Q=(0,b.jsxs)(re,{children:[F,(0,b.jsxs)(ie,{onCloseAutoFocus:I,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex h-[min(38rem,calc(100dvh-2rem))] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover`,children:[G,q,J,Z]})]}),t[55]=G,t[56]=q,t[57]=J,t[58]=Z,t[59]=Q):Q=t[59];let $;return t[60]!==Q||t[61]!==P?($=(0,b.jsx)(c,{open:!0,onOpenChange:P,children:Q}),t[60]=Q,t[61]=P,t[62]=$):$=t[62],$}function ue(e){return e.language}export{x as PluginDetailsDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=[`022,22,2,002,4,032,00001,000032,0001,0043,0000021,0012,0023,021,002003,000023,00003,0032,000001,02,001,00021,01,1,202,232,023,32,0223,12,23,243,21`,`{".":[{"'":[{"s":0,"n":3}],"a":[{"p":[{"n":5}],"n":[{"t":[{"i":[{"m":[{"n":7}]},6]}]}]}],"b":[{"i":[{"o":8}]}],"c":[{"a":[{"p":[{"s":9}]}],"i":[{"r":[{"c":[{"u":[{"m":10}]}]}]}],"o":[{"o":[{"p":11}]}]},19],"d":[{"i":[{"s":12}]},19],"e":[{"x":[{"e":13,"t":[{"r":[{"a":14}]}]}]}],"f":[{"r":[{"a":[{"n":[{"k":15}]}],"e":[{"e":16}]}]}],"l":[{"i":[{"p":[{"s":[{"a":17}]}]}]}],"n":[{"a":[{"r":[{"c":[{"o":18}]}]}]}],"o":[{"p":[{"t":[{"o":6}]}],"r":[{"t":[{"o":[{"p":7}]}]}]}],"p":[{"a":[{"r":[{"a":6}]}],"o":[{"l":[{"i":[{"p":7}]}]}],"r":[{"e":8}],"s":19}],"r":[{"e":[{"a":[{"c":20}],"i":[{"s":[{"c":[{"r":11}]}]}]}]}],"t":[{"r":[{"a":[{"n":[{"s":[{"a":[{"c":15}],"c":15,"d":15,"l":15,"n":15,"p":15,"r":15,"t":15}]}]}]}]}],"s":[{"u":[{"b":[{"l":[{"u":12}],"r":12}]}]},19],"w":[{"a":[{"g":[{"n":12}]}],"e":[{"l":[{"t":21}]}]}],"z":19}],"'":[{".":2},1],"b":[{"'":2,"b":2,"c":2,"d":2,"f":2,"m":2,"n":2,"p":2,"s":2,"t":2,"v":2,"l":19,"r":19,".":2},23],"c":[{"'":2,"b":2,"c":[{".":19},2],"d":2,"f":2,"j":[{".":2},19],"k":2,"m":2,"n":2,"q":2,"s":2,"t":2,"z":2,"h":[{"h":2,".":2,"b":2,"r":3,"n":2},19],"l":19,"r":19,".":2},23],"d":[{"'":2,"b":2,"d":2,"g":2,"h":19,"l":2,"m":2,"n":2,"p":2,"r":19,"s":2,"t":2,"v":2,"w":2,".":2},23],"f":[{"'":2,"b":2,"g":2,"f":2,"n":2,"l":19,"r":19,"s":2,"t":2,".":2},23],"g":[{"'":2,"b":2,"d":2,"f":2,"g":[{".":19},2],"h":[{"t":24},19],"j":19,"l":19,"m":2,"n":[{".":2},19],"p":2,"r":19,"s":2,"t":2,"v":2,"w":2,"z":2,".":2},23],"h":[{"'":2,"b":2,"d":2,"h":2,"i":[{"p":[{"n":17}]}],"l":19,"m":2,"n":2,"r":2,"v":2,".":2},23],"j":[{"'":2,".":2},23],"k":[{"'":2,"g":2,"f":2,"h":19,"k":2,"l":19,"m":2,"r":19,"s":2,"t":2,".":2},23],"l":[{"'":[{".":2,"'":2}],"b":2,"c":2,"d":2,"f":25,"g":2,"h":19,"j":19,"k":2,"l":2,"m":2,"n":2,"p":2,"q":2,"r":2,"s":2,"t":2,"v":2,"w":2,"z":2,".":2},23],"m":[{"'":2,"b":2,"c":2,"f":2,"l":2,"m":2,"n":2,"p":2,"q":2,"r":2,"s":2,"t":2,"v":2,"w":2,".":2},23],"n":[{"'":2,"b":2,"c":2,"d":2,"f":2,"g":[{"n":26},2],"k":2,"l":2,"m":2,"n":2,"p":2,"q":2,"r":2,"s":[{".":19,"f":[{"e":[{"r":26}]}]},2],"t":[{".":19},2],"v":2,"z":2,"h":[{"e":[{"i":[{"t":2}]}]}],".":2},23],"p":[{"'":2,"d":2,"h":19,"l":19,"n":[{"e":27},2],"p":2,"r":19,"s":[{"i":[{"c":27}]},2],"t":2,"z":2,".":2},23],"q":[{"'":2,"q":2,".":2},23],"r":[{"'":2,"b":2,"c":2,"d":2,"f":2,"h":19,"g":2,"k":2,"l":2,"m":2,"n":2,"p":2,"q":2,"r":2,"s":2,"t":[{"s":28},2],"v":2,"x":2,"w":2,"z":2,".":2},23],"s":[{"'":[{".":4,"'":4}],"t":[{"'":2,".":1,"b":1,"c":1,"d":1,"f":1,"m":1,"n":1,"p":1,"s":1,"t":1,"v":1}],".":4,"s":[{".":4,"m":31},30],"p":[{"n":25}]},29],"t":[{"'":[{".":2,"'":2}],"b":2,"c":2,"d":2,"f":2,"g":19,"h":19,"l":19,"m":2,"n":2,"p":2,"r":19,"s":[{".":2},1],"t":[{"m":26,"s":26},2],"v":2,"w":2,"z":[{"k":2,"s":3},19],".":2},23],"v":[{"'":[{".":2,"'":2}],"c":2,"l":19,"r":19,"s":[{".":2}],"v":2,".":2},23],"w":[{"'":2,"h":19,"a":[{"r":3}],"y":32,".":2},23],"x":[{"'":2,"b":2,"c":2,"f":2,"h":2,"m":2,"p":2,"t":2,"w":2,".":2},23],"z":[{"'":[{".":2,"'":2}],"b":2,"d":2,"l":2,"n":2,"p":2,"r":2,"s":2,"t":2,"v":2,"z":2,".":2},23],"a":[{"i":[{"a":22,"e":22,"o":22,"u":22}],"u":[{"o":22}],"t":[{".":2}]}],"e":[{"i":[{"u":22}],"w":19}],"o":[{"a":19,"e":19,"i":19,"u":19}],"y":[{"o":[{"u":22}],"i":22}]}`,[]];export{e as Pms};
|
package/dist/gateway/static/root/assets/{popover-select-CLsphyzA.js → popover-select-hRG1EzAY.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
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"./createLucideIcon-DPHK1VkS.js";import{t as a}from"./check-DUBLcKHA.js";import{t as o}from"./cn-0WouolD0.js";import{t as s}from"./skeleton-DzdOeGYz.js";import{a as c,i as l,o as u,s as d}from"./dist-
|
|
1
|
+
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"./createLucideIcon-DPHK1VkS.js";import{t as a}from"./check-DUBLcKHA.js";import{t as o}from"./cn-0WouolD0.js";import{t as s}from"./skeleton-DzdOeGYz.js";import{a as c,i as l,o as u,s as d}from"./dist-BSVQC3i_.js";import{a as f,s as p,t as m}from"./settings-shell-dialog-layer-BU3UuiJr.js";var h=i(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),g=e(t(),1),_=n();function v(e,t=!1){if(!t)return m;switch(e){case`modal`:return f;case`page`:return p;default:return`z-50`}}var y=r(),b=(0,g.createContext)({layer:`default`,portalContainer:null});function x(e,t){return e===`modal`||t===`modal`?`modal`:e===`page`||t===`page`?`page`:`default`}function S(e){let t=(0,_.c)(9),{layer:n,portalContainer:r,children:i}=e,a=(0,g.useContext)(b),o;t[0]!==n||t[1]!==a.layer?(o=x(a.layer,n),t[0]=n,t[1]=a.layer,t[2]=o):o=t[2];let s=o,c=r??a.portalContainer,l;t[3]!==s||t[4]!==c?(l={layer:s,portalContainer:c},t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;return t[6]!==i||t[7]!==l?(u=(0,y.jsx)(b.Provider,{value:l,children:i}),t[6]=i,t[7]=l,t[8]=u):u=t[8],u}function C(){return(0,g.useContext)(b).layer}function w(){return(0,g.useContext)(b).portalContainer}function T(e){let t=(0,_.c)(3),n=w(),r;return t[0]!==n||t[1]!==e?(r=e?.closest(`[role="dialog"]`)??n,t[0]=n,t[1]=e,t[2]=r):r=t[2],r}function E(e){let t=(0,_.c)(14),{options:n,values:r,multiple:i,onChange:a,ariaLabel:s}=e,c=i!==void 0&&i,l=(0,g.useId)(),u;if(t[0]!==c||t[1]!==l||t[2]!==a||t[3]!==n||t[4]!==r){let e;t[6]!==c||t[7]!==l||t[8]!==a||t[9]!==r?(e=e=>(0,y.jsxs)(`label`,{className:o(`touch-target flex min-h-10 min-w-0 items-center gap-3 rounded-md px-2 py-2 text-sm text-fg has-focus-visible:ring-2 has-focus-visible:ring-accent`,e.disabled?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-hover`),children:[(0,y.jsx)(`input`,{type:c?`checkbox`:`radio`,name:l,value:e.value,checked:r.includes(e.value),disabled:e.disabled,className:`shrink-0 accent-accent`,onChange:t=>a(c?t.target.checked?[...r,e.value]:r.filter(t=>t!==e.value):[e.value])}),e.icon,(0,y.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:e.label})]},e.value),t[6]=c,t[7]=l,t[8]=a,t[9]=r,t[10]=e):e=t[10],u=n.map(e),t[0]=c,t[1]=l,t[2]=a,t[3]=n,t[4]=r,t[5]=u}else u=t[5];let d;return t[11]!==s||t[12]!==u?(d=(0,y.jsx)(`fieldset`,{"aria-label":s,className:`min-w-0 space-y-0.5`,children:u}),t[11]=s,t[12]=u,t[13]=d):d=t[13],d}var D=`flex max-h-[min(20rem,var(--radix-popover-content-available-height))] flex-col overflow-hidden`,O=`min-h-0 flex-1 overflow-y-auto overscroll-y-contain touch-pan-y [scrollbar-gutter:stable]`;function k({value:e,options:t,placeholder:n,allowEmpty:r=!0,emptyLabel:i=n,emptyDisabled:f=!1,disabledValues:p,disabled:m,id:_,ariaLabel:b,ariaLabelledBy:x,ariaDescribedBy:S,title:w,triggerClassName:E,triggerIcon:k,contentClassName:A,side:j=`bottom`,align:M=`start`,onChange:N,searchPlaceholder:P,searchValue:F,onSearchChange:I,loading:L=!1,statusMessage:R,selectedLabel:z}){let[B,V]=(0,g.useState)(!1),[H,U]=(0,g.useState)(null),W=C(),G=T(H),K=v(W,G!==null),q=t.find(t=>t.value===e),J=z??q?.label??(e?`${e} · unavailable`:n),Y;return(0,y.jsxs)(u,{open:B,onOpenChange:V,children:[(0,y.jsx)(d,{asChild:!0,children:(0,y.jsxs)(`button`,{ref:U,id:_,type:`button`,"aria-label":b,"aria-labelledby":x,"aria-describedby":S,title:w,disabled:m,className:o(`touch-target box-border flex h-10 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-edge bg-surface-inset px-3 text-left text-sm font-normal text-fg`,`hover:border-edge-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,m&&`cursor-not-allowed opacity-50 hover:border-edge`,E),children:[k,(0,y.jsx)(`span`,{className:o(`min-w-0 truncate`,!e&&`text-fg-subtle`),children:J}),(0,y.jsx)(h,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]})}),(0,y.jsx)(c,{container:G??void 0,children:(0,y.jsxs)(l,{side:j,align:M,sideOffset:4,collisionPadding:8,className:o(K,D,`w-[var(--radix-popover-trigger-width)] min-w-[16rem] rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover outline-none`,A),children:[P?(0,y.jsx)(`input`,{type:`search`,"aria-label":P,placeholder:P,value:F,onChange:e=>I?.(e.target.value),className:`mb-1 w-full shrink-0 rounded-md bg-surface-base px-3 py-2 text-base text-fg placeholder:text-fg-subtle sm:text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}):null,(0,y.jsxs)(`div`,{"data-select-scroll-region":!0,className:o(O,`max-h-64`),children:[r?(0,y.jsxs)(`button`,{type:`button`,disabled:f,className:o(`touch-target flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,e===``&&`bg-surface-active font-medium`,f&&`cursor-not-allowed opacity-45 hover:bg-transparent`),onClick:()=>{f||(N(``),V(!1))},children:[(0,y.jsx)(a,{className:o(`size-4 shrink-0`,e!==``&&`invisible`),"aria-hidden":`true`}),(0,y.jsx)(`span`,{className:`min-w-0 truncate text-fg-subtle`,children:i})]}):null,L?(0,y.jsx)(`div`,{className:`space-y-2 p-2`,"aria-busy":`true`,children:[0,1,2].map(e=>(0,y.jsx)(s,{className:`h-8 w-full`},e))}):null,R&&!L?(0,y.jsx)(`p`,{role:`status`,className:`px-3 py-2 text-xs text-fg-muted`,children:R}):null,(L?[]:t).map(t=>{let n=t.disabled===!0||p?.has(t.value)===!0&&t.value!==e,r=t.group&&t.group!==Y;return Y=t.group,(0,y.jsxs)(g.Fragment,{children:[r?(0,y.jsx)(`div`,{className:`px-2 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wide text-fg-subtle`,children:t.group}):null,(0,y.jsxs)(`button`,{type:`button`,disabled:n,className:o(`touch-target flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,t.value===e&&`bg-surface-active font-medium`,n&&`cursor-not-allowed opacity-45 hover:bg-transparent`),onClick:()=>{n||(N(t.value),V(!1))},children:[t.icon??(0,y.jsx)(a,{className:o(`size-4 shrink-0`,t.value!==e&&`invisible`),"aria-hidden":`true`}),(0,y.jsx)(`span`,{className:`min-w-0 truncate`,children:t.label}),t.icon?(0,y.jsx)(a,{className:o(`ml-auto size-4 shrink-0`,t.value!==e&&`invisible`),"aria-hidden":!0}):null]})]},`${t.group??``}:${t.value}`)})]})]})})]})}function A(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(A).join(``):(0,g.isValidElement)(e)?A(e.props.children):``}function j(e,t){let n=[];return g.Children.forEach(e,e=>{if(!(0,g.isValidElement)(e))return;if(e.type===g.Fragment){n.push(...j(e.props.children,t));return}if(e.type===N){let t=e.props;n.push(...j(t.children,A(t.label)));return}if(e.type!==M)return;let r=e.props,i=A(r.children).trim(),a=r.value==null?i:String(r.value);n.push({value:a,label:i,disabled:r.disabled,group:t})}),n}function M(e){return null}function N(e){return null}function P(e){if(!e)return;let t=e.split(/\s+/).filter(Boolean).filter(e=>{let t=e.includes(`:`)?e.slice(e.lastIndexOf(`:`)+1):e;return t===`block`||t===`inline-block`||t===`inline-flex`||t===`flex`||t===`flex-1`||t===`flex-auto`||t===`flex-initial`||t===`flex-none`||t===`grow`||t===`shrink`||t===`min-w-0`||t===`min-h-0`||t.startsWith(`w-`)||t.startsWith(`min-w-`)||t.startsWith(`max-w-`)||t.startsWith(`basis-`)||t.startsWith(`grow-`)||t.startsWith(`shrink-`)||t.startsWith(`self-`)||t.startsWith(`order-`)||t.startsWith(`col-`)||t.startsWith(`row-`)});return t.length===0?void 0:t.join(` `)}function F(e){let t=(0,_.c)(67),n,r,i,a,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]):({align:n,children:r,className:i,contentClassName:a,disabled:s,id:c,onChange:l,placeholder:u,side:f,triggerClassName:p,value:m,...d}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m);let h=(0,g.useId)(),v=m==null?``:String(m),b,x,S,C,w,T,E,D,O,A;if(t[13]!==r||t[14]!==i||t[15]!==s||t[16]!==h||t[17]!==c||t[18]!==u||t[19]!==d.name||t[20]!==v){let e=j(r);C=e.find(L),x=C!==void 0,S=C?.label||u||``,D=s||void 0,t[31]===i?O=t[32]:(O=P(i),t[31]=i,t[32]=O),A=d.name,b=k,w=c??h,T=v,E=e.filter(I),t[13]=r,t[14]=i,t[15]=s,t[16]=h,t[17]=c,t[18]=u,t[19]=d.name,t[20]=v,t[21]=b,t[22]=x,t[23]=S,t[24]=C,t[25]=w,t[26]=T,t[27]=E,t[28]=D,t[29]=O,t[30]=A}else b=t[21],x=t[22],S=t[23],C=t[24],w=t[25],T=t[26],E=t[27],D=t[28],O=t[29],A=t[30];let M=u??S,N=C?.disabled===!0,F=d[`aria-label`],R=d[`aria-labelledby`],z=d[`aria-describedby`],B=d.title,V;t[33]!==i||t[34]!==p?(V=o(i,p),t[33]=i,t[34]=p,t[35]=V):V=t[35];let H;t[36]===l?H=t[37]:(H=e=>l?.({target:{value:e},currentTarget:{value:e}}),t[36]=l,t[37]=H);let U;t[38]!==b||t[39]!==n||t[40]!==x||t[41]!==a||t[42]!==s||t[43]!==S||t[44]!==d.title||t[45]!==f||t[46]!==w||t[47]!==R||t[48]!==z||t[49]!==V||t[50]!==H||t[51]!==T||t[52]!==E||t[53]!==M||t[54]!==N||t[55]!==F?(U=(0,y.jsx)(b,{id:w,value:T,options:E,placeholder:M,allowEmpty:x,emptyLabel:S,emptyDisabled:N,disabled:s,ariaLabel:F,ariaLabelledBy:R,ariaDescribedBy:z,title:B,side:f,align:n,triggerClassName:V,contentClassName:a,onChange:H}),t[38]=b,t[39]=n,t[40]=x,t[41]=a,t[42]=s,t[43]=S,t[44]=d.title,t[45]=f,t[46]=w,t[47]=R,t[48]=z,t[49]=V,t[50]=H,t[51]=T,t[52]=E,t[53]=M,t[54]=N,t[55]=F,t[56]=U):U=t[56];let W;t[57]!==s||t[58]!==d.name||t[59]!==v?(W=(0,y.jsx)(`input`,{name:d.name,value:v,readOnly:!0,hidden:!0,disabled:s}),t[57]=s,t[58]=d.name,t[59]=v,t[60]=W):W=t[60];let G;return t[61]!==U||t[62]!==W||t[63]!==D||t[64]!==O||t[65]!==A?(G=(0,y.jsxs)(`div`,{"aria-disabled":D,className:O,"data-select-name":A,children:[U,W]}),t[61]=U,t[62]=W,t[63]=D,t[64]=O,t[65]=A,t[66]=G):G=t[66],G}function I(e){return e.value!==``}function L(e){return e.value===``}export{D as a,T as c,h as d,E as i,C as l,F as n,O as o,M as r,S as s,k as t,v as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{n,p as r}from"./locale-store-B4o4aDCg.js";import{t as i}from"./messages-hlOsXkQ7.js";import{n as a,r as o}from"./popover-select-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{n,p as r}from"./locale-store-B4o4aDCg.js";import{t as i}from"./messages-hlOsXkQ7.js";import{n as a,r as o}from"./popover-select-hRG1EzAY.js";import{t as s}from"./cn-0WouolD0.js";import{t as c}from"./middleware-Pd0e8Igk.js";import{o as l}from"./form-field-width-DJw_jULe.js";import{i as u}from"./theme-store-C7t81hG7.js";var d=e(),f=[`compact`,`default`,`large`];function p(e){document.documentElement.dataset.fontScale=e}function m(){try{let e=localStorage.getItem(`xopc-web-font-scale`),t=`default`;if(e){let n=JSON.parse(e).state?.preference;n&&f.includes(n)&&(t=n)}p(t)}catch{p(`default`)}}var h=r(c(e=>({preference:`default`,setPreference:t=>{p(t),e({preference:t})}}),{name:`xopc-web-font-scale`}));function g(){p(h.getState().preference)}var _=t(),v=[`language`,`theme`,`font`];function y(e){let t=(0,d.c)(59),{variant:r,sections:c}=e,f=c===void 0?v:c,p=n(T),m=n(w),g=u(C),y=u(S),E=h(x),D=h(b),O;t[0]===p?O=t[1]:(O=i(p),t[0]=p,t[1]=O);let k=O.appearanceSettings,A=r===`page`?`w-full max-w-[min(100%,12rem)] shrink-0 sm:ml-auto sm:w-auto sm:max-w-[11rem]`:r===`toolbar`?`w-auto min-w-[6.5rem] max-w-[10rem] shrink-0 sm:min-w-[7.5rem]`:`w-full`,j;t[2]===A?j=t[3]:(j=s(l,A),t[2]=A,t[3]=j);let M=j,N=r===`page`?`flex flex-col gap-2 border-b border-edge-subtle px-4 py-3.5 last:border-b-0 sm:flex-row sm:items-center sm:justify-between sm:gap-6 sm:px-5 sm:py-4`:`flex flex-col gap-1.5`,P;t[4]===f?P=t[5]:(P=e=>f.includes(e),t[4]=f,t[5]=P);let F=P;if(r===`toolbar`){let e;t[6]!==k||t[7]!==p||t[8]!==M||t[9]!==m||t[10]!==F?(e=F(`language`)?(0,_.jsxs)(a,{className:M,value:p,"aria-label":k.languageTitle,onChange:e=>m(e.target.value),children:[(0,_.jsx)(o,{value:`en`,children:k.langOptionEn}),(0,_.jsx)(o,{value:`zh`,children:k.langOptionZh})]}):null,t[6]=k,t[7]=p,t[8]=M,t[9]=m,t[10]=F,t[11]=e):e=t[11];let n;t[12]!==k||t[13]!==M||t[14]!==y||t[15]!==F||t[16]!==g?(n=F(`theme`)?(0,_.jsxs)(a,{className:M,value:g,"aria-label":k.themeTitle,onChange:e=>y(e.target.value),children:[(0,_.jsx)(o,{value:`light`,children:k.themeOptionLight}),(0,_.jsx)(o,{value:`dark`,children:k.themeOptionDark}),(0,_.jsx)(o,{value:`system`,children:k.themeOptionSystem})]}):null,t[12]=k,t[13]=M,t[14]=y,t[15]=F,t[16]=g,t[17]=n):n=t[17];let r;t[18]!==k||t[19]!==E||t[20]!==M||t[21]!==D||t[22]!==F?(r=F(`font`)?(0,_.jsxs)(a,{className:M,value:E,"aria-label":k.fontScaleTitle,onChange:e=>D(e.target.value),children:[(0,_.jsx)(o,{value:`compact`,children:k.fontScaleCompact}),(0,_.jsx)(o,{value:`default`,children:k.fontScaleDefault}),(0,_.jsx)(o,{value:`large`,children:k.fontScaleLarge})]}):null,t[18]=k,t[19]=E,t[20]=M,t[21]=D,t[22]=F,t[23]=r):r=t[23];let i;return t[24]!==e||t[25]!==n||t[26]!==r?(i=(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[e,n,r]}),t[24]=e,t[25]=n,t[26]=r,t[27]=i):i=t[27],i}let I=r===`sidebar`&&`flex flex-col gap-4`,L;t[28]===I?L=t[29]:(L=s(I),t[28]=I,t[29]=L);let R;t[30]!==k||t[31]!==p||t[32]!==N||t[33]!==M||t[34]!==m||t[35]!==F||t[36]!==r?(R=F(`language`)?(0,_.jsxs)(`div`,{className:N,children:[(0,_.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,_.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:k.languageTitle}),r===`page`?null:(0,_.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:k.languageDescription})]}),(0,_.jsxs)(a,{className:M,value:p,"aria-label":k.languageTitle,onChange:e=>m(e.target.value),children:[(0,_.jsx)(o,{value:`en`,children:k.langOptionEn}),(0,_.jsx)(o,{value:`zh`,children:k.langOptionZh})]})]}):null,t[30]=k,t[31]=p,t[32]=N,t[33]=M,t[34]=m,t[35]=F,t[36]=r,t[37]=R):R=t[37];let z;t[38]!==k||t[39]!==N||t[40]!==M||t[41]!==y||t[42]!==F||t[43]!==g||t[44]!==r?(z=F(`theme`)?(0,_.jsxs)(`div`,{className:N,children:[(0,_.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,_.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:k.themeTitle}),r===`page`?null:(0,_.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:k.themeDescription})]}),(0,_.jsxs)(a,{className:M,value:g,"aria-label":k.themeTitle,onChange:e=>y(e.target.value),children:[(0,_.jsx)(o,{value:`light`,children:k.themeOptionLight}),(0,_.jsx)(o,{value:`dark`,children:k.themeOptionDark}),(0,_.jsx)(o,{value:`system`,children:k.themeOptionSystem})]})]}):null,t[38]=k,t[39]=N,t[40]=M,t[41]=y,t[42]=F,t[43]=g,t[44]=r,t[45]=z):z=t[45];let B;t[46]!==k||t[47]!==E||t[48]!==N||t[49]!==M||t[50]!==D||t[51]!==F||t[52]!==r?(B=F(`font`)?(0,_.jsxs)(`div`,{className:N,children:[(0,_.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,_.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:k.fontScaleTitle}),r===`page`?null:(0,_.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:k.fontScaleDescription})]}),(0,_.jsxs)(a,{className:M,value:E,"aria-label":k.fontScaleTitle,onChange:e=>D(e.target.value),children:[(0,_.jsx)(o,{value:`compact`,children:k.fontScaleCompact}),(0,_.jsx)(o,{value:`default`,children:k.fontScaleDefault}),(0,_.jsx)(o,{value:`large`,children:k.fontScaleLarge})]})]}):null,t[46]=k,t[47]=E,t[48]=N,t[49]=M,t[50]=D,t[51]=F,t[52]=r,t[53]=B):B=t[53];let V;return t[54]!==B||t[55]!==L||t[56]!==R||t[57]!==z?(V=(0,_.jsxs)(`div`,{className:L,children:[R,z,B]}),t[54]=B,t[55]=L,t[56]=R,t[57]=z,t[58]=V):V=t[58],V}function b(e){return e.setPreference}function x(e){return e.preference}function S(e){return e.setPreference}function C(e){return e.preference}function w(e){return e.setLanguage}function T(e){return e.language}export{h as i,m as n,g as r,y as t};
|
package/dist/gateway/static/root/assets/{preview-runtime-MJUo7XlD.js → preview-runtime-D9y0frrZ.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/attachment-process-heavy-DGZZ-M85.js","assets/rolldown-runtime-aKtaBQYM.js","assets/preload-helper-Czpn1I53.js","assets/pdf-runtime-JnUAvfIa.js","assets/source-workspace-editor-BwYU5OEh.js","assets/vendor-react-BOUWij0V.js","assets/vendor-codemirror-aCQ0FcJT.js","assets/languages-kF11aUYU.js","assets/binary-plugins-5GVlyrXg.js","assets/messages-hlOsXkQ7.js","assets/attachment-utils-core-BPYdUI6y.js","assets/preview-open-alternatives-CY_hjK4b.js","assets/download-Dk-ZjtO6.js","assets/createLucideIcon-DPHK1VkS.js","assets/external-link-DjqjBmc3.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/interaction-BdhHBbYa.js","assets/electron-env-DHOGevH3.js","assets/use-blob-object-url-D4BFuzZB.js","assets/media-plugins-B5XMcW5S.js","assets/archive-plugin-Co_oRPj1.js","assets/jszip.min-Dj17eJqX.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{a,i as o,l as s}from"./locale-store-B4o4aDCg.js";import{t as c}from"./messages-hlOsXkQ7.js";import{t as l}from"./createLucideIcon-DPHK1VkS.js";import{K as u,t as d}from"./markdown-view-C7kqotD-.js";import{t as f}from"./plus-Q2yW6OE7.js";import{t as p}from"./rotate-cw-LIg3Am9S.js";import{t as m}from"./search-DA7gz22f.js";import{t as h}from"./cn-0WouolD0.js";import{t as g}from"./skeleton-DzdOeGYz.js";import{r as _}from"./turn-outcome-BSbEJx8h.js";import{a as v,c as y,o as b,r as x,t as S}from"./attachment-utils-core-BPYdUI6y.js";import{n as C}from"./electron-env-DHOGevH3.js";import{t as w}from"./use-async-resource-BHFGZCY2.js";import{a as T,c as E,d as D,m as O,n as k,r as ee,u as A}from"./workspace-api-CIfedJeG.js";import{t as j}from"./index.module-Cd9ENXfk.js";var M=l(`step-forward`,[[`path`,{d:`M10.029 4.285A2 2 0 0 0 7 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`1ystz2`}],[`path`,{d:`M3 4v16`,key:`1ph11n`}]]),N=l(`step-back`,[[`path`,{d:`M13.971 4.285A2 2 0 0 1 17 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`,key:`19qhus`}],[`path`,{d:`M21 20V4`,key:`cb8qj8`}]]),P=5*1024*1024,F=32*1024*1024,I=new Set(`.astro,.bat,.c,.cc,.clj,.cljs,.cljc,.cmd,.cpp,.cs,.cts,.cxx,.dart,.edn,.erl,.ex,.exs,.fish,.fs,.fsx,.go,.gql,.graphql,.groovy,.h,.hh,.hpp,.hrl,.hxx,.java,.ts,.tsx,.mts,.js,.jsx,.mjs,.cjs,.css,.scss,.sass,.less,.json,.jsonc,.json5,.yml,.yaml,.xml,.xsd,.xsl,.py,.pyw,.rb,.php,.rs,.kt,.kts,.scala,.swift,.m,.mm,.sh,.bash,.zsh,.ps1,.sql,.lua,.r,.pl,.pm,.sol,.tf,.tfvars,.nix,.proto,.vue,.svelte,.toml,.ini,.cfg,.conf,.properties`.split(`,`)),L=new Set([`.txt`,`.log`,`.lock`,`.csv`,`.tsv`,`.env`,`.gitignore`,`.gitattributes`,`.editorconfig`,`.npmrc`,`.dockerignore`,`.eslintignore`,`.prettierignore`,`.stylelintignore`]),R=new Set([`dockerfile`,`gemfile`,`jenkinsfile`,`makefile`,`procfile`,`rakefile`]),z=new Set([`brewfile`,`changelog`,`codeowners`,`license`,`readme`]),te=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`,`.ico`,`.svg`,`.svgz`,`.tif`,`.tiff`,`.avif`,`.heic`,`.heif`,`.jxl`]),B=new Set([`.mp3`,`.wav`,`.ogg`,`.oga`,`.aac`,`.m4a`,`.flac`,`.opus`,`.weba`]),V=new Set([`.mp4`,`.webm`,`.mov`,`.m4v`,`.ogv`]),ne=new Set([`.zip`]),H=new Map([[`.pdf`,`application/pdf`],[`.docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`.pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`.xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`.xls`,`application/vnd.ms-excel`],[`.md`,`text/markdown`],[`.markdown`,`text/markdown`],[`.html`,`text/html`],[`.htm`,`text/html`],[`.json`,`application/json`],[`.txt`,`text/plain`],[`.csv`,`text/csv`],[`.tsv`,`text/tab-separated-values`],[`.png`,`image/png`],[`.jpg`,`image/jpeg`],[`.jpeg`,`image/jpeg`],[`.gif`,`image/gif`],[`.webp`,`image/webp`],[`.svg`,`image/svg+xml`],[`.svgz`,`image/svg+xml`],[`.mp3`,`audio/mpeg`],[`.wav`,`audio/wav`],[`.ogg`,`audio/ogg`],[`.mp4`,`video/mp4`],[`.webm`,`video/webm`],[`.mov`,`video/quicktime`],[`.zip`,`application/zip`]]);function U(e){let t=W(e),n=t.lastIndexOf(`.`);return n<0||n===t.length-1?``:t.slice(n).toLowerCase()}function W(e){let t=e.replace(/\\/g,`/`).split(`/`);return t[t.length-1]||e}function re(e,t){let n=t?.split(`;`)[0]?.trim().toLowerCase();return n&&n!==`application/octet-stream`?n:H.get(U(e))??n??`application/octet-stream`}function ie(e,t){let n=U(e),r=W(e).toLowerCase(),i=re(e,t);return i===`text/markdown`||n===`.md`||n===`.markdown`?`markdown`:i===`text/html`||n===`.html`||n===`.htm`?`html`:i===`application/pdf`||n===`.pdf`?`pdf`:i===`application/vnd.openxmlformats-officedocument.wordprocessingml.document`||n===`.docx`?`docx`:i===`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`||i===`application/vnd.ms-excel`||n===`.xlsx`||n===`.xls`?`spreadsheet`:i===`application/vnd.openxmlformats-officedocument.presentationml.presentation`||n===`.pptx`?`pptx`:i.startsWith(`image/`)||te.has(n)?`image`:i.startsWith(`audio/`)||B.has(n)?`audio`:i.startsWith(`video/`)||V.has(n)?`video`:i===`application/zip`||ne.has(n)?`archive`:I.has(n)||R.has(r)||r.startsWith(`dockerfile.`)?`code`:i.startsWith(`text/`)||L.has(n)||z.has(r)||r.startsWith(`.env.`)||i===`application/json`?`text`:`unsupported`}function ae(e){switch(e){case`text`:case`markdown`:case`code`:case`html`:return`text`;case`unsupported`:return`metadata`;default:return`binary`}}async function G(e){let{uri:t,conversationId:n,taskId:r}=e;try{let e=_(t),i=await a(o(e?`/api/files/${encodeURIComponent(e)}/content`:y(t,n,r)));return i.ok?{ok:!0,blob:await i.blob()}:{ok:!1,reason:`http`,status:i.status}}catch(e){return{ok:!1,reason:`network`,message:e instanceof Error?e.message:String(e)}}}async function oe(e){let t=await G(e);return t.ok?{ok:!0,buffer:await t.blob.arrayBuffer()}:t}var K=n(),q=e(t(),1);function J(e){return e.id?String(e.id):`${e.name}:${e.uri??``}`}function se(){return{id:`__empty__`,context:`attachment`,fileName:``,mimeType:`application/octet-stream`,type:`unsupported`,source:{kind:`inline`}}}function Y(e){let t=(0,K.c)(65),{open:n,attachment:r,authToken:i,conversationId:a,language:o}=e,[s,l]=(0,q.useState)(n?r:null),[u,d]=(0,q.useState)(!1),[f,p]=(0,q.useState)(!1),m;t[0]!==r||t[1]!==n?(m=n&&r?J(r):null,t[0]=r,t[1]=n,t[2]=m):m=t[2];let h=m,g=(0,q.useRef)(h);h!==g.current&&(g.current=h,l(n&&r?r:null),d(!1),p(!1));let _=s,y;bb0:{if(!_){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=se(),t[3]=e):e=t[3],y=e;break bb0}let e=_.name??`attachment`,n,r;t[4]!==e||t[5]!==_.mimeType?(n=re(e,_.mimeType),r=ie(e,n),t[4]=e,t[5]=_.mimeType,t[6]=n,t[7]=r):(n=t[6],r=t[7]);let i=r,o=_.id?String(_.id):`${e}:${_.uri??``}`,s;t[8]!==a||t[9]!==_.uri?(s=_.uri?{kind:`media-uri`,uri:_.uri,conversationId:a}:{kind:`inline`},t[8]=a,t[9]=_.uri,t[10]=s):s=t[10];let c;t[11]!==e||t[12]!==n||t[13]!==_.size||t[14]!==o||t[15]!==s||t[16]!==i?(c={id:o,context:`attachment`,fileName:e,mimeType:n,size:_.size,type:i,source:s},t[11]=e,t[12]=n,t[13]=_.size,t[14]=o,t[15]=s,t[16]=i,t[17]=c):c=t[17],y=c}let b=y,S;t[18]===_?S=t[19]:(S=_?v(_):void 0,t[18]=_,t[19]=S);let C=S,T=_?.uri,E;t[20]===b.type?E=t[21]:(E=ae(b.type),t[20]=b.type,t[21]=E);let D=E,O=!!(n&&T&&!C&&i&&(D===`binary`||D===`text`)),k;t[22]!==a||t[23]!==o||t[24]!==T||t[25]!==_?.taskId?(k=async()=>{let e=c(o).chat,t=await oe({uri:T,conversationId:a,taskId:_?.taskId});if(!t.ok)throw t.reason===`http`?Error(`${e.attachmentPreviewLoadError} (HTTP ${t.status})`):Error(t.message);return t.buffer},t[22]=a,t[23]=o,t[24]=T,t[25]=_?.taskId,t[26]=k):k=t[26];let ee=_?.taskId,A;t[27]!==i||t[28]!==a||t[29]!==C||t[30]!==o||t[31]!==T||t[32]!==n||t[33]!==D||t[34]!==ee?(A=[n,T,i,o,C,ee,a,D],t[27]=i,t[28]=a,t[29]=C,t[30]=o,t[31]=T,t[32]=n,t[33]=D,t[34]=ee,t[35]=A):A=t[35];let j;t[36]===O?j=t[37]:(j={enabled:O,initial:null,errorData:null},t[36]=O,t[37]=j);let M=w(k,A,j),N;bb1:{if(C)try{let e;t[38]===C?e=t[39]:(e=x(C),t[38]=C,t[39]=e),N=e;break bb1}catch{N=null;break bb1}if(O&&M.loading){N=null;break bb1}N=M.data??null}let P=N,F=D===`binary`?P:null,I=_?.extractedText??``,L;t[40]!==P||t[41]!==I||t[42]!==o||t[43]!==D?(L=D===`text`?I||(P?new TextDecoder(`utf-8`,{fatal:!1}).decode(new Uint8Array(P)):c(o).chat.attachmentPreviewNoText):null,t[40]=P,t[41]=I,t[42]=o,t[43]=D,t[44]=L):L=t[44];let R=L,z=!!_?.extractedText,te=b.type===`pptx`&&I.length>3e5,B;t[45]!==i||t[46]!==C||t[47]!==o||t[48]!==T||t[49]!==n||t[50]!==D?(B=n&&T&&!C&&!i&&D===`binary`?c(o).chat.attachmentPreviewMissingAuth:null,t[45]=i,t[46]=C,t[47]=o,t[48]=T,t[49]=n,t[50]=D,t[51]=B):B=t[51];let V=B,ne=M.error?M.error instanceof Error?M.error.message:String(M.error):null,H=f?null:V??ne,U=O?M.loading:!1,W;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>p(!0),t[52]=W):W=t[52];let G=I||null,Y;return t[53]!==F||t[54]!==b||t[55]!==P||t[56]!==te||t[57]!==z||t[58]!==H||t[59]!==_||t[60]!==u||t[61]!==U||t[62]!==G||t[63]!==R?(Y={preview:_,descriptor:b,fileType:b.type,fileName:b.fileName,loading:U,loadError:H,clearLoadError:W,textContent:R,binaryBuffer:F,downloadBuffer:P,hasExtractedText:z,extractedText:G,extractedTextTruncated:te,showExtractedText:u,setShowExtractedText:d},t[53]=F,t[54]=b,t[55]=P,t[56]=te,t[57]=z,t[58]=H,t[59]=_,t[60]=u,t[61]=U,t[62]=G,t[63]=R,t[64]=Y):Y=t[64],Y}function ce(e){let t=(0,K.c)(12),{projectId:n,conversationId:r,agentId:i}=e,a;bb0:{let e;t[0]===n?e=t[1]:(e=n?.trim(),t[0]=n,t[1]=e);let o=e;if(o){let e;t[2]===o?e=t[3]:(e={projectId:o},t[2]=o,t[3]=e),a=e;break bb0}let s;t[4]===r?s=t[5]:(s=r?.trim(),t[4]=r,t[5]=s);let c=s;if(c){let e;t[6]===c?e=t[7]:(e={conversationId:c},t[6]=c,t[7]=e),a=e;break bb0}let l;t[8]===i?l=t[9]:(l=i?.trim(),t[8]=i,t[9]=l);let u=l,d;t[10]===u?d=t[11]:(d=u?{agentId:u}:void 0,t[10]=u,t[11]=d),a=d}return a}function le(e){return{descriptor:e,textContent:null,binaryBuffer:null,fileResourceId:null,mtimeMs:null,loadError:null,loading:!1,pptxText:null,pptxTruncated:!1,pptxError:null}}function ue(e,t){switch(t.type){case`clear`:return le(t.descriptor);case`loadStart`:return{...le(t.descriptor),loading:!0};case`loadSuccess`:return{...e,descriptor:t.payload.descriptor,textContent:t.payload.textContent??null,binaryBuffer:t.payload.binaryBuffer??null,fileResourceId:t.payload.fileResourceId??null,mtimeMs:t.payload.mtimeMs??null,loadError:null,loading:!1};case`loadError`:return{...le(t.descriptor),loadError:t.error};case`patchMtime`:return{...e,mtimeMs:t.mtimeMs};case`patchText`:return{...e,textContent:t.text};case`pptxClear`:return{...e,pptxText:null,pptxTruncated:!1,pptxError:null};case`pptxSuccess`:return{...e,pptxText:t.text,pptxTruncated:t.truncated,pptxError:null};case`pptxError`:return{...e,pptxText:null,pptxTruncated:!1,pptxError:t.error}}}function de(e,t){switch(t.type){case`reset`:return{sourceEditMode:!1,saveStatus:`idle`};case`source`:return{...e,sourceEditMode:typeof t.value==`function`?t.value(e.sourceEditMode):t.value};case`saveStatus`:return{...e,saveStatus:t.value}}}function fe({filePath:e,projectId:t,conversationId:n,agentId:r,resolvedFile:a,initialEditMode:o=!1}){let s=ce({projectId:t,conversationId:n,agentId:r}),c=(0,q.useMemo)(()=>{let t=e?W(e):``,i=re(t,b(t)),a=e?ie(t,i):`unsupported`;return{id:e||`__empty__`,context:`workspace`,fileName:t,mimeType:i,type:a,source:{kind:`workspace`,path:e||``,conversationId:n,agentId:r}}},[r,e,n]),[l,u]=(0,q.useReducer)(ue,c,le),[d,f]=(0,q.useReducer)(de,{sourceEditMode:o,saveStatus:`idle`}),[p,m]=(0,q.useState)([]),[h,g]=(0,q.useState)([]),_=(0,q.useRef)(e),v=(0,q.useRef)(void 0),y=(0,q.useRef)(null),x=(0,q.useRef)(null),w=(0,q.useRef)(null),[M,N]=(0,q.useState)(!1),[P,F]=(0,q.useState)(!1),[I,L]=(0,q.useState)(0);_.current!==e&&(_.current=e,f({type:`reset`})),(0,q.useEffect)(()=>{if(!e){u({type:`clear`,descriptor:c});return}let t=!1;u({type:`loadStart`,descriptor:c});let n=ae(c.type),r=e=>{t||u({type:`loadError`,descriptor:c,error:e instanceof Error?e.message:String(e)})};return n===`metadata`?(Promise.all([D(e,s).catch(()=>null),A(e,s).catch(()=>null)]).then(async([n,r])=>{if(!n){t||u({type:`loadSuccess`,payload:{descriptor:c,fileResourceId:r?.fileId??null,mtimeMs:typeof r?.mtimeMs==`number`?r.mtimeMs:null}});return}let i={...c,mimeType:n.mimeType,type:ie(n.name,n.mimeType)};if(ae(i.type)===`text`){let{content:r,mtimeMs:a,revision:o}=await E(e,s);t||(v.current=o,y.current=r,x.current=r,N(!1),F(!1)),t||u({type:`loadSuccess`,payload:{descriptor:i,textContent:r,fileResourceId:n.id,mtimeMs:typeof a==`number`?a:n.modifiedAt}});return}t||u({type:`loadSuccess`,payload:{descriptor:i,fileResourceId:n.id,mtimeMs:n.modifiedAt}})}).catch(r),()=>{t=!0}):(n===`text`?E(e,s,I===0?a:void 0).then(({content:e,mtimeMs:n,revision:r,fileId:i})=>{t||(v.current=r,y.current=e,x.current=e,N(!1),F(!1)),t||u({type:`loadSuccess`,payload:{descriptor:c,textContent:e,fileResourceId:i??null,mtimeMs:typeof n==`number`?n:null}})}).catch(r):Promise.all([T(e,s),A(e,s).catch(()=>null)]).then(async([e,n])=>{let r=await e.arrayBuffer();t||u({type:`loadSuccess`,payload:{descriptor:c,binaryBuffer:r,fileResourceId:n?.fileId??null,mtimeMs:typeof n?.mtimeMs==`number`?n.mtimeMs:null}})}).catch(r),()=>{t=!0})},[c,e,s,I,a]),(0,q.useEffect)(()=>{if(!l.binaryBuffer||l.descriptor.type!==`pptx`){u({type:`pptxClear`});return}let e=!1;return u({type:`pptxClear`}),i(()=>import(`./attachment-process-heavy-DGZZ-M85.js`).then(e=>e.processPptx(l.binaryBuffer,l.descriptor.fileName)),__vite__mapDeps([0,1,2,3])).then(({extractedText:t})=>{if(e)return;let n=t.length>S;u({type:`pptxSuccess`,text:n?t.slice(0,S):t,truncated:n})}).catch(t=>{e||u({type:`pptxError`,error:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},[l.binaryBuffer,l.descriptor.fileName,l.descriptor.type]);let R=(0,q.useCallback)(async()=>{if(w.current&&!await w.current)return!1;if(!e||y.current===null||y.current===x.current)return!0;let t=(async()=>{f({type:`saveStatus`,value:`saving`});try{for(;y.current!==x.current;){let t=y.current,n=await O(e,t,s,v.current);v.current=n.revision,x.current=t,typeof n.mtimeMs==`number`&&u({type:`patchMtime`,mtimeMs:n.mtimeMs})}return N(!1),f({type:`saveStatus`,value:`saved`}),!0}catch{return f({type:`saveStatus`,value:`error`}),!1}})();w.current=t;try{return await t}finally{w.current===t&&(w.current=null)}},[e,s]),z=j(()=>void R(),500),te=(0,q.useCallback)(e=>{y.current=e,N(e!==x.current),u({type:`patchText`,text:e}),z()},[z]);(0,q.useEffect)(()=>{let e=e=>{y.current!==x.current&&(e.preventDefault(),e.returnValue=``)};return window.addEventListener(`beforeunload`,e),()=>{window.removeEventListener(`beforeunload`,e),z.cancel()}},[z]);let B=(0,q.useCallback)(()=>{!M&&!w.current&&L(e=>e+1)},[M]),V=(0,q.useRef)(!1),ne=(0,q.useCallback)(async()=>{if(!(!e||l.loading||w.current||V.current)){V.current=!0;try{let t=await D(e,s);if(!t||!(v.current?t.revision!==v.current:l.mtimeMs!=null&&t.modifiedAt!==l.mtimeMs))return;M||d.sourceEditMode?F(!0):B()}catch{F(!0)}finally{V.current=!1}}},[M,d.sourceEditMode,e,l.loading,l.mtimeMs,s,B]),H=(0,q.useCallback)(async()=>{if(!e)return;let t=W(e);if(l.binaryBuffer){k(t,l.binaryBuffer,l.descriptor.mimeType||`application/octet-stream`);return}if(l.textContent!=null){ee(t,l.textContent);return}let n=await T(e,s);k(t,await n.arrayBuffer(),l.descriptor.mimeType||n.type||`application/octet-stream`)},[e,l.binaryBuffer,l.descriptor.mimeType,l.textContent,s]),U=(0,q.useCallback)(async()=>{if(!e)throw Error(`No workspace file selected`);let t=W(e),n=l.descriptor.mimeType||`application/octet-stream`,r;return r=l.binaryBuffer?new Blob([l.binaryBuffer],{type:n}):l.textContent==null?await T(e,s):new Blob([l.textContent],{type:n}),new File([r],t,{type:l.descriptor.mimeType||r.type||`application/octet-stream`,lastModified:l.mtimeMs??Date.now()})},[e,l.binaryBuffer,l.descriptor.mimeType,l.mtimeMs,l.textContent,s]),G=!l.loading&&!!e,oe=C()&&(!!l.fileResourceId&&!!window.electronAPI?.shell?.openFileResource||l.descriptor.type===`spreadsheet`&&!!l.binaryBuffer&&!!window.electronAPI?.shell?.openTemporaryFile),K=C()&&!!l.fileResourceId&&!!window.electronAPI?.shell?.chooseAppAndOpenFileResource,J=(0,q.useCallback)(async()=>{let e=l.fileResourceId;if(!C()||!e||!window.electronAPI?.shell?.getOpenWithAppsForFileResource){g([]),m([]);return}try{let t=await window.electronAPI.shell.getOpenWithAppsForFileResource(e);g(t.recommended.map(e=>({name:e.name,path:e.path,iconDataUrl:e.iconDataUrl}))),m(t.recent.map(e=>({name:e.name,path:e.path,iconDataUrl:e.iconDataUrl,lastUsedAt:e.lastUsedAt})))}catch{g([]),m([])}},[l.fileResourceId]);(0,q.useEffect)(()=>{J()},[J]);let se=(0,q.useCallback)(async()=>{let e=l.fileResourceId;if(e&&window.electronAPI?.shell?.openFileResource)return window.electronAPI.shell.openFileResource(e);if(l.descriptor.type===`spreadsheet`&&l.binaryBuffer&&window.electronAPI?.shell?.openTemporaryFile)return window.electronAPI.shell.openTemporaryFile({fileName:l.descriptor.fileName,data:new Uint8Array(l.binaryBuffer)})},[l.binaryBuffer,l.descriptor.fileName,l.descriptor.type,l.fileResourceId]),Y=(0,q.useCallback)(async()=>{let e=l.fileResourceId;if(!e||!window.electronAPI?.shell?.chooseAppAndOpenFileResource)return;let t=await window.electronAPI.shell.chooseAppAndOpenFileResource(e);return t.ok&&J(),t},[l.fileResourceId,J]),fe=(0,q.useCallback)(async e=>{let t=l.fileResourceId;if(!t||!e||!window.electronAPI?.shell?.openFileResourceWithApp)return;let n=await window.electronAPI.shell.openFileResourceWithApp(t,e);return n.ok&&J(),n},[l.fileResourceId,J]),X=C()&&!!l.fileResourceId&&!!window.electronAPI?.shell?.showFileResourceInFolder,pe=(0,q.useCallback)(async()=>{let e=l.fileResourceId;if(e&&window.electronAPI?.shell?.showFileResourceInFolder)return window.electronAPI.shell.showFileResourceInFolder(e)},[l.fileResourceId]);return{...l,dirty:M,externalChange:P,flushSource:R,refresh:B,checkForUpdates:ne,extractedText:l.descriptor.type===`pptx`?l.pptxText:null,extractedTextTruncated:l.pptxTruncated,sourceEditMode:d.sourceEditMode,setSourceEditMode:e=>f({type:`source`,value:e}),saveStatus:d.saveStatus,onSourceChange:te,onDownload:H,createAttachmentFile:U,canDownload:G,canOpenWithSystemApp:oe,onOpenWithSystemApp:se,canChooseOpenWithApp:K,onChooseOpenWithApp:Y,recommendedOpenWithApps:h,recentOpenWithApps:p,onOpenWithRecentApp:fe,canRevealInFolder:X,onRevealInFolder:pe}}var X=new Map;function pe(e){return X.get(e)??{zoom:1,rotation:0,page:1,pageCount:null,searchQuery:``,scroll:[]}}function me(e,t){let n={...pe(e),...t};for(X.delete(e),X.set(e,n);X.size>100;)X.delete(X.keys().next().value)}s.subscribe((e,t)=>{(e.baseUrl!==t.baseUrl||e.conversationId!==t.conversationId)&&X.clear()});var he=120*1e3,Z=new Map;function ge(){return typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function _e(e){for(let[t,n]of Z)n.expiresAt<=e&&Z.delete(t)}function ve(e,t=Date.now()){_e(t);let n=ge();return Z.set(n,{file:e,name:e.name,type:e.type,expiresAt:t+he}),n}function ye(e,t=Date.now()){let n=Z.get(e);return n?n.expiresAt<=t?(Z.delete(e),null):{name:n.name,type:n.type}:null}function be(e,t=Date.now()){let n=Z.get(e);if(!n)return null;if(n.expiresAt<=t)return Z.delete(e),null;if(!n.file)return null;let r=n.file;return n.file=null,r}var xe=`<script>
|
|
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{a,i as o,l as s}from"./locale-store-B4o4aDCg.js";import{t as c}from"./messages-hlOsXkQ7.js";import{t as l}from"./createLucideIcon-DPHK1VkS.js";import{K as u,t as d}from"./markdown-view-BpBBv9Gr.js";import{t as f}from"./plus-Q2yW6OE7.js";import{t as p}from"./rotate-cw-LIg3Am9S.js";import{t as m}from"./search-DA7gz22f.js";import{t as h}from"./cn-0WouolD0.js";import{t as g}from"./skeleton-DzdOeGYz.js";import{r as _}from"./turn-outcome-BSbEJx8h.js";import{a as v,c as y,o as b,r as x,t as S}from"./attachment-utils-core-BPYdUI6y.js";import{n as C}from"./electron-env-DHOGevH3.js";import{t as w}from"./use-async-resource-BHFGZCY2.js";import{a as T,c as E,d as D,m as O,n as k,r as ee,u as A}from"./workspace-api-DEPruUJB.js";import{t as j}from"./index.module-Cd9ENXfk.js";var M=l(`step-forward`,[[`path`,{d:`M10.029 4.285A2 2 0 0 0 7 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`1ystz2`}],[`path`,{d:`M3 4v16`,key:`1ph11n`}]]),N=l(`step-back`,[[`path`,{d:`M13.971 4.285A2 2 0 0 1 17 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`,key:`19qhus`}],[`path`,{d:`M21 20V4`,key:`cb8qj8`}]]),P=5*1024*1024,F=32*1024*1024,I=new Set(`.astro,.bat,.c,.cc,.clj,.cljs,.cljc,.cmd,.cpp,.cs,.cts,.cxx,.dart,.edn,.erl,.ex,.exs,.fish,.fs,.fsx,.go,.gql,.graphql,.groovy,.h,.hh,.hpp,.hrl,.hxx,.java,.ts,.tsx,.mts,.js,.jsx,.mjs,.cjs,.css,.scss,.sass,.less,.json,.jsonc,.json5,.yml,.yaml,.xml,.xsd,.xsl,.py,.pyw,.rb,.php,.rs,.kt,.kts,.scala,.swift,.m,.mm,.sh,.bash,.zsh,.ps1,.sql,.lua,.r,.pl,.pm,.sol,.tf,.tfvars,.nix,.proto,.vue,.svelte,.toml,.ini,.cfg,.conf,.properties`.split(`,`)),L=new Set([`.txt`,`.log`,`.lock`,`.csv`,`.tsv`,`.env`,`.gitignore`,`.gitattributes`,`.editorconfig`,`.npmrc`,`.dockerignore`,`.eslintignore`,`.prettierignore`,`.stylelintignore`]),R=new Set([`dockerfile`,`gemfile`,`jenkinsfile`,`makefile`,`procfile`,`rakefile`]),z=new Set([`brewfile`,`changelog`,`codeowners`,`license`,`readme`]),te=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`,`.ico`,`.svg`,`.svgz`,`.tif`,`.tiff`,`.avif`,`.heic`,`.heif`,`.jxl`]),B=new Set([`.mp3`,`.wav`,`.ogg`,`.oga`,`.aac`,`.m4a`,`.flac`,`.opus`,`.weba`]),V=new Set([`.mp4`,`.webm`,`.mov`,`.m4v`,`.ogv`]),ne=new Set([`.zip`]),H=new Map([[`.pdf`,`application/pdf`],[`.docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`.pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`.xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`.xls`,`application/vnd.ms-excel`],[`.md`,`text/markdown`],[`.markdown`,`text/markdown`],[`.html`,`text/html`],[`.htm`,`text/html`],[`.json`,`application/json`],[`.txt`,`text/plain`],[`.csv`,`text/csv`],[`.tsv`,`text/tab-separated-values`],[`.png`,`image/png`],[`.jpg`,`image/jpeg`],[`.jpeg`,`image/jpeg`],[`.gif`,`image/gif`],[`.webp`,`image/webp`],[`.svg`,`image/svg+xml`],[`.svgz`,`image/svg+xml`],[`.mp3`,`audio/mpeg`],[`.wav`,`audio/wav`],[`.ogg`,`audio/ogg`],[`.mp4`,`video/mp4`],[`.webm`,`video/webm`],[`.mov`,`video/quicktime`],[`.zip`,`application/zip`]]);function U(e){let t=W(e),n=t.lastIndexOf(`.`);return n<0||n===t.length-1?``:t.slice(n).toLowerCase()}function W(e){let t=e.replace(/\\/g,`/`).split(`/`);return t[t.length-1]||e}function re(e,t){let n=t?.split(`;`)[0]?.trim().toLowerCase();return n&&n!==`application/octet-stream`?n:H.get(U(e))??n??`application/octet-stream`}function ie(e,t){let n=U(e),r=W(e).toLowerCase(),i=re(e,t);return i===`text/markdown`||n===`.md`||n===`.markdown`?`markdown`:i===`text/html`||n===`.html`||n===`.htm`?`html`:i===`application/pdf`||n===`.pdf`?`pdf`:i===`application/vnd.openxmlformats-officedocument.wordprocessingml.document`||n===`.docx`?`docx`:i===`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`||i===`application/vnd.ms-excel`||n===`.xlsx`||n===`.xls`?`spreadsheet`:i===`application/vnd.openxmlformats-officedocument.presentationml.presentation`||n===`.pptx`?`pptx`:i.startsWith(`image/`)||te.has(n)?`image`:i.startsWith(`audio/`)||B.has(n)?`audio`:i.startsWith(`video/`)||V.has(n)?`video`:i===`application/zip`||ne.has(n)?`archive`:I.has(n)||R.has(r)||r.startsWith(`dockerfile.`)?`code`:i.startsWith(`text/`)||L.has(n)||z.has(r)||r.startsWith(`.env.`)||i===`application/json`?`text`:`unsupported`}function ae(e){switch(e){case`text`:case`markdown`:case`code`:case`html`:return`text`;case`unsupported`:return`metadata`;default:return`binary`}}async function G(e){let{uri:t,conversationId:n,taskId:r}=e;try{let e=_(t),i=await a(o(e?`/api/files/${encodeURIComponent(e)}/content`:y(t,n,r)));return i.ok?{ok:!0,blob:await i.blob()}:{ok:!1,reason:`http`,status:i.status}}catch(e){return{ok:!1,reason:`network`,message:e instanceof Error?e.message:String(e)}}}async function oe(e){let t=await G(e);return t.ok?{ok:!0,buffer:await t.blob.arrayBuffer()}:t}var K=n(),q=e(t(),1);function J(e){return e.id?String(e.id):`${e.name}:${e.uri??``}`}function se(){return{id:`__empty__`,context:`attachment`,fileName:``,mimeType:`application/octet-stream`,type:`unsupported`,source:{kind:`inline`}}}function Y(e){let t=(0,K.c)(65),{open:n,attachment:r,authToken:i,conversationId:a,language:o}=e,[s,l]=(0,q.useState)(n?r:null),[u,d]=(0,q.useState)(!1),[f,p]=(0,q.useState)(!1),m;t[0]!==r||t[1]!==n?(m=n&&r?J(r):null,t[0]=r,t[1]=n,t[2]=m):m=t[2];let h=m,g=(0,q.useRef)(h);h!==g.current&&(g.current=h,l(n&&r?r:null),d(!1),p(!1));let _=s,y;bb0:{if(!_){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=se(),t[3]=e):e=t[3],y=e;break bb0}let e=_.name??`attachment`,n,r;t[4]!==e||t[5]!==_.mimeType?(n=re(e,_.mimeType),r=ie(e,n),t[4]=e,t[5]=_.mimeType,t[6]=n,t[7]=r):(n=t[6],r=t[7]);let i=r,o=_.id?String(_.id):`${e}:${_.uri??``}`,s;t[8]!==a||t[9]!==_.uri?(s=_.uri?{kind:`media-uri`,uri:_.uri,conversationId:a}:{kind:`inline`},t[8]=a,t[9]=_.uri,t[10]=s):s=t[10];let c;t[11]!==e||t[12]!==n||t[13]!==_.size||t[14]!==o||t[15]!==s||t[16]!==i?(c={id:o,context:`attachment`,fileName:e,mimeType:n,size:_.size,type:i,source:s},t[11]=e,t[12]=n,t[13]=_.size,t[14]=o,t[15]=s,t[16]=i,t[17]=c):c=t[17],y=c}let b=y,S;t[18]===_?S=t[19]:(S=_?v(_):void 0,t[18]=_,t[19]=S);let C=S,T=_?.uri,E;t[20]===b.type?E=t[21]:(E=ae(b.type),t[20]=b.type,t[21]=E);let D=E,O=!!(n&&T&&!C&&i&&(D===`binary`||D===`text`)),k;t[22]!==a||t[23]!==o||t[24]!==T||t[25]!==_?.taskId?(k=async()=>{let e=c(o).chat,t=await oe({uri:T,conversationId:a,taskId:_?.taskId});if(!t.ok)throw t.reason===`http`?Error(`${e.attachmentPreviewLoadError} (HTTP ${t.status})`):Error(t.message);return t.buffer},t[22]=a,t[23]=o,t[24]=T,t[25]=_?.taskId,t[26]=k):k=t[26];let ee=_?.taskId,A;t[27]!==i||t[28]!==a||t[29]!==C||t[30]!==o||t[31]!==T||t[32]!==n||t[33]!==D||t[34]!==ee?(A=[n,T,i,o,C,ee,a,D],t[27]=i,t[28]=a,t[29]=C,t[30]=o,t[31]=T,t[32]=n,t[33]=D,t[34]=ee,t[35]=A):A=t[35];let j;t[36]===O?j=t[37]:(j={enabled:O,initial:null,errorData:null},t[36]=O,t[37]=j);let M=w(k,A,j),N;bb1:{if(C)try{let e;t[38]===C?e=t[39]:(e=x(C),t[38]=C,t[39]=e),N=e;break bb1}catch{N=null;break bb1}if(O&&M.loading){N=null;break bb1}N=M.data??null}let P=N,F=D===`binary`?P:null,I=_?.extractedText??``,L;t[40]!==P||t[41]!==I||t[42]!==o||t[43]!==D?(L=D===`text`?I||(P?new TextDecoder(`utf-8`,{fatal:!1}).decode(new Uint8Array(P)):c(o).chat.attachmentPreviewNoText):null,t[40]=P,t[41]=I,t[42]=o,t[43]=D,t[44]=L):L=t[44];let R=L,z=!!_?.extractedText,te=b.type===`pptx`&&I.length>3e5,B;t[45]!==i||t[46]!==C||t[47]!==o||t[48]!==T||t[49]!==n||t[50]!==D?(B=n&&T&&!C&&!i&&D===`binary`?c(o).chat.attachmentPreviewMissingAuth:null,t[45]=i,t[46]=C,t[47]=o,t[48]=T,t[49]=n,t[50]=D,t[51]=B):B=t[51];let V=B,ne=M.error?M.error instanceof Error?M.error.message:String(M.error):null,H=f?null:V??ne,U=O?M.loading:!1,W;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>p(!0),t[52]=W):W=t[52];let G=I||null,Y;return t[53]!==F||t[54]!==b||t[55]!==P||t[56]!==te||t[57]!==z||t[58]!==H||t[59]!==_||t[60]!==u||t[61]!==U||t[62]!==G||t[63]!==R?(Y={preview:_,descriptor:b,fileType:b.type,fileName:b.fileName,loading:U,loadError:H,clearLoadError:W,textContent:R,binaryBuffer:F,downloadBuffer:P,hasExtractedText:z,extractedText:G,extractedTextTruncated:te,showExtractedText:u,setShowExtractedText:d},t[53]=F,t[54]=b,t[55]=P,t[56]=te,t[57]=z,t[58]=H,t[59]=_,t[60]=u,t[61]=U,t[62]=G,t[63]=R,t[64]=Y):Y=t[64],Y}function ce(e){let t=(0,K.c)(12),{projectId:n,conversationId:r,agentId:i}=e,a;bb0:{let e;t[0]===n?e=t[1]:(e=n?.trim(),t[0]=n,t[1]=e);let o=e;if(o){let e;t[2]===o?e=t[3]:(e={projectId:o},t[2]=o,t[3]=e),a=e;break bb0}let s;t[4]===r?s=t[5]:(s=r?.trim(),t[4]=r,t[5]=s);let c=s;if(c){let e;t[6]===c?e=t[7]:(e={conversationId:c},t[6]=c,t[7]=e),a=e;break bb0}let l;t[8]===i?l=t[9]:(l=i?.trim(),t[8]=i,t[9]=l);let u=l,d;t[10]===u?d=t[11]:(d=u?{agentId:u}:void 0,t[10]=u,t[11]=d),a=d}return a}function le(e){return{descriptor:e,textContent:null,binaryBuffer:null,fileResourceId:null,mtimeMs:null,loadError:null,loading:!1,pptxText:null,pptxTruncated:!1,pptxError:null}}function ue(e,t){switch(t.type){case`clear`:return le(t.descriptor);case`loadStart`:return{...le(t.descriptor),loading:!0};case`loadSuccess`:return{...e,descriptor:t.payload.descriptor,textContent:t.payload.textContent??null,binaryBuffer:t.payload.binaryBuffer??null,fileResourceId:t.payload.fileResourceId??null,mtimeMs:t.payload.mtimeMs??null,loadError:null,loading:!1};case`loadError`:return{...le(t.descriptor),loadError:t.error};case`patchMtime`:return{...e,mtimeMs:t.mtimeMs};case`patchText`:return{...e,textContent:t.text};case`pptxClear`:return{...e,pptxText:null,pptxTruncated:!1,pptxError:null};case`pptxSuccess`:return{...e,pptxText:t.text,pptxTruncated:t.truncated,pptxError:null};case`pptxError`:return{...e,pptxText:null,pptxTruncated:!1,pptxError:t.error}}}function de(e,t){switch(t.type){case`reset`:return{sourceEditMode:!1,saveStatus:`idle`};case`source`:return{...e,sourceEditMode:typeof t.value==`function`?t.value(e.sourceEditMode):t.value};case`saveStatus`:return{...e,saveStatus:t.value}}}function fe({filePath:e,projectId:t,conversationId:n,agentId:r,resolvedFile:a,initialEditMode:o=!1}){let s=ce({projectId:t,conversationId:n,agentId:r}),c=(0,q.useMemo)(()=>{let t=e?W(e):``,i=re(t,b(t)),a=e?ie(t,i):`unsupported`;return{id:e||`__empty__`,context:`workspace`,fileName:t,mimeType:i,type:a,source:{kind:`workspace`,path:e||``,conversationId:n,agentId:r}}},[r,e,n]),[l,u]=(0,q.useReducer)(ue,c,le),[d,f]=(0,q.useReducer)(de,{sourceEditMode:o,saveStatus:`idle`}),[p,m]=(0,q.useState)([]),[h,g]=(0,q.useState)([]),_=(0,q.useRef)(e),v=(0,q.useRef)(void 0),y=(0,q.useRef)(null),x=(0,q.useRef)(null),w=(0,q.useRef)(null),[M,N]=(0,q.useState)(!1),[P,F]=(0,q.useState)(!1),[I,L]=(0,q.useState)(0);_.current!==e&&(_.current=e,f({type:`reset`})),(0,q.useEffect)(()=>{if(!e){u({type:`clear`,descriptor:c});return}let t=!1;u({type:`loadStart`,descriptor:c});let n=ae(c.type),r=e=>{t||u({type:`loadError`,descriptor:c,error:e instanceof Error?e.message:String(e)})};return n===`metadata`?(Promise.all([D(e,s).catch(()=>null),A(e,s).catch(()=>null)]).then(async([n,r])=>{if(!n){t||u({type:`loadSuccess`,payload:{descriptor:c,fileResourceId:r?.fileId??null,mtimeMs:typeof r?.mtimeMs==`number`?r.mtimeMs:null}});return}let i={...c,mimeType:n.mimeType,type:ie(n.name,n.mimeType)};if(ae(i.type)===`text`){let{content:r,mtimeMs:a,revision:o}=await E(e,s);t||(v.current=o,y.current=r,x.current=r,N(!1),F(!1)),t||u({type:`loadSuccess`,payload:{descriptor:i,textContent:r,fileResourceId:n.id,mtimeMs:typeof a==`number`?a:n.modifiedAt}});return}t||u({type:`loadSuccess`,payload:{descriptor:i,fileResourceId:n.id,mtimeMs:n.modifiedAt}})}).catch(r),()=>{t=!0}):(n===`text`?E(e,s,I===0?a:void 0).then(({content:e,mtimeMs:n,revision:r,fileId:i})=>{t||(v.current=r,y.current=e,x.current=e,N(!1),F(!1)),t||u({type:`loadSuccess`,payload:{descriptor:c,textContent:e,fileResourceId:i??null,mtimeMs:typeof n==`number`?n:null}})}).catch(r):Promise.all([T(e,s),A(e,s).catch(()=>null)]).then(async([e,n])=>{let r=await e.arrayBuffer();t||u({type:`loadSuccess`,payload:{descriptor:c,binaryBuffer:r,fileResourceId:n?.fileId??null,mtimeMs:typeof n?.mtimeMs==`number`?n.mtimeMs:null}})}).catch(r),()=>{t=!0})},[c,e,s,I,a]),(0,q.useEffect)(()=>{if(!l.binaryBuffer||l.descriptor.type!==`pptx`){u({type:`pptxClear`});return}let e=!1;return u({type:`pptxClear`}),i(()=>import(`./attachment-process-heavy-DGZZ-M85.js`).then(e=>e.processPptx(l.binaryBuffer,l.descriptor.fileName)),__vite__mapDeps([0,1,2,3])).then(({extractedText:t})=>{if(e)return;let n=t.length>S;u({type:`pptxSuccess`,text:n?t.slice(0,S):t,truncated:n})}).catch(t=>{e||u({type:`pptxError`,error:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},[l.binaryBuffer,l.descriptor.fileName,l.descriptor.type]);let R=(0,q.useCallback)(async()=>{if(w.current&&!await w.current)return!1;if(!e||y.current===null||y.current===x.current)return!0;let t=(async()=>{f({type:`saveStatus`,value:`saving`});try{for(;y.current!==x.current;){let t=y.current,n=await O(e,t,s,v.current);v.current=n.revision,x.current=t,typeof n.mtimeMs==`number`&&u({type:`patchMtime`,mtimeMs:n.mtimeMs})}return N(!1),f({type:`saveStatus`,value:`saved`}),!0}catch{return f({type:`saveStatus`,value:`error`}),!1}})();w.current=t;try{return await t}finally{w.current===t&&(w.current=null)}},[e,s]),z=j(()=>void R(),500),te=(0,q.useCallback)(e=>{y.current=e,N(e!==x.current),u({type:`patchText`,text:e}),z()},[z]);(0,q.useEffect)(()=>{let e=e=>{y.current!==x.current&&(e.preventDefault(),e.returnValue=``)};return window.addEventListener(`beforeunload`,e),()=>{window.removeEventListener(`beforeunload`,e),z.cancel()}},[z]);let B=(0,q.useCallback)(()=>{!M&&!w.current&&L(e=>e+1)},[M]),V=(0,q.useRef)(!1),ne=(0,q.useCallback)(async()=>{if(!(!e||l.loading||w.current||V.current)){V.current=!0;try{let t=await D(e,s);if(!t||!(v.current?t.revision!==v.current:l.mtimeMs!=null&&t.modifiedAt!==l.mtimeMs))return;M||d.sourceEditMode?F(!0):B()}catch{F(!0)}finally{V.current=!1}}},[M,d.sourceEditMode,e,l.loading,l.mtimeMs,s,B]),H=(0,q.useCallback)(async()=>{if(!e)return;let t=W(e);if(l.binaryBuffer){k(t,l.binaryBuffer,l.descriptor.mimeType||`application/octet-stream`);return}if(l.textContent!=null){ee(t,l.textContent);return}let n=await T(e,s);k(t,await n.arrayBuffer(),l.descriptor.mimeType||n.type||`application/octet-stream`)},[e,l.binaryBuffer,l.descriptor.mimeType,l.textContent,s]),U=(0,q.useCallback)(async()=>{if(!e)throw Error(`No workspace file selected`);let t=W(e),n=l.descriptor.mimeType||`application/octet-stream`,r;return r=l.binaryBuffer?new Blob([l.binaryBuffer],{type:n}):l.textContent==null?await T(e,s):new Blob([l.textContent],{type:n}),new File([r],t,{type:l.descriptor.mimeType||r.type||`application/octet-stream`,lastModified:l.mtimeMs??Date.now()})},[e,l.binaryBuffer,l.descriptor.mimeType,l.mtimeMs,l.textContent,s]),G=!l.loading&&!!e,oe=C()&&(!!l.fileResourceId&&!!window.electronAPI?.shell?.openFileResource||l.descriptor.type===`spreadsheet`&&!!l.binaryBuffer&&!!window.electronAPI?.shell?.openTemporaryFile),K=C()&&!!l.fileResourceId&&!!window.electronAPI?.shell?.chooseAppAndOpenFileResource,J=(0,q.useCallback)(async()=>{let e=l.fileResourceId;if(!C()||!e||!window.electronAPI?.shell?.getOpenWithAppsForFileResource){g([]),m([]);return}try{let t=await window.electronAPI.shell.getOpenWithAppsForFileResource(e);g(t.recommended.map(e=>({name:e.name,path:e.path,iconDataUrl:e.iconDataUrl}))),m(t.recent.map(e=>({name:e.name,path:e.path,iconDataUrl:e.iconDataUrl,lastUsedAt:e.lastUsedAt})))}catch{g([]),m([])}},[l.fileResourceId]);(0,q.useEffect)(()=>{J()},[J]);let se=(0,q.useCallback)(async()=>{let e=l.fileResourceId;if(e&&window.electronAPI?.shell?.openFileResource)return window.electronAPI.shell.openFileResource(e);if(l.descriptor.type===`spreadsheet`&&l.binaryBuffer&&window.electronAPI?.shell?.openTemporaryFile)return window.electronAPI.shell.openTemporaryFile({fileName:l.descriptor.fileName,data:new Uint8Array(l.binaryBuffer)})},[l.binaryBuffer,l.descriptor.fileName,l.descriptor.type,l.fileResourceId]),Y=(0,q.useCallback)(async()=>{let e=l.fileResourceId;if(!e||!window.electronAPI?.shell?.chooseAppAndOpenFileResource)return;let t=await window.electronAPI.shell.chooseAppAndOpenFileResource(e);return t.ok&&J(),t},[l.fileResourceId,J]),fe=(0,q.useCallback)(async e=>{let t=l.fileResourceId;if(!t||!e||!window.electronAPI?.shell?.openFileResourceWithApp)return;let n=await window.electronAPI.shell.openFileResourceWithApp(t,e);return n.ok&&J(),n},[l.fileResourceId,J]),X=C()&&!!l.fileResourceId&&!!window.electronAPI?.shell?.showFileResourceInFolder,Z=(0,q.useCallback)(async()=>{let e=l.fileResourceId;if(e&&window.electronAPI?.shell?.showFileResourceInFolder)return window.electronAPI.shell.showFileResourceInFolder(e)},[l.fileResourceId]);return{...l,dirty:M,externalChange:P,flushSource:R,refresh:B,checkForUpdates:ne,extractedText:l.descriptor.type===`pptx`?l.pptxText:null,extractedTextTruncated:l.pptxTruncated,sourceEditMode:d.sourceEditMode,setSourceEditMode:e=>f({type:`source`,value:e}),saveStatus:d.saveStatus,onSourceChange:te,onDownload:H,createAttachmentFile:U,canDownload:G,canOpenWithSystemApp:oe,onOpenWithSystemApp:se,canChooseOpenWithApp:K,onChooseOpenWithApp:Y,recommendedOpenWithApps:h,recentOpenWithApps:p,onOpenWithRecentApp:fe,canRevealInFolder:X,onRevealInFolder:Z}}var X=new Map;function Z(e){return X.get(e)??{zoom:1,rotation:0,page:1,pageCount:null,searchQuery:``,scroll:[]}}function pe(e,t){let n={...Z(e),...t};for(X.delete(e),X.set(e,n);X.size>100;)X.delete(X.keys().next().value)}s.subscribe((e,t)=>{(e.baseUrl!==t.baseUrl||e.conversationId!==t.conversationId)&&X.clear()});var me=`<script>
|
|
3
3
|
window.addEventListener('click', (event) => {
|
|
4
4
|
if (event.defaultPrevented || event.button !== 0 ||
|
|
5
5
|
event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
@@ -12,4 +12,4 @@ window.addEventListener('click', (event) => {
|
|
|
12
12
|
event.preventDefault();
|
|
13
13
|
window.location.assign('about:srcdoc' + href);
|
|
14
14
|
});
|
|
15
|
-
<\/script>`;function Se(e){let t=/<head(?:\s[^>]*)?>/i.exec(e);if(t?.index!==void 0){let n=t.index+t[0].length;return`${e.slice(0,n)}${xe}${e.slice(n)}`}let n=/<html(?:\s[^>]*)?>/i.exec(e);if(n?.index!==void 0){let t=n.index+n[0].length;return`${e.slice(0,t)}<head>${xe}</head>${e.slice(t)}`}let r=/^\s*<!doctype[^>]*>/i.exec(e);return r?`${r[0]}<head>${xe}</head>${e.slice(r[0].length)}`:`<head>${xe}</head>${e}`}var Q=r();function Ce(e){let t=(0,K.c)(22),{html:n,title:r}=e,i=(0,q.useRef)(null),[a,s]=(0,q.useState)(!1),c;t[0]===n?c=t[1]:(c=Se(n),t[0]=n,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=()=>{i.current?.contentWindow?.postMessage({type:`xopc-html-preview`,html:l},`*`)},t[2]=l,t[3]=u);let d=u,f,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=e=>{e.source===i.current?.contentWindow&&e.data?.type===`xopc-html-preview-ready`&&s(!0)};window.addEventListener(`message`,e);let t=window.setTimeout(()=>s(!0),1800);return()=>{window.removeEventListener(`message`,e),window.clearTimeout(t)}},p=[],t[4]=f,t[5]=p):(f=t[4],p=t[5]),(0,q.useEffect)(f,p);let m;t[6]===d?m=t[7]:(m=[d],t[6]=d,t[7]=m),(0,q.useEffect)(d,m);let _=!a,v;t[8]===a?v=t[9]:(v=a?null:(0,Q.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 space-y-4 rounded-lg bg-surface-panel p-4`,children:[(0,Q.jsx)(g,{className:`h-5 w-1/3`}),(0,Q.jsx)(g,{className:`h-32 w-full rounded-xl`}),(0,Q.jsx)(g,{className:`h-4 w-2/3`})]}),t[8]=a,t[9]=v);let y=a?`opacity-100`:`pointer-events-none opacity-0`,b;t[10]===y?b=t[11]:(b=h(`min-h-0 w-full flex-1 rounded-lg border border-edge-subtle bg-white motion-safe:transition-opacity motion-safe:duration-150 dark:border-edge dark:bg-[#1e1e1e]`,y),t[10]=y,t[11]=b);let x=a?void 0:-1,S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=o(`/api/preview/html`),t[12]=S):S=t[12];let C;t[13]!==d||t[14]!==x||t[15]!==b||t[16]!==r?(C=(0,Q.jsx)(`iframe`,{ref:i,title:r,className:b,tabIndex:x,src:S,sandbox:`allow-scripts allow-popups allow-popups-to-escape-sandbox allow-downloads allow-forms allow-modals`,referrerPolicy:`no-referrer`,onLoad:d}),t[13]=d,t[14]=x,t[15]=b,t[16]=r,t[17]=C):C=t[17];let w;return t[18]!==C||t[19]!==_||t[20]!==v?(w=(0,Q.jsxs)(`div`,{className:`relative flex min-h-0 w-full flex-1 flex-col`,"aria-busy":_,children:[v,C]}),t[18]=C,t[19]=_,t[20]=v,t[21]=w):w=t[21],w}var we=(0,q.lazy)(()=>i(()=>import(`./source-workspace-editor-BwYU5OEh.js`).then(e=>({default:e.SourceWorkspaceEditor})),__vite__mapDeps([4,1,5,6,7,2])));function Te(){let e=(0,K.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col px-4 py-3`,"aria-busy":!0,children:[(0,Q.jsx)(`div`,{className:`h-4 w-11/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-9/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-10/12 animate-pulse rounded bg-surface-hover`})]}),e[0]=t):t=e[0],t}function Ee(e){let t=e.lastIndexOf(`.`);return t>0?e.slice(t).toLowerCase():``}function De(e){return{".ts":`typescript`,".tsx":`tsx`,".js":`javascript`,".jsx":`jsx`,".json":`json`,".css":`css`,".yml":`yaml`,".yaml":`yaml`,".py":`python`,".go":`go`,".rs":`rust`,".sh":`bash`}[Ee(e)]??`plaintext`}function Oe(e){let t=(0,K.c)(12),{text:n,targetLine:r}=e,i=(0,q.useRef)(null),a;if(t[0]!==n){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\r\n|\n|\r/,t[2]=e):e=t[2],a=n.split(e),t[0]=n,t[1]=a}else a=t[1];let o=a,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{i.current?.scrollIntoView({block:`center`})},t[3]=s):s=t[3];let c;t[4]!==r||t[5]!==n?(c=[r,n],t[4]=r,t[5]=n,t[6]=c):c=t[6],(0,q.useEffect)(s,c);let l;t[7]!==o||t[8]!==r?(l=o.map((e,t)=>{let n=t+1,a=n===r;return(0,Q.jsxs)(`div`,{ref:a?i:void 0,className:a?`flex bg-accent-soft/60 text-fg`:`flex`,"data-line":n,children:[(0,Q.jsx)(`span`,{className:`w-12 shrink-0 select-none pr-3 text-right text-fg-subtle`,children:n}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words`,children:e||` `})]},n)}),t[7]=o,t[8]=r,t[9]=l):l=t[9];let u;return t[10]===l?u=t[11]:(u=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto px-4 py-3`,children:(0,Q.jsx)(`div`,{className:`min-w-max font-mono text-xs leading-relaxed text-fg`,children:l})}),t[10]=l,t[11]=u),u}function ke(e){let t=(0,K.c)(6),{text:n,targetLine:r}=e,i=(0,q.useRef)(null),a,o;t[0]!==r||t[1]!==n?(a=()=>{if(!r||!i.current)return;let e=n.split(/\r?\n/,r);if(!/^#{1,6}\s/.test(e.at(-1)??``))return;let t=e.filter(Ae).length-1;i.current.querySelectorAll(`h1,h2,h3,h4,h5,h6`)[t]?.scrollIntoView({block:`nearest`})},o=[r,n],t[0]=r,t[1]=n,t[2]=a,t[3]=o):(a=t[2],o=t[3]),(0,q.useEffect)(a,o);let s;return t[4]===n?s=t[5]:(s=(0,Q.jsx)(`div`,{ref:i,className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:(0,Q.jsx)(d,{content:n})}),t[4]=n,t[5]=s),s}function Ae(e){return/^#{1,6}\s/.test(e)}function je(e,t){let n=e.textContent??``,r=e.descriptor.context===`workspace`,i=e.workspaceEditing;return r&&i?.sourceEditMode?(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,Q.jsx)(q.Suspense,{fallback:(0,Q.jsx)(Te,{}),children:(0,Q.jsx)(we,{fileName:e.descriptor.fileName,initialContent:n,onChange:e=>i.onSourceChange?.(e),isDark:(i.isDark??e.resolvedTheme===`dark`)===!0,lineWrap:i.sourceWordWrap===!0},e.descriptor.id)})}):t===`markdown`?(0,Q.jsx)(ke,{text:n,targetLine:e.targetLine}):t===`html`?(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden px-2 pb-2 pt-1 sm:px-4`,children:(0,Q.jsx)(Ce,{html:n,title:e.descriptor.fileName})}):e.targetLine&&e.targetLine>0?(0,Q.jsx)(Oe,{text:n,targetLine:e.targetLine}):t===`code`?(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:(0,Q.jsx)(d,{content:`\`\`\`${De(e.descriptor.fileName)}\n${n}\n\`\`\``})}):(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:(0,Q.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs text-fg`,children:n})})}function Me(e){return je(e,`text`)}function Ne(e){return je(e,`markdown`)}function Pe(e){return je(e,`code`)}function Fe(e){return je(e,`html`)}function Ie(){return(0,q.createElement)(`div`,{className:`px-4 py-6 text-sm text-fg-muted`},`Loading preview...`)}function $(e,t,n,r=`binary`){let i=(0,q.lazy)(n);return{id:e,readMode:r,capabilities:t,render:e=>(0,q.createElement)(q.Suspense,{fallback:Ie()},(0,q.createElement)(i,e))}}var Le={text:{id:`text`,readMode:`text`,capabilities:[`download`,`edit`],render:e=>(0,q.createElement)(Me,e)},markdown:{id:`markdown`,readMode:`text`,capabilities:[`download`,`edit`],render:e=>(0,q.createElement)(Ne,e)},code:{id:`code`,readMode:`text`,capabilities:[`download`,`edit`],render:e=>(0,q.createElement)(Pe,e)},html:{id:`html`,readMode:`text`,capabilities:[`download`,`edit`],render:e=>(0,q.createElement)(Fe,e)},image:$(`image`,[`download`,`zoom`,`rotate`],()=>i(()=>import(`./binary-plugins-5GVlyrXg.js`).then(e=>({default:e.InteractiveImagePreview})),__vite__mapDeps([8,1,5,2,9,10,11,12,13,14,15,16,17,18,19]))),pdf:$(`pdf`,[`download`,`zoom`,`rotate`,`pageNavigation`,`print`],()=>i(()=>import(`./binary-plugins-5GVlyrXg.js`).then(e=>({default:e.PdfPreviewPluginView})),__vite__mapDeps([8,1,5,2,9,10,11,12,13,14,15,16,17,18,19]))),docx:$(`docx`,[`download`],()=>i(()=>import(`./binary-plugins-5GVlyrXg.js`).then(e=>({default:e.DocxPreviewPluginView})),__vite__mapDeps([8,1,5,2,9,10,11,12,13,14,15,16,17,18,19]))),spreadsheet:$(`spreadsheet`,[`download`],()=>i(()=>import(`./binary-plugins-5GVlyrXg.js`).then(e=>({default:e.SpreadsheetPreviewPluginView})),__vite__mapDeps([8,1,5,2,9,10,11,12,13,14,15,16,17,18,19]))),pptx:$(`pptx`,[`download`],()=>i(()=>import(`./binary-plugins-5GVlyrXg.js`).then(e=>({default:e.PptxPreviewPluginView})),__vite__mapDeps([8,1,5,2,9,10,11,12,13,14,15,16,17,18,19]))),audio:$(`audio`,[`download`],()=>i(()=>import(`./media-plugins-B5XMcW5S.js`).then(e=>({default:e.AudioPreviewPluginView})),__vite__mapDeps([20,1,5,9,10,11,12,13,14,15,16,17,18,19]))),video:$(`video`,[`download`],()=>i(()=>import(`./media-plugins-B5XMcW5S.js`).then(e=>({default:e.VideoPreviewPluginView})),__vite__mapDeps([20,1,5,9,10,11,12,13,14,15,16,17,18,19]))),archive:$(`archive`,[`download`],()=>i(()=>import(`./archive-plugin-Co_oRPj1.js`).then(e=>({default:e.ArchivePreviewPluginView})),__vite__mapDeps([21,1,5,9,22,11,12,13,14,15,16,17,18]))),unsupported:$(`unsupported`,[`download`],()=>i(()=>import(`./media-plugins-B5XMcW5S.js`).then(e=>({default:e.UnsupportedPreviewPluginView})),__vite__mapDeps([20,1,5,9,10,11,12,13,14,15,16,17,18,19])),`metadata`)};function Re(e){return Le[e]??Le.unsupported}function ze(e){let t=(0,K.c)(63),{plugin:n,controls:r,onZoomIn:i,onZoomOut:a,onZoomReset:o,onRotate:s,onSearchChange:c}=e,l;t[0]===n.capabilities?l=t[1]:(l=n.capabilities.includes(`zoom`),t[0]=n.capabilities,t[1]=l);let d=l,h;t[2]===n.capabilities?h=t[3]:(h=n.capabilities.includes(`search`),t[2]=n.capabilities,t[3]=h);let g=h,_;t[4]===n.capabilities?_=t[5]:(_=n.capabilities.includes(`rotate`),t[4]=n.capabilities,t[5]=_);let v=_,y;t[6]!==r||t[7]!==n.capabilities?(y=n.capabilities.includes(`pageNavigation`)&&r.pageCount!=null&&r.pageCount>1,t[6]=r,t[7]=n.capabilities,t[8]=y):y=t[8];let b=y;if(!(d||g||v||b))return null;let x;if(t[9]!==b||t[10]!==v||t[11]!==g||t[12]!==d||t[13]!==r||t[14]!==s||t[15]!==c||t[16]!==i||t[17]!==a||t[18]!==o){let e=[];if(b){let n=r.page<=1,i;t[20]===r?i=t[21]:(i=()=>r.setPage(Math.max(1,r.page-1)),t[20]=r,t[21]=i);let a;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(N,{className:`size-3.5`}),t[22]=a):a=t[22];let o;t[23]!==n||t[24]!==i?(o=(0,Q.jsx)(Be,{label:`Previous page`,disabled:n,onClick:i,children:a}),t[23]=n,t[24]=i,t[25]=o):o=t[25];let s;t[26]!==r.page||t[27]!==r.pageCount?(s=(0,Q.jsxs)(`span`,{className:`min-w-16 px-1 text-center text-xs text-fg-muted`,children:[r.page,` / `,r.pageCount]}),t[26]=r.page,t[27]=r.pageCount,t[28]=s):s=t[28];let c=r.page>=(r.pageCount??1),l;t[29]===r?l=t[30]:(l=()=>r.setPage(Math.min(r.pageCount??r.page,r.page+1)),t[29]=r,t[30]=l);let u;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(M,{className:`size-3.5`}),t[31]=u):u=t[31];let d;t[32]!==c||t[33]!==l?(d=(0,Q.jsx)(Be,{label:`Next page`,disabled:c,onClick:l,children:u}),t[32]=c,t[33]=l,t[34]=d):d=t[34];let f;t[35]!==s||t[36]!==d||t[37]!==o?(f=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-edge-subtle bg-surface-base p-0.5 dark:border-edge`,children:[o,s,d]},`page`),t[35]=s,t[36]=d,t[37]=o,t[38]=f):f=t[38],e.push(f)}if(d){let n;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(u,{className:`size-3.5`}),t[39]=n):n=t[39];let s;t[40]===a?s=t[41]:(s=(0,Q.jsx)(Be,{label:`Zoom out`,onClick:a,children:n}),t[40]=a,t[41]=s);let c;t[42]===r.zoom?c=t[43]:(c=Math.round(r.zoom*100),t[42]=r.zoom,t[43]=c);let l;t[44]!==o||t[45]!==c?(l=(0,Q.jsxs)(`button`,{type:`button`,className:`min-w-14 rounded px-1.5 py-1 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:o,title:`Reset zoom`,children:[c,`%`]}),t[44]=o,t[45]=c,t[46]=l):l=t[46];let d;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(f,{className:`size-3.5`}),t[47]=d):d=t[47];let p;t[48]===i?p=t[49]:(p=(0,Q.jsx)(Be,{label:`Zoom in`,onClick:i,children:d}),t[48]=i,t[49]=p);let m;t[50]!==p||t[51]!==s||t[52]!==l?(m=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-edge-subtle bg-surface-base p-0.5 dark:border-edge`,children:[s,l,p]},`zoom`),t[50]=p,t[51]=s,t[52]=l,t[53]=m):m=t[53],e.push(m)}if(v){let n;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(p,{className:`size-3.5`}),t[54]=n):n=t[54];let r;t[55]===s?r=t[56]:(r=(0,Q.jsx)(Be,{label:`Rotate`,onClick:s,children:n},`rotate`),t[55]=s,t[56]=r),e.push(r)}if(g){let n;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(m,{className:`size-3.5`,"aria-hidden":!0}),t[57]=n):n=t[57];let i;t[58]===c?i=t[59]:(i=e=>c(e.target.value),t[58]=c,t[59]=i);let a;t[60]!==r.searchQuery||t[61]!==i?(a=(0,Q.jsxs)(`label`,{className:`flex min-w-40 items-center gap-1 rounded-md border border-edge-subtle bg-surface-base px-2 py-1 text-xs text-fg-muted dark:border-edge`,children:[n,(0,Q.jsx)(`input`,{className:`min-w-0 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-subtle`,value:r.searchQuery,onChange:i,placeholder:`Search`})]},`search`),t[60]=r.searchQuery,t[61]=i,t[62]=a):a=t[62],e.push(a)}x=(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:e}),t[9]=b,t[10]=v,t[11]=g,t[12]=d,t[13]=r,t[14]=s,t[15]=c,t[16]=i,t[17]=a,t[18]=o,t[19]=x}else x=t[19];return x}function Be(e){let t=(0,K.c)(6),{label:n,disabled:r,onClick:i,children:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=h(`inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:opacity-40`),t[0]=o):o=t[0];let s;return t[1]!==a||t[2]!==r||t[3]!==n||t[4]!==i?(s=(0,Q.jsx)(`button`,{type:`button`,className:o,title:n,"aria-label":n,disabled:r,onClick:i,children:a}),t[1]=a,t[2]=r,t[3]=n,t[4]=i,t[5]=s):s=t[5],s}function Ve(e){let t=Re(e.type),n=pe(e.id),[r,i]=(0,q.useState)(n.zoom),[a,o]=(0,q.useState)(n.rotation),[s,c]=(0,q.useState)(n.page),[l,u]=(0,q.useState)(n.pageCount),[d,f]=(0,q.useState)(n.searchQuery),p=(0,q.useCallback)(e=>{c(Math.max(1,Math.min(l??e,Math.floor(e))))},[l]);(0,q.useEffect)(()=>{let t=pe(e.id);i(t.zoom),o(t.rotation),c(t.page),u(t.pageCount),f(t.searchQuery)},[e.id,e.type]);let m=(0,q.useRef)({zoom:r,rotation:a,page:s,pageCount:l,searchQuery:d});return m.current={zoom:r,rotation:a,page:s,pageCount:l,searchQuery:d},(0,q.useEffect)(()=>()=>me(e.id,m.current),[e.id]),{plugin:t,controls:(0,q.useMemo)(()=>({zoom:r,rotation:a,page:s,pageCount:l,searchQuery:d,setPageCount:u,setPage:p}),[s,l,a,d,p,r]),onZoomIn:()=>i(e=>Math.min(4,Number((e+.15).toFixed(2)))),onZoomOut:()=>i(e=>Math.max(.25,Number((e-.15).toFixed(2)))),onZoomReset:()=>{i(1),o(0)},onRotate:()=>o(e=>(e+90)%360),onSearchChange:f}}function He(e){let t=(0,K.c)(8),{controller:n}=e,r;return t[0]!==n.controls||t[1]!==n.onRotate||t[2]!==n.onSearchChange||t[3]!==n.onZoomIn||t[4]!==n.onZoomOut||t[5]!==n.onZoomReset||t[6]!==n.plugin?(r=(0,Q.jsx)(ze,{plugin:n.plugin,controls:n.controls,onZoomIn:n.onZoomIn,onZoomOut:n.onZoomOut,onZoomReset:n.onZoomReset,onRotate:n.onRotate,onSearchChange:n.onSearchChange}),t[0]=n.controls,t[1]=n.onRotate,t[2]=n.onSearchChange,t[3]=n.onZoomIn,t[4]=n.onZoomOut,t[5]=n.onZoomReset,t[6]=n.plugin,t[7]=r):r=t[7],r}function Ue(e){let t=(0,K.c)(14),n;t[0]===e.language?n=t[1]:(n=c(e.language),t[0]=e.language,t[1]=n);let r=n,{controller:i}=e;if(e.loading){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 px-4 py-6`,"aria-busy":`true`,children:[(0,Q.jsx)(g,{className:`h-5 w-48 max-w-full`}),(0,Q.jsx)(g,{className:`h-4 w-full`}),(0,Q.jsx)(g,{className:`h-4 w-11/12`}),(0,Q.jsx)(g,{className:`h-4 w-3/4`}),(0,Q.jsx)(g,{className:`mt-3 min-h-48 flex-1 rounded-lg`})]}),t[2]=e):e=t[2],e}if(e.loadError){let n=(e.descriptor.context===`workspace`?r.workspace.loadError:r.chat.attachmentPreviewLoadError)+`: `+e.loadError,i;return t[3]===n?i=t[4]:(i=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:(0,Q.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:n})}),t[3]=n,t[4]=i),i}if(e.descriptor.context===`attachment`&&e.showExtractedText&&e.descriptor.type!==`image`){let n=e.extractedText||r.chat.attachmentPreviewNoText,i;return t[5]===n?i=t[6]:(i=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden`,children:(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto rounded-lg border border-edge-subtle bg-surface-hover/40 p-4 dark:border-edge`,children:(0,Q.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-fg-muted`,children:n})})}),t[5]=n,t[6]=i),i}let a=`${e.descriptor.id}:${i.plugin.id}`,o;t[7]!==i.controls||t[8]!==e?(o={...e,controls:i.controls},t[7]=i.controls,t[8]=e,t[9]=o):o=t[9];let s;return t[10]!==i.plugin.render||t[11]!==a||t[12]!==o?(s=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,Q.jsx)(We,{pluginRender:i.plugin.render,props:o},a)}),t[10]=i.plugin.render,t[11]=a,t[12]=o,t[13]=s):s=t[13],s}function We(e){let t=(0,K.c)(5),{pluginRender:n,props:r}=e,i;t[0]!==n||t[1]!==r?(i=n(r),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;return t[3]===i?a=t[4]:(a=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:i}),t[3]=i,t[4]=a),a}export{ae as _,ye as a,me as c,G as d,F as f,re as g,W as h,ve as i,fe as l,ie as m,Ue as n,be as o,P as p,Ve as r,pe as s,He as t,Y as u,N as v,M as y};
|
|
15
|
+
<\/script>`;function he(e){let t=/<head(?:\s[^>]*)?>/i.exec(e);if(t?.index!==void 0){let n=t.index+t[0].length;return`${e.slice(0,n)}${me}${e.slice(n)}`}let n=/<html(?:\s[^>]*)?>/i.exec(e);if(n?.index!==void 0){let t=n.index+n[0].length;return`${e.slice(0,t)}<head>${me}</head>${e.slice(t)}`}let r=/^\s*<!doctype[^>]*>/i.exec(e);return r?`${r[0]}<head>${me}</head>${e.slice(r[0].length)}`:`<head>${me}</head>${e}`}var Q=r();function ge(e){let t=(0,K.c)(22),{html:n,title:r}=e,i=(0,q.useRef)(null),[a,s]=(0,q.useState)(!1),c;t[0]===n?c=t[1]:(c=he(n),t[0]=n,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=()=>{i.current?.contentWindow?.postMessage({type:`xopc-html-preview`,html:l},`*`)},t[2]=l,t[3]=u);let d=u,f,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=e=>{e.source===i.current?.contentWindow&&e.data?.type===`xopc-html-preview-ready`&&s(!0)};window.addEventListener(`message`,e);let t=window.setTimeout(()=>s(!0),1800);return()=>{window.removeEventListener(`message`,e),window.clearTimeout(t)}},p=[],t[4]=f,t[5]=p):(f=t[4],p=t[5]),(0,q.useEffect)(f,p);let m;t[6]===d?m=t[7]:(m=[d],t[6]=d,t[7]=m),(0,q.useEffect)(d,m);let _=!a,v;t[8]===a?v=t[9]:(v=a?null:(0,Q.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 space-y-4 rounded-lg bg-surface-panel p-4`,children:[(0,Q.jsx)(g,{className:`h-5 w-1/3`}),(0,Q.jsx)(g,{className:`h-32 w-full rounded-xl`}),(0,Q.jsx)(g,{className:`h-4 w-2/3`})]}),t[8]=a,t[9]=v);let y=a?`opacity-100`:`pointer-events-none opacity-0`,b;t[10]===y?b=t[11]:(b=h(`min-h-0 w-full flex-1 rounded-lg border border-edge-subtle bg-white motion-safe:transition-opacity motion-safe:duration-150 dark:border-edge dark:bg-[#1e1e1e]`,y),t[10]=y,t[11]=b);let x=a?void 0:-1,S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=o(`/api/preview/html`),t[12]=S):S=t[12];let C;t[13]!==d||t[14]!==x||t[15]!==b||t[16]!==r?(C=(0,Q.jsx)(`iframe`,{ref:i,title:r,className:b,tabIndex:x,src:S,sandbox:`allow-scripts allow-popups allow-popups-to-escape-sandbox allow-downloads allow-forms allow-modals`,referrerPolicy:`no-referrer`,onLoad:d}),t[13]=d,t[14]=x,t[15]=b,t[16]=r,t[17]=C):C=t[17];let w;return t[18]!==C||t[19]!==_||t[20]!==v?(w=(0,Q.jsxs)(`div`,{className:`relative flex min-h-0 w-full flex-1 flex-col`,"aria-busy":_,children:[v,C]}),t[18]=C,t[19]=_,t[20]=v,t[21]=w):w=t[21],w}var _e=(0,q.lazy)(()=>i(()=>import(`./source-workspace-editor-BwYU5OEh.js`).then(e=>({default:e.SourceWorkspaceEditor})),__vite__mapDeps([4,1,5,6,7,2])));function ve(){let e=(0,K.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col px-4 py-3`,"aria-busy":!0,children:[(0,Q.jsx)(`div`,{className:`h-4 w-11/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-9/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-10/12 animate-pulse rounded bg-surface-hover`})]}),e[0]=t):t=e[0],t}function ye(e){let t=e.lastIndexOf(`.`);return t>0?e.slice(t).toLowerCase():``}function be(e){return{".ts":`typescript`,".tsx":`tsx`,".js":`javascript`,".jsx":`jsx`,".json":`json`,".css":`css`,".yml":`yaml`,".yaml":`yaml`,".py":`python`,".go":`go`,".rs":`rust`,".sh":`bash`}[ye(e)]??`plaintext`}function xe(e){let t=(0,K.c)(12),{text:n,targetLine:r}=e,i=(0,q.useRef)(null),a;if(t[0]!==n){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\r\n|\n|\r/,t[2]=e):e=t[2],a=n.split(e),t[0]=n,t[1]=a}else a=t[1];let o=a,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{i.current?.scrollIntoView({block:`center`})},t[3]=s):s=t[3];let c;t[4]!==r||t[5]!==n?(c=[r,n],t[4]=r,t[5]=n,t[6]=c):c=t[6],(0,q.useEffect)(s,c);let l;t[7]!==o||t[8]!==r?(l=o.map((e,t)=>{let n=t+1,a=n===r;return(0,Q.jsxs)(`div`,{ref:a?i:void 0,className:a?`flex bg-accent-soft/60 text-fg`:`flex`,"data-line":n,children:[(0,Q.jsx)(`span`,{className:`w-12 shrink-0 select-none pr-3 text-right text-fg-subtle`,children:n}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words`,children:e||` `})]},n)}),t[7]=o,t[8]=r,t[9]=l):l=t[9];let u;return t[10]===l?u=t[11]:(u=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto px-4 py-3`,children:(0,Q.jsx)(`div`,{className:`min-w-max font-mono text-xs leading-relaxed text-fg`,children:l})}),t[10]=l,t[11]=u),u}function Se(e){let t=(0,K.c)(6),{text:n,targetLine:r}=e,i=(0,q.useRef)(null),a,o;t[0]!==r||t[1]!==n?(a=()=>{if(!r||!i.current)return;let e=n.split(/\r?\n/,r);if(!/^#{1,6}\s/.test(e.at(-1)??``))return;let t=e.filter(Ce).length-1;i.current.querySelectorAll(`h1,h2,h3,h4,h5,h6`)[t]?.scrollIntoView({block:`nearest`})},o=[r,n],t[0]=r,t[1]=n,t[2]=a,t[3]=o):(a=t[2],o=t[3]),(0,q.useEffect)(a,o);let s;return t[4]===n?s=t[5]:(s=(0,Q.jsx)(`div`,{ref:i,className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:(0,Q.jsx)(d,{content:n})}),t[4]=n,t[5]=s),s}function Ce(e){return/^#{1,6}\s/.test(e)}function we(e,t){let n=e.textContent??``,r=e.descriptor.context===`workspace`,i=e.workspaceEditing;return r&&i?.sourceEditMode?(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,Q.jsx)(q.Suspense,{fallback:(0,Q.jsx)(ve,{}),children:(0,Q.jsx)(_e,{fileName:e.descriptor.fileName,initialContent:n,onChange:e=>i.onSourceChange?.(e),isDark:(i.isDark??e.resolvedTheme===`dark`)===!0,lineWrap:i.sourceWordWrap===!0},e.descriptor.id)})}):t===`markdown`?(0,Q.jsx)(Se,{text:n,targetLine:e.targetLine}):t===`html`?(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden px-2 pb-2 pt-1 sm:px-4`,children:(0,Q.jsx)(ge,{html:n,title:e.descriptor.fileName})}):e.targetLine&&e.targetLine>0?(0,Q.jsx)(xe,{text:n,targetLine:e.targetLine}):t===`code`?(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:(0,Q.jsx)(d,{content:`\`\`\`${be(e.descriptor.fileName)}\n${n}\n\`\`\``})}):(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:(0,Q.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs text-fg`,children:n})})}function Te(e){return we(e,`text`)}function Ee(e){return we(e,`markdown`)}function De(e){return we(e,`code`)}function Oe(e){return we(e,`html`)}function ke(){return(0,q.createElement)(`div`,{className:`px-4 py-6 text-sm text-fg-muted`},`Loading preview...`)}function $(e,t,n,r=`binary`){let i=(0,q.lazy)(n);return{id:e,readMode:r,capabilities:t,render:e=>(0,q.createElement)(q.Suspense,{fallback:ke()},(0,q.createElement)(i,e))}}var Ae={text:{id:`text`,readMode:`text`,capabilities:[`download`,`edit`],render:e=>(0,q.createElement)(Te,e)},markdown:{id:`markdown`,readMode:`text`,capabilities:[`download`,`edit`],render:e=>(0,q.createElement)(Ee,e)},code:{id:`code`,readMode:`text`,capabilities:[`download`,`edit`],render:e=>(0,q.createElement)(De,e)},html:{id:`html`,readMode:`text`,capabilities:[`download`,`edit`],render:e=>(0,q.createElement)(Oe,e)},image:$(`image`,[`download`,`zoom`,`rotate`],()=>i(()=>import(`./binary-plugins-5GVlyrXg.js`).then(e=>({default:e.InteractiveImagePreview})),__vite__mapDeps([8,1,5,2,9,10,11,12,13,14,15,16,17,18,19]))),pdf:$(`pdf`,[`download`,`zoom`,`rotate`,`pageNavigation`,`print`],()=>i(()=>import(`./binary-plugins-5GVlyrXg.js`).then(e=>({default:e.PdfPreviewPluginView})),__vite__mapDeps([8,1,5,2,9,10,11,12,13,14,15,16,17,18,19]))),docx:$(`docx`,[`download`],()=>i(()=>import(`./binary-plugins-5GVlyrXg.js`).then(e=>({default:e.DocxPreviewPluginView})),__vite__mapDeps([8,1,5,2,9,10,11,12,13,14,15,16,17,18,19]))),spreadsheet:$(`spreadsheet`,[`download`],()=>i(()=>import(`./binary-plugins-5GVlyrXg.js`).then(e=>({default:e.SpreadsheetPreviewPluginView})),__vite__mapDeps([8,1,5,2,9,10,11,12,13,14,15,16,17,18,19]))),pptx:$(`pptx`,[`download`],()=>i(()=>import(`./binary-plugins-5GVlyrXg.js`).then(e=>({default:e.PptxPreviewPluginView})),__vite__mapDeps([8,1,5,2,9,10,11,12,13,14,15,16,17,18,19]))),audio:$(`audio`,[`download`],()=>i(()=>import(`./media-plugins-B5XMcW5S.js`).then(e=>({default:e.AudioPreviewPluginView})),__vite__mapDeps([20,1,5,9,10,11,12,13,14,15,16,17,18,19]))),video:$(`video`,[`download`],()=>i(()=>import(`./media-plugins-B5XMcW5S.js`).then(e=>({default:e.VideoPreviewPluginView})),__vite__mapDeps([20,1,5,9,10,11,12,13,14,15,16,17,18,19]))),archive:$(`archive`,[`download`],()=>i(()=>import(`./archive-plugin-Co_oRPj1.js`).then(e=>({default:e.ArchivePreviewPluginView})),__vite__mapDeps([21,1,5,9,22,11,12,13,14,15,16,17,18]))),unsupported:$(`unsupported`,[`download`],()=>i(()=>import(`./media-plugins-B5XMcW5S.js`).then(e=>({default:e.UnsupportedPreviewPluginView})),__vite__mapDeps([20,1,5,9,10,11,12,13,14,15,16,17,18,19])),`metadata`)};function je(e){return Ae[e]??Ae.unsupported}function Me(e){let t=(0,K.c)(63),{plugin:n,controls:r,onZoomIn:i,onZoomOut:a,onZoomReset:o,onRotate:s,onSearchChange:c}=e,l;t[0]===n.capabilities?l=t[1]:(l=n.capabilities.includes(`zoom`),t[0]=n.capabilities,t[1]=l);let d=l,h;t[2]===n.capabilities?h=t[3]:(h=n.capabilities.includes(`search`),t[2]=n.capabilities,t[3]=h);let g=h,_;t[4]===n.capabilities?_=t[5]:(_=n.capabilities.includes(`rotate`),t[4]=n.capabilities,t[5]=_);let v=_,y;t[6]!==r||t[7]!==n.capabilities?(y=n.capabilities.includes(`pageNavigation`)&&r.pageCount!=null&&r.pageCount>1,t[6]=r,t[7]=n.capabilities,t[8]=y):y=t[8];let b=y;if(!(d||g||v||b))return null;let x;if(t[9]!==b||t[10]!==v||t[11]!==g||t[12]!==d||t[13]!==r||t[14]!==s||t[15]!==c||t[16]!==i||t[17]!==a||t[18]!==o){let e=[];if(b){let n=r.page<=1,i;t[20]===r?i=t[21]:(i=()=>r.setPage(Math.max(1,r.page-1)),t[20]=r,t[21]=i);let a;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(N,{className:`size-3.5`}),t[22]=a):a=t[22];let o;t[23]!==n||t[24]!==i?(o=(0,Q.jsx)(Ne,{label:`Previous page`,disabled:n,onClick:i,children:a}),t[23]=n,t[24]=i,t[25]=o):o=t[25];let s;t[26]!==r.page||t[27]!==r.pageCount?(s=(0,Q.jsxs)(`span`,{className:`min-w-16 px-1 text-center text-xs text-fg-muted`,children:[r.page,` / `,r.pageCount]}),t[26]=r.page,t[27]=r.pageCount,t[28]=s):s=t[28];let c=r.page>=(r.pageCount??1),l;t[29]===r?l=t[30]:(l=()=>r.setPage(Math.min(r.pageCount??r.page,r.page+1)),t[29]=r,t[30]=l);let u;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(M,{className:`size-3.5`}),t[31]=u):u=t[31];let d;t[32]!==c||t[33]!==l?(d=(0,Q.jsx)(Ne,{label:`Next page`,disabled:c,onClick:l,children:u}),t[32]=c,t[33]=l,t[34]=d):d=t[34];let f;t[35]!==s||t[36]!==d||t[37]!==o?(f=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-edge-subtle bg-surface-base p-0.5 dark:border-edge`,children:[o,s,d]},`page`),t[35]=s,t[36]=d,t[37]=o,t[38]=f):f=t[38],e.push(f)}if(d){let n;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(u,{className:`size-3.5`}),t[39]=n):n=t[39];let s;t[40]===a?s=t[41]:(s=(0,Q.jsx)(Ne,{label:`Zoom out`,onClick:a,children:n}),t[40]=a,t[41]=s);let c;t[42]===r.zoom?c=t[43]:(c=Math.round(r.zoom*100),t[42]=r.zoom,t[43]=c);let l;t[44]!==o||t[45]!==c?(l=(0,Q.jsxs)(`button`,{type:`button`,className:`min-w-14 rounded px-1.5 py-1 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:o,title:`Reset zoom`,children:[c,`%`]}),t[44]=o,t[45]=c,t[46]=l):l=t[46];let d;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(f,{className:`size-3.5`}),t[47]=d):d=t[47];let p;t[48]===i?p=t[49]:(p=(0,Q.jsx)(Ne,{label:`Zoom in`,onClick:i,children:d}),t[48]=i,t[49]=p);let m;t[50]!==p||t[51]!==s||t[52]!==l?(m=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-edge-subtle bg-surface-base p-0.5 dark:border-edge`,children:[s,l,p]},`zoom`),t[50]=p,t[51]=s,t[52]=l,t[53]=m):m=t[53],e.push(m)}if(v){let n;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(p,{className:`size-3.5`}),t[54]=n):n=t[54];let r;t[55]===s?r=t[56]:(r=(0,Q.jsx)(Ne,{label:`Rotate`,onClick:s,children:n},`rotate`),t[55]=s,t[56]=r),e.push(r)}if(g){let n;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(m,{className:`size-3.5`,"aria-hidden":!0}),t[57]=n):n=t[57];let i;t[58]===c?i=t[59]:(i=e=>c(e.target.value),t[58]=c,t[59]=i);let a;t[60]!==r.searchQuery||t[61]!==i?(a=(0,Q.jsxs)(`label`,{className:`flex min-w-40 items-center gap-1 rounded-md border border-edge-subtle bg-surface-base px-2 py-1 text-xs text-fg-muted dark:border-edge`,children:[n,(0,Q.jsx)(`input`,{className:`min-w-0 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-subtle`,value:r.searchQuery,onChange:i,placeholder:`Search`})]},`search`),t[60]=r.searchQuery,t[61]=i,t[62]=a):a=t[62],e.push(a)}x=(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:e}),t[9]=b,t[10]=v,t[11]=g,t[12]=d,t[13]=r,t[14]=s,t[15]=c,t[16]=i,t[17]=a,t[18]=o,t[19]=x}else x=t[19];return x}function Ne(e){let t=(0,K.c)(6),{label:n,disabled:r,onClick:i,children:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=h(`inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:opacity-40`),t[0]=o):o=t[0];let s;return t[1]!==a||t[2]!==r||t[3]!==n||t[4]!==i?(s=(0,Q.jsx)(`button`,{type:`button`,className:o,title:n,"aria-label":n,disabled:r,onClick:i,children:a}),t[1]=a,t[2]=r,t[3]=n,t[4]=i,t[5]=s):s=t[5],s}function Pe(e){let t=je(e.type),n=Z(e.id),[r,i]=(0,q.useState)(n.zoom),[a,o]=(0,q.useState)(n.rotation),[s,c]=(0,q.useState)(n.page),[l,u]=(0,q.useState)(n.pageCount),[d,f]=(0,q.useState)(n.searchQuery),p=(0,q.useCallback)(e=>{c(Math.max(1,Math.min(l??e,Math.floor(e))))},[l]);(0,q.useEffect)(()=>{let t=Z(e.id);i(t.zoom),o(t.rotation),c(t.page),u(t.pageCount),f(t.searchQuery)},[e.id,e.type]);let m=(0,q.useRef)({zoom:r,rotation:a,page:s,pageCount:l,searchQuery:d});return m.current={zoom:r,rotation:a,page:s,pageCount:l,searchQuery:d},(0,q.useEffect)(()=>()=>pe(e.id,m.current),[e.id]),{plugin:t,controls:(0,q.useMemo)(()=>({zoom:r,rotation:a,page:s,pageCount:l,searchQuery:d,setPageCount:u,setPage:p}),[s,l,a,d,p,r]),onZoomIn:()=>i(e=>Math.min(4,Number((e+.15).toFixed(2)))),onZoomOut:()=>i(e=>Math.max(.25,Number((e-.15).toFixed(2)))),onZoomReset:()=>{i(1),o(0)},onRotate:()=>o(e=>(e+90)%360),onSearchChange:f}}function Fe(e){let t=(0,K.c)(8),{controller:n}=e,r;return t[0]!==n.controls||t[1]!==n.onRotate||t[2]!==n.onSearchChange||t[3]!==n.onZoomIn||t[4]!==n.onZoomOut||t[5]!==n.onZoomReset||t[6]!==n.plugin?(r=(0,Q.jsx)(Me,{plugin:n.plugin,controls:n.controls,onZoomIn:n.onZoomIn,onZoomOut:n.onZoomOut,onZoomReset:n.onZoomReset,onRotate:n.onRotate,onSearchChange:n.onSearchChange}),t[0]=n.controls,t[1]=n.onRotate,t[2]=n.onSearchChange,t[3]=n.onZoomIn,t[4]=n.onZoomOut,t[5]=n.onZoomReset,t[6]=n.plugin,t[7]=r):r=t[7],r}function Ie(e){let t=(0,K.c)(14),n;t[0]===e.language?n=t[1]:(n=c(e.language),t[0]=e.language,t[1]=n);let r=n,{controller:i}=e;if(e.loading){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 px-4 py-6`,"aria-busy":`true`,children:[(0,Q.jsx)(g,{className:`h-5 w-48 max-w-full`}),(0,Q.jsx)(g,{className:`h-4 w-full`}),(0,Q.jsx)(g,{className:`h-4 w-11/12`}),(0,Q.jsx)(g,{className:`h-4 w-3/4`}),(0,Q.jsx)(g,{className:`mt-3 min-h-48 flex-1 rounded-lg`})]}),t[2]=e):e=t[2],e}if(e.loadError){let n=(e.descriptor.context===`workspace`?r.workspace.loadError:r.chat.attachmentPreviewLoadError)+`: `+e.loadError,i;return t[3]===n?i=t[4]:(i=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:(0,Q.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:n})}),t[3]=n,t[4]=i),i}if(e.descriptor.context===`attachment`&&e.showExtractedText&&e.descriptor.type!==`image`){let n=e.extractedText||r.chat.attachmentPreviewNoText,i;return t[5]===n?i=t[6]:(i=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden`,children:(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto rounded-lg border border-edge-subtle bg-surface-hover/40 p-4 dark:border-edge`,children:(0,Q.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-fg-muted`,children:n})})}),t[5]=n,t[6]=i),i}let a=`${e.descriptor.id}:${i.plugin.id}`,o;t[7]!==i.controls||t[8]!==e?(o={...e,controls:i.controls},t[7]=i.controls,t[8]=e,t[9]=o):o=t[9];let s;return t[10]!==i.plugin.render||t[11]!==a||t[12]!==o?(s=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,Q.jsx)(Le,{pluginRender:i.plugin.render,props:o},a)}),t[10]=i.plugin.render,t[11]=a,t[12]=o,t[13]=s):s=t[13],s}function Le(e){let t=(0,K.c)(5),{pluginRender:n,props:r}=e,i;t[0]!==n||t[1]!==r?(i=n(r),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;return t[3]===i?a=t[4]:(a=(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:i}),t[3]=i,t[4]=a),a}export{pe as a,G as c,ie as d,W as f,M as g,N as h,Z as i,F as l,ae as m,Ie as n,fe as o,re as p,Pe as r,Y as s,Fe as t,P as u};
|
|
@@ -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{t as i}from"./chunk-KS7C4IRE-
|
|
1
|
+
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"./chunk-KS7C4IRE-DbzE-1bp.js";import{a,i as o,n as s,p as c}from"./locale-store-B4o4aDCg.js";import{t as l}from"./messages-hlOsXkQ7.js";import{t as u}from"./createLucideIcon-DPHK1VkS.js";import{t as d}from"./activity-YogQEteU.js";import{t as f}from"./bot-DjLkhyZL.js";import{t as p}from"./circle-check-C23XjkUj.js";import{t as m}from"./circle-pause-CN9jYH2s.js";import{t as h}from"./clock-3-DnrAnuyZ.js";import{t as g}from"./external-link-DjqjBmc3.js";import{t as _}from"./loader-circle-CifKLtgG.js";import{_ as v}from"./markdown-view-BpBBv9Gr.js";import{t as y}from"./message-square-fVE7Ghj1.js";import{t as b}from"./pause-DuPxgSxk.js";import{t as x}from"./play-kxZvpBg8.js";import{t as S}from"./rotate-ccw-JM1TBLpp.js";import{t as C}from"./rotate-cw-LIg3Am9S.js";import{t as w}from"./sparkles-DHlfQFAF.js";import{t as T}from"./triangle-alert-2JXFNNKU.js";import{t as E}from"./volume-2-BSJhAY97.js";import{t as D}from"./zap-dximCGjy.js";import{t as ee}from"./cn-0WouolD0.js";import{i as O}from"./vendor-swr-CdRzEUwF.js";import{t as k}from"./button-C5tRaJxt.js";import{t as A}from"./automation-api-CxLFngqe.js";import{n as j,o as M,s as N}from"./playback-coordinator-CWHIf0wr.js";var P=u(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),F=u(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),te=u(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),I=u(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),L=e(t(),1),R=n(),ne=!1,re=[`play`,`pause`,`stop`,`seekto`,`seekbackward`,`seekforward`];function ie(){return typeof navigator>`u`?void 0:navigator.mediaSession}function ae(e){let t=ie();if(!t)return;ne=!0;let n={play:e.resume,pause:e.pause,stop:e.stop,seekto:({seekTime:t})=>{t!==void 0&&e.seek(t)},seekbackward:({seekOffset:t})=>e.seek(e.position()-(t??10)),seekforward:({seekOffset:t})=>e.seek(e.position()+(t??10))};for(let e of re)try{t.setActionHandler(e,n[e])}catch{}}function z(e){let t=ie();if(!(!ne||!t)){typeof MediaMetadata<`u`&&t.metadata?.title!==e.source?.title&&(t.metadata=e.source?new MediaMetadata({title:e.source.title,artist:`xopc`}):null),t.playbackState=e.status===`playing`?`playing`:`paused`;try{t.setPositionState(e.durationComplete&&e.duration>0?{duration:e.duration,playbackRate:e.rate,position:Math.min(e.duration,Math.max(0,e.currentTime))}:void 0)}catch{}}}function oe(){let e=ie();if(!(!ne||!e)){ne=!1,e.metadata=null,e.playbackState=`none`;for(let t of re)try{e.setActionHandler(t,null)}catch{}try{e.setPositionState()}catch{}}}var se=/```[\s\S]*?```|~~~[\s\S]*?~~~/g,ce=/[^。!?!?\.\n]+[。!?!?\.]?|\n+/g;function le(e){return e.replace(se,`
|
|
2
2
|
`).replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]+)\]\([^)]*\)/g,`$1`).replace(/^#{1,6}\s+/gm,``).replace(/^\s*[-*+]\s+/gm,``).replace(/^\s*\d+[.)]\s+/gm,``).replace(/[|`*_~>]/g,` `).replace(/<[^>]+>/g,` `)}function ue(e){if(!e.trim())return``;let t=e.replace(se,`
|
|
3
3
|
`),n;if(typeof DOMParser>`u`)n=le(t);else{let e=v.parse(t,{gfm:!0,breaks:!1}),r=new DOMParser().parseFromString(`<main>${e}</main>`,`text/html`);r.querySelectorAll(`pre, script, style`).forEach(e=>e.remove()),r.querySelectorAll(`img`).forEach(e=>e.replaceWith(e.alt||``)),r.querySelectorAll(`br, p, h1, h2, h3, h4, h5, h6, li, tr`).forEach(e=>{e.append(r.createTextNode(`
|
|
4
4
|
`))}),n=r.body.textContent??``}return n.replace(/https?:\/\/\S+/gi,``).replace(/[\t ]+/g,` `).replace(/ *\n */g,`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{r as n,t as r,u as i}from"./chunk-KS7C4IRE-DbzE-1bp.js";import{n as a}from"./locale-store-B4o4aDCg.js";import{t as o}from"./skeleton-DzdOeGYz.js";import{i as s,o as c}from"./product-delivery-4gEqUIsK.js";import{i as l}from"./vendor-swr-CdRzEUwF.js";import{n as u}from"./api-oA0NOKLI.js";import{t as d}from"./open-route-MyZ2sB9C.js";var f=e(),p=t();function m(){let e=(0,f.c)(14),t=i(),r=a(h)===`zh`,m=s(`xopc://open${t.search}`),_=m?.kind===`local_app`?m.id:null,{data:v,error:y}=l(_?[`local-app-open`,_]:null,()=>u(_));if(!m){let t=r?`这个打开链接无效。`:`This open link is invalid.`,n;return e[0]!==t||e[1]!==r?(n=(0,p.jsx)(g,{message:t,zh:r}),e[0]=t,e[1]=r,e[2]=n):n=e[2],n}if(m.kind!==`local_app`){let t=c({...m,title:m.id,capabilities:[`open`]}),i;return e[3]!==t||e[4]!==r?(i=t?(0,p.jsx)(n,{to:t,replace:!0}):(0,p.jsx)(g,{message:r?`这个内容无法在应用中打开。`:`This content cannot be opened in the app.`,zh:r}),e[3]=t,e[4]=r,e[5]=i):i=e[5],i}if(y){let t=typeof y==`object`&&y&&`status`in y&&y.status===404?r?`找不到这个应用,它可能已被删除。`:`This app was not found and may have been deleted.`:y instanceof Error?y.message:r?`无法打开这个应用。`:`Unable to open this app.`,n;return e[6]!==t||e[7]!==r?(n=(0,p.jsx)(g,{message:t,zh:r}),e[6]=t,e[7]=r,e[8]=n):n=e[8],n}if(v){let t;e[9]===v?t=e[10]:(t=d(v),e[9]=v,e[10]=t);let r;return e[11]===t?r=e[12]:(r=(0,p.jsx)(n,{to:t,replace:!0}),e[11]=t,e[12]=r),r}let b;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,p.jsxs)(`div`,{className:`flex w-full flex-col gap-4 px-3 py-6 sm:px-5 xl:px-6`,"aria-busy":!0,children:[(0,p.jsx)(o,{className:`h-6 w-48`}),(0,p.jsx)(o,{className:`h-32 rounded-xl`})]}),e[13]=b):b=e[13],b}function h(e){return e.language}function g(e){let t=(0,f.c)(7),{message:n,zh:i}=e,a;t[0]===n?a=t[1]:(a=(0,p.jsx)(`p`,{children:n}),t[0]=n,t[1]=a);let o=i?`查看应用`:`View apps`,s;t[2]===o?s=t[3]:(s=(0,p.jsx)(r,{className:`mt-3 inline-flex font-medium text-accent hover:underline`,to:`/local-apps`,children:o}),t[2]=o,t[3]=s);let c;return t[4]!==a||t[5]!==s?(c=(0,p.jsxs)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,role:`alert`,children:[a,s]}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}export{m as ProductOpenPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{l as n,t as r}from"./chunk-KS7C4IRE-BPb7KheU.js";import{i,l as a,n as o}from"./locale-store-B4o4aDCg.js";import{t as s}from"./messages-hlOsXkQ7.js";import{i as c,u as l}from"./automation-display-DaVDNZz8.js";import{H as u,I as d,t as f}from"./markdown-view-C7kqotD-.js";import{t as p}from"./skeleton-DzdOeGYz.js";import{a as m,c as h}from"./api-D0r-2gWQ.js";import{i as g}from"./vendor-swr-CdRzEUwF.js";import{t as _}from"./button-ChmVQg9O.js";import{t as v}from"./automation-api-CxLFngqe.js";import{n as y}from"./automation-task-card-BS-RT312.js";import{i as b,n as x}from"./api-oA0NOKLI.js";import{n as S}from"./product-preview-modal-DToUA1EF.js";import{t as C}from"./open-route-MyZ2sB9C.js";import{i as w,r as T}from"./automation-result-state-CjiuyW-C.js";import{t as E}from"./project-overview-model-DrLXaO-t.js";var D=e(),O=t(),k=new Set([`queued`,`running`,`cancelling`]);function A(e){let t=(0,D.c)(60),{automationId:n,runId:r}=e,i=o(N),a=i===`zh`,c,l;t[0]!==n||t[1]!==r?(c=[`automation-run-preview`,n,r],l=async()=>{let[e,t]=await Promise.all([v.get(n),r?v.getRun(r).then(M):Promise.resolve(void 0)]);if(t&&t.automationId!==n)throw Error(`Run does not belong to this task`);return{task:e.automation,run:t}},t[0]=n,t[1]=r,t[2]=c,t[3]=l):(c=t[2],l=t[3]);let u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u={shouldRetryOnError:!1,refreshInterval:j},t[4]=u):u=t[4];let{data:d,error:m,mutate:h}=g(c,l,u);if(m){let e=a?`暂时无法读取这次运行,请重试。`:`Could not load this run. Try again.`,n;t[5]===e?n=t[6]:(n=(0,O.jsx)(`p`,{children:e}),t[5]=e,t[6]=n);let r;t[7]===h?r=t[8]:(r=()=>void h(),t[7]=h,t[8]=r);let i=a?`重试`:`Retry`,o;t[9]!==r||t[10]!==i?(o=(0,O.jsx)(_,{variant:`secondary`,onClick:r,children:i}),t[9]=r,t[10]=i,t[11]=o):o=t[11];let s;return t[12]!==n||t[13]!==o?(s=(0,O.jsxs)(`div`,{role:`alert`,className:`space-y-3 text-sm text-fg-muted`,children:[n,o]}),t[12]=n,t[13]=o,t[14]=s):s=t[14],s}if(!d){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,O.jsxs)(`div`,{className:`space-y-4`,"aria-busy":`true`,children:[(0,O.jsx)(p,{className:`h-6 w-2/3`}),(0,O.jsx)(p,{className:`h-4 w-1/3`}),(0,O.jsx)(p,{className:`h-32`})]}),t[15]=e):e=t[15],e}let b=d.run;if(!b){let e;t[16]===d.task.name?e=t[17]:(e=(0,O.jsx)(`h2`,{className:`text-lg font-medium text-fg`,children:d.task.name}),t[16]=d.task.name,t[17]=e);let n=a?`这条旧链接没有关联具体执行,请从任务的运行记录查看。`:`This older link does not identify an execution. Choose one from the task history.`,r;t[18]===n?r=t[19]:(r=(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n}),t[18]=n,t[19]=r);let i;return t[20]!==e||t[21]!==r?(i=(0,O.jsxs)(`div`,{className:`space-y-3`,children:[e,r]}),t[20]=e,t[21]=r,t[22]=i):i=t[22],i}let x;t[23]===d.task.name?x=t[24]:(x=(0,O.jsx)(`h2`,{className:`text-lg font-medium text-fg`,children:d.task.name}),t[23]=d.task.name,t[24]=x);let S;t[25]===i?S=t[26]:(S=s(i),t[25]=i,t[26]=S);let C=S.automations.status[b.status],E;t[27]!==b.createdAtMs||t[28]!==a?(E=new Date(b.createdAtMs).toLocaleString(a?`zh-CN`:`en-US`),t[27]=b.createdAtMs,t[28]=a,t[29]=E):E=t[29];let A;t[30]!==C||t[31]!==E?(A=(0,O.jsxs)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:[C,` · `,E]}),t[30]=C,t[31]=E,t[32]=A):A=t[32];let P;t[33]!==x||t[34]!==A?(P=(0,O.jsxs)(`div`,{className:`space-y-2`,children:[x,A]}),t[33]=x,t[34]=A,t[35]=P):P=t[35];let F;t[36]!==b.status||t[37]!==a?(F=b.status===`queued`?(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`任务正在排队,开始后会自动更新。`:`Queued. This view updates when execution starts.`}):b.status===`running`?(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`正在执行,结果会自动显示在这里。`:`Running. The result will appear here automatically.`}):null,t[36]=b.status,t[37]=a,t[38]=F):F=t[38];let I;t[39]===b.summary?I=t[40]:(I=b.summary?(0,O.jsx)(f,{content:b.summary}):null,t[39]=b.summary,t[40]=I);let L;t[41]!==i||t[42]!==b?(L=b.error?(0,O.jsx)(`p`,{className:`text-sm leading-6 text-danger`,children:T(b,i)}):null,t[41]=i,t[42]=b,t[43]=L):L=t[43];let R;t[44]!==n||t[45]!==i||t[46]!==b.id||t[47]!==b.status?(R=b.status===`failed`||b.status===`timeout`?(0,O.jsx)(y,{automationId:n,runId:b.id,language:i,variant:`secondary`}):null,t[44]=n,t[45]=i,t[46]=b.id,t[47]=b.status,t[48]=R):R=t[48];let z;t[49]!==i||t[50]!==b.id||t[51]!==b.status?(z=k.has(b.status)?null:(0,O.jsx)(w,{runId:b.id,language:i}),t[49]=i,t[50]=b.id,t[51]=b.status,t[52]=z):z=t[52];let ee;return t[53]!==F||t[54]!==I||t[55]!==L||t[56]!==R||t[57]!==z||t[58]!==P?(ee=(0,O.jsxs)(`div`,{className:`space-y-5`,children:[P,F,I,L,R,z]}),t[53]=F,t[54]=I,t[55]=L,t[56]=R,t[57]=z,t[58]=P,t[59]=ee):ee=t[59],ee}function j(e){return e&&(e.task.state.runningRunId||e.run&&k.has(e.run.status))?3e3:0}function M(e){return e.run}function N(e){return e.language}var P=`rounded text-sm text-accent-fg hover:underline focus-visible:ring-2 focus-visible:ring-accent`,F=e=>e.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`);function I(e){let t=(0,D.c)(83),{project:i,target:c}=e,l=o(re),m=a(B),_=n(),v=l===`zh`,y;t[0]===l?y=t[1]:(y=s(l),t[0]=l,t[1]=y);let b=y.projectDetailPage,x;t[2]!==c.id||t[3]!==m?(x=[`chat-project-operating-view`,c.id,m],t[2]=c.id,t[3]=m,t[4]=x):x=t[4];let S;t[5]===c.id?S=t[6]:(S=()=>h(c.id),t[5]=c.id,t[6]=S);let C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C={shouldRetryOnError:!1},t[7]=C):C=t[7];let{data:w,error:T,isLoading:k,mutate:A}=g(x,S,C),j=`${_.pathname}${_.search}`,M=`/projects/${encodeURIComponent(c.id)}`,N;t[8]!==j||t[9]!==M||t[10]!==c.ownerAgentId?(N=e=>{let t=new URLSearchParams;return c.ownerAgentId&&t.set(`agentId`,c.ownerAgentId),u(`${M}/${e}${t.size?`?${t}`:``}`,j)},t[8]=j,t[9]=M,t[10]=c.ownerAgentId,t[11]=N):N=t[11];let I=N,V;t[12]===j?V=t[13]:(V=e=>d(j,e),t[12]=j,t[13]=V);let H=V,U,W,G,K,q,J,Y;if(t[14]!==T||t[15]!==k||t[16]!==A||t[17]!==b||t[18]!==i||t[19]!==I||t[20]!==H||t[21]!==w||t[22]!==v){let e=w?.tasks??[],n={moving:0,ready:0,waiting:0,needsUser:0,done:0};for(let t of e)t.phase===`closed`?t.resolution===`done`&&(n.done+=1):F(t)?n.needsUser+=1:[`queued`,`running`,`verifying`].includes(t.operationalState)?n.moving+=1:[`waiting`,`blocked`].includes(t.operationalState)?n.waiting+=1:n.ready+=1;let a={moving:v?`进行中`:`In progress`,ready:v?`待处理`:`To do`,waiting:v?`等待中`:`Waiting`,needsUser:v?`等你处理`:`Needs you`,done:v?`已完成`:`Completed`},o=new Set(e.filter(ne).map(te)),s=(w?.blockers??[]).filter(e=>o.has(e.taskId)).sort(ee),c=s.filter((e,t)=>s.findIndex(t=>t.taskId===e.taskId)===t).slice(0,2),l=E(e,e.length).sort(z).slice(0,3),u=[...(i.recentUpdates??[]).map((e,t)=>({id:`update:${e.id??t}`,source:`project`,summary:e.summary,at:e.createdAt,title:v?`项目进展`:`Project update`,href:I(`progress`)})),...(w?.recentResults??[]).map(e=>{let{taskId:t,taskTitle:n,receipt:r}=e;return{id:`receipt:${r.runId}`,source:`task:${t}`,summary:r.summary,at:r.finalizedAt,title:`${n} · ${v?{passed:`验证通过`,failed:`验证失败`,unverified:`未验证`}[r.verification.status]:r.verification.status}`,href:H(t)}})].filter(R).sort(L),d=u.filter((e,t)=>u.findIndex(t=>t.source===e.source&&t.summary.trim()===e.summary.trim())===t).slice(0,3),m;t[30]===v?m=t[31]:(m=e=>e===void 0||!Number.isFinite(new Date(e).getTime())?null:new Intl.DateTimeFormat(v?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(new Date(e)),t[30]=v,t[31]=m);let h=m,g=i.lastActiveAt||i.updatedAt,_;t[32]!==h||t[33]!==g?(_=h(g),t[32]=h,t[33]=g,t[34]=_):_=t[34];let y=_,x=i.outcome||i.description||i.brief,S=v?`项目健康度尚未评估`:`Project health not assessed`,C=v?`进展正常`:`On track`,D=v?`存在风险`:`At risk`,j=v?`偏离计划`:`Off track`,M;t[35]!==S||t[36]!==C||t[37]!==D||t[38]!==j?(M={unknown:S,on_track:C,at_risk:D,off_track:j},t[35]=S,t[36]=C,t[37]=D,t[38]=j,t[39]=M):M=t[39];let N=M;U=`space-y-5`;let B;t[40]===i.name?B=t[41]:(B=(0,O.jsx)(`h2`,{className:`min-w-0 break-words text-xl font-semibold text-fg`,children:i.name}),t[40]=i.name,t[41]=B);let re=b.statuses[i.status],V;t[42]===re?V=t[43]:(V=(0,O.jsx)(`span`,{className:`shrink-0 rounded-md bg-surface-inset px-2 py-1 text-xs text-fg-muted`,children:re}),t[42]=re,t[43]=V);let X;t[44]!==B||t[45]!==V?(X=(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[B,V]}),t[44]=B,t[45]=V,t[46]=X):X=t[46];let Z;t[47]!==x||t[48]!==v?(Z=x?(0,O.jsx)(`div`,{className:`line-clamp-3 text-sm text-fg-muted`,children:(0,O.jsx)(f,{content:x,mermaidActions:!1})}):(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:v?`尚未填写项目目标。`:`No project goal recorded yet.`}),t[47]=x,t[48]=v,t[49]=Z):Z=t[49];let ie=N[i.health],ae=y?` · ${v?`最近活动`:`Last activity`} ${y}`:``,Q;t[50]!==ie||t[51]!==ae?(Q=(0,O.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[ie,ae]}),t[50]=ie,t[51]=ae,t[52]=Q):Q=t[52],t[53]!==X||t[54]!==Z||t[55]!==Q?(W=(0,O.jsxs)(`div`,{className:`space-y-2`,children:[X,Z,Q]}),t[53]=X,t[54]=Z,t[55]=Q,t[56]=W):W=t[56];let oe=v?`当前概况`:`Overview`,se=v?`当前概况`:`Overview`,$;t[57]===se?$=t[58]:($=(0,O.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:se}),t[57]=se,t[58]=$);let ce=k?(0,O.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-3`,children:[(0,O.jsx)(p,{className:`h-4 w-3/4`}),(0,O.jsx)(p,{className:`h-14 w-full`})]}):T||!w?(0,O.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 text-sm text-fg-muted`,children:[(0,O.jsx)(`span`,{children:v?`任务概况暂时无法读取。`:`Task overview is temporarily unavailable.`}),(0,O.jsx)(`button`,{type:`button`,onClick:()=>void A(),className:P,children:v?`重试`:`Retry`})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:e.length===0?v?`尚未关联任务,可在项目中添加下一步工作。`:`No tasks linked yet. Add the next piece of work in the project.`:v?`${n.moving} 项任务正在推进,${n.needsUser} 项等你处理,${n.waiting} 项等待中。`:`${n.moving} in progress, ${n.needsUser} need your input, ${n.waiting} waiting.`}),w.digest.recommendedAction&&(0,O.jsxs)(`p`,{className:`break-words text-sm leading-6 text-fg-muted`,children:[v?`建议下一步:`:`Suggested next step: `,w.digest.recommendedAction]}),(0,O.jsx)(`dl`,{className:`grid grid-cols-3 gap-3 border-t border-edge pt-3 sm:grid-cols-5`,children:Object.keys(a).map(e=>(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{className:`text-xs text-fg-muted`,children:a[e]}),(0,O.jsx)(`dd`,{className:`mt-1 text-xl font-semibold tabular-nums text-fg`,children:n[e]})]},e))})]});t[59]!==oe||t[60]!==$||t[61]!==ce?(G=(0,O.jsxs)(`section`,{"aria-label":oe,className:`space-y-3 rounded-xl border border-edge bg-surface-inset/50 p-4`,children:[$,ce]}),t[59]=oe,t[60]=$,t[61]=ce,t[62]=G):G=t[62],K=w&&(0,O.jsxs)(`div`,{className:`grid gap-6 sm:grid-cols-2`,children:[(0,O.jsxs)(`section`,{className:`min-w-0 space-y-3`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:v?`优先关注`:`Needs attention`}),c.length?(0,O.jsx)(`ul`,{className:`divide-y divide-edge`,children:c.map(e=>(0,O.jsx)(`li`,{className:`py-3 first:pt-0`,children:(0,O.jsxs)(r,{to:H(e.taskId),className:`block rounded-lg focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,O.jsx)(`p`,{className:`break-words text-sm font-medium text-fg`,children:e.title}),(0,O.jsx)(`p`,{className:`mt-1 line-clamp-3 break-words text-sm leading-6 text-fg-muted`,children:e.detail}),(0,O.jsx)(`span`,{className:`mt-2 inline-block ${P}`,children:v?`查看关联任务 →`:`View task →`})]})},e.taskId))}):(0,O.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:v?`暂无已记录的阻塞或待处理提醒。`:`No recorded blockers or attention items.`})]}),(0,O.jsxs)(`section`,{className:`min-w-0 space-y-3`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:v?`当前任务`:`Current tasks`}),(0,O.jsx)(r,{to:I(`tasks`),className:P,children:v?`查看全部`:`View all`})]}),l.length?(0,O.jsx)(`ul`,{className:`divide-y divide-edge`,children:l.map(e=>(0,O.jsx)(`li`,{children:(0,O.jsxs)(r,{to:H(e.id),className:`block rounded-lg py-3 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,O.jsx)(`p`,{className:`break-words text-sm font-medium text-fg`,children:e.title}),(0,O.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[b.board.phases[e.phase],e.operationalState===`idle`?``:` · ${b.board.operationalStates[e.operationalState]}`]})]})},e.id))}):(0,O.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:v?`暂无可推进的任务,等待中的任务可在全部任务中查看。`:`No actionable tasks. View all tasks to see any waiting work.`})]})]}),q=`space-y-3 border-t border-edge pt-5`;let le=v?`最近进展`:`Recent progress`,ue;t[63]===le?ue=t[64]:(ue=(0,O.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:le}),t[63]=le,t[64]=ue);let de;t[65]===I?de=t[66]:(de=I(`progress`),t[65]=I,t[66]=de);let fe=v?`查看记录`:`View history`,pe;t[67]!==de||t[68]!==fe?(pe=(0,O.jsx)(r,{to:de,className:P,children:fe}),t[67]=de,t[68]=fe,t[69]=pe):pe=t[69],t[70]!==ue||t[71]!==pe?(J=(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[ue,pe]}),t[70]=ue,t[71]=pe,t[72]=J):J=t[72],Y=d.length?(0,O.jsx)(`ul`,{className:`divide-y divide-edge-subtle`,children:d.map(e=>(0,O.jsxs)(`li`,{className:`space-y-2 py-3 first:pt-0`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-2`,children:[(0,O.jsxs)(`p`,{className:`min-w-0 break-words text-xs text-fg-muted`,children:[e.title,h(e.at)?` · ${h(e.at)}`:``]}),(0,O.jsx)(r,{to:e.href,className:P,children:v?`查看来源`:`View source`})]}),(0,O.jsx)(`div`,{className:`line-clamp-3 break-words text-sm text-fg`,children:(0,O.jsx)(f,{content:e.summary,mermaidActions:!1})})]},e.id))}):(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:v?`暂无项目进展或执行结果。`:`No project updates or execution results yet.`}),t[14]=T,t[15]=k,t[16]=A,t[17]=b,t[18]=i,t[19]=I,t[20]=H,t[21]=w,t[22]=v,t[23]=U,t[24]=W,t[25]=G,t[26]=K,t[27]=q,t[28]=J,t[29]=Y}else U=t[23],W=t[24],G=t[25],K=t[26],q=t[27],J=t[28],Y=t[29];let X;t[73]!==q||t[74]!==J||t[75]!==Y?(X=(0,O.jsxs)(`section`,{className:q,children:[J,Y]}),t[73]=q,t[74]=J,t[75]=Y,t[76]=X):X=t[76];let Z;return t[77]!==U||t[78]!==W||t[79]!==G||t[80]!==K||t[81]!==X?(Z=(0,O.jsxs)(`div`,{className:U,children:[W,G,K,X]}),t[77]=U,t[78]=W,t[79]=G,t[80]=K,t[81]=X,t[82]=Z):Z=t[82],Z}function L(e,t){return(t.at||0)-(e.at||0)}function R(e){return e.summary?.trim()}function z(e,t){return Number([`queued`,`running`,`verifying`].includes(t.operationalState))-Number([`queued`,`running`,`verifying`].includes(e.operationalState))}function ee(e,t){return Number([`input_required`,`approval_required`].includes(t.kind))-Number([`input_required`,`approval_required`].includes(e.kind))}function te(e){return e.id}function ne(e){return e.phase!==`closed`}function B(e){return e.conversationId}function re(e){return e.language}async function V(e){switch(e.kind){case`project`:return{kind:e.kind,value:await m(e.id)};case`automation`:{let[t,n]=await Promise.all([v.list(),v.runs(5,e.id)]);return{kind:e.kind,value:t.automations.find(t=>t.id===e.id),runs:n.runs}}case`local_app`:{let t=await x(e.id),n=e.sourceHash?await b(e.id,e.sourceHash):void 0;return{kind:e.kind,value:t,previewUrl:n?.previewUrl||t.draftPreviewUrl}}}}var H={pending:[`等待中`,`Pending`],planned:[`计划中`,`Planned`],active:[`进行中`,`Active`],paused:[`已暂停`,`Paused`],completed:[`已完成`,`Completed`],cancelled:[`已取消`,`Cancelled`],archived:[`已归档`,`Archived`],queued:[`排队中`,`Queued`],running:[`运行中`,`Running`],succeeded:[`成功`,`Succeeded`],failed:[`失败`,`Failed`],timeout:[`超时`,`Timed out`],cancelling:[`取消中`,`Cancelling`],unknown:[`尚未评估`,`Not assessed`],on_track:[`进展正常`,`On track`],at_risk:[`存在风险`,`At risk`],off_track:[`偏离计划`,`Off track`]};function U(e){let t=(0,D.c)(5),{target:n}=e;if(n.kind===`automation`&&n.view===`run`){let e;return t[0]!==n.id||t[1]!==n.runId?(e=(0,O.jsx)(A,{automationId:n.id,runId:n.runId}),t[0]=n.id,t[1]=n.runId,t[2]=e):e=t[2],e}let r;return t[3]===n?r=t[4]:(r=(0,O.jsx)(W,{target:n}),t[3]=n,t[4]=r),r}function W(e){let t=(0,D.c)(56),{target:n}=e,u=a(J),d=o(q),f=d===`zh`,p=s(d),m;t[0]===f?m=t[1]:(m=e=>H[e]?.[+!f]||e,t[0]=f,t[1]=m);let h=m,_;t[2]!==n.href||t[3]!==u?(_=[`chat-product-preview`,n.href,u],t[2]=n.href,t[3]=u,t[4]=_):_=t[4];let v;t[5]===n?v=t[6]:(v=()=>V(n),t[5]=n,t[6]=v);let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y={shouldRetryOnError:!1,refreshInterval:K},t[7]=y):y=t[7];let{data:b,error:x,isLoading:w}=g(_,v,y);if(w){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,O.jsx)(S,{}),t[8]=e):e=t[8],e}if(x){let e=f?`无法加载内容,它可能已删除或暂时不可用。`:`Unable to load this content. It may have been deleted or be temporarily unavailable.`,n;return t[9]===e?n=t[10]:(n=(0,O.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:e}),t[9]=e,t[10]=n),n}if(!b?.value){let e=f?`内容不存在或已删除。`:`This content is unavailable or has been deleted.`,n;return t[11]===e?n=t[12]:(n=(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e}),t[11]=e,t[12]=n),n}let T=G;if(b.kind===`project`){let e;return t[13]!==b.value||t[14]!==n?(e=(0,O.jsx)(I,{project:b.value,target:n}),t[13]=b.value,t[14]=n,t[15]=e):e=t[15],e}if(b.kind===`automation`){let e=b.value,n=e.action.kind===`agent`?e.action.instruction:void 0,r;t[16]===e.name?r=t[17]:(r=(0,O.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:e.name}),t[16]=e.name,t[17]=r);let i;t[18]!==e.description||t[19]!==T?(i=T(e.description),t[18]=e.description,t[19]=T,t[20]=i):i=t[20];let a;t[21]!==n||t[22]!==T?(a=T(n),t[21]=n,t[22]=T,t[23]=a):a=t[23];let o;t[24]!==e.state.nextRunAtMs||t[25]!==f?(o=e.state.nextRunAtMs&&(0,O.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[f?`下次运行`:`Next run`,` · `,new Date(e.state.nextRunAtMs).toLocaleString(f?`zh-CN`:`en-US`)]}),t[24]=e.state.nextRunAtMs,t[25]=f,t[26]=o):o=t[26];let s;t[27]===e.state.lastError?s=t[28]:(s=e.state.lastError&&(0,O.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:e.state.lastError}),t[27]=e.state.lastError,t[28]=s);let u=f?`最近运行`:`Recent runs`,m;t[29]===u?m=t[30]:(m=(0,O.jsx)(`h3`,{className:`font-medium text-fg`,children:u}),t[29]=u,t[30]=m);let g;t[31]!==b.runs||t[32]!==T||t[33]!==h||t[34]!==f?(g=b.runs.length?b.runs.map(e=>(0,O.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-edge p-3`,children:[(0,O.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[h(e.status),` · `,new Date(e.createdAtMs).toLocaleString(f?`zh-CN`:`en-US`)]}),T(e.summary),e.error&&(0,O.jsx)(`p`,{className:`text-sm text-danger`,children:e.error})]},e.id)):(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:f?`暂无运行记录。`:`No runs yet.`}),t[31]=b.runs,t[32]=T,t[33]=h,t[34]=f,t[35]=g):g=t[35];let _;return t[36]!==m||t[37]!==g?(_=(0,O.jsxs)(`section`,{className:`space-y-3`,children:[m,g]}),t[36]=m,t[37]=g,t[38]=_):_=t[38],(0,O.jsxs)(`div`,{className:`space-y-6`,children:[(0,O.jsxs)(`div`,{className:`space-y-3`,children:[r,(0,O.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[l(e)?f?`已完成`:`Completed`:e.enabled?f?`已启用`:`Enabled`:f?`已暂停`:`Paused`,` · `,c(e.trigger,p.automations,p.cron,d)]}),i,a,o,s]}),_]})}let E=b.value,k;t[39]===E.name?k=t[40]:(k=(0,O.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:E.name}),t[39]=E.name,t[40]=k);let A=E.description||E.idea,j;t[41]!==T||t[42]!==A?(j=T(A),t[41]=T,t[42]=A,t[43]=j):j=t[43];let M;t[44]!==E.name||t[45]!==b.previewUrl||t[46]!==f?(M=b.previewUrl&&(0,O.jsx)(`iframe`,{title:f?`${E.name} 交互预览`:`${E.name} interactive preview`,src:i(b.previewUrl),sandbox:`allow-scripts allow-forms`,className:`h-[min(30rem,55dvh)] w-full rounded-lg border border-edge bg-white`}),t[44]=E.name,t[45]=b.previewUrl,t[46]=f,t[47]=M):M=t[47];let N;t[48]!==E||t[49]!==f?(N=E.installationState===`installed`&&E.enabled&&E.status===`installed`&&(0,O.jsx)(r,{to:C(E),className:`inline-flex rounded-lg bg-accent px-3 py-2 text-sm text-white focus-visible:ring-2 focus-visible:ring-accent`,children:f?`使用应用`:`Use app`}),t[48]=E,t[49]=f,t[50]=N):N=t[50];let P;return t[51]!==k||t[52]!==j||t[53]!==M||t[54]!==N?(P=(0,O.jsxs)(`div`,{className:`space-y-5`,children:[k,j,M,N]}),t[51]=k,t[52]=j,t[53]=M,t[54]=N,t[55]=P):P=t[55],P}function G(e){return e?.trim()?(0,O.jsx)(f,{content:e,mermaidActions:!1}):null}function K(e){return e?.kind===`automation`&&e.value?.state.runningRunId?3e3:0}function q(e){return e.language}function J(e){return e.conversationId}export{U as default};
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n,u as r}from"./chunk-KS7C4IRE-DbzE-1bp.js";import{i,l as a,n as o}from"./locale-store-B4o4aDCg.js";import{t as s}from"./messages-hlOsXkQ7.js";import{i as c,u as l}from"./automation-display-DaVDNZz8.js";import{H as u,I as d,t as f}from"./markdown-view-BpBBv9Gr.js";import{t as p}from"./skeleton-DzdOeGYz.js";import{a as m,c as h}from"./api-D0r-2gWQ.js";import{i as g}from"./vendor-swr-CdRzEUwF.js";import{t as _}from"./button-C5tRaJxt.js";import{t as v}from"./automation-api-CxLFngqe.js";import{n as y}from"./automation-task-card-f5_tNbzB.js";import{i as b,n as x}from"./api-oA0NOKLI.js";import{n as S}from"./product-preview-modal-CIe5WW9E.js";import{t as C}from"./open-route-MyZ2sB9C.js";import{i as w,r as T}from"./automation-result-state-CjiuyW-C.js";import{t as E}from"./project-overview-model-DrLXaO-t.js";var D=e(),O=t(),k=new Set([`queued`,`running`,`cancelling`]);function A(e){let t=(0,D.c)(60),{automationId:n,runId:r}=e,i=o(N),a=i===`zh`,c,l;t[0]!==n||t[1]!==r?(c=[`automation-run-preview`,n,r],l=async()=>{let[e,t]=await Promise.all([v.get(n),r?v.getRun(r).then(M):Promise.resolve(void 0)]);if(t&&t.automationId!==n)throw Error(`Run does not belong to this task`);return{task:e.automation,run:t}},t[0]=n,t[1]=r,t[2]=c,t[3]=l):(c=t[2],l=t[3]);let u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u={shouldRetryOnError:!1,refreshInterval:j},t[4]=u):u=t[4];let{data:d,error:m,mutate:h}=g(c,l,u);if(m){let e=a?`暂时无法读取这次运行,请重试。`:`Could not load this run. Try again.`,n;t[5]===e?n=t[6]:(n=(0,O.jsx)(`p`,{children:e}),t[5]=e,t[6]=n);let r;t[7]===h?r=t[8]:(r=()=>void h(),t[7]=h,t[8]=r);let i=a?`重试`:`Retry`,o;t[9]!==r||t[10]!==i?(o=(0,O.jsx)(_,{variant:`secondary`,onClick:r,children:i}),t[9]=r,t[10]=i,t[11]=o):o=t[11];let s;return t[12]!==n||t[13]!==o?(s=(0,O.jsxs)(`div`,{role:`alert`,className:`space-y-3 text-sm text-fg-muted`,children:[n,o]}),t[12]=n,t[13]=o,t[14]=s):s=t[14],s}if(!d){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,O.jsxs)(`div`,{className:`space-y-4`,"aria-busy":`true`,children:[(0,O.jsx)(p,{className:`h-6 w-2/3`}),(0,O.jsx)(p,{className:`h-4 w-1/3`}),(0,O.jsx)(p,{className:`h-32`})]}),t[15]=e):e=t[15],e}let b=d.run;if(!b){let e;t[16]===d.task.name?e=t[17]:(e=(0,O.jsx)(`h2`,{className:`text-lg font-medium text-fg`,children:d.task.name}),t[16]=d.task.name,t[17]=e);let n=a?`这条旧链接没有关联具体执行,请从任务的运行记录查看。`:`This older link does not identify an execution. Choose one from the task history.`,r;t[18]===n?r=t[19]:(r=(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n}),t[18]=n,t[19]=r);let i;return t[20]!==e||t[21]!==r?(i=(0,O.jsxs)(`div`,{className:`space-y-3`,children:[e,r]}),t[20]=e,t[21]=r,t[22]=i):i=t[22],i}let x;t[23]===d.task.name?x=t[24]:(x=(0,O.jsx)(`h2`,{className:`text-lg font-medium text-fg`,children:d.task.name}),t[23]=d.task.name,t[24]=x);let S;t[25]===i?S=t[26]:(S=s(i),t[25]=i,t[26]=S);let C=S.automations.status[b.status],E;t[27]!==b.createdAtMs||t[28]!==a?(E=new Date(b.createdAtMs).toLocaleString(a?`zh-CN`:`en-US`),t[27]=b.createdAtMs,t[28]=a,t[29]=E):E=t[29];let A;t[30]!==C||t[31]!==E?(A=(0,O.jsxs)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:[C,` · `,E]}),t[30]=C,t[31]=E,t[32]=A):A=t[32];let P;t[33]!==x||t[34]!==A?(P=(0,O.jsxs)(`div`,{className:`space-y-2`,children:[x,A]}),t[33]=x,t[34]=A,t[35]=P):P=t[35];let F;t[36]!==b.status||t[37]!==a?(F=b.status===`queued`?(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`任务正在排队,开始后会自动更新。`:`Queued. This view updates when execution starts.`}):b.status===`running`?(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`正在执行,结果会自动显示在这里。`:`Running. The result will appear here automatically.`}):null,t[36]=b.status,t[37]=a,t[38]=F):F=t[38];let I;t[39]===b.summary?I=t[40]:(I=b.summary?(0,O.jsx)(f,{content:b.summary}):null,t[39]=b.summary,t[40]=I);let L;t[41]!==i||t[42]!==b?(L=b.error?(0,O.jsx)(`p`,{className:`text-sm leading-6 text-danger`,children:T(b,i)}):null,t[41]=i,t[42]=b,t[43]=L):L=t[43];let R;t[44]!==n||t[45]!==i||t[46]!==b.id||t[47]!==b.status?(R=b.status===`failed`||b.status===`timeout`?(0,O.jsx)(y,{automationId:n,runId:b.id,language:i,variant:`secondary`}):null,t[44]=n,t[45]=i,t[46]=b.id,t[47]=b.status,t[48]=R):R=t[48];let z;t[49]!==i||t[50]!==b.id||t[51]!==b.status?(z=k.has(b.status)?null:(0,O.jsx)(w,{runId:b.id,language:i}),t[49]=i,t[50]=b.id,t[51]=b.status,t[52]=z):z=t[52];let ee;return t[53]!==F||t[54]!==I||t[55]!==L||t[56]!==R||t[57]!==z||t[58]!==P?(ee=(0,O.jsxs)(`div`,{className:`space-y-5`,children:[P,F,I,L,R,z]}),t[53]=F,t[54]=I,t[55]=L,t[56]=R,t[57]=z,t[58]=P,t[59]=ee):ee=t[59],ee}function j(e){return e&&(e.task.state.runningRunId||e.run&&k.has(e.run.status))?3e3:0}function M(e){return e.run}function N(e){return e.language}var P=`rounded text-sm text-accent-fg hover:underline focus-visible:ring-2 focus-visible:ring-accent`,F=e=>e.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`);function I(e){let t=(0,D.c)(83),{project:i,target:c}=e,l=o(re),m=a(B),_=r(),v=l===`zh`,y;t[0]===l?y=t[1]:(y=s(l),t[0]=l,t[1]=y);let b=y.projectDetailPage,x;t[2]!==c.id||t[3]!==m?(x=[`chat-project-operating-view`,c.id,m],t[2]=c.id,t[3]=m,t[4]=x):x=t[4];let S;t[5]===c.id?S=t[6]:(S=()=>h(c.id),t[5]=c.id,t[6]=S);let C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C={shouldRetryOnError:!1},t[7]=C):C=t[7];let{data:w,error:T,isLoading:k,mutate:A}=g(x,S,C),j=`${_.pathname}${_.search}`,M=`/projects/${encodeURIComponent(c.id)}`,N;t[8]!==j||t[9]!==M||t[10]!==c.ownerAgentId?(N=e=>{let t=new URLSearchParams;return c.ownerAgentId&&t.set(`agentId`,c.ownerAgentId),u(`${M}/${e}${t.size?`?${t}`:``}`,j)},t[8]=j,t[9]=M,t[10]=c.ownerAgentId,t[11]=N):N=t[11];let I=N,V;t[12]===j?V=t[13]:(V=e=>d(j,e),t[12]=j,t[13]=V);let H=V,U,W,G,K,q,J,Y;if(t[14]!==T||t[15]!==k||t[16]!==A||t[17]!==b||t[18]!==i||t[19]!==I||t[20]!==H||t[21]!==w||t[22]!==v){let e=w?.tasks??[],r={moving:0,ready:0,waiting:0,needsUser:0,done:0};for(let t of e)t.phase===`closed`?t.resolution===`done`&&(r.done+=1):F(t)?r.needsUser+=1:[`queued`,`running`,`verifying`].includes(t.operationalState)?r.moving+=1:[`waiting`,`blocked`].includes(t.operationalState)?r.waiting+=1:r.ready+=1;let a={moving:v?`进行中`:`In progress`,ready:v?`待处理`:`To do`,waiting:v?`等待中`:`Waiting`,needsUser:v?`等你处理`:`Needs you`,done:v?`已完成`:`Completed`},o=new Set(e.filter(ne).map(te)),s=(w?.blockers??[]).filter(e=>o.has(e.taskId)).sort(ee),c=s.filter((e,t)=>s.findIndex(t=>t.taskId===e.taskId)===t).slice(0,2),l=E(e,e.length).sort(z).slice(0,3),u=[...(i.recentUpdates??[]).map((e,t)=>({id:`update:${e.id??t}`,source:`project`,summary:e.summary,at:e.createdAt,title:v?`项目进展`:`Project update`,href:I(`progress`)})),...(w?.recentResults??[]).map(e=>{let{taskId:t,taskTitle:n,receipt:r}=e;return{id:`receipt:${r.runId}`,source:`task:${t}`,summary:r.summary,at:r.finalizedAt,title:`${n} · ${v?{passed:`验证通过`,failed:`验证失败`,unverified:`未验证`}[r.verification.status]:r.verification.status}`,href:H(t)}})].filter(R).sort(L),d=u.filter((e,t)=>u.findIndex(t=>t.source===e.source&&t.summary.trim()===e.summary.trim())===t).slice(0,3),m;t[30]===v?m=t[31]:(m=e=>e===void 0||!Number.isFinite(new Date(e).getTime())?null:new Intl.DateTimeFormat(v?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(new Date(e)),t[30]=v,t[31]=m);let h=m,g=i.lastActiveAt||i.updatedAt,_;t[32]!==h||t[33]!==g?(_=h(g),t[32]=h,t[33]=g,t[34]=_):_=t[34];let y=_,x=i.outcome||i.description||i.brief,S=v?`项目健康度尚未评估`:`Project health not assessed`,C=v?`进展正常`:`On track`,D=v?`存在风险`:`At risk`,j=v?`偏离计划`:`Off track`,M;t[35]!==S||t[36]!==C||t[37]!==D||t[38]!==j?(M={unknown:S,on_track:C,at_risk:D,off_track:j},t[35]=S,t[36]=C,t[37]=D,t[38]=j,t[39]=M):M=t[39];let N=M;U=`space-y-5`;let B;t[40]===i.name?B=t[41]:(B=(0,O.jsx)(`h2`,{className:`min-w-0 break-words text-xl font-semibold text-fg`,children:i.name}),t[40]=i.name,t[41]=B);let re=b.statuses[i.status],V;t[42]===re?V=t[43]:(V=(0,O.jsx)(`span`,{className:`shrink-0 rounded-md bg-surface-inset px-2 py-1 text-xs text-fg-muted`,children:re}),t[42]=re,t[43]=V);let X;t[44]!==B||t[45]!==V?(X=(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[B,V]}),t[44]=B,t[45]=V,t[46]=X):X=t[46];let Z;t[47]!==x||t[48]!==v?(Z=x?(0,O.jsx)(`div`,{className:`line-clamp-3 text-sm text-fg-muted`,children:(0,O.jsx)(f,{content:x,mermaidActions:!1})}):(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:v?`尚未填写项目目标。`:`No project goal recorded yet.`}),t[47]=x,t[48]=v,t[49]=Z):Z=t[49];let ie=N[i.health],ae=y?` · ${v?`最近活动`:`Last activity`} ${y}`:``,Q;t[50]!==ie||t[51]!==ae?(Q=(0,O.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[ie,ae]}),t[50]=ie,t[51]=ae,t[52]=Q):Q=t[52],t[53]!==X||t[54]!==Z||t[55]!==Q?(W=(0,O.jsxs)(`div`,{className:`space-y-2`,children:[X,Z,Q]}),t[53]=X,t[54]=Z,t[55]=Q,t[56]=W):W=t[56];let oe=v?`当前概况`:`Overview`,se=v?`当前概况`:`Overview`,$;t[57]===se?$=t[58]:($=(0,O.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:se}),t[57]=se,t[58]=$);let ce=k?(0,O.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-3`,children:[(0,O.jsx)(p,{className:`h-4 w-3/4`}),(0,O.jsx)(p,{className:`h-14 w-full`})]}):T||!w?(0,O.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 text-sm text-fg-muted`,children:[(0,O.jsx)(`span`,{children:v?`任务概况暂时无法读取。`:`Task overview is temporarily unavailable.`}),(0,O.jsx)(`button`,{type:`button`,onClick:()=>void A(),className:P,children:v?`重试`:`Retry`})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:e.length===0?v?`尚未关联任务,可在项目中添加下一步工作。`:`No tasks linked yet. Add the next piece of work in the project.`:v?`${r.moving} 项任务正在推进,${r.needsUser} 项等你处理,${r.waiting} 项等待中。`:`${r.moving} in progress, ${r.needsUser} need your input, ${r.waiting} waiting.`}),w.digest.recommendedAction&&(0,O.jsxs)(`p`,{className:`break-words text-sm leading-6 text-fg-muted`,children:[v?`建议下一步:`:`Suggested next step: `,w.digest.recommendedAction]}),(0,O.jsx)(`dl`,{className:`grid grid-cols-3 gap-3 border-t border-edge pt-3 sm:grid-cols-5`,children:Object.keys(a).map(e=>(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{className:`text-xs text-fg-muted`,children:a[e]}),(0,O.jsx)(`dd`,{className:`mt-1 text-xl font-semibold tabular-nums text-fg`,children:r[e]})]},e))})]});t[59]!==oe||t[60]!==$||t[61]!==ce?(G=(0,O.jsxs)(`section`,{"aria-label":oe,className:`space-y-3 rounded-xl border border-edge bg-surface-inset/50 p-4`,children:[$,ce]}),t[59]=oe,t[60]=$,t[61]=ce,t[62]=G):G=t[62],K=w&&(0,O.jsxs)(`div`,{className:`grid gap-6 sm:grid-cols-2`,children:[(0,O.jsxs)(`section`,{className:`min-w-0 space-y-3`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:v?`优先关注`:`Needs attention`}),c.length?(0,O.jsx)(`ul`,{className:`divide-y divide-edge`,children:c.map(e=>(0,O.jsx)(`li`,{className:`py-3 first:pt-0`,children:(0,O.jsxs)(n,{to:H(e.taskId),className:`block rounded-lg focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,O.jsx)(`p`,{className:`break-words text-sm font-medium text-fg`,children:e.title}),(0,O.jsx)(`p`,{className:`mt-1 line-clamp-3 break-words text-sm leading-6 text-fg-muted`,children:e.detail}),(0,O.jsx)(`span`,{className:`mt-2 inline-block ${P}`,children:v?`查看关联任务 →`:`View task →`})]})},e.taskId))}):(0,O.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:v?`暂无已记录的阻塞或待处理提醒。`:`No recorded blockers or attention items.`})]}),(0,O.jsxs)(`section`,{className:`min-w-0 space-y-3`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:v?`当前任务`:`Current tasks`}),(0,O.jsx)(n,{to:I(`tasks`),className:P,children:v?`查看全部`:`View all`})]}),l.length?(0,O.jsx)(`ul`,{className:`divide-y divide-edge`,children:l.map(e=>(0,O.jsx)(`li`,{children:(0,O.jsxs)(n,{to:H(e.id),className:`block rounded-lg py-3 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,O.jsx)(`p`,{className:`break-words text-sm font-medium text-fg`,children:e.title}),(0,O.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[b.board.phases[e.phase],e.operationalState===`idle`?``:` · ${b.board.operationalStates[e.operationalState]}`]})]})},e.id))}):(0,O.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:v?`暂无可推进的任务,等待中的任务可在全部任务中查看。`:`No actionable tasks. View all tasks to see any waiting work.`})]})]}),q=`space-y-3 border-t border-edge pt-5`;let le=v?`最近进展`:`Recent progress`,ue;t[63]===le?ue=t[64]:(ue=(0,O.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:le}),t[63]=le,t[64]=ue);let de;t[65]===I?de=t[66]:(de=I(`progress`),t[65]=I,t[66]=de);let fe=v?`查看记录`:`View history`,pe;t[67]!==de||t[68]!==fe?(pe=(0,O.jsx)(n,{to:de,className:P,children:fe}),t[67]=de,t[68]=fe,t[69]=pe):pe=t[69],t[70]!==ue||t[71]!==pe?(J=(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[ue,pe]}),t[70]=ue,t[71]=pe,t[72]=J):J=t[72],Y=d.length?(0,O.jsx)(`ul`,{className:`divide-y divide-edge-subtle`,children:d.map(e=>(0,O.jsxs)(`li`,{className:`space-y-2 py-3 first:pt-0`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-2`,children:[(0,O.jsxs)(`p`,{className:`min-w-0 break-words text-xs text-fg-muted`,children:[e.title,h(e.at)?` · ${h(e.at)}`:``]}),(0,O.jsx)(n,{to:e.href,className:P,children:v?`查看来源`:`View source`})]}),(0,O.jsx)(`div`,{className:`line-clamp-3 break-words text-sm text-fg`,children:(0,O.jsx)(f,{content:e.summary,mermaidActions:!1})})]},e.id))}):(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:v?`暂无项目进展或执行结果。`:`No project updates or execution results yet.`}),t[14]=T,t[15]=k,t[16]=A,t[17]=b,t[18]=i,t[19]=I,t[20]=H,t[21]=w,t[22]=v,t[23]=U,t[24]=W,t[25]=G,t[26]=K,t[27]=q,t[28]=J,t[29]=Y}else U=t[23],W=t[24],G=t[25],K=t[26],q=t[27],J=t[28],Y=t[29];let X;t[73]!==q||t[74]!==J||t[75]!==Y?(X=(0,O.jsxs)(`section`,{className:q,children:[J,Y]}),t[73]=q,t[74]=J,t[75]=Y,t[76]=X):X=t[76];let Z;return t[77]!==U||t[78]!==W||t[79]!==G||t[80]!==K||t[81]!==X?(Z=(0,O.jsxs)(`div`,{className:U,children:[W,G,K,X]}),t[77]=U,t[78]=W,t[79]=G,t[80]=K,t[81]=X,t[82]=Z):Z=t[82],Z}function L(e,t){return(t.at||0)-(e.at||0)}function R(e){return e.summary?.trim()}function z(e,t){return Number([`queued`,`running`,`verifying`].includes(t.operationalState))-Number([`queued`,`running`,`verifying`].includes(e.operationalState))}function ee(e,t){return Number([`input_required`,`approval_required`].includes(t.kind))-Number([`input_required`,`approval_required`].includes(e.kind))}function te(e){return e.id}function ne(e){return e.phase!==`closed`}function B(e){return e.conversationId}function re(e){return e.language}async function V(e){switch(e.kind){case`project`:return{kind:e.kind,value:await m(e.id)};case`automation`:{let[t,n]=await Promise.all([v.list(),v.runs(5,e.id)]);return{kind:e.kind,value:t.automations.find(t=>t.id===e.id),runs:n.runs}}case`local_app`:{let t=await x(e.id),n=e.sourceHash?await b(e.id,e.sourceHash):void 0;return{kind:e.kind,value:t,previewUrl:n?.previewUrl||t.draftPreviewUrl}}}}var H={pending:[`等待中`,`Pending`],planned:[`计划中`,`Planned`],active:[`进行中`,`Active`],paused:[`已暂停`,`Paused`],completed:[`已完成`,`Completed`],cancelled:[`已取消`,`Cancelled`],archived:[`已归档`,`Archived`],queued:[`排队中`,`Queued`],running:[`运行中`,`Running`],succeeded:[`成功`,`Succeeded`],failed:[`失败`,`Failed`],timeout:[`超时`,`Timed out`],cancelling:[`取消中`,`Cancelling`],unknown:[`尚未评估`,`Not assessed`],on_track:[`进展正常`,`On track`],at_risk:[`存在风险`,`At risk`],off_track:[`偏离计划`,`Off track`]};function U(e){let t=(0,D.c)(5),{target:n}=e;if(n.kind===`automation`&&n.view===`run`){let e;return t[0]!==n.id||t[1]!==n.runId?(e=(0,O.jsx)(A,{automationId:n.id,runId:n.runId}),t[0]=n.id,t[1]=n.runId,t[2]=e):e=t[2],e}let r;return t[3]===n?r=t[4]:(r=(0,O.jsx)(W,{target:n}),t[3]=n,t[4]=r),r}function W(e){let t=(0,D.c)(56),{target:r}=e,u=a(J),d=o(q),f=d===`zh`,p=s(d),m;t[0]===f?m=t[1]:(m=e=>H[e]?.[+!f]||e,t[0]=f,t[1]=m);let h=m,_;t[2]!==r.href||t[3]!==u?(_=[`chat-product-preview`,r.href,u],t[2]=r.href,t[3]=u,t[4]=_):_=t[4];let v;t[5]===r?v=t[6]:(v=()=>V(r),t[5]=r,t[6]=v);let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y={shouldRetryOnError:!1,refreshInterval:K},t[7]=y):y=t[7];let{data:b,error:x,isLoading:w}=g(_,v,y);if(w){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,O.jsx)(S,{}),t[8]=e):e=t[8],e}if(x){let e=f?`无法加载内容,它可能已删除或暂时不可用。`:`Unable to load this content. It may have been deleted or be temporarily unavailable.`,n;return t[9]===e?n=t[10]:(n=(0,O.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:e}),t[9]=e,t[10]=n),n}if(!b?.value){let e=f?`内容不存在或已删除。`:`This content is unavailable or has been deleted.`,n;return t[11]===e?n=t[12]:(n=(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e}),t[11]=e,t[12]=n),n}let T=G;if(b.kind===`project`){let e;return t[13]!==b.value||t[14]!==r?(e=(0,O.jsx)(I,{project:b.value,target:r}),t[13]=b.value,t[14]=r,t[15]=e):e=t[15],e}if(b.kind===`automation`){let e=b.value,n=e.action.kind===`agent`?e.action.instruction:void 0,r;t[16]===e.name?r=t[17]:(r=(0,O.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:e.name}),t[16]=e.name,t[17]=r);let i;t[18]!==e.description||t[19]!==T?(i=T(e.description),t[18]=e.description,t[19]=T,t[20]=i):i=t[20];let a;t[21]!==n||t[22]!==T?(a=T(n),t[21]=n,t[22]=T,t[23]=a):a=t[23];let o;t[24]!==e.state.nextRunAtMs||t[25]!==f?(o=e.state.nextRunAtMs&&(0,O.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[f?`下次运行`:`Next run`,` · `,new Date(e.state.nextRunAtMs).toLocaleString(f?`zh-CN`:`en-US`)]}),t[24]=e.state.nextRunAtMs,t[25]=f,t[26]=o):o=t[26];let s;t[27]===e.state.lastError?s=t[28]:(s=e.state.lastError&&(0,O.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:e.state.lastError}),t[27]=e.state.lastError,t[28]=s);let u=f?`最近运行`:`Recent runs`,m;t[29]===u?m=t[30]:(m=(0,O.jsx)(`h3`,{className:`font-medium text-fg`,children:u}),t[29]=u,t[30]=m);let g;t[31]!==b.runs||t[32]!==T||t[33]!==h||t[34]!==f?(g=b.runs.length?b.runs.map(e=>(0,O.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-edge p-3`,children:[(0,O.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[h(e.status),` · `,new Date(e.createdAtMs).toLocaleString(f?`zh-CN`:`en-US`)]}),T(e.summary),e.error&&(0,O.jsx)(`p`,{className:`text-sm text-danger`,children:e.error})]},e.id)):(0,O.jsx)(`p`,{className:`text-sm text-fg-muted`,children:f?`暂无运行记录。`:`No runs yet.`}),t[31]=b.runs,t[32]=T,t[33]=h,t[34]=f,t[35]=g):g=t[35];let _;return t[36]!==m||t[37]!==g?(_=(0,O.jsxs)(`section`,{className:`space-y-3`,children:[m,g]}),t[36]=m,t[37]=g,t[38]=_):_=t[38],(0,O.jsxs)(`div`,{className:`space-y-6`,children:[(0,O.jsxs)(`div`,{className:`space-y-3`,children:[r,(0,O.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[l(e)?f?`已完成`:`Completed`:e.enabled?f?`已启用`:`Enabled`:f?`已暂停`:`Paused`,` · `,c(e.trigger,p.automations,p.cron,d)]}),i,a,o,s]}),_]})}let E=b.value,k;t[39]===E.name?k=t[40]:(k=(0,O.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:E.name}),t[39]=E.name,t[40]=k);let A=E.description||E.idea,j;t[41]!==T||t[42]!==A?(j=T(A),t[41]=T,t[42]=A,t[43]=j):j=t[43];let M;t[44]!==E.name||t[45]!==b.previewUrl||t[46]!==f?(M=b.previewUrl&&(0,O.jsx)(`iframe`,{title:f?`${E.name} 交互预览`:`${E.name} interactive preview`,src:i(b.previewUrl),sandbox:`allow-scripts allow-forms`,className:`h-[min(30rem,55dvh)] w-full rounded-lg border border-edge bg-white`}),t[44]=E.name,t[45]=b.previewUrl,t[46]=f,t[47]=M):M=t[47];let N;t[48]!==E||t[49]!==f?(N=E.installationState===`installed`&&E.enabled&&E.status===`installed`&&(0,O.jsx)(n,{to:C(E),className:`inline-flex rounded-lg bg-accent px-3 py-2 text-sm text-white focus-visible:ring-2 focus-visible:ring-accent`,children:f?`使用应用`:`Use app`}),t[48]=E,t[49]=f,t[50]=N):N=t[50];let P;return t[51]!==k||t[52]!==j||t[53]!==M||t[54]!==N?(P=(0,O.jsxs)(`div`,{className:`space-y-5`,children:[k,j,M,N]}),t[51]=k,t[52]=j,t[53]=M,t[54]=N,t[55]=P):P=t[55],P}function G(e){return e?.trim()?(0,O.jsx)(f,{content:e,mermaidActions:!1}):null}function K(e){return e?.kind===`automation`&&e.value?.state.runningRunId?3e3:0}function q(e){return e.language}function J(e){return e.conversationId}export{U as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/product-preview-content-CsdXwIxP.js","assets/vendor-react-BOUWij0V.js","assets/rolldown-runtime-aKtaBQYM.js","assets/chunk-KS7C4IRE-DbzE-1bp.js","assets/preload-helper-Czpn1I53.js","assets/locale-store-B4o4aDCg.js","assets/messages-hlOsXkQ7.js","assets/automation-display-DaVDNZz8.js","assets/createLucideIcon-DPHK1VkS.js","assets/markdown-view-BpBBv9Gr.js","assets/diagnostics-Bo0Z42P_.js","assets/dist-DlirbHVs.js","assets/es2015-CFqg57eW.js","assets/dist-CDSvxjOh.js","assets/download-Dk-ZjtO6.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.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/skeleton-DzdOeGYz.js","assets/api-D0r-2gWQ.js","assets/tasks-BIehlq7k.js","assets/turn-outcome-BSbEJx8h.js","assets/specialists-xbB3xL9e.js","assets/files-GdwDamkp.js","assets/vendor-swr-CdRzEUwF.js","assets/button-C5tRaJxt.js","assets/automation-api-CxLFngqe.js","assets/automation-task-card-f5_tNbzB.js","assets/chevron-down-ccbiQQz_.js","assets/chevron-right-BweFrslA.js","assets/popover-select-hRG1EzAY.js","assets/check-DUBLcKHA.js","assets/dist-BSVQC3i_.js","assets/dist-DSRLZhL9.js","assets/floating-ui.dom-CiMnRY5O.js","assets/floating-ui.react-dom-Gx6CM22l.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/message-circle-Badhj-4D.js","assets/pencil-DmIY3Oa-.js","assets/chat-agents-api-B-47bqbd.js","assets/gateway-config-swr-2VOPSLSq.js","assets/agent-avatar-display-BDHjRaTK.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/agent-display-names-Bje7vfSn.js","assets/model-selector-RNPw-Mz4.js","assets/settings-2-D-csvaET.js","assets/registry-api-CmLu4MA9.js","assets/gateway-startup-retry-D0i7dt51.js","assets/open-capability-settings-DQsmJxI7.js","assets/interaction-BdhHBbYa.js","assets/form-field-width-DJw_jULe.js","assets/model-sort-_Tz8s_4N.js","assets/date-picker-BWrSxZf1.js","assets/calendar-days-hw_Y-g-s.js","assets/chevron-left-DqFhpbvK.js","assets/time-picker-otHjbob1.js","assets/clock-3-DnrAnuyZ.js","assets/api-oA0NOKLI.js","assets/open-route-MyZ2sB9C.js","assets/automation-result-state-CjiuyW-C.js","assets/project-overview-model-DrLXaO-t.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{t as a}from"./chunk-KS7C4IRE-DbzE-1bp.js";import{n as o}from"./locale-store-B4o4aDCg.js";import{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./dist-DlirbHVs.js";import{t as m}from"./external-link-DjqjBmc3.js";import{H as h}from"./markdown-view-BpBBv9Gr.js";import{t as g}from"./x-B_N4OPjy.js";import{t as _}from"./skeleton-DzdOeGYz.js";import{i as v}from"./vendor-swr-CdRzEUwF.js";import{t as y}from"./button-C5tRaJxt.js";import{t as b}from"./automation-api-CxLFngqe.js";import{r as x}from"./automation-task-card-f5_tNbzB.js";var S=n(),C=e(t(),1),w=r(),T=(0,C.lazy)(()=>i(()=>import(`./product-preview-content-CsdXwIxP.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70]))),E={project:[`项目预览`,`Project preview`],automation:[`自动化详情`,`Automation details`],local_app:[`应用预览`,`App preview`]};function D(){let e=(0,S.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsxs)(`div`,{className:`space-y-4`,"aria-busy":`true`,children:[(0,w.jsx)(_,{className:`h-7 w-2/3`}),(0,w.jsx)(_,{className:`h-4 w-full`}),(0,w.jsx)(_,{className:`h-4 w-4/5`}),(0,w.jsx)(_,{className:`h-32 w-full`})]}),e[0]=t):t=e[0],t}function O(e){let t=(0,S.c)(8),{target:n,backgroundPath:r,onClose:i}=e;if(n.kind===`automation`&&n.view!==`run`){let e;return t[0]!==r||t[1]!==i||t[2]!==n?(e=(0,w.jsx)(k,{target:n,backgroundPath:r,onClose:i}),t[0]=r,t[1]=i,t[2]=n,t[3]=e):e=t[3],e}let a;return t[4]!==r||t[5]!==i||t[6]!==n?(a=(0,w.jsx)(j,{target:n,backgroundPath:r,onClose:i}),t[4]=r,t[5]=i,t[6]=n,t[7]=a):a=t[7],a}function k(e){let t=(0,S.c)(34),{target:n,backgroundPath:r,onClose:i}=e,a=o(A),l,m;t[0]===n.id?(l=t[1],m=t[2]):(l=[`automation-card`,n.id],m=()=>b.get(n.id),t[0]=n.id,t[1]=l,t[2]=m);let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h={revalidateOnFocus:!1,shouldRetryOnError:!1},t[3]=h):h=t[3];let{data:g,error:_,mutate:C}=v(l,m,h);if(g?.automation){if(g.automation.action.kind===`agent`&&!g.automation.management){let e;return t[4]!==g.automation||t[5]!==a||t[6]!==i?(e=(0,w.jsx)(x,{automation:g.automation,language:a,onClose:i}),t[4]=g.automation,t[5]=a,t[6]=i,t[7]=e):e=t[7],e}let e;return t[8]!==r||t[9]!==i||t[10]!==n?(e=(0,w.jsx)(j,{target:n,backgroundPath:r,onClose:i}),t[8]=r,t[9]=i,t[10]=n,t[11]=e):e=t[11],e}let T=a===`zh`,E;t[12]===i?E=t[13]:(E=e=>{e||i()},t[12]=i,t[13]=E);let O;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,w.jsx)(s,{className:`fixed inset-0 z-65 bg-scrim`}),t[14]=O):O=t[14];let k=T?`定时任务详情`:`Scheduled task details`,M;t[15]===k?M=t[16]:(M=(0,w.jsx)(f,{className:`mb-5 font-medium`,children:k}),t[15]=k,t[16]=M);let N=T?`查看和编辑定时任务。`:`View and edit the scheduled task.`,P;t[17]===N?P=t[18]:(P=(0,w.jsx)(c,{className:`sr-only`,children:N}),t[17]=N,t[18]=P);let F;t[19]!==_||t[20]!==C||t[21]!==T?(F=_?(0,w.jsxs)(`div`,{role:`alert`,className:`text-sm text-fg-muted`,children:[(0,w.jsx)(`p`,{children:T?`任务已不存在或暂时无法读取。`:`This task is unavailable.`}),(0,w.jsx)(y,{variant:`secondary`,onClick:()=>void C(),children:T?`重试`:`Retry`})]}):(0,w.jsx)(D,{}),t[19]=_,t[20]=C,t[21]=T,t[22]=F):F=t[22];let I=T?`关闭`:`Close`,L;t[23]!==i||t[24]!==I?(L=(0,w.jsx)(y,{className:`mt-auto self-end`,variant:`ghost`,onClick:i,children:I}),t[23]=i,t[24]=I,t[25]=L):L=t[25];let R;t[26]!==F||t[27]!==L||t[28]!==M||t[29]!==P?(R=(0,w.jsxs)(u,{children:[O,(0,w.jsxs)(d,{className:`fixed left-1/2 top-1/2 z-70 flex h-[min(600px,calc(100dvh-2rem))] w-[min(680px,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay p-5`,children:[M,P,F,L]})]}),t[26]=F,t[27]=L,t[28]=M,t[29]=P,t[30]=R):R=t[30];let z;return t[31]!==R||t[32]!==E?(z=(0,w.jsx)(p,{open:!0,onOpenChange:E,children:R}),t[31]=R,t[32]=E,t[33]=z):z=t[33],z}function A(e){return e.language}function j(e){let t=(0,S.c)(34),{target:n,backgroundPath:r,onClose:i}=e,_=o(M)===`zh`,v=n.kind===`project`?`w-[min(55rem,calc(100vw-2rem))]`:`w-[min(52rem,calc(100vw-2rem))]`,y=n.kind===`automation`&&n.view===`run`?_?`运行情况`:`Run progress`:E[n.kind][+!_],b;t[0]===i?b=t[1]:(b=e=>{e||i()},t[0]=i,t[1]=b);let x;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,w.jsx)(s,{className:`fixed inset-0 z-[80] bg-black/45 backdrop-blur-[1px]`}),t[2]=x):x=t[2];let O=`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(48rem,calc(100dvh-2rem))] ${v} -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay focus:outline-none`,k;t[3]===y?k=t[4]:(k=(0,w.jsx)(f,{className:`min-w-0 flex-1 truncate font-medium text-fg`,children:y}),t[3]=y,t[4]=k);let A=_?`查看关联内容,或打开独立页面。`:`Preview related content or open its full page.`,j;t[5]===A?j=t[6]:(j=(0,w.jsx)(c,{className:`sr-only`,children:A}),t[5]=A,t[6]=j);let N;t[7]!==r||t[8]!==n.href||t[9]!==n.view||t[10]!==_?(N=n.view!==`run`&&(0,w.jsxs)(a,{to:h(n.href,r),className:`flex shrink-0 items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm text-accent hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,w.jsx)(m,{className:`size-4`,"aria-hidden":!0}),_?`打开独立页面`:`Open full page`]}),t[7]=r,t[8]=n.href,t[9]=n.view,t[10]=_,t[11]=N):N=t[11];let P=_?`关闭预览`:`Close preview`,F=_?`关闭预览`:`Close preview`,I;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,w.jsx)(g,{className:`size-4`,"aria-hidden":!0}),t[12]=I):I=t[12];let L;t[13]!==P||t[14]!==F?(L=(0,w.jsx)(l,{title:P,"aria-label":F,className:`flex size-8 shrink-0 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:I}),t[13]=P,t[14]=F,t[15]=L):L=t[15];let R;t[16]!==L||t[17]!==k||t[18]!==j||t[19]!==N?(R=(0,w.jsxs)(`header`,{className:`flex shrink-0 items-center gap-3 border-b border-edge bg-surface-panel px-5 py-3.5`,children:[k,j,N,L]}),t[16]=L,t[17]=k,t[18]=j,t[19]=N,t[20]=R):R=t[20];let z=`min-h-0 flex-1 overflow-y-auto overscroll-contain p-5 ${n.kind===`project`?`sm:p-6`:`sm:p-8`}`,B;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,w.jsx)(D,{}),t[21]=B):B=t[21];let V;t[22]===n?V=t[23]:(V=(0,w.jsx)(C.Suspense,{fallback:B,children:(0,w.jsx)(T,{target:n},n.href)}),t[22]=n,t[23]=V);let H;t[24]!==z||t[25]!==V?(H=(0,w.jsx)(`div`,{className:z,children:V}),t[24]=z,t[25]=V,t[26]=H):H=t[26];let U;t[27]!==R||t[28]!==H||t[29]!==O?(U=(0,w.jsxs)(u,{children:[x,(0,w.jsxs)(d,{className:O,children:[R,H]})]}),t[27]=R,t[28]=H,t[29]=O,t[30]=U):U=t[30];let W;return t[31]!==b||t[32]!==U?(W=(0,w.jsx)(p,{open:!0,onOpenChange:b,children:U}),t[31]=b,t[32]=U,t[33]=W):W=t[33],W}function M(e){return e.language}export{D as n,O as t};
|