@xopcai/xopc 0.0.463 → 0.0.465
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/sidepanel.js +5 -0
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/adapters/cli-login.js +23 -49
- package/dist/extensions/feishu/src/adapters/gateway-setup.d.ts +3 -0
- package/dist/extensions/feishu/src/adapters/gateway-setup.js +180 -128
- package/dist/extensions/feishu/src/adapters/onboard-cli.d.ts +1 -1
- package/dist/extensions/feishu/src/adapters/onboard-cli.js +27 -15
- package/dist/extensions/feishu/src/auth/app-registration.d.ts +1 -0
- package/dist/extensions/feishu/src/auth/app-registration.js +12 -9
- package/dist/extensions/feishu/src/outbound/outbound-adapter.js +40 -16
- package/dist/extensions/feishu/src/plugin.d.ts +2 -0
- package/dist/extensions/feishu/src/plugin.js +37 -23
- package/dist/extensions/feishu/src/status/status-adapter.d.ts +1 -1
- package/dist/extensions/feishu/src/status/status-adapter.js +8 -5
- package/dist/extensions/feishu/src/streaming/streaming-adapter.js +97 -69
- package/dist/extensions/feishu/src/transport/client/bot-info.d.ts +10 -0
- package/dist/extensions/feishu/src/transport/client/bot-info.js +34 -0
- package/dist/extensions/feishu/src/transport/client/client.d.ts +7 -1
- package/dist/extensions/feishu/src/transport/client/client.js +6 -5
- package/dist/extensions/feishu/src/transport/client/install-sdk.d.ts +2 -0
- package/dist/extensions/feishu/src/transport/client/install-sdk.js +77 -0
- package/dist/extensions/feishu/src/transport/client/lark-sdk.d.ts +2 -0
- package/dist/extensions/feishu/src/transport/client/lark-sdk.js +27 -3
- package/dist/extensions/feishu/src/transport/client/sdk-catalog.d.ts +1 -0
- package/dist/extensions/feishu/src/transport/client/sdk-catalog.js +317 -0
- package/dist/extensions/feishu/src/transport/reliability/inbound-pipeline.d.ts +1 -1
- package/dist/extensions/feishu/src/transport/reliability/inbound-pipeline.js +13 -5
- package/dist/extensions/feishu/src/transport/reliability/message-ingress.d.ts +21 -0
- package/dist/extensions/feishu/src/transport/reliability/message-ingress.js +313 -0
- package/dist/extensions/feishu/src/transport/socket-mode/monitor.d.ts +1 -0
- package/dist/extensions/feishu/src/transport/socket-mode/monitor.js +56 -171
- package/dist/extensions/feishu/src/transport/webhook/monitor.d.ts +1 -0
- package/dist/extensions/feishu/src/transport/webhook/monitor.js +10 -102
- package/dist/extensions/telegram/src/account-manager.d.ts +1 -0
- package/dist/extensions/telegram/src/account-manager.js +3 -0
- package/dist/extensions/telegram/src/adapters/debounce-keys.js +7 -2
- package/dist/extensions/telegram/src/adapters/gateway-setup.js +113 -63
- package/dist/extensions/telegram/src/adapters/streaming-adapter.js +8 -4
- package/dist/extensions/telegram/src/doctor.js +1 -1
- package/dist/extensions/telegram/src/inbound-coalescer.d.ts +8 -6
- package/dist/extensions/telegram/src/inbound-coalescer.js +47 -88
- package/dist/extensions/telegram/src/inbound-processor.js +5 -1
- package/dist/extensions/telegram/src/outbound-sender.js +16 -23
- package/dist/extensions/telegram/src/plugin.js +80 -57
- package/dist/extensions/telegram/src/polling-session.d.ts +3 -6
- package/dist/extensions/telegram/src/polling-session.js +107 -94
- package/dist/extensions/telegram/src/rich-message.d.ts +4 -0
- package/dist/extensions/telegram/src/rich-message.js +23 -0
- package/dist/extensions/telegram/src/timeout-abort.d.ts +1 -1
- package/dist/extensions/telegram/src/timeout-abort.js +9 -3
- package/dist/extensions/telegram/src/update-offset-store.d.ts +1 -0
- package/dist/extensions/telegram/src/update-offset-store.js +6 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.d.ts +1 -0
- package/dist/extensions/weixin/src/api/api.js +12 -6
- package/dist/extensions/weixin/src/api/types.d.ts +5 -2
- package/dist/extensions/weixin/src/auth/login-qr.d.ts +7 -1
- package/dist/extensions/weixin/src/auth/login-qr.js +48 -13
- package/dist/extensions/weixin/src/cdn/pic-decrypt.d.ts +2 -2
- package/dist/extensions/weixin/src/cdn/pic-decrypt.js +37 -25
- package/dist/extensions/weixin/src/cli/gateway-qr-login.d.ts +8 -0
- package/dist/extensions/weixin/src/cli/gateway-qr-login.js +45 -6
- package/dist/extensions/weixin/src/cli/qr-login.d.ts +1 -1
- package/dist/extensions/weixin/src/cli/qr-login.js +9 -3
- package/dist/extensions/weixin/src/media/media-download.d.ts +1 -0
- package/dist/extensions/weixin/src/media/media-download.js +4 -5
- package/dist/extensions/weixin/src/messaging/process-message.d.ts +2 -0
- package/dist/extensions/weixin/src/messaging/process-message.js +90 -65
- package/dist/extensions/weixin/src/messaging/quote-cache.d.ts +10 -0
- package/dist/extensions/weixin/src/messaging/quote-cache.js +46 -0
- package/dist/extensions/weixin/src/monitor/monitor.d.ts +3 -3
- package/dist/extensions/weixin/src/monitor/monitor.js +108 -104
- package/dist/extensions/weixin/src/plugin.d.ts +5 -1
- package/dist/extensions/weixin/src/plugin.js +138 -42
- package/dist/gateway/static/root/assets/{activity-store-CQHh48Zf.js → activity-store-B9heFbtJ.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CAz-Ke6Q.js → agent-avatar-dicebear-nzhB7Xjk.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-loBdGw_i.js → agent-avatar-display-DBzgoHMD.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-By2Q-6JS.js → agent-defaults-settings-panel-BJrNV93g.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-C_rlXuEe.js → agent-plugin-dialog-DLbTHALG.js} +1 -1
- package/dist/gateway/static/root/assets/agents-C2xG8f56.js +77 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-D0N09mqJ.js → agents-admin-api-CqQbYIiY.js} +1 -1
- package/dist/gateway/static/root/assets/{api-B1J5ajiP.js → api-8tNOT72p.js} +1 -1
- package/dist/gateway/static/root/assets/{api-B4FJ51EC.js → api-BGodd--L.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BHlUDZOG.js → app-management-settings-panel-Q7apF7KE.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Du5JLyV1.js → appearance-settings-ClVZeUmo.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-D1qzENN_.js → apps-page-BsJJwpKj.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BAvglLfu.js → archive-plugin-Bl_M0WJp.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-DxBmyzp0.js → automation-api-BOnIc_vw.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-CAsqgMNR.js → automation-result-state-BwDSJs05.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-BmYeWB_N.js → automation-run-list-CqlIq4BG.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-CJbIHRxN.js → automation-task-card-D3WXVKRs.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-HYFnPiNG.js → automations-page-Bimqx5Pc.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-2SOvmw-f.js +9 -0
- package/dist/gateway/static/root/assets/{binary-plugins-D2bFqG6K.js → binary-plugins-DDNKe1Io.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DrZyRQQ0.js → block-editor-BQ3amsRP.js} +5 -5
- package/dist/gateway/static/root/assets/{browser-settings-page-CGcgZOWh.js → browser-settings-page-CHf1_RVl.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-hSb-qEgL.js → capabilities-C5oWMC-Z.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-Dr-vvMez.js → capabilities-Cj8vl1ZY.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-U_hQx5ou.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-B08mjrGB.js → capabilities-settings-panel-k5CcwhXN.js} +1 -1
- package/dist/gateway/static/root/assets/channels-BUzno8Pi.js +1 -0
- package/dist/gateway/static/root/assets/chat-agents-api-C3JChTsh.js +1 -0
- package/dist/gateway/static/root/assets/{chat-chart-block-ClCZyIi0.js → chat-chart-block-DrtmYOIo.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-CalELOKj.js → chat-page-qnsMsF_s.js} +29 -29
- package/dist/gateway/static/root/assets/{chat-terminal-dock-eneTvxV3.js → chat-terminal-dock-B0D220I-.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-CP0F6sIm.js → command-palette-api-CkJ6_Yf3.js} +1 -1
- package/dist/gateway/static/root/assets/composer-handoff-params-GKGdXjMZ.js +1 -0
- package/dist/gateway/static/root/assets/{composer-model-config-control-DAagrRx_.js → composer-model-config-control-DQCOWHzJ.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-CqV6Xj-H.js → composer-notifications-D__OU_xx.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-Dc43dgSg.js → composer-payload-handoff-BBTbJ1bO.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-f-vcEpeF.js → computer-settings-page-DGRUCkOt.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-CZ-FXxaW.js → connected-providers-grid-BoDipD2g.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-Cibh2lrV.js → connection-usage-guide-B1VUqibv.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-Btz68iy8.js → connector-service-page-bwQ1PekA.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-CTuVWwBf.js → connectors-api-BvYGL65q.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-B9mpz_Rt.js → connectors-page-BX6Jt6w5.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-XnE3iFhG.js → date-picker-ClRDaNBJ.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-VGKm0HVn.js → date-time-picker-CA6H47M6.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CBm3DySQ.js → desktop-pet-Bi8Hgf-x.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-6O77QXGo.js → desktop-pet-settings-CQ6qE8lf.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-B8fGILny.js → dev-view-store-UCqQeWa2.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-qtUvtdDT.js → device-pairing-wizard-gC-XZxt2.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-ByDqf5fE.js → directory-picker-path-field-Y8snl5Xl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-authoritative-grants-BfL8dMBf.js → extension-authoritative-grants-D2abOXTl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-Bn_5xu_M.js → extension-debug-page-OOlRCInL.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-Vs6USa0c.js → extension-iframe-host-D_WXBf6a.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-BIzkukYp.js → extension-marketplace-api-Bmtm6-L1.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-GIekDj_w.js → extension-message-router-xqjjSxcp.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C_3bIjSB.js → extension-page-bpQnyNz-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-D-LolObs.js → extension-provider-l7SvHEK1.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-BvUtZGLT.js +1 -0
- package/dist/gateway/static/root/assets/{file-preview-surface-i5UOFnQF.js → file-preview-surface-B-r2ZnCV.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-1Rk0LeEM.js → gateway-config-swr-DOwezeL2.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-DIs1pjkQ.js → gateway-realtime-Br7dErHY.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-OaEqjNTb.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-DTmlcJps.js → gateway-restart-B3Xro3qd.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-ClcCloqQ.js → gateway-settings-DCnP-HPj.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-D6WPS0RW.js → gateway-startup-retry-vteSIhYI.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-BpDMnJe7.js → global-defaults-api-Bpje9rVk.js} +1 -1
- package/dist/gateway/static/root/assets/grip-horizontal-CqVA8V1e.js +1 -0
- package/dist/gateway/static/root/assets/home-page-CNEgNWEQ.js +8 -0
- package/dist/gateway/static/root/assets/{image-generation-api-sbtx4NiC.js → image-generation-api-BvpAa3Lj.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-CBlaxUhl.js → imports-page-Dx5T5pqw.js} +1 -1
- package/dist/gateway/static/root/assets/index-Cdo4_zon.js +11 -0
- package/dist/gateway/static/root/assets/index-DYTktubl.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-DxSv1wS2.js → install-connector-dialog-Cb4ufypG.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CnAV96nr.js → keyboard-shortcuts-settings-BEuXrnv0.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CfnixDO3.js → local-app-workbench-page-CPFIbEbv.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BI3Be5qo.js → local-apps-page-DxHcRSxc.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-Cmc-GCVa.js +4 -0
- package/dist/gateway/static/root/assets/{locale-store-Dy1EByeG.js → locale-store-tI9VX7dp.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CMW34T31.js → logs-page-BcibwftP.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-B5w5DdXH.js → management-api-C9tFjLcE.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-DfcMIqbQ.js → management-settings-DbnAlXoB.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CNJaAdNN.js → markdown-view-CSpQhSka.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-DCIEL5bA.js → mcp-conversation-setup-page-DedbjJbF.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DGhWjPIU.js → media-plugins-BYnP_orq.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-BAnhwALN.js → messages-e5MhDONm.js} +2 -2
- package/dist/gateway/static/root/assets/{model-selector-C-CqPBao.js → model-selector-B4oTiJI6.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-Bgh3Gfgl.js → models-hub-cache-DpEClnsE.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-DsXb1qjW.js → note-detail-panel-D8asMfBm.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DcDw5kp4.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-BOIM9Q_D.js → notes-api-pVC1amyp.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BTpiOw67.js → notes-page-CG1_6PLz.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-B560CHeD.js → oauth-api-BsVPwufr.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-D63M8Iv7.js → oauth-provider-connect-Bu20kmPq.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-B_Vdo2Ai.js → page-context-capture-button-CDsnNXjS.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-Cr5GqS2D.js → page-context-draft-D6tu8c_9.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-DeaRqZgV.js +1 -0
- package/dist/gateway/static/root/assets/panels-top-left-BKvp2Dag.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-BMRVyTrE.js → personal-avatar-BboNc6e2.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-I3IGVSJh.js → personal-page-gMRmLCWG.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-profile-settings-C4CxmQLQ.js → personal-profile-settings-Cd4QyseL.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-CnxI2TL0.js → personal-settings-panel-CtBY_Uk1.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-flTci8mm.js → phone-dependencies-card-BgH1LluB.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-Vi_Swyv6.js → phone-model-connection-DkdKU5Kv.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-BOv3mb_F.js → phone-model-picker-0g1z4RPL.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-vD0bTcHj.js → phone-settings-page-DlIUajBY.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-Ltrevdsx.js → phone-workspace-store-DW2sZtkh.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-F08k_k2u.js → plugin-details-dialog-9KUkZk_t.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-D1pZekPs.js → preference-select-fields-DH5QZhIc.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-CGso8wGv.js → product-automation-feedback-a1thJ0M9.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BO8lUvw3.js → product-open-page-DCzQh7tr.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-Dgtb4LF7.js → product-preview-content-C5TLcagj.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-C35EWUps.js → product-preview-modal-D9f-7kcI.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-Dy46uSEt.js → project-detail-page-C4Z2HTRZ.js} +2 -2
- package/dist/gateway/static/root/assets/{project-understanding-Cg8WbBNB.js → project-understanding-CoPBvlqf.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-C6Pt6OdT.js → projects-page-k1v8Fry8.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-Nytkkop9.js → providers-api-BSJZyO8n.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-CFX7CANT.js → recording-upload-CExCePtr.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DuDIthjL.js → registry-api-CqcJj60w.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DePwafOK.js → remote-access-hub-BLFkNl1y.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-BRKhKJA0.js → resource-unavailable-B_BXTQa7.js} +1 -1
- package/dist/gateway/static/root/assets/{right-workspace-store-HPw7Gw0n.js → right-workspace-store-OceFhUjM.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-ClsAFFQc.js +2 -0
- package/dist/gateway/static/root/assets/{routine-panel-KH1VaEdC.js → routine-panel-BsE9o9uu.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-Dd8a07eo.js → runtime-tools-api-aAZChVm4.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CvHQoqHu.js → runtime-tools-settings-panel-Bn9HTrK5.js} +1 -1
- package/dist/gateway/static/root/assets/schema-form-BxBDgLrg.js +1 -0
- package/dist/gateway/static/root/assets/{service-recommendation-list-BmRtbJz2.js → service-recommendation-list-BNIVRGDf.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-BFiIYodK.js → session-api-DdW7Wix2.js} +1 -1
- package/dist/gateway/static/root/assets/session-channel-icon-DUJbB-Km.js +1 -0
- package/dist/gateway/static/root/assets/{session-identity-label-D5SAi0Uh.js → session-identity-label-DjhlQ6LU.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-XgtApqIh.js +25 -0
- package/dist/gateway/static/root/assets/sessions-page-CfhKeUkZ.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BBG8dTIY.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-B-H1gYOs.js → settings-advanced-section-BOoJfJuB.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-YH60sibB.js → settings-mode-store-BMh_BQ9a.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C39lKVRv.js → settings-page-M6XwzIyu.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-DEZZ8D0S.js → settings-page-header-Bfu4cuQd.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-De2j64Lo.js → settings-page-layout-BnZa1qHH.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-Dh6BPwv0.js → setup-interaction-page-CVlrVNrm.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DGAAczL-.js → setup-status-panel-FFyDODEx.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-C1t_HB6f.js → share-link-dialog-Cv-eDEw_.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Cqy-7-rd.js → share-preview-page-BctH6eFs.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-Dm07CnXw.js → shares-api-cLTEcQLE.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DcetAN8K.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-BV8oFqeE.js → skill-api-CgEZJoy9.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-1o_YRCu9.js → skill-list-api-BWVr2PL5.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-fGsO9Y86.js → skill-reload-api-BLhHNvaK.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DReUQ4Ug.js → skills-page-DIjcAvA0.js} +1 -1
- package/dist/gateway/static/root/assets/sliding-segmented-DagP0myu.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-CUI6QHEP.js → system-settings-panel-C7LAPaN_.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-D1dNWTnP.js → task-detail-page-DmNEMg-l.js} +1 -1
- package/dist/gateway/static/root/assets/{task-result-evidence-CW_tN93T.js → task-result-evidence-BsBn3n_l.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-Du53Upr2.js → terminal-panel-store-DJbLuUku.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BaWep_o7.js → theme-store-QGcjV6pN.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-CnciBMVH.js → tracing-settings-page-BKCiPwYL.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-Iz7JCBt3.js → tunnel-api-S7J5Lpzt.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-BFc8PamJ.js → understanding-activity-store-BNVhtJkn.js} +1 -1
- package/dist/gateway/static/root/assets/understanding-refresh-store-CM6bUcaJ.js +1 -0
- package/dist/gateway/static/root/assets/undo-2-6IMTwK4M.js +1 -0
- package/dist/gateway/static/root/assets/{unlink-BEuthaaq.js → unlink-NsCMuCT1.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DL2fmeOh.js → usage-page-D-AqzjIx.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-N_SjHXTw.js → use-autosave-CqZbhhCc.js} +1 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-BfLhIb2_.js +2 -0
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-D0IBFhM9.js → use-file-preview-expanded-DufxDues.js} +3 -3
- package/dist/gateway/static/root/assets/{use-personal-profile-C1vqD9yV.js → use-personal-profile-RnjxZnLa.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-B5IsKrRW.js → use-realtime-voice-w3aHR2dr.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-7X2ydgS8.js → use-workspace-tree-2Ck-ql5c.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-CBcGMhrR.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-B_GApUQP.js → voice-api-key-field-C4rhpgco.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DhJ3l8fk.js → voice-config-api-7AHN-ns6.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-CEeFBhp3.js → voice-input-shortcut-events-BbRrj833.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-57pwZeKD.js → voice-settings-wamtp0lg.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BJ15p4rH.js → work-discovery-overlay-fVofN7aP.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-8XciWNs5.js → work-discovery-page-DcQG5GWy.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-BGZduAXV.js → working-directory-picker-modal-D8Stwszr.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Dd_UDfeo.js → workspace-api-D3iuTdNK.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-C-J7vr2o.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-Clj9hMj5.js → workspace-file-preview-dialog-BXbL5Y1h.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-CvZxU9de.js → workspace-open-location-menu-1gFO_BdL.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-preview-store-imhtuEIP.js → workspace-preview-store-adwmi4nx.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Q_jezTUy.js → xopc-cloud-account-card-DhGh4rm7.js} +1 -1
- package/dist/gateway/static/root/index.html +97 -93
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/session-input-command.js +5 -0
- package/dist/src/agent/inbound/inbound-loop.js +14 -0
- package/dist/src/agent/messaging/outbound-coordinator.js +1 -1
- package/dist/src/agent/prompt/response-language.js +9 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +3 -0
- package/dist/src/channels/connection-probe.d.ts +23 -0
- package/dist/src/channels/connection-probe.js +98 -0
- package/dist/src/channels/manager.d.ts +2 -0
- package/dist/src/channels/manager.js +5 -0
- package/dist/src/channels/message-journal.d.ts +25 -0
- package/dist/src/channels/message-journal.js +79 -0
- package/dist/src/channels/outbound-sender.d.ts +8 -0
- package/dist/src/channels/outbound-sender.js +60 -1
- package/dist/src/channels/plugins/types.adapters.d.ts +4 -0
- package/dist/src/channels/verified-inbound.js +20 -14
- package/dist/src/cli/commands/gateway/lifecycle.js +2 -2
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/config/schema.d.ts +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -1
- package/dist/src/gateway/hono/middleware/auth.js +1 -1
- package/dist/src/gateway/hono/routes/channels.js +23 -10
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/desktop-host.js +1 -1
- package/dist/src/gateway/hono/routes/imports.js +1 -1
- package/dist/src/gateway/hono/routes/personal-agent.js +3 -3
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.js +48 -20
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +2 -2
- package/dist/src/gateway/service/agent-runner.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service.js +8 -8
- package/dist/src/i18n/response-language.d.ts +1 -1
- package/dist/src/infra/bus/index.d.ts +1 -1
- package/dist/src/infra/bus/queue.d.ts +16 -3
- package/dist/src/infra/bus/queue.js +74 -3
- package/dist/src/infra/debounce.d.ts +1 -0
- package/dist/src/infra/debounce.js +40 -35
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-restart.js +2 -2
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/knowledge-memory/index.js +2 -2
- package/dist/src/knowledge-memory/repository.d.ts +9 -0
- package/dist/src/knowledge-memory/repository.js +12 -2
- package/dist/src/notifications/service.js +2 -2
- package/dist/src/phone/stream-gateway.js +1 -1
- package/dist/src/runtime-tools/types.d.ts +1 -1
- package/dist/src/storage/sqlite/session-creation-repository.js +6 -1
- package/dist/src/user-context/config.d.ts +1 -1
- package/package.json +4 -5
- package/dist/extensions/demo-memory/src/index.d.ts +0 -6
- package/dist/extensions/demo-memory/src/index.js +0 -146
- package/dist/extensions/demo-memory/xopc.extension.json +0 -15
- package/dist/gateway/static/root/assets/agents-DC0lHtl5.js +0 -77
- package/dist/gateway/static/root/assets/automations-workspace-JCQ1IXFk.js +0 -9
- package/dist/gateway/static/root/assets/capabilities-page-kPv2dOzf.js +0 -2
- package/dist/gateway/static/root/assets/channels-B--IHNs4.js +0 -1
- package/dist/gateway/static/root/assets/chat-agents-api-CjlzCSmC.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-BV51dk16.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-sx7B8kdC.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DefKShSW.js +0 -8
- package/dist/gateway/static/root/assets/index-CChzK_5b.css +0 -1
- package/dist/gateway/static/root/assets/index-DUo6H0PC.js +0 -11
- package/dist/gateway/static/root/assets/local-session-drafts-BIBHRkpM.js +0 -4
- package/dist/gateway/static/root/assets/note-image-lightbox-D6mvMSKr.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-Bm8oxpFR.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-ChTaYgpA.js +0 -2
- package/dist/gateway/static/root/assets/schema-form-C9TYGa0_.js +0 -1
- package/dist/gateway/static/root/assets/session-channel-icon-BzkFo-Ci.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-63NaXb1s.js +0 -25
- package/dist/gateway/static/root/assets/sessions-page-DQEq_VJS.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cvx7DnU8.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BDr50uTV.js +0 -1
- package/dist/gateway/static/root/assets/sliding-segmented-CgQ3BFdb.js +0 -1
- package/dist/gateway/static/root/assets/understanding-refresh-store-CdEfR40A.js +0 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-Xn6eUus2.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-D2FHjLi7.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-DVPJcbuE.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as a,l as o,n as s,o as c}from"./locale-store-Dy1EByeG.js";import{t as l}from"./messages-BAnhwALN.js";import{a as u,n as d,o as f,r as p,s as m,t as h}from"./dist-CY7CS_D3.js";import{t as g}from"./check-DUBLcKHA.js";import{t as _}from"./chevron-down-ccbiQQz_.js";import{n as v,r as y}from"./popover-select-CLsphyzA.js";import{i as b}from"./file-tree-utils-DJs1faGv.js";import{t as x}from"./cloud-C4-yfnnk.js";import{t as S}from"./copy-Dv6d4Dvw.js";import{t as ee}from"./file-tree-CFlZnV3Y.js";import{t as C}from"./file-text-D12HbeVy.js";import{t as w}from"./folder-open-CyzJ19I9.js";import{t as T}from"./history-DXH_9jsE.js";import{t as E}from"./loader-circle-CifKLtgG.js";import{t as D}from"./message-square-fVE7Ghj1.js";import{t as O}from"./plus-Q2yW6OE7.js";import{t as te}from"./refresh-cw-BRlGaq2w.js";import{t as k}from"./sticky-note-fzP7NAJq.js";import{t as A}from"./trash-2-DusmjVPV.js";import{n as j,r as M,t as N}from"./share-link-dialog-C1t_HB6f.js";import{t as P}from"./x-B_N4OPjy.js";import{t as F}from"./cn-0WouolD0.js";import{t as I}from"./skeleton-DzdOeGYz.js";import{i as ne}from"./vendor-swr-CdRzEUwF.js";import{n as L,r as R}from"./gateway-config-swr-1Rk0LeEM.js";import{o as z}from"./agents-admin-api-D0N09mqJ.js";import{t as B}from"./button-Cc4hUNTt.js";import{t as V}from"./copy-to-clipboard-HOJ79TWv.js";import{s as H}from"./form-field-width-DJw_jULe.js";import{t as U}from"./page-tabs-oeTY7z3_.js";import{r as W}from"./settings-form-draft-Dy10ldo8.js";import{t as G}from"./confirm-dialog-DrA5mTQp.js";import{a as K,b as re,c as ie,g as ae,l as oe,m as se,o as ce,r as le,t as ue,v as de,x as fe}from"./shares-api-Dm07CnXw.js";import{t as pe}from"./use-workspace-tree-7X2ydgS8.js";import{t as me}from"./workspace-editor-agent-store-DVPJcbuE.js";import{n as he}from"./agent-display-names-Bje7vfSn.js";import{t as ge}from"./settings-loading-skeleton-CAoOV17i.js";import{t as _e}from"./oauth-provider-connect-D63M8Iv7.js";import{t as ve}from"./number-input-El7Szeln.js";import{n as ye,t as be}from"./settings-page-header-DEZZ8D0S.js";import{t as q}from"./settings-page-layout-De2j64Lo.js";import{t as J}from"./settings-form-section-num14vSv.js";var Y=e(t(),1),xe=n(),X={enabled:!0,defaultTtlHours:24,maxTtlDays:30,maxActiveShares:500,maxFileSizeMb:500,directoryMaxFolderSizeMb:2048,directoryMaxFileCount:1e4,inlinePreviewMimes:[`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/svg+xml`,`application/pdf`,`text/html`,`text/markdown`,`text/plain`,`application/json`],noteEnabled:!0,noteMaxTotalSizeMb:250,noteMaxAttachmentCount:50,siteEnabled:!0,siteDefaultTtlHours:24,siteMaxTtlDays:30,maxActiveSites:50,siteMaxRootDirSizeMb:1024,siteMaxFileCount:2e4};function Se(){return structuredClone(X)}var Z=36e5,Ce=864e5,Q=1048576;function we(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Te(e,t=32){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.trim().length>0).map(e=>e.trim()).slice(0,t):[]}function Ee(e){let t=we(e)?e:{},n=we(t.gateway)?t.gateway:{},r=we(n.share)?n.share:{},i=we(r.directory)?r.directory:{},a=we(r.note)?r.note:{},o=we(n.siteShare)?n.siteShare:{},s=we(o.static)?o.static:{},c=typeof r.defaultTtlMs==`number`&&Number.isFinite(r.defaultTtlMs)?Math.floor(r.defaultTtlMs):X.defaultTtlHours*Z,l=typeof r.maxTtlMs==`number`&&Number.isFinite(r.maxTtlMs)?Math.floor(r.maxTtlMs):X.maxTtlDays*Ce,u=typeof r.maxFileSize==`number`&&Number.isFinite(r.maxFileSize)?Math.floor(r.maxFileSize):X.maxFileSizeMb*Q,d=typeof i.maxFolderSize==`number`&&Number.isFinite(i.maxFolderSize)?Math.floor(i.maxFolderSize):X.directoryMaxFolderSizeMb*Q,f=typeof o.defaultTtlMs==`number`&&Number.isFinite(o.defaultTtlMs)?Math.floor(o.defaultTtlMs):X.siteDefaultTtlHours*Z,p=typeof o.maxTtlMs==`number`&&Number.isFinite(o.maxTtlMs)?Math.floor(o.maxTtlMs):X.siteMaxTtlDays*Ce,m=typeof s.maxRootDirSize==`number`&&Number.isFinite(s.maxRootDirSize)?Math.floor(s.maxRootDirSize):X.siteMaxRootDirSizeMb*Q,h=typeof a.maxTotalSize==`number`&&Number.isFinite(a.maxTotalSize)?Math.floor(a.maxTotalSize):X.noteMaxTotalSizeMb*Q;return{enabled:r.enabled!==!1,defaultTtlHours:Math.max(1,Math.round(c/Z)),maxTtlDays:Math.max(1,Math.round(l/Ce)),maxActiveShares:typeof r.maxActiveShares==`number`&&Number.isFinite(r.maxActiveShares)?Math.max(1,Math.min(1e4,Math.floor(r.maxActiveShares))):X.maxActiveShares,maxFileSizeMb:Math.max(1,Math.round(u/Q)),directoryMaxFolderSizeMb:Math.max(1,Math.round(d/Q)),directoryMaxFileCount:typeof i.maxFileCount==`number`&&Number.isFinite(i.maxFileCount)?Math.max(1,Math.min(1e5,Math.floor(i.maxFileCount))):X.directoryMaxFileCount,inlinePreviewMimes:Te(r.inlinePreviewMimes,32).length?Te(r.inlinePreviewMimes,32):[...X.inlinePreviewMimes],noteEnabled:a.enabled!==!1,noteMaxTotalSizeMb:Math.max(1,Math.round(h/Q)),noteMaxAttachmentCount:typeof a.maxAttachmentCount==`number`&&Number.isFinite(a.maxAttachmentCount)?Math.max(0,Math.min(500,Math.floor(a.maxAttachmentCount))):X.noteMaxAttachmentCount,siteEnabled:o.enabled!==!1,siteDefaultTtlHours:Math.max(1,Math.round(f/Z)),siteMaxTtlDays:Math.max(1,Math.round(p/Ce)),maxActiveSites:typeof o.maxActiveSites==`number`&&Number.isFinite(o.maxActiveSites)?Math.max(1,Math.min(1e3,Math.floor(o.maxActiveSites))):X.maxActiveSites,siteMaxRootDirSizeMb:Math.max(1,Math.round(m/Q)),siteMaxFileCount:typeof s.maxFileCount==`number`&&Number.isFinite(s.maxFileCount)?Math.max(1,Math.min(1e5,Math.floor(s.maxFileCount))):X.siteMaxFileCount}}function De(e){let t=e.defaultTtlHours*Z,n=e.maxTtlDays*Ce,r=e.siteDefaultTtlHours*Z,i=e.siteMaxTtlDays*Ce;return t<6e4||t>6048e5?`Default share TTL must be between 1 minute and 7 days.`:n<6e4||n>2592e6?`Maximum share TTL must be between 1 minute and 30 days.`:t>n?`Default TTL cannot exceed maximum TTL.`:e.maxActiveShares<1||e.maxActiveShares>1e4?`Maximum active shares must be between 1 and 10,000.`:e.maxActiveSites<1||e.maxActiveSites>1e3?`Maximum active site shares must be between 1 and 1,000.`:e.maxFileSizeMb<1||e.maxFileSizeMb>10240?`Maximum file size must be between 1 MB and 10 GB.`:e.directoryMaxFolderSizeMb<1||e.directoryMaxFolderSizeMb>10240?`Maximum folder size must be between 1 MB and 10 GB.`:e.directoryMaxFileCount<1||e.directoryMaxFileCount>1e5?`Maximum directory file count must be between 1 and 100,000.`:e.noteMaxTotalSizeMb<1||e.noteMaxTotalSizeMb>2048?`Maximum Note snapshot size must be between 1 MB and 2 GB.`:e.noteMaxAttachmentCount<0||e.noteMaxAttachmentCount>500?`Maximum Note attachment count must be between 0 and 500.`:r<6e4||r>6048e5?`Default site share TTL must be between 1 minute and 7 days.`:i<6e4||i>2592e6?`Maximum site share TTL must be between 1 minute and 30 days.`:r>i?`Default site TTL cannot exceed maximum site TTL.`:e.siteMaxRootDirSizeMb<1||e.siteMaxRootDirSizeMb>10240?`Maximum static site size must be between 1 MB and 10 GB.`:e.siteMaxFileCount<1||e.siteMaxFileCount>1e5?`Maximum static site file count must be between 1 and 100,000.`:null}async function Oe(e){let t=De(e);if(t)throw Error(t);await c(a(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{share:{enabled:e.enabled,defaultTtlMs:e.defaultTtlHours*Z,maxTtlMs:e.maxTtlDays*Ce,maxActiveShares:e.maxActiveShares,maxFileSize:e.maxFileSizeMb*Q,inlinePreviewMimes:e.inlinePreviewMimes,directory:{maxFolderSize:e.directoryMaxFolderSizeMb*Q,maxFileCount:e.directoryMaxFileCount},note:{enabled:e.noteEnabled,maxTotalSize:e.noteMaxTotalSizeMb*Q,maxAttachmentCount:e.noteMaxAttachmentCount}},siteShare:{enabled:e.siteEnabled,defaultTtlMs:e.siteDefaultTtlHours*Z,maxTtlMs:e.siteMaxTtlDays*Ce,maxActiveSites:e.maxActiveSites,static:{maxRootDirSize:e.siteMaxRootDirSizeMb*Q,maxFileCount:e.siteMaxFileCount}}}})}),L()}var $=r();function ke(){return F(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,H,`dark:border-edge`)}function Ae({hasToken:e}){let t=l(s(e=>e.language)).sharesSettings,{data:n,isLoading:r}=R(e),i=(0,Y.useMemo)(()=>n?.payload?.config===void 0?null:structuredClone(Ee(n.payload.config)),[n]),a=(0,Y.useRef)(!1),[o,c]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(!1),g=o??i,_=i,v=(0,Y.useMemo)(()=>!g||!_?!1:JSON.stringify(g)!==JSON.stringify(_),[g,_]),y=(0,Y.useCallback)(e=>{a.current=!0,c(t=>{let n=t??_;return n?{...n,...e}:null})},[_]),b=(0,Y.useCallback)(async()=>{if(!(!g||u)){d(!0),p(null),h(!1);try{await Oe(g),a.current=!1,c(null),h(!0),window.setTimeout(()=>h(!1),2500)}catch(e){p(e instanceof Error?e.message:t.policySaveError)}finally{d(!1)}}},[g,u,t.policySaveError]),x=(0,Y.useCallback)(()=>{a.current=!1,c(null),p(null),h(!1)},[]);return!e||!g?r?(0,$.jsx)(J,{children:(0,$.jsx)(ge,{rows:2})}):null:(0,$.jsxs)(J,{children:[(0,$.jsxs)(`div`,{className:`mb-4 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.policyTitle}),(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.policyHint})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[m?(0,$.jsx)(`span`,{className:`text-sm text-fg-muted`,children:t.policySaved}):null,(0,$.jsx)(B,{type:`button`,variant:`secondary`,disabled:u,onClick:()=>y(Se()),children:t.policyUseRecommended}),(0,$.jsx)(B,{type:`button`,variant:`secondary`,disabled:!v||u,onClick:x,children:t.policyDiscard}),(0,$.jsx)(B,{type:`button`,variant:`primary`,disabled:!v||u,onClick:()=>void b(),children:u?t.policySaving:t.policySave})]})]}),v?(0,$.jsx)(`p`,{className:`mb-3 text-xs text-amber-800 dark:text-amber-200`,children:t.policyUnsaved}):null,f?(0,$.jsx)(`p`,{className:`mb-3 text-sm text-red-600 dark:text-red-400`,children:f}):null,(0,$.jsx)(`p`,{className:`mb-4 text-xs text-fg-subtle`,children:t.policyRestartHint}),(0,$.jsx)(je,{t,form:g,onChange:y})]})}function je(e){let t=(0,xe.c)(189),{t:n,form:r,onChange:i}=e,a;t[0]===n.policyFileSection?a=t[1]:(a=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.policyFileSection}),t[0]=n.policyFileSection,t[1]=a);let o;t[2]===n.policyFileSectionHint?o=t[3]:(o=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:n.policyFileSectionHint}),t[2]=n.policyFileSectionHint,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,$.jsxs)(`div`,{className:`mb-4`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===i?c=t[8]:(c=e=>i({enabled:e.target.checked}),t[7]=i,t[8]=c);let l;t[9]!==r.enabled||t[10]!==c?(l=(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:r.enabled,onChange:c}),t[9]=r.enabled,t[10]=c,t[11]=l):l=t[11];let u;t[12]!==n.policyEnabled||t[13]!==l?(u=(0,$.jsxs)(`label`,{className:`mb-4 flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[l,n.policyEnabled]}),t[12]=n.policyEnabled,t[13]=l,t[14]=u):u=t[14];let d=!r.enabled,f;t[15]===i?f=t[16]:(f=e=>i({defaultTtlHours:e}),t[15]=i,t[16]=f);let p;t[17]!==r.defaultTtlHours||t[18]!==n.policyDefaultTtlHint||t[19]!==n.policyDefaultTtlHours||t[20]!==d||t[21]!==f?(p=(0,$.jsx)(Me,{id:`share-default-ttl-hours`,label:n.policyDefaultTtlHours,hint:n.policyDefaultTtlHint,value:r.defaultTtlHours,min:1,max:168,disabled:d,onChange:f}),t[17]=r.defaultTtlHours,t[18]=n.policyDefaultTtlHint,t[19]=n.policyDefaultTtlHours,t[20]=d,t[21]=f,t[22]=p):p=t[22];let m=!r.enabled,h;t[23]===i?h=t[24]:(h=e=>i({maxTtlDays:e}),t[23]=i,t[24]=h);let g;t[25]!==r.maxTtlDays||t[26]!==n.policyMaxTtlDays||t[27]!==n.policyMaxTtlHint||t[28]!==m||t[29]!==h?(g=(0,$.jsx)(Me,{id:`share-max-ttl-days`,label:n.policyMaxTtlDays,hint:n.policyMaxTtlHint,value:r.maxTtlDays,min:1,max:30,disabled:m,onChange:h}),t[25]=r.maxTtlDays,t[26]=n.policyMaxTtlDays,t[27]=n.policyMaxTtlHint,t[28]=m,t[29]=h,t[30]=g):g=t[30];let _=!r.enabled,v;t[31]===i?v=t[32]:(v=e=>i({maxActiveShares:e}),t[31]=i,t[32]=v);let y;t[33]!==r.maxActiveShares||t[34]!==n.policyMaxActiveShares||t[35]!==n.policyMaxActiveSharesHint||t[36]!==_||t[37]!==v?(y=(0,$.jsx)(Me,{id:`share-max-active`,label:n.policyMaxActiveShares,hint:n.policyMaxActiveSharesHint,value:r.maxActiveShares,min:1,max:1e4,disabled:_,onChange:v}),t[33]=r.maxActiveShares,t[34]=n.policyMaxActiveShares,t[35]=n.policyMaxActiveSharesHint,t[36]=_,t[37]=v,t[38]=y):y=t[38];let b=!r.enabled,x;t[39]===i?x=t[40]:(x=e=>i({maxFileSizeMb:e}),t[39]=i,t[40]=x);let S;t[41]!==r.maxFileSizeMb||t[42]!==n.policyMaxFileSizeHint||t[43]!==n.policyMaxFileSizeMb||t[44]!==b||t[45]!==x?(S=(0,$.jsx)(Me,{id:`share-max-file-mb`,label:n.policyMaxFileSizeMb,hint:n.policyMaxFileSizeHint,value:r.maxFileSizeMb,min:1,max:10240,disabled:b,onChange:x}),t[41]=r.maxFileSizeMb,t[42]=n.policyMaxFileSizeHint,t[43]=n.policyMaxFileSizeMb,t[44]=b,t[45]=x,t[46]=S):S=t[46];let ee=!r.enabled,C;t[47]===i?C=t[48]:(C=e=>i({directoryMaxFolderSizeMb:e}),t[47]=i,t[48]=C);let w;t[49]!==r.directoryMaxFolderSizeMb||t[50]!==n.policyDirectoryMaxFolderSizeHint||t[51]!==n.policyDirectoryMaxFolderSizeMb||t[52]!==ee||t[53]!==C?(w=(0,$.jsx)(Me,{id:`share-directory-max-size-mb`,label:n.policyDirectoryMaxFolderSizeMb,hint:n.policyDirectoryMaxFolderSizeHint,value:r.directoryMaxFolderSizeMb,min:1,max:10240,disabled:ee,onChange:C}),t[49]=r.directoryMaxFolderSizeMb,t[50]=n.policyDirectoryMaxFolderSizeHint,t[51]=n.policyDirectoryMaxFolderSizeMb,t[52]=ee,t[53]=C,t[54]=w):w=t[54];let T=!r.enabled,E;t[55]===i?E=t[56]:(E=e=>i({directoryMaxFileCount:e}),t[55]=i,t[56]=E);let D;t[57]!==r.directoryMaxFileCount||t[58]!==n.policyDirectoryMaxFileCount||t[59]!==n.policyDirectoryMaxFileCountHint||t[60]!==T||t[61]!==E?(D=(0,$.jsx)(Me,{id:`share-directory-max-files`,label:n.policyDirectoryMaxFileCount,hint:n.policyDirectoryMaxFileCountHint,value:r.directoryMaxFileCount,min:1,max:1e5,disabled:T,onChange:E}),t[57]=r.directoryMaxFileCount,t[58]=n.policyDirectoryMaxFileCount,t[59]=n.policyDirectoryMaxFileCountHint,t[60]=T,t[61]=E,t[62]=D):D=t[62];let O;t[63]!==g||t[64]!==y||t[65]!==S||t[66]!==w||t[67]!==D||t[68]!==p?(O=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[p,g,y,S,w,D]}),t[63]=g,t[64]=y,t[65]=S,t[66]=w,t[67]=D,t[68]=p,t[69]=O):O=t[69];let te=!r.enabled,k;t[70]===i?k=t[71]:(k=e=>i({inlinePreviewMimes:e}),t[70]=i,t[71]=k);let A;t[72]!==r.inlinePreviewMimes||t[73]!==n||t[74]!==te||t[75]!==k?(A=(0,$.jsx)(Ne,{t:n,values:r.inlinePreviewMimes,disabled:te,onChange:k}),t[72]=r.inlinePreviewMimes,t[73]=n,t[74]=te,t[75]=k,t[76]=A):A=t[76];let j;t[77]!==O||t[78]!==A||t[79]!==s||t[80]!==u?(j=(0,$.jsxs)(`div`,{className:`rounded-xl bg-surface-base/45 p-4`,children:[s,u,O,A]}),t[77]=O,t[78]=A,t[79]=s,t[80]=u,t[81]=j):j=t[81];let M;t[82]===n.policyNoteSection?M=t[83]:(M=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.policyNoteSection}),t[82]=n.policyNoteSection,t[83]=M);let N;t[84]===n.policyNoteSectionHint?N=t[85]:(N=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:n.policyNoteSectionHint}),t[84]=n.policyNoteSectionHint,t[85]=N);let P;t[86]!==M||t[87]!==N?(P=(0,$.jsxs)(`div`,{className:`mb-4`,children:[M,N]}),t[86]=M,t[87]=N,t[88]=P):P=t[88];let F;t[89]===i?F=t[90]:(F=e=>i({noteEnabled:e.target.checked}),t[89]=i,t[90]=F);let I;t[91]!==r.noteEnabled||t[92]!==F?(I=(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:r.noteEnabled,onChange:F}),t[91]=r.noteEnabled,t[92]=F,t[93]=I):I=t[93];let ne;t[94]!==n.policyNoteEnabled||t[95]!==I?(ne=(0,$.jsxs)(`label`,{className:`mb-4 flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[I,n.policyNoteEnabled]}),t[94]=n.policyNoteEnabled,t[95]=I,t[96]=ne):ne=t[96];let L=!r.enabled||!r.noteEnabled,R;t[97]===i?R=t[98]:(R=e=>i({noteMaxTotalSizeMb:e}),t[97]=i,t[98]=R);let z;t[99]!==r.noteMaxTotalSizeMb||t[100]!==n.policyNoteMaxTotalSizeHint||t[101]!==n.policyNoteMaxTotalSizeMb||t[102]!==L||t[103]!==R?(z=(0,$.jsx)(Me,{id:`share-note-max-size-mb`,label:n.policyNoteMaxTotalSizeMb,hint:n.policyNoteMaxTotalSizeHint,value:r.noteMaxTotalSizeMb,min:1,max:2048,disabled:L,onChange:R}),t[99]=r.noteMaxTotalSizeMb,t[100]=n.policyNoteMaxTotalSizeHint,t[101]=n.policyNoteMaxTotalSizeMb,t[102]=L,t[103]=R,t[104]=z):z=t[104];let B=!r.enabled||!r.noteEnabled,V;t[105]===i?V=t[106]:(V=e=>i({noteMaxAttachmentCount:e}),t[105]=i,t[106]=V);let H;t[107]!==r.noteMaxAttachmentCount||t[108]!==n.policyNoteMaxAttachmentCount||t[109]!==n.policyNoteMaxAttachmentCountHint||t[110]!==B||t[111]!==V?(H=(0,$.jsx)(Me,{id:`share-note-max-attachments`,label:n.policyNoteMaxAttachmentCount,hint:n.policyNoteMaxAttachmentCountHint,value:r.noteMaxAttachmentCount,min:0,max:500,disabled:B,onChange:V}),t[107]=r.noteMaxAttachmentCount,t[108]=n.policyNoteMaxAttachmentCount,t[109]=n.policyNoteMaxAttachmentCountHint,t[110]=B,t[111]=V,t[112]=H):H=t[112];let U;t[113]!==z||t[114]!==H?(U=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[z,H]}),t[113]=z,t[114]=H,t[115]=U):U=t[115];let W;t[116]!==P||t[117]!==ne||t[118]!==U?(W=(0,$.jsxs)(`div`,{className:`rounded-xl bg-surface-base/45 p-4`,children:[P,ne,U]}),t[116]=P,t[117]=ne,t[118]=U,t[119]=W):W=t[119];let G;t[120]===n.policySiteSection?G=t[121]:(G=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.policySiteSection}),t[120]=n.policySiteSection,t[121]=G);let K;t[122]===n.policySiteSectionHint?K=t[123]:(K=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:n.policySiteSectionHint}),t[122]=n.policySiteSectionHint,t[123]=K);let re;t[124]!==G||t[125]!==K?(re=(0,$.jsxs)(`div`,{className:`mb-4`,children:[G,K]}),t[124]=G,t[125]=K,t[126]=re):re=t[126];let ie;t[127]===i?ie=t[128]:(ie=e=>i({siteEnabled:e.target.checked}),t[127]=i,t[128]=ie);let ae;t[129]!==r.siteEnabled||t[130]!==ie?(ae=(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:r.siteEnabled,onChange:ie}),t[129]=r.siteEnabled,t[130]=ie,t[131]=ae):ae=t[131];let oe;t[132]!==n.policySiteEnabled||t[133]!==ae?(oe=(0,$.jsxs)(`label`,{className:`mb-4 flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[ae,n.policySiteEnabled]}),t[132]=n.policySiteEnabled,t[133]=ae,t[134]=oe):oe=t[134];let se=!r.siteEnabled,ce;t[135]===i?ce=t[136]:(ce=e=>i({siteDefaultTtlHours:e}),t[135]=i,t[136]=ce);let le;t[137]!==r.siteDefaultTtlHours||t[138]!==n.policySiteDefaultTtlHint||t[139]!==n.policySiteDefaultTtlHours||t[140]!==se||t[141]!==ce?(le=(0,$.jsx)(Me,{id:`site-share-default-ttl-hours`,label:n.policySiteDefaultTtlHours,hint:n.policySiteDefaultTtlHint,value:r.siteDefaultTtlHours,min:1,max:168,disabled:se,onChange:ce}),t[137]=r.siteDefaultTtlHours,t[138]=n.policySiteDefaultTtlHint,t[139]=n.policySiteDefaultTtlHours,t[140]=se,t[141]=ce,t[142]=le):le=t[142];let ue=!r.siteEnabled,de;t[143]===i?de=t[144]:(de=e=>i({siteMaxTtlDays:e}),t[143]=i,t[144]=de);let fe;t[145]!==r.siteMaxTtlDays||t[146]!==n.policySiteMaxTtlDays||t[147]!==n.policySiteMaxTtlHint||t[148]!==ue||t[149]!==de?(fe=(0,$.jsx)(Me,{id:`site-share-max-ttl-days`,label:n.policySiteMaxTtlDays,hint:n.policySiteMaxTtlHint,value:r.siteMaxTtlDays,min:1,max:30,disabled:ue,onChange:de}),t[145]=r.siteMaxTtlDays,t[146]=n.policySiteMaxTtlDays,t[147]=n.policySiteMaxTtlHint,t[148]=ue,t[149]=de,t[150]=fe):fe=t[150];let pe=!r.siteEnabled,me;t[151]===i?me=t[152]:(me=e=>i({maxActiveSites:e}),t[151]=i,t[152]=me);let he;t[153]!==r.maxActiveSites||t[154]!==n.policyMaxActiveSites||t[155]!==n.policyMaxActiveSitesHint||t[156]!==pe||t[157]!==me?(he=(0,$.jsx)(Me,{id:`site-share-max-active`,label:n.policyMaxActiveSites,hint:n.policyMaxActiveSitesHint,value:r.maxActiveSites,min:1,max:1e3,disabled:pe,onChange:me}),t[153]=r.maxActiveSites,t[154]=n.policyMaxActiveSites,t[155]=n.policyMaxActiveSitesHint,t[156]=pe,t[157]=me,t[158]=he):he=t[158];let ge=!r.siteEnabled,_e;t[159]===i?_e=t[160]:(_e=e=>i({siteMaxRootDirSizeMb:e}),t[159]=i,t[160]=_e);let ve;t[161]!==r.siteMaxRootDirSizeMb||t[162]!==n.policySiteMaxRootDirSizeHint||t[163]!==n.policySiteMaxRootDirSizeMb||t[164]!==ge||t[165]!==_e?(ve=(0,$.jsx)(Me,{id:`site-share-max-root-size-mb`,label:n.policySiteMaxRootDirSizeMb,hint:n.policySiteMaxRootDirSizeHint,value:r.siteMaxRootDirSizeMb,min:1,max:10240,disabled:ge,onChange:_e}),t[161]=r.siteMaxRootDirSizeMb,t[162]=n.policySiteMaxRootDirSizeHint,t[163]=n.policySiteMaxRootDirSizeMb,t[164]=ge,t[165]=_e,t[166]=ve):ve=t[166];let ye=!r.siteEnabled,be;t[167]===i?be=t[168]:(be=e=>i({siteMaxFileCount:e}),t[167]=i,t[168]=be);let q;t[169]!==r.siteMaxFileCount||t[170]!==n.policySiteMaxFileCount||t[171]!==n.policySiteMaxFileCountHint||t[172]!==ye||t[173]!==be?(q=(0,$.jsx)(Me,{id:`site-share-max-files`,label:n.policySiteMaxFileCount,hint:n.policySiteMaxFileCountHint,value:r.siteMaxFileCount,min:1,max:1e5,disabled:ye,onChange:be}),t[169]=r.siteMaxFileCount,t[170]=n.policySiteMaxFileCount,t[171]=n.policySiteMaxFileCountHint,t[172]=ye,t[173]=be,t[174]=q):q=t[174];let J;t[175]!==le||t[176]!==fe||t[177]!==he||t[178]!==ve||t[179]!==q?(J=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[le,fe,he,ve,q]}),t[175]=le,t[176]=fe,t[177]=he,t[178]=ve,t[179]=q,t[180]=J):J=t[180];let Y;t[181]!==re||t[182]!==oe||t[183]!==J?(Y=(0,$.jsxs)(`div`,{className:`rounded-xl bg-surface-base/45 p-4`,children:[re,oe,J]}),t[181]=re,t[182]=oe,t[183]=J,t[184]=Y):Y=t[184];let X;return t[185]!==j||t[186]!==W||t[187]!==Y?(X=(0,$.jsxs)(`div`,{className:`space-y-4`,children:[j,W,Y]}),t[185]=j,t[186]=W,t[187]=Y,t[188]=X):X=t[188],X}function Me(e){let t=(0,xe.c)(21),{id:n,label:r,hint:i,value:a,min:o,max:s,disabled:c,onChange:l}=e,u;t[0]!==n||t[1]!==r?(u=(0,$.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,htmlFor:n,children:r}),t[0]=n,t[1]=r,t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=F(ke(),`max-w-xs font-mono text-xs`),t[3]=d):d=t[3];let f;t[4]!==s||t[5]!==o||t[6]!==l?(f=e=>{let t=Number(e.target.value);Number.isFinite(t)&&l(Math.max(o,Math.min(s,Math.floor(t))))},t[4]=s,t[5]=o,t[6]=l,t[7]=f):f=t[7];let p;t[8]!==c||t[9]!==n||t[10]!==s||t[11]!==o||t[12]!==f||t[13]!==a?(p=(0,$.jsx)(ve,{id:n,type:`number`,min:o,max:s,disabled:c,className:d,value:a,onChange:f}),t[8]=c,t[9]=n,t[10]=s,t[11]=o,t[12]=f,t[13]=a,t[14]=p):p=t[14];let m;t[15]===i?m=t[16]:(m=(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:i}),t[15]=i,t[16]=m);let h;return t[17]!==u||t[18]!==p||t[19]!==m?(h=(0,$.jsxs)(`div`,{children:[u,p,m]}),t[17]=u,t[18]=p,t[19]=m,t[20]=h):h=t[20],h}function Ne(e){let t=(0,xe.c)(25),{t:n,values:r,disabled:i,onChange:a}=e,o;t[0]!==a||t[1]!==r?(o=e=>{let t=e.trim();!t||r.includes(t)||r.length>=32||a([...r,t])},t[0]=a,t[1]=r,t[2]=o):o=t[2];let s=o,c;t[3]===n.policyInlinePreviewMimes?c=t[4]:(c=(0,$.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.policyInlinePreviewMimes}),t[3]=n.policyInlinePreviewMimes,t[4]=c);let l;t[5]===n.policyInlinePreviewMimesHint?l=t[6]:(l=(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n.policyInlinePreviewMimesHint}),t[5]=n.policyInlinePreviewMimesHint,t[6]=l);let u;t[7]!==i||t[8]!==a||t[9]!==r?(u=r.map(e=>(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-edge bg-surface-panel px-2 py-0.5 font-mono text-xs text-fg`,children:[e,i?null:(0,$.jsx)(`button`,{type:`button`,className:`text-fg-muted hover:text-fg`,"aria-label":`Remove ${e}`,onClick:()=>a(r.filter(t=>t!==e)),children:`×`})]},e)),t[7]=i,t[8]=a,t[9]=r,t[10]=u):u=t[10];let d;t[11]===u?d=t[12]:(d=(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:u}),t[11]=u,t[12]=d);let f;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=F(ke(),`font-mono text-xs`),t[13]=f):f=t[13];let p=i||r.length>=32,m;t[14]===s?m=t[15]:(m=e=>{e.key===`Enter`&&(e.preventDefault(),s(e.target.value),e.target.value=``)},t[14]=s,t[15]=m);let h;t[16]!==n.policyMimePlaceholder||t[17]!==p||t[18]!==m?(h=(0,$.jsx)(`input`,{className:f,placeholder:n.policyMimePlaceholder,disabled:p,onKeyDown:m}),t[16]=n.policyMimePlaceholder,t[17]=p,t[18]=m,t[19]=h):h=t[19];let g;return t[20]!==c||t[21]!==l||t[22]!==d||t[23]!==h?(g=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-xl bg-surface-base/45 p-4`,children:[c,l,d,h]}),t[20]=c,t[21]=l,t[22]=d,t[23]=h,t[24]=g):g=t[24],g}function Pe(e){let t=(0,xe.c)(70),{open:n,onOpenChange:r,onConfirm:i,initialPath:a,selectKind:c,conversationId:g,agentId:_}=e,b=c===void 0?`any`:c,x=l(s(Le)),S=x.workspace,C=x.sharesSettings,T=me(Ie),{data:D}=ne(o(Fe)?`picker-agents-list`:null,z),O;bb0:{let e;t[0]===_?e=t[1]:(e=_?.trim(),t[0]=_,t[1]=e);let n=e;if(n){O=n;break bb0}let r;t[2]===T?r=t[3]:(r=T.trim(),t[2]=T,t[3]=r);let i=r;if(i){O=i;break bb0}if(D?.defaultId){O=D.defaultId;break bb0}if(D?.agents?.[0]?.id){O=D.agents[0].id;break bb0}O=``}let k=O,[A,j]=(0,Y.useState)(k),M,N;t[4]===k?(M=t[5],N=t[6]):(M=()=>{j(k)},N=[k],t[4]=k,t[5]=M,t[6]=N),(0,Y.useEffect)(M,N);let{tree:I,loading:L,error:R,loadRoot:V,loadChildren:H,reset:U}=pe(A,g??null),W;t[7]===a?W=t[8]:(W=a?{path:a,isDirectory:!1}:null,t[7]=a,t[8]=W);let[G,K]=(0,Y.useState)(W),re;t[9]!==a||t[10]!==V||t[11]!==n||t[12]!==U||t[13]!==K?(re=()=>{if(!n){U(),K(a?{path:a,isDirectory:!1}:null);return}V()},t[9]=a,t[10]=V,t[11]=n,t[12]=U,t[13]=K,t[14]=re):re=t[14];let ie;t[15]!==g||t[16]!==a||t[17]!==V||t[18]!==n||t[19]!==A||t[20]!==U?(ie=[n,A,g,V,U,a],t[15]=g,t[16]=a,t[17]=V,t[18]=n,t[19]=A,t[20]=U,t[21]=ie):ie=t[21],(0,Y.useEffect)(re,ie);let ae;t[22]===H?ae=t[23]:(ae=e=>{H(e)},t[22]=H,t[23]=ae);let oe=ae,se=G!==null&&(b===`any`||b===`file`&&!G.isDirectory||b===`directory`&&G.isDirectory),ce;bb1:{if(!G){ce=C.pickerHintNone;break bb1}if(b===`file`&&G.isDirectory){ce=C.pickerHintNeedsFile;break bb1}if(b===`directory`&&!G.isDirectory){ce=C.pickerHintNeedsDirectory;break bb1}ce=`${G.isDirectory?`📁`:`📄`} ${G.path}`}let le=ce,ue=D?.agents??[],de;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(u,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),t[24]=de):de=t[24];let fe;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(fe=F(`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] w-[min(34rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2`,`flex h-[min(28rem,calc(100vh-3rem))] flex-col overflow-hidden rounded-lg border border-edge bg-surface-overlay shadow-popover outline-none`),t[25]=fe):fe=t[25];let ge;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,$.jsx)(w,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),t[26]=ge):ge=t[26];let _e=x.cron.refresh,ve=x.cron.refresh,ye;t[27]===V?ye=t[28]:(ye=()=>void V(),t[27]=V,t[28]=ye);let be=L&&`animate-spin`,q;t[29]===be?q=t[30]:(q=F(`size-4`,be),t[29]=be,t[30]=q);let J;t[31]===q?J=t[32]:(J=(0,$.jsx)(te,{className:q,"aria-hidden":!0}),t[31]=q,t[32]=J);let X;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(P,{className:`size-4`}),t[33]=X):X=t[33];let Se;t[34]!==R||t[35]!==S.loadError?(Se=R?(0,$.jsxs)(`p`,{className:`shrink-0 px-4 py-2 text-xs text-red-600 dark:text-red-400`,children:[S.loadError,`: `,R]}):null,t[34]=R,t[35]=S.loadError,t[36]=Se):Se=t[36];let Z;t[37]!==oe||t[38]!==L||t[39]!==G?.path||t[40]!==K||t[41]!==S.emptyDir||t[42]!==S.title||t[43]!==I?(Z=L&&I.length===0?(0,$.jsxs)(`p`,{className:`flex shrink-0 items-center gap-2 px-4 py-3 text-sm text-fg-muted`,children:[(0,$.jsx)(E,{className:`size-4 animate-spin`}),S.title,`…`]}):(0,$.jsx)(ee,{tree:I,selectedPath:G?.path??null,onSelectFile:e=>K({path:e,isDirectory:!1}),onSelectEntry:(e,t)=>K({path:e,isDirectory:t}),onExpandDir:oe,onAction:void 0,emptyHint:S.emptyDir}),t[37]=oe,t[38]=L,t[39]=G?.path,t[40]=K,t[41]=S.emptyDir,t[42]=S.title,t[43]=I,t[44]=Z):Z=t[44];let Ce;t[45]!==Se||t[46]!==Z?(Ce=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[Se,Z]}),t[45]=Se,t[46]=Z,t[47]=Ce):Ce=t[47];let Q;t[48]===le?Q=t[49]:(Q=(0,$.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-xs text-fg-muted`,children:le}),t[48]=le,t[49]=Q);let we;t[50]===r?we=t[51]:(we=()=>r(!1),t[50]=r,t[51]=we);let Te;t[52]!==C.cancel||t[53]!==we?(Te=(0,$.jsx)(B,{type:`button`,variant:`ghost`,onClick:we,children:C.cancel}),t[52]=C.cancel,t[53]=we,t[54]=Te):Te=t[54];let Ee=!se,De;t[55]!==i||t[56]!==r||t[57]!==A||t[58]!==G?(De=()=>{G&&(i({...G,agentId:A}),r(!1))},t[55]=i,t[56]=r,t[57]=A,t[58]=G,t[59]=De):De=t[59];let Oe;t[60]!==C.pickerConfirm||t[61]!==Ee||t[62]!==De?(Oe=(0,$.jsx)(B,{type:`button`,disabled:Ee,onClick:De,children:C.pickerConfirm}),t[60]=C.pickerConfirm,t[61]=Ee,t[62]=De,t[63]=Oe):Oe=t[63];let ke;t[64]!==Te||t[65]!==Oe?(ke=(0,$.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[Te,Oe]}),t[64]=Te,t[65]=Oe,t[66]=ke):ke=t[66];let Ae;return t[67]!==Q||t[68]!==ke?(Ae=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-edge px-4 py-3`,children:[Q,ke]}),t[67]=Q,t[68]=ke,t[69]=Ae):Ae=t[69],(0,$.jsx)(h,{open:n,onOpenChange:r,children:(0,$.jsxs)(f,{children:[de,(0,$.jsxs)(p,{className:fe,children:[(0,$.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-edge px-4`,children:[ge,(0,$.jsx)(m,{className:`min-w-0 flex-1 truncate text-base font-semibold text-fg`,children:C.pickerTitle}),(0,$.jsx)(`button`,{type:`button`,className:`inline-flex size-8 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50`,title:_e,"aria-label":ve,disabled:L,onClick:ye,children:J}),(0,$.jsx)(d,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex size-8 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":S.close,children:X})})]}),ue.length>0?(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-edge px-4 py-2`,children:[(0,$.jsx)(`label`,{className:`text-xs text-fg-muted`,htmlFor:`picker-agent-select`,children:C.pickerAgentLabel}),(0,$.jsx)(v,{id:`picker-agent-select`,className:`min-w-0 flex-1 rounded-md border border-edge bg-surface-panel px-2 py-1 text-sm text-fg focus:outline-none focus:ring-2 focus:ring-accent`,value:A,onChange:e=>{j(e.target.value),K(null)},children:ue.map(e=>(0,$.jsxs)(y,{value:e.id,children:[he(e,x.agentsSettings),e.id===D?.defaultId?` ★`:``]},e.id))})]}):null,Ce,Ae]})]})})}function Fe(e){return e.conversationId}function Ie(e){return e.agentId}function Le(e){return e.language}var Re=[`shares`,`policy`];function ze(e){let t=(e??``).trim();return Re.includes(t)?t:`shares`}function Be(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function Ve(e,t){let n=new Date(e).getTime()-Date.now(),r=Math.abs(n),i=n<0;if(r<6e4)return t===`zh`?`刚刚`:`just now`;let a=Math.floor(r/6e4);if(a<60){let e=t===`zh`?`${a} 分钟`:`${a}m`;return i?t===`zh`?`${e}前`:`${e} ago`:e}let o=Math.floor(a/60);if(o<24){let e=t===`zh`?`${o} 小时`:`${o}h`;return i?t===`zh`?`${e}前`:`${e} ago`:e}let s=Math.floor(o/24),c=t===`zh`?`${s} 天`:`${s}d`;return i?t===`zh`?`${c}前`:`${c} ago`:c}var He=[{value:36e5,key:`1h`},{value:216e5,key:`6h`},{value:864e5,key:`24h`},{value:2592e5,key:`3d`},{value:6048e5,key:`7d`},{value:2592e6,key:`30d`}];function Ue(){let e=(0,xe.c)(23),t=s(Ge),n=l(t).sharesSettings,r=!!o(We),[a,c]=i(),u;e[0]===a?u=e[1]:(u=ze(a.get(`tab`)),e[0]=a,e[1]=u);let d=u,f;e[2]===c?f=e[3]:(f=e=>{c(t=>{let n=new URLSearchParams(t);return e===`shares`?n.delete(`tab`):n.set(`tab`,e),n},{replace:!0})},e[2]=c,e[3]=f);let p=f;if(!r)return(0,$.jsx)(ye,{gap:`gap-3`,padding:`px-3 py-8 sm:px-5 xl:px-6`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.needToken})});let m={shares:n.tabShares,policy:n.tabPolicy},h=Re.map(e=>({id:e,label:m[e]})),g;e[4]===n.title?g=e[5]:(g=(0,$.jsx)(be,{title:n.title}),e[4]=n.title,e[5]=g);let _;e[6]!==d||e[7]!==p||e[8]!==n.tabsAria||e[9]!==h?(_=(0,$.jsx)(U,{items:h,activeTab:d,onChange:p,ariaLabel:n.tabsAria,tabIdPrefix:`shares-tab`,panelIdPrefix:`shares-panel`}),e[6]=d,e[7]=p,e[8]=n.tabsAria,e[9]=h,e[10]=_):_=e[10];let v;e[11]!==d||e[12]!==r||e[13]!==t||e[14]!==n?(v=d===`shares`?(0,$.jsx)(Ke,{t:n,language:t}):(0,$.jsx)(Ae,{hasToken:r}),e[11]=d,e[12]=r,e[13]=t,e[14]=n,e[15]=v):v=e[15];let y;e[16]!==d||e[17]!==v?(y=(0,$.jsx)(q,{id:d,activeTab:d,tabIdPrefix:`shares-tab`,panelIdPrefix:`shares-panel`,showHeading:!1,children:v}),e[16]=d,e[17]=v,e[18]=y):y=e[18];let b;return e[19]!==g||e[20]!==_||e[21]!==y?(b=(0,$.jsxs)(ye,{children:[g,_,y]}),e[19]=g,e[20]=_,e[21]=y,e[22]=b):b=e[22],b}function We(e){return e.conversationId}function Ge(e){return e.language}function Ke(e){let t=(0,xe.c)(79),{t:n,language:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={refreshInterval:3e4},t[0]=i):i=t[0];let{data:a,error:o,isLoading:s,mutate:c}=ne(`shares-list`,se,i),l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={refreshInterval:3e4},t[1]=l):l=t[1];let u=ne(`hosted-publications-list`,oe,l),d;t[2]===a?.payload?.shares?d=t[3]:(d=a?.payload?.shares??[],t[2]=a?.payload?.shares,t[3]=d);let f=d,[p,m]=(0,Y.useState)(!1),h;bb0:{if(p){h=f;break bb0}let e;t[4]===f?e=t[5]:(e=f.filter(Ze),t[4]=f,t[5]=e),h=e}let g=h,_;t[6]===f?_=t[7]:(_=f.filter(Xe),t[6]=f,t[7]=_);let v=_.length,y;t[8]===f?y=t[9]:(y=f.filter(Ye),t[8]=f,t[9]=y);let b=y.length,x;t[10]===c?x=t[11]:(x=()=>void c(),t[10]=c,t[11]=x);let S;t[12]!==n||t[13]!==x?(S=(0,$.jsx)(rt,{t:n,onCreated:x}),t[12]=n,t[13]=x,t[14]=S):S=t[14];let ee=u.data?.connected===!0,C=u.data?.publishingAllowed===!0,w;t[15]===u?w=t[16]:(w=()=>void u.mutate(),t[15]=u,t[16]=w);let T;t[17]!==r||t[18]!==C||t[19]!==w||t[20]!==ee?(T=(0,$.jsx)(Qe,{language:r,connected:ee,publishingAllowed:C,onCreated:w}),t[17]=r,t[18]=C,t[19]=w,t[20]=ee,t[21]=T):T=t[21];let E=p?n.allSharesTitle:n.listTitle,D;t[22]===v?D=t[23]:(D=v>0&&(0,$.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-fg-muted`,children:[`(`,v,`)`]}),t[22]=v,t[23]=D);let O;t[24]!==E||t[25]!==D?(O=(0,$.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[E,D]}),t[24]=E,t[25]=D,t[26]=O):O=t[26];let k;t[27]===c?k=t[28]:(k=()=>void c(),t[27]=c,t[28]=k);let A=s&&`animate-spin`,j;t[29]===A?j=t[30]:(j=F(`size-3.5`,A),t[29]=A,t[30]=j);let M;t[31]===j?M=t[32]:(M=(0,$.jsx)(te,{className:j}),t[31]=j,t[32]=M);let N;t[33]!==s||t[34]!==k||t[35]!==M?(N=(0,$.jsx)(B,{type:`button`,variant:`ghost`,className:`px-2 py-1`,onClick:k,disabled:s,children:M}),t[33]=s,t[34]=k,t[35]=M,t[36]=N):N=t[36];let P;t[37]!==b||t[38]!==p||t[39]!==n.hideExpired||t[40]!==n.showExpired?(P=b>0&&(0,$.jsx)(`button`,{type:`button`,className:`text-xs text-accent hover:underline`,onClick:()=>m(Je),children:p?n.hideExpired:n.showExpired}),t[37]=b,t[38]=p,t[39]=n.hideExpired,t[40]=n.showExpired,t[41]=P):P=t[41];let I;t[42]!==N||t[43]!==P?(I=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[N,P]}),t[42]=N,t[43]=P,t[44]=I):I=t[44];let L;t[45]!==O||t[46]!==I?(L=(0,$.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[O,I]}),t[45]=O,t[46]=I,t[47]=L):L=t[47];let R;t[48]!==a||t[49]!==o||t[50]!==g||t[51]!==s||t[52]!==r||t[53]!==c||t[54]!==n?(R=s&&!a?(0,$.jsx)(`div`,{className:`grid gap-2`,"aria-busy":`true`,children:Array.from({length:4}).map(qe)}):o?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-red-600 dark:text-red-400`,children:[(0,$.jsx)(`span`,{children:n.error}),(0,$.jsx)(B,{type:`button`,variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>void c(),children:n.retry})]}):g.length===0?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.emptyState}):(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:g.map(e=>(0,$.jsx)(at,{share:e,t:n,language:r,onRevoked:()=>void c(),onExtended:()=>void c()},e.id))}),t[48]=a,t[49]=o,t[50]=g,t[51]=s,t[52]=r,t[53]=c,t[54]=n,t[55]=R):R=t[55];let z;t[56]!==b||t[57]!==c||t[58]!==p||t[59]!==n?(z=b>0&&p&&(0,$.jsx)(ot,{t:n,onCleaned:()=>void c()}),t[56]=b,t[57]=c,t[58]=p,t[59]=n,t[60]=z):z=t[60];let V;t[61]!==L||t[62]!==R||t[63]!==z?(V=(0,$.jsxs)(J,{children:[L,R,z]}),t[61]=L,t[62]=R,t[63]=z,t[64]=V):V=t[64];let H;t[65]===u?H=t[66]:(H=()=>void u.mutate(),t[65]=u,t[66]=H);let U;t[67]!==u.data||t[68]!==u.error||t[69]!==u.isLoading||t[70]!==r||t[71]!==n||t[72]!==H?(U=(0,$.jsx)($e,{data:u.data,error:u.error,isLoading:u.isLoading,language:r,t:n,onChanged:H}),t[67]=u.data,t[68]=u.error,t[69]=u.isLoading,t[70]=r,t[71]=n,t[72]=H,t[73]=U):U=t[73];let W;return t[74]!==T||t[75]!==V||t[76]!==U||t[77]!==S?(W=(0,$.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[S,T,V,U]}),t[74]=T,t[75]=V,t[76]=U,t[77]=S,t[78]=W):W=t[78],W}function qe(e,t){return(0,$.jsx)(`div`,{className:`rounded-lg bg-surface-base/55 p-3`,children:(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(I,{className:`h-4 w-2/3`}),(0,$.jsx)(I,{className:`mt-2 h-3 w-1/2`})]}),(0,$.jsx)(I,{className:`h-7 w-20 rounded-md`})]})},t)}function Je(e){return!e}function Ye(e){return e.expired||e.revoked}function Xe(e){return!e.expired&&!e.revoked}function Ze(e){return!e.expired&&!e.revoked}function Qe({language:e,connected:t,publishingAllowed:n,onCreated:r}){let i=e===`zh`,[a,o]=(0,Y.useState)(``),[s,c]=(0,Y.useState)(``),[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(``),[h,g]=(0,Y.useState)(6048e5),[_,b]=(0,Y.useState)(!1),[S,ee]=(0,Y.useState)(null),[T,D]=(0,Y.useState)(null),O=async()=>{if(a.trim()){b(!0),D(null);try{let e=await le({path:a.trim(),title:p.trim()||void 0,ttlMs:h,spaFallback:!0,...s?{agentId:s}:{}});ee(e),r()}catch(e){D(e instanceof Error?e.message:String(e))}finally{b(!1)}}};return(0,$.jsxs)(J,{children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(x,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:i?`发布静态网站`:`Publish static website`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:i?`把工作区内的 HTML 文件,或包含 index.html 的网站目录,发布到隔离的托管域名。`:`Publish an HTML file or a website directory containing index.html to the isolated hosted origin.`}),t&&!n?(0,$.jsx)(`p`,{className:`mt-3 rounded-md bg-warning-soft px-3 py-2 text-xs text-warning`,children:i?`管理员已暂停你的公网分享能力。已有远端链接当前不可访问;你仍可在下方撤销它们。`:`An administrator has paused public sharing for your account. Existing hosted links are unavailable, but you can still revoke them below.`}):null,(0,$.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-[1fr_12rem]`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`input`,{value:a,onChange:e=>{o(e.target.value),u(!1),ee(null)},placeholder:i?`选择 HTML 文件或网站目录`:`Select an HTML file or website directory`,className:`h-9 min-w-0 flex-1 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent`}),(0,$.jsxs)(B,{type:`button`,variant:`ghost`,className:`shrink-0`,onClick:()=>f(!0),children:[a&&!l?(0,$.jsx)(C,{className:`size-4`}):(0,$.jsx)(w,{className:`size-4`}),a?i?`更换`:`Change`:i?`选择`:`Browse`]})]}),(0,$.jsxs)(v,{value:String(h),onChange:e=>g(Number(e.target.value)),children:[(0,$.jsx)(y,{value:`86400000`,children:i?`24 小时`:`24 hours`}),(0,$.jsx)(y,{value:`604800000`,children:i?`7 天`:`7 days`}),(0,$.jsx)(y,{value:`2592000000`,children:i?`30 天`:`30 days`})]}),(0,$.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),placeholder:i?`网站标题(可选)`:`Site title (optional)`,className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent sm:col-span-2`})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center gap-3`,children:[(0,$.jsxs)(B,{type:`button`,onClick:()=>void O(),disabled:!a.trim()||_||!t||!n,children:[_?(0,$.jsx)(E,{className:`size-4 animate-spin`}):(0,$.jsx)(x,{className:`size-4`}),_?i?`发布中…`:`Publishing…`:i?`发布网站`:`Publish site`]}),S?(0,$.jsxs)(`button`,{type:`button`,className:`min-w-0 truncate text-xs text-accent hover:underline`,onClick:()=>void V(S.shareUrl),children:[S.shareUrl,` · `,S.fileCount,` `,i?`个文件`:`files`,` · `,Be(S.totalBytes)]}):null]}),T?(0,$.jsx)(`p`,{className:`mt-3 text-xs text-danger`,children:T}):null]})]}),(0,$.jsx)(Pe,{open:d,onOpenChange:f,initialPath:a||void 0,agentId:s||void 0,selectKind:`any`,onConfirm:e=>{o(e.path),c(e.agentId),u(e.isDirectory),ee(null),D(null)}})]})}function $e(e){let t=(0,xe.c)(18),{data:n,error:r,isLoading:i,language:a,t:o,onChanged:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(x,{className:`size-4 text-accent`,"aria-hidden":!0}),t[0]=c):c=t[0];let l;t[1]===o.hostedTitle?l=t[2]:(l=(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[c,o.hostedTitle]}),t[1]=o.hostedTitle,t[2]=l);let u;t[3]===o.hostedHint?u=t[4]:(u=(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:o.hostedHint}),t[3]=o.hostedHint,t[4]=u);let d;t[5]!==l||t[6]!==u?(d=(0,$.jsx)(`div`,{className:`mb-3 flex items-start justify-between gap-3`,children:(0,$.jsxs)(`div`,{children:[l,u]})}),t[5]=l,t[6]=u,t[7]=d):d=t[7];let f;t[8]!==n||t[9]!==r||t[10]!==i||t[11]!==a||t[12]!==s||t[13]!==o?(f=i&&!n?(0,$.jsx)(`div`,{className:`grid gap-2`,"aria-busy":`true`,children:Array.from({length:2}).map(et)}):r?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:o.error}):n?.connected?(0,$.jsxs)(`div`,{className:`space-y-3`,children:[n.publishingAllowed?null:(0,$.jsx)(`p`,{className:`rounded-md bg-warning-soft px-3 py-2 text-xs text-warning`,children:a===`zh`?`管理员已暂停公网分享。已有托管链接当前不可访问,也不能更新;撤销操作仍然可用。`:`An administrator has paused public sharing. Existing hosted links are unavailable and cannot be updated; revocation remains available.`}),n.publications.length===0?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:o.hostedEmpty}):(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.publications.map(e=>(0,$.jsx)(tt,{publication:e,language:a,t:o,publishingAllowed:n.publishingAllowed,onChanged:s},e.id))})]}):(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:o.hostedDisconnected}),(0,$.jsx)(_e,{providerId:`xopc-share`,displayName:`XOPC Hosted Share`,connected:!1,onConnected:s})]}),t[8]=n,t[9]=r,t[10]=i,t[11]=a,t[12]=s,t[13]=o,t[14]=f):f=t[14];let p;return t[15]!==d||t[16]!==f?(p=(0,$.jsxs)(J,{children:[d,f]}),t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function et(e,t){return(0,$.jsxs)(`div`,{className:`rounded-lg bg-surface-base/55 p-3`,children:[(0,$.jsx)(I,{className:`h-4 w-2/3`}),(0,$.jsx)(I,{className:`mt-2 h-3 w-1/2`})]},t)}function tt({publication:e,language:t,t:n,publishingAllowed:r,onChanged:i}){let[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(!1),[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(!1),h=Date.now()>=new Date(e.expiresAt).getTime(),_=e.status===`active`&&!h,v=e.status===`revoked`?n.statusRevoked:h?n.statusExpired:e.status===`staging`?t===`zh`?`准备中`:`Staging`:n.statusActive,y=e.kind===`note_document`?k:e.kind===`static_site`?x:D,b=e.kind===`note_document`?t===`zh`?`笔记文档`:`Note document`:e.kind===`static_site`?t===`zh`?`静态网站`:`Static website`:t===`zh`?`会话快照`:`Conversation snapshot`,ee=(0,Y.useCallback)(async()=>{e.shareUrl&&await V(e.shareUrl)&&(u(!0),window.setTimeout(()=>u(!1),2e3))},[e.shareUrl]),C=(0,Y.useCallback)(async()=>{o(!1),c(!0);try{await de(e.id),i()}catch{}finally{c(!1)}},[e.id,i]),w=(0,Y.useCallback)(async()=>{if(!(!e.revision||e.revision<=1)){f(!0);try{let t=(await ie(e.id)).find(t=>t.revision<e.revision);if(!t)return;await fe(e.id,e.revision,t.revision),i()}catch{}finally{f(!1)}}},[e.id,e.revision,i]),O=(0,Y.useCallback)(async()=>{m(!0);try{await ae(e.id),i()}catch{}finally{m(!1)}},[e.id,i]);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`rounded-lg bg-surface-base/55 px-3 py-2.5`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(y,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,$.jsx)(`span`,{className:F(`text-xs font-medium`,_?`text-emerald-600 dark:text-emerald-400`:`text-fg-subtle`),children:v})]}),(0,$.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:[b,` · `,n.hostedRevision,` `,e.revision??`—`,` · `,e.managedFromThisDevice?n.hostedThisDevice:n.hostedOtherDevice]}),(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[(0,$.jsxs)(`span`,{children:[t===`zh`?`浏览`:`Views`,`: `,e.viewCount,e.maxViews===null?``:` / ${e.maxViews}`]}),(0,$.jsx)(`span`,{children:h?n.statusExpired:Ve(e.expiresAt,t)}),e.description?(0,$.jsx)(`span`,{className:`italic`,children:e.description}):null]})]}),_?(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[e.shareUrl?(0,$.jsx)(B,{type:`button`,variant:`ghost`,className:`px-2 py-1`,disabled:!r,title:n.copyUrl,onClick:()=>void ee(),children:l?(0,$.jsx)(g,{className:`size-3.5 text-emerald-500`}):(0,$.jsx)(S,{className:`size-3.5`})}):null,(e.revision??0)>1?(0,$.jsx)(B,{type:`button`,variant:`ghost`,className:`px-2 py-1`,disabled:d||!r,onClick:()=>void w(),title:t===`zh`?`回滚上一版本`:`Roll back one revision`,children:d?(0,$.jsx)(E,{className:`size-3.5 animate-spin`}):(0,$.jsx)(T,{className:`size-3.5`})}):null,e.kind===`static_site`&&e.managedFromThisDevice?(0,$.jsx)(B,{type:`button`,variant:`ghost`,className:`px-2 py-1`,disabled:p||!r,onClick:()=>void O(),title:t===`zh`?`发布工作区中的最新版本`:`Publish latest workspace version`,children:(0,$.jsx)(te,{className:F(`size-3.5`,p&&`animate-spin`)})}):null,(0,$.jsx)(B,{type:`button`,variant:`ghost`,className:`px-2 py-1 text-red-600 hover:text-red-700 dark:text-red-400`,disabled:s,onClick:()=>o(!0),children:s?(0,$.jsx)(E,{className:`size-3.5 animate-spin`}):(0,$.jsx)(A,{className:`size-3.5`})})]}):null]})}),(0,$.jsx)(G,{open:a,title:n.revokeConfirmTitle,description:n.revokeConfirmBody,confirmLabel:n.revokeConfirmLabel,cancelLabel:n.cancel,destructive:!0,onConfirm:()=>void C(),onCancel:()=>o(!1)})]})}var nt={expanded:!0,path:``,isDirectory:!1,agentId:``,ttlMs:864e5,maxViews:null,description:``,directoryMode:`browse`,creating:!1,result:null,errorMsg:null,resultDialogOpen:!1,pickerOpen:!1};function rt({t:e,onCreated:t}){let[n,r]=(0,Y.useReducer)(W,nt),{expanded:i,path:a,isDirectory:o,agentId:s,ttlMs:c,maxViews:l,description:u,directoryMode:d,creating:f,result:p,errorMsg:m,resultDialogOpen:h,pickerOpen:g}=n,_=(0,Y.useCallback)(async()=>{if(a.trim()){r({type:`patch`,patch:{creating:!0,errorMsg:null,result:null}});try{let e=await K({path:a.trim(),ttlMs:c,maxViews:l,description:u.trim()||void 0,...s?{agentId:s}:{},...o?{kind:`directory`,directoryMode:d}:{}});r({type:`patch`,patch:{result:e.payload,resultDialogOpen:!0}}),t()}catch(e){r({type:`patch`,patch:{errorMsg:e instanceof Error?e.message:String(e)}})}finally{r({type:`patch`,patch:{creating:!1}})}}},[a,o,s,c,l,u,d,t]),b=(0,Y.useCallback)(()=>{r({type:`patch`,patch:{path:``,isDirectory:!1,agentId:``,description:``,maxViews:null,ttlMs:864e5,directoryMode:`browse`,result:null,errorMsg:null}})},[]);return i?(0,$.jsxs)(J,{children:[(0,$.jsx)(`h2`,{className:`mb-1 text-sm font-semibold text-fg`,children:e.createTitle}),(0,$.jsx)(`p`,{className:`mb-4 text-xs text-fg-muted`,children:e.createHint}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.pathLabel}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`div`,{className:F(`flex min-w-0 flex-1 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm`,a?`text-fg`:`text-fg-subtle`),children:a?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{"aria-hidden":!0,children:o?`📁`:`📄`}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:a,children:a})]}):(0,$.jsx)(`span`,{className:`truncate`,children:e.pathPlaceholder})}),(0,$.jsxs)(B,{type:`button`,variant:`ghost`,onClick:()=>r({type:`patch`,patch:{pickerOpen:!0}}),children:[(0,$.jsx)(C,{className:`size-4`}),a?e.pathBrowseChange:e.pathBrowse]})]})]}),o?(0,$.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.directoryModeLabel}),(0,$.jsxs)(v,{className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:outline-none focus:ring-2 focus:ring-accent`,value:d,onChange:e=>r({type:`patch`,patch:{directoryMode:e.target.value===`zip-only`?`zip-only`:`browse`}}),children:[(0,$.jsx)(y,{value:`browse`,children:e.directoryModeBrowse}),(0,$.jsx)(y,{value:`zip-only`,children:e.directoryModeZipOnly})]})]}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,$.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.ttlLabel}),(0,$.jsx)(v,{className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:outline-none focus:ring-2 focus:ring-accent`,value:c,onChange:e=>r({type:`patch`,patch:{ttlMs:Number(e.target.value)}}),children:He.map(t=>(0,$.jsx)(y,{value:t.value,children:e.ttlOptions[t.key]},t.key))})]}),(0,$.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.maxViewsLabel}),(0,$.jsxs)(v,{className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:outline-none focus:ring-2 focus:ring-accent`,value:l??`unlimited`,onChange:e=>r({type:`patch`,patch:{maxViews:e.target.value===`unlimited`?null:Number(e.target.value)}}),children:[(0,$.jsx)(y,{value:`unlimited`,children:e.maxViewsUnlimited}),(0,$.jsx)(y,{value:`1`,children:`1`}),(0,$.jsx)(y,{value:`5`,children:`5`}),(0,$.jsx)(y,{value:`10`,children:`10`}),(0,$.jsx)(y,{value:`50`,children:`50`}),(0,$.jsx)(y,{value:`100`,children:`100`})]})]})]}),(0,$.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.descriptionLabel}),(0,$.jsx)(`input`,{type:`text`,className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle focus:outline-none focus:ring-2 focus:ring-accent`,placeholder:e.descriptionPlaceholder,value:u,onChange:e=>r({type:`patch`,patch:{description:e.target.value}})})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,$.jsxs)(B,{type:`button`,disabled:f||!a.trim(),onClick:()=>void _(),children:[f?(0,$.jsx)(E,{className:`size-4 animate-spin`}):(0,$.jsx)(O,{className:`size-4`}),f?e.creating:e.createButton]}),(0,$.jsx)(B,{type:`button`,variant:`ghost`,onClick:()=>{b(),r({type:`patch`,patch:{expanded:!1}})},children:e.cancel})]}),m&&(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:m})]}),(0,$.jsx)(j,{open:h,onOpenChange:e=>{r({type:`patch`,patch:{resultDialogOpen:e,...e?{}:{result:null}}})},result:p}),(0,$.jsx)(Pe,{open:g,onOpenChange:e=>r({type:`patch`,patch:{pickerOpen:e}}),initialPath:a||void 0,selectKind:`any`,onConfirm:e=>r({type:`patch`,patch:{path:e.path,isDirectory:e.isDirectory,agentId:e.agentId,directoryMode:`browse`}})})]}):(0,$.jsxs)(B,{type:`button`,onClick:()=>r({type:`patch`,patch:{expanded:!0}}),className:`self-start`,children:[(0,$.jsx)(O,{className:`size-4`}),e.createTitle]})}var it={revokeOpen:!1,revoking:!1,linksOpen:!1,urlCopied:!1,copyFailed:!1,extending:!1};function at({share:e,t,language:n,onRevoked:r,onExtended:i}){let[a,o]=(0,Y.useReducer)(W,it),{revokeOpen:s,revoking:c,linksOpen:l,urlCopied:u,copyFailed:d,extending:f}=a,p=!e.expired&&!e.revoked,m=e.revoked?t.statusRevoked:e.expired?t.statusExpired:t.statusActive,h=e.revoked?`text-red-600 dark:text-red-400`:e.expired?`text-fg-subtle`:`text-emerald-600 dark:text-emerald-400`,v=(0,Y.useCallback)(async()=>{o({type:`patch`,patch:{revokeOpen:!1,revoking:!0}});try{await re(e.id),r()}catch{}finally{o({type:`patch`,patch:{revoking:!1}})}},[e.id,r]),y=(0,Y.useCallback)(async()=>{if(o({type:`patch`,patch:{linksOpen:!0,copyFailed:!1}}),!await V(e.shareUrl)){o({type:`patch`,patch:{copyFailed:!0}}),window.setTimeout(()=>o({type:`patch`,patch:{copyFailed:!1}}),2500);return}o({type:`patch`,patch:{urlCopied:!0}}),window.setTimeout(()=>o({type:`patch`,patch:{urlCopied:!1}}),2e3)},[e.shareUrl]),x=(0,Y.useCallback)(async()=>{o({type:`patch`,patch:{extending:!0}});try{await ce(e.id,864e5),i()}catch{}finally{o({type:`patch`,patch:{extending:!1}})}},[e.id,i]),ee=`share-links-${e.id}`;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`rounded-lg bg-surface-panel/80 px-3 py-2.5 shadow-surface`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsxs)(`button`,{type:`button`,className:F(`flex min-w-0 flex-1 items-start gap-3 rounded-md text-left`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),"aria-expanded":l,"aria-controls":ee,onClick:()=>o({type:`patch`,patch:{linksOpen:!l}}),children:[(0,$.jsx)(_,{className:F(`mt-0.5 size-4 shrink-0 text-fg-muted transition-transform`,l?`rotate-0`:`-rotate-90`),"aria-hidden":!0}),e.kind===`note`?(0,$.jsx)(k,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}):e.kind===`session`?(0,$.jsx)(D,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}):(0,$.jsx)(C,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.fileName}),(0,$.jsx)(`span`,{className:F(`text-xs font-medium`,h),children:m})]}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-subtle`,children:e.kind===`note`?n===`zh`?`笔记快照 · 版本 ${e.snapshotRevision??1}`:`Note snapshot · revision ${e.snapshotRevision??1}`:e.kind===`session`?n===`zh`?`会话快照 · ${e.messageCount??0} 条消息 · 版本 ${e.snapshotRevision??1}`:`Conversation snapshot · ${e.messageCount??0} messages · revision ${e.snapshotRevision??1}`:e.workspaceRelativePath}),(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[(0,$.jsx)(`span`,{children:Be(e.fileSize)}),(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(b,{className:`size-3`}),e.expired?n===`zh`?`已过期`:`expired`:Ve(e.expiresAt,n)]}),(0,$.jsxs)(`span`,{children:[t.views,`: `,e.downloadCount,e.maxViews!==null&&` ${t.viewsOf} ${e.maxViews}`]}),e.description&&(0,$.jsx)(`span`,{className:`italic text-fg-subtle`,children:e.description})]})]})]}),(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:p&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(B,{type:`button`,variant:`ghost`,className:`px-2 py-1`,title:t.copyUrl,onClick:()=>void y(),children:u?(0,$.jsx)(g,{className:`size-3.5 text-emerald-500`}):(0,$.jsx)(S,{className:`size-3.5`})}),(0,$.jsx)(B,{type:`button`,variant:`ghost`,className:`px-2 py-1`,onClick:()=>void x(),disabled:f,title:t.extend,children:f?(0,$.jsx)(E,{className:`size-3.5 animate-spin`}):(0,$.jsx)(b,{className:`size-3.5`})}),(0,$.jsx)(B,{type:`button`,variant:`ghost`,className:`px-2 py-1 text-red-600 hover:text-red-700 dark:text-red-400`,onClick:()=>o({type:`patch`,patch:{revokeOpen:!0}}),disabled:c,children:c?(0,$.jsx)(E,{className:`size-3.5 animate-spin`}):(0,$.jsx)(A,{className:`size-3.5`})})]})})]}),p&&l?(0,$.jsxs)(`div`,{id:ee,className:`mt-3 bg-surface-base/45 py-3 pl-7 pr-3`,children:[(0,$.jsx)(M,{shareUrl:e.shareUrl,lanUrl:e.lanUrl,reachability:e.reachability,compact:!0}),d?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-red-600 dark:text-red-400`,children:t.copyFailed}):null,(0,$.jsx)(`div`,{className:`mt-2`,children:(0,$.jsx)(N,{reachability:e.reachability})})]}):null]}),(0,$.jsx)(G,{open:s,title:t.revokeConfirmTitle,description:t.revokeConfirmBody,confirmLabel:t.revokeConfirmLabel,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void v(),onCancel:()=>o({type:`patch`,patch:{revokeOpen:!1}})})]})}function ot({t:e,onCleaned:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(!1),o=(0,Y.useCallback)(async()=>{r(!1),a(!0);try{await ue(),t()}catch{}finally{a(!1)}},[t]);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,$.jsxs)(B,{type:`button`,variant:`secondary`,disabled:i,onClick:()=>r(!0),className:`border-danger/40 px-2 py-1 text-xs text-danger hover:bg-danger/10`,children:[i?(0,$.jsx)(E,{className:`size-3.5 animate-spin`}):(0,$.jsx)(A,{className:`size-3.5`}),e.cleanExpired]})}),(0,$.jsx)(G,{open:n,title:e.cleanExpiredConfirmTitle,description:e.cleanExpiredConfirmBody,confirmLabel:e.cleanExpiredConfirmLabel,cancelLabel:e.cancel,destructive:!0,onConfirm:()=>void o(),onCancel:()=>r(!1)})]})}export{Ue as SharesSettingsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
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"./cn-0WouolD0.js";import{n as o,t as s}from"./sliding-indicator-hwz0sx3h.js";import{r as c}from"./segmented-styles-Cqb91xsn.js";var l=i(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),u=n(),d=e(t(),1),f=r(),p=`touch-target relative z-[2] box-border flex h-6 flex-1 cursor-pointer items-center justify-center gap-1 rounded-pill border-0 bg-transparent px-2 py-0 text-center text-xs font-medium leading-none outline-none transition-[color,background-color,box-shadow] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel active:scale-100 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`;function m(e){let t=(0,u.c)(23),{value:n,onChange:r,options:i,"aria-label":l,flush:m,className:h,buttonClassName:g,indicatorClassName:_}=e,v=m!==void 0&&m,y=(0,d.useRef)(null),b=o(y,`button`,`button[aria-pressed="true"]`,+!v),x=v?`rounded-pill bg-surface-hover`:c,S;t[0]!==h||t[1]!==x?(S=a(x,`relative isolate flex w-full max-w-full flex-row items-center`,h),t[0]=h,t[1]=x,t[2]=S):S=t[2];let C=v?`bg-surface-active`:`bg-surface-panel shadow-sm dark:ring-1 dark:ring-edge-strong/40`,w;t[3]!==_||t[4]!==C?(w=a(`rounded-pill`,C,_),t[3]=_,t[4]=C,t[5]=w):w=t[5];let T;t[6]!==w||t[7]!==b?(T=(0,f.jsx)(s,{bounds:b,className:w}),t[6]=w,t[7]=b,t[8]=T):T=t[8];let E;if(t[9]!==g||t[10]!==r||t[11]!==i||t[12]!==n){let e;t[14]!==g||t[15]!==r||t[16]!==n?(e=e=>{let t=e.icon,i=n===e.value;return(0,f.jsxs)(`button`,{type:`button`,"aria-pressed":i,title:e.title??e.label,onClick:()=>r(e.value),className:a(p,i?`text-fg`:`text-fg-subtle`,g),children:[t?(0,f.jsx)(t,{className:`block size-3 shrink-0 opacity-80`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,f.jsx)(`span`,{className:`min-w-0 shrink truncate leading-none`,children:e.label})]},e.value)},t[14]=g,t[15]=r,t[16]=n,t[17]=e):e=t[17],E=i.map(e),t[9]=g,t[10]=r,t[11]=i,t[12]=n,t[13]=E}else E=t[13];let D;return t[18]!==l||t[19]!==S||t[20]!==T||t[21]!==E?(D=(0,f.jsxs)(`div`,{ref:y,className:S,role:`group`,"aria-label":l,children:[T,E]}),t[18]=l,t[19]=S,t[20]=T,t[21]=E,t[22]=D):D=t[22],D}export{l as n,m as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,o as n,p as r}from"./locale-store-Dy1EByeG.js";import{t as i}from"./createLucideIcon-DPHK1VkS.js";import{o as a}from"./vendor-swr-CdRzEUwF.js";var o=i(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),s=i(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),c=i(`handshake`,[[`path`,{d:`m11 17 2 2a1 1 0 1 0 3-3`,key:`efffak`}],[`path`,{d:`m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4`,key:`9pr0kb`}],[`path`,{d:`m21 3 1 11h-2`,key:`1tisrp`}],[`path`,{d:`M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3`,key:`1uvwmv`}],[`path`,{d:`M3 4h8`,key:`1ep09j`}]]),l=i(`languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),u=i(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),d=i(`user-round-pen`,[[`path`,{d:`M2 21a8 8 0 0 1 10.821-7.487`,key:`1c8h7z`}],[`path`,{d:`M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`1817ys`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}]]);function f(){return n(t(`/api/user-model`))}async function p(){let e=await f();return{profile:{callName:typeof e.profile.callName==`string`?e.profile.callName:``,role:typeof e.profile.role==`string`?e.profile.role:``,pronouns:typeof e.profile.pronouns==`string`?e.profile.pronouns:``,timezone:typeof e.profile.timezone==`string`?e.profile.timezone:``,locale:typeof e.profile.locale==`string`?e.profile.locale:``},...typeof e.suggestedCallName==`string`?{suggestedCallName:e.suggestedCallName}:{}}}async function m(e){let r=await n(t(`/api/user-model/profile`),{method:`PATCH`,body:JSON.stringify(e)});return{callName:r.profile.callName??``,role:r.profile.role??``,pronouns:r.profile.pronouns??``,timezone:r.profile.timezone??``,locale:r.profile.locale??``}}function h(){return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}function g(e,r){return n(t(`/api/user-model/assertions/${encodeURIComponent(e)}/status`),{method:`PATCH`,body:JSON.stringify({status:r})})}function _(e,r,i){return n(t(`/api/user-model/assertions/${encodeURIComponent(e)}/scope`),{method:`PATCH`,body:JSON.stringify({scope:r,version:i})})}function v(e,r){return n(t(`/api/user-model/assertions/${encodeURIComponent(e)}`),{method:`PATCH`,body:JSON.stringify({statement:r})})}function y(e,r){return n(t(`/api/user-model/priorities/${encodeURIComponent(e)}`),{method:`PATCH`,body:JSON.stringify(r)})}function b(e){let r=Date.now();return n(t(`/api/user-model/priorities`),{method:`POST`,body:JSON.stringify({targetType:`topic`,targetId:e.title.trim(),rank:`primary`,urgency:1,scope:{type:`global`},validFrom:r,validTo:e.validTo})})}function x(e,r){return n(t(`/api/user-model/rules/${encodeURIComponent(e)}/status`),{method:`PATCH`,body:JSON.stringify({status:r})})}function S(e){return n(t(`/api/user-model/rules`),{method:`POST`,body:JSON.stringify({category:e.category,statement:e.statement,priority:50,scope:e.scope,conditions:{...e.conditions,requiresConfirmation:!1}})})}function C(e,r,i){return n(t(`/api/knowledge-memory/${encodeURIComponent(e.id)}/review`),{method:`POST`,body:JSON.stringify({action:r,expectedStatus:e.status,...i===void 0?{}:{content:i}})})}function w(e){return n(t(`/api/user-model/assertions/${encodeURIComponent(e)}`),{method:`DELETE`})}function T(e){return n(t(`/api/knowledge-memory/${encodeURIComponent(e)}`),{method:`DELETE`})}function E(e){return n(t(`/api/user-model/settings`),{method:`PATCH`,body:JSON.stringify(e)})}async function D(){let n=await e(t(`/api/user-model/export`));if(!n.ok)throw Error(`Export failed (${n.status})`);let r=await n.blob(),i=(n.headers.get(`Content-Disposition`)??``).match(/filename="([^"]+)"/)?.[1]??`xopc-memory.json`,a=URL.createObjectURL(r),o=document.createElement(`a`);o.href=a,o.download=i,o.click(),URL.revokeObjectURL(a)}function O(e,r){return n(t(`/api/knowledge-memory/${encodeURIComponent(e.id)}/scope`),{method:`PATCH`,body:JSON.stringify({scope:r,version:e.version})})}var k=e=>e.status===`queued`||e.status===`running`,A=new Set,j,M=r((e,r)=>({sources:[],starting:!1,async start(i){if(!r().starting){e({starting:!0,error:void 0});try{await n(t(`/api/user-model/refresh`),{method:`POST`,body:JSON.stringify(i?{sourceIds:[i]}:{})}),await r().poll()}catch(t){e({error:t instanceof Error?t.message:String(t)})}finally{e({starting:!1})}}},poll(){return j||(j=(async()=>{try{let i=await n(t(`/api/user-model/refresh`)),o=new Map(r().sources.map(e=>[e.id,e.status]));e({sources:i.sources,error:void 0}),i.sources.some(e=>!k(e)&&o.get(e.id)!==e.status)&&a(`/api/user-model`);for(let e of i.sources)k(e)&&e.metadata.phase===`waiting_desktop`&&N(e)}catch(t){e({error:t instanceof Error?t.message:String(t)})}})().finally(()=>{j=void 0}),j)}}));async function N(e){let r=window.electronAPI?.understandingSources?.collect;if(!(!r||A.size>0)){A.add(e.id);try{let i;try{let t=(await r([e.adapterId])).find(t=>t.sourceId===e.adapterId);i=t?.status===`completed`?{items:t.items}:{items:[],error:t?.error??`Source collection failed. Check its permissions and retry.`}}catch{i={items:[],error:`Source collection was interrupted. Please retry.`}}await n(t(`/api/user-model/refresh/sources/${encodeURIComponent(e.id)}/collection`),{method:`POST`,body:JSON.stringify(i)}),await M.getState().poll()}catch(e){M.setState({error:e instanceof Error?e.message:String(e)})}finally{A.delete(e.id)}}}export{s as C,c as S,y as _,w as a,u as b,D as c,C as d,_ as f,E as g,x as h,S as i,f as l,O as m,v as n,T as o,g as p,b as r,h as s,M as t,p as u,m as v,o as w,l as x,d as y};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/attachment-load-DrVGNxJm.js","assets/rolldown-runtime-aKtaBQYM.js","assets/attachment-utils-core-BIOUBrpT.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{n as a}from"./locale-store-Dy1EByeG.js";import{t as o}from"./messages-BAnhwALN.js";import{o as s,r as c,s as l,t as u}from"./dist-CY7CS_D3.js";import{t as d}from"./chevron-left-DqFhpbvK.js";import{t as f}from"./chevron-right-BweFrslA.js";import{n as p,t as m}from"./file-BqMS_3DT.js";import{a as h,b as g,l as _,n as v,t as y}from"./use-file-preview-expanded-D0IBFhM9.js";import{t as b}from"./mic-CuUb7zc-.js";import{n as x}from"./share-link-dialog-C1t_HB6f.js";import{t as S}from"./cn-0WouolD0.js";import{r as C,t as w}from"./constants-Bg1wM2nv.js";import{r as T}from"./attachment-utils-core-BIOUBrpT.js";import{n as E}from"./right-workspace-store-HPw7Gw0n.js";import{n as D}from"./interaction-BdhHBbYa.js";import{t as O}from"./composer-notifications-CqV6Xj-H.js";import{n as k}from"./electron-env-DHOGevH3.js";import{i as A}from"./skill-wire-pattern-BPpeIcCi.js";import{a as j,n as ee,t as M}from"./file-preview-surface-i5UOFnQF.js";function N(e,t){let n=e.trim(),r=t.trim();return n&&A(n)?`/skill:${n}${r?` ${r}`:` `}`:r||null}function P(e,t,n){let r=e.trim(),i=t?.trim()??``;if(!r&&!i)return null;let a=new URLSearchParams;return r&&a.set(`draft`,r),a.set(`autoSend`,`1`),i&&a.set(`attachmentsHandoff`,i),n?.projectScope===`none`&&a.set(`projectScope`,`none`),`/chat/new?${a.toString()}`}function F(e){let t=e.startsWith(`?`)?e.slice(1):e;if(!t)return``;let n=new URLSearchParams(t),r=new URLSearchParams,i=n.get(`skill`),a=n.get(`slash`),o=n.get(`draft`),s=n.get(`autoSend`),c=n.get(`attachmentHandoff`),l=n.get(`attachmentsHandoff`),u=n.get(`agentSetup`);i&&r.set(`skill`,i),a&&r.set(`slash`,a),o&&r.set(`draft`,o),s===`1`&&r.set(`autoSend`,`1`),c&&r.set(`attachmentHandoff`,c),l&&r.set(`attachmentsHandoff`,l),n.get(`setup`)===`automation`&&r.set(`setup`,`automation`),u===`1`&&r.set(`agentSetup`,`1`),n.get(`scene`)===`find-skills`&&r.set(`scene`,`find-skills`);let d=r.toString();return d?`?${d}`:``}function I(e){let t=e.startsWith(`?`)?e.slice(1):e,n=new URLSearchParams(t),r=n.get(`projectId`)?.trim();return r?{kind:`project`,projectId:r}:n.get(`projectScope`)===`none`?{kind:`none`}:{kind:`remember-last`}}function L(e){let t=e?.trim();return t?`/chat/new?projectId=${encodeURIComponent(t)}`:`/chat/new?projectScope=none`}var R=n(),z=e(t(),1),B=r();function V(e){let t=(0,R.c)(6),n=g(),r,i;if(t[0]!==n||t[1]!==e?(r=()=>{!n||e.embedded||!e.open||!e.attachment||(E.getState().openFile({attachment:e.attachment,images:e.images,conversationId:e.conversationId||void 0,resultRevision:e.resultRevision},n),e.onClose())},i=[n,e],t[0]=n,t[1]=e,t[2]=r,t[3]=i):(r=t[2],i=t[3]),(0,z.useEffect)(r,i),n&&!e.embedded)return null;let a;return t[4]===e?a=t[5]:(a=(0,B.jsx)(H,{...e}),t[4]=e,t[5]=a),a}function H({open:e,embedded:t=!1,tabId:n,attachment:r,images:i=[],resultRevision:p,onAttachmentChange:m,authToken:h,conversationId:g,layerClassName:b=`z-[115]`,onClose:w}){let T=a(e=>e.language),E=o(T).chat,A=_({open:e,attachment:r,authToken:h,conversationId:g,language:T}),N=j(),{expanded:P,setExpanded:F}=y(e,N.dialogOpen),[I,L]=(0,z.useState)(!1),{preview:R,fileType:V,hasExtractedText:H}=A,U=r?i.findIndex(e=>e===r||e.id&&e.id===r.id||e.uri&&e.uri===r.uri||!e.id&&!e.uri&&e.name===r.name&&!!e.data&&e.data===r.data):-1,W=V===`image`&&i.length>1&&U>=0&&!!m,G=e=>{if(!W||N.dialogOpen)return;let t=U+(e===`previous`?-1:1);t>=0&&t<i.length&&m?.(i[t])},K=V!==`image`&&V!==`text`&&V!==`pptx`&&H,q=R?.uri?C(R.uri):null,J=!!(q||R?.uri?.startsWith(`media://`)&&(g||R.taskId)),Y=()=>{!R?.uri||!J||N.createShareLink(q?{fileId:q,fileName:R.name}:{uri:R.uri,conversationId:g??void 0,taskId:R.taskId,fileName:R.name})},X=!!(R&&!A.loading&&!A.loadError),Z=()=>{F(!1),w()},te=()=>{if(!R||!A.downloadBuffer)return;let e=new Blob([A.downloadBuffer],{type:A.descriptor.mimeType}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=R.name??`download`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},ne=!!A.downloadBuffer,re=k()&&V===`spreadsheet`&&/\.xlsx?$/i.test(A.fileName)&&!!A.downloadBuffer&&!!window.electronAPI?.shell?.openTemporaryFile,ie=async()=>{let e=A.downloadBuffer,t=window.electronAPI?.shell?.openTemporaryFile;if(!(!e||!t||I)){L(!0);try{(await t({fileName:A.fileName,data:new Uint8Array(e)})).ok||O(`warning`,E.attachmentPreviewOpenLocalFailed)}catch{O(`warning`,E.attachmentPreviewOpenLocalFailed)}finally{L(!1)}}},ae={onDownload:te,canDownload:ne},Q=S(`min-h-0 min-w-0 flex-1 cursor-pointer border-0 p-0`,`bg-surface-base transition-colors`,`hover:bg-surface-hover/90 dark:bg-black/60 dark:hover:bg-black/70`,D.focusRingBase),$=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(v,{header:{expanded:P,onToggleExpanded:X?()=>F(e=>!e):void 0,hideClose:t,hideExpand:!!n,onClose:Z,share:J?{onClick:Y,loading:N.loading}:void 0,openWithSystemApp:re?{onClick:()=>void ie(),loading:I}:void 0,textView:K?{active:A.showExtractedText,onChange:e=>{A.setShowExtractedText(e),A.clearLoadError()}}:void 0},chat:A.downloadBuffer?{conversationId:g,createFile:async()=>new File([A.downloadBuffer],A.fileName,{type:A.descriptor.mimeType})}:void 0,onImageSwipe:W?G:void 0,language:T,descriptor:n?{...A.descriptor,id:n}:A.descriptor,loading:A.loading,loadError:A.loadError,textContent:A.textContent,binaryBuffer:A.binaryBuffer,showExtractedText:A.showExtractedText,extractedText:A.extractedText,extractedTextTruncated:A.extractedTextTruncated,actions:ae}),p?(0,B.jsxs)(`p`,{className:`shrink-0 border-t border-edge px-4 py-2 text-xs text-fg-muted`,"data-result-revision":!0,children:[T===`zh`?`成果版本`:`Result version`,` `,p]}):null,W?(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-center gap-4 border-t border-edge bg-surface-panel px-3 py-2`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":E.attachmentPreviewPreviousImage,disabled:U===0,onClick:()=>G(`previous`),className:S(`flex size-11 touch-manipulation items-center justify-center rounded-lg hover:bg-surface-hover disabled:opacity-30`,D.focusRingBase),children:(0,B.jsx)(d,{size:20,"aria-hidden":`true`})}),(0,B.jsxs)(`span`,{role:`status`,className:`min-w-16 text-center text-sm tabular-nums text-fg-muted`,children:[U+1,` / `,i.length]}),(0,B.jsx)(`button`,{type:`button`,"aria-label":E.attachmentPreviewNextImage,disabled:U===i.length-1,onClick:()=>G(`next`),className:S(`flex size-11 touch-manipulation items-center justify-center rounded-lg hover:bg-surface-hover disabled:opacity-30`,D.focusRingBase),children:(0,B.jsx)(f,{size:20,"aria-hidden":`true`})})]}):null]});return t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(M,{expanded:P,children:$}),(0,B.jsx)(x,{open:N.dialogOpen,onOpenChange:N.handleOpenChange,loading:N.loading,error:N.error,result:N.result,pendingParams:N.pendingParams,onConfirm:e=>void N.confirmShareLink(e)})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(u,{open:e,onOpenChange:e=>!e&&Z(),children:(0,B.jsx)(s,{children:(0,B.jsxs)(c,{"aria-describedby":void 0,onKeyDown:e=>{!W||N.dialogOpen||e.altKey||e.ctrlKey||e.metaKey||e.target.closest(`input, textarea, select, [contenteditable="true"]`)||(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),G(e.key===`ArrowLeft`?`previous`:`next`))},className:S(`xopc-dialog-content-fullscreen fixed inset-0 flex h-[100dvh] w-full flex-row overflow-hidden`,ee(),b,`border-0 bg-transparent p-0 shadow-none outline-none`),children:[(0,B.jsx)(l,{className:`sr-only`,children:R?.name??``}),(0,B.jsx)(`button`,{type:`button`,className:Q,onClick:Z,"aria-label":E.attachmentPreviewClose}),(0,B.jsx)(`div`,{className:S(`flex h-full min-h-0 shrink-0 flex-col overflow-hidden`,P?`w-full`:`w-[min(100%,var(--max-width-app-main))]`,`bg-surface-panel sm:border-x sm:border-edge dark:sm:border-edge`,`shadow-float dark:shadow-elevated`),children:$}),(0,B.jsx)(`button`,{type:`button`,className:Q,onClick:Z,"aria-label":E.attachmentPreviewClose})]})})}),(0,B.jsx)(x,{open:N.dialogOpen,onOpenChange:N.handleOpenChange,loading:N.loading,error:N.error,result:N.result,pendingParams:N.pendingParams,onConfirm:e=>void N.confirmShareLink(e)})]})}function U(e){let t=(0,R.c)(23),{attachments:n,conversationId:r,topPadded:i,onRemove:s,className:c}=e,l=a(W),u;t[0]===l?u=t[1]:(u=o(l),t[0]=l,t[1]=u);let d=u.chat,[f,h]=(0,z.useState)(null);if(n.length===0)return null;let g=i?`pt-2`:`pt-3`,_;t[2]!==c||t[3]!==g?(_=S(`flex flex-wrap gap-2 border-b border-edge-subtle/90 bg-surface-hover/20 px-4 pb-2 dark:border-edge-subtle`,g,c),t[2]=c,t[3]=g,t[4]=_):_=t[4];let v;if(t[5]!==n||t[6]!==d||t[7]!==s){let e;t[9]!==d||t[10]!==s?(e=(e,t)=>{let n=e.type===`pasted_text`?d.pastedText:e.name;return(0,B.jsxs)(`div`,{className:`flex max-w-[200px] items-center rounded-lg bg-surface-hover text-xs dark:bg-surface-hover/80`,children:[(0,B.jsxs)(`button`,{type:`button`,className:S(`flex min-w-0 flex-1 items-center gap-1.5 rounded-l-lg py-1 pl-2 pr-1 text-left hover:bg-surface-active`,D.transition,D.press,D.focusRingPanel),onClick:()=>h(e),"aria-label":`${d.attachmentPreviewOpen}: ${n}`,title:`${d.attachmentPreviewOpen}: ${n}`,children:[e.mimeType?.startsWith(`image/`)&&e.content?(0,B.jsx)(`img`,{src:`data:${e.mimeType};base64,${e.content}`,alt:``,className:`size-6 shrink-0 rounded object-cover`}):e.type===`voice`||e.mimeType?.startsWith(`audio/`)?(0,B.jsx)(b,{className:`size-3.5 shrink-0 text-accent-fg`,"aria-hidden":!0}):e.type===`pasted_text`?(0,B.jsx)(p,{className:`size-3.5 shrink-0 text-accent-fg`,"aria-hidden":!0}):(0,B.jsx)(m,{className:`size-3.5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n}),(0,B.jsx)(`span`,{className:`shrink-0 text-fg-disabled`,children:T(e.size)})]}),(0,B.jsx)(`button`,{type:`button`,className:S(`flex min-h-8 min-w-8 items-center justify-center rounded-r-lg text-fg-muted hover:bg-surface-active hover:text-fg`,D.transition,D.press,D.focusRingPanel),onClick:()=>s(t),"aria-label":`${d.attachmentPreviewRemove}: ${n}`,title:`${d.attachmentPreviewRemove}: ${n}`,children:(0,B.jsx)(`span`,{"aria-hidden":!0,children:`×`})})]},e.id??`${e.name}-${e.size}-${e.mimeType}-${e.content?.slice(0,16)??``}`)},t[9]=d,t[10]=s,t[11]=e):e=t[11],v=n.map(e),t[5]=n,t[6]=d,t[7]=s,t[8]=v}else v=t[8];let y;t[12]!==_||t[13]!==v?(y=(0,B.jsx)(`div`,{className:_,children:v}),t[12]=_,t[13]=v,t[14]=y):y=t[14];let x=f!==null,C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>h(null),t[15]=C):C=t[15];let w;t[16]!==r||t[17]!==f||t[18]!==x?(w=(0,B.jsx)(V,{open:x,attachment:f,conversationId:r,onClose:C}),t[16]=r,t[17]=f,t[18]=x,t[19]=w):w=t[19];let E;return t[20]!==y||t[21]!==w?(E=(0,B.jsxs)(B.Fragment,{children:[y,w]}),t[20]=y,t[21]=w,t[22]=E):E=t[22],E}function W(e){return e.language}function G(e){let{chat:t,initialAttachments:n=[],onAttachmentsChange:r}=e,[a,o]=(0,z.useState)(n),[s,c]=(0,z.useState)(!1),l=(0,z.useRef)(null),u=(0,z.useRef)(a),d=(0,z.useRef)(r);u.current=a,d.current=r;let f=(0,z.useCallback)(e=>{let t=typeof e==`function`?e(u.current):e;u.current=t,o(t),d.current?.(t)},[]),p=(0,z.useCallback)(()=>{f([])},[]),m=(0,z.useCallback)(e=>{f(t=>t.filter((t,n)=>n!==e))},[]),g=(0,z.useCallback)(()=>u.current.map(e=>({type:e.type===`voice`?`voice`:e.type||`file`,mimeType:e.mimeType,data:e.content,name:e.name,size:e.size,...e.uri?{uri:e.uri}:{},...typeof e.durationSeconds==`number`&&Number.isFinite(e.durationSeconds)&&e.durationSeconds>0?{durationSeconds:e.durationSeconds}:{}})),[]),_=(0,z.useCallback)(async(e,n)=>{if(e.length===0)return;let r=10-u.current.length;if(r<=0){O(`warning`,t.maxAttachmentsReached,{max:10});return}let a=e.slice(0,r);e.length>a.length&&O(`warning`,t.maxAttachmentsTruncated,{max:10,dropped:e.length-a.length});let{loadAttachment:o}=await i(async()=>{let{loadAttachment:e}=await import(`./attachment-load-DrVGNxJm.js`).then(e=>e.t);return{loadAttachment:e}},__vite__mapDeps([0,1,2])),s=(await Promise.all(a.map(async e=>{if(e.size>33554432)return O(`warning`,t.attachmentFileTooLarge,{name:e.name,maxSize:T(w)}),null;try{return await o(e,e.name)}catch{return O(`error`,t.attachmentLoadFailed,{name:e.name}),null}}))).filter(e=>e!==null).map(e=>n?{...e,type:n}:e);f(e=>[...e,...s])},[t.attachmentFileTooLarge,t.attachmentLoadFailed,t.maxAttachmentsReached,t.maxAttachmentsTruncated]),v=(0,z.useCallback)(e=>_(e),[_]);return(0,z.useEffect)(()=>{if(e.conversationId)return h(e.conversationId,async e=>{let t=u.current.length;return await _([e]),u.current.length>t})},[_,e.conversationId]),{attachments:a,setAttachments:f,attachmentsRef:u,isDragging:s,setIsDragging:c,fileInputRef:l,processFiles:v,processPastedText:(0,z.useCallback)(e=>_([new File([e.text],e.name,{type:e.mimeType})],`pasted_text`),[_]),removeAttachment:m,clearAttachments:p,wireAttachmentsPayload:g}}export{P as a,F as c,N as i,U as n,L as o,V as r,I as s,G as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{l as i,m as a,t as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as s,n as c,o as l}from"./locale-store-Dy1EByeG.js";import{a as u,c as d,i as f,n as p,o as m,r as h,s as g,t as _}from"./dist-CY7CS_D3.js";import{n as v,t as y}from"./earth-C9Z4bTTG.js";import{t as b}from"./bot-DjLkhyZL.js";import{C as x,S,_ as C,a as w,b as T,c as E,d as D,f as O,g as k,h as A,i as j,l as M,m as ee,n as N,o as te,p as P,r as F,s as I,t as L,v as R,w as z,x as B,y as ne}from"./understanding-refresh-store-CdEfR40A.js";import{t as re}from"./briefcase-business-BsoCaI_t.js";import{t as ie}from"./calendar-days-hw_Y-g-s.js";import{t as ae}from"./check-DUBLcKHA.js";import{t as oe}from"./chevron-down-ccbiQQz_.js";import{t as V}from"./chevron-right-BweFrslA.js";import{n as H,r as U,t as W}from"./popover-select-CLsphyzA.js";import{t as se}from"./circle-alert-BEjgurr2.js";import{t as G}from"./circle-check-C23XjkUj.js";import{t as ce}from"./clock-3-DnrAnuyZ.js";import{t as le}from"./database-CjjeZfRG.js";import{t as ue}from"./download-Dk-ZjtO6.js";import{t as de}from"./ellipsis-0k4rZLoy.js";import{m as K,p as q,t as J}from"./understanding-activity-store-BFc8PamJ.js";import{t as fe}from"./folder-open-CyzJ19I9.js";import{t as pe}from"./git-branch-Dh9uxTot.js";import{t as me}from"./list-todo-CTVRto8O.js";import{t as he}from"./loader-circle-CifKLtgG.js";import{t as ge}from"./lock-keyhole-DEK5kH0u.js";import{t as _e}from"./message-circle-Badhj-4D.js";import{t as ve}from"./pencil-DmIY3Oa-.js";import{t as ye}from"./plus-Q2yW6OE7.js";import{t as be}from"./refresh-cw-BRlGaq2w.js";import{t as xe}from"./search-DA7gz22f.js";import{t as Se}from"./shield-check-BU58siTV.js";import{t as Ce}from"./sliders-horizontal-DqsYor6I.js";import{t as we}from"./sparkles-DHlfQFAF.js";import{t as Te}from"./sticky-note-fzP7NAJq.js";import{t as Ee}from"./trash-2-DusmjVPV.js";import{t as De}from"./upload-rrb46c3c.js";import{t as Oe}from"./user-round-C9jxPhMR.js";import{t as ke}from"./x-B_N4OPjy.js";import{t as Ae}from"./cn-0WouolD0.js";import{t as je}from"./skeleton-DzdOeGYz.js";import{i as Me}from"./vendor-swr-CdRzEUwF.js";import{t as Y}from"./button-Cc4hUNTt.js";import{r as Ne}from"./app-chrome-BeB4KgOf.js";import{t as Pe}from"./page-tabs-oeTY7z3_.js";import{t as Fe}from"./page-header-store-Bm8oxpFR.js";import{t as Ie}from"./loopi-CNtmi9FU.js";import{t as Le}from"./sliding-tab-list-CmcrqRzN.js";import{l as Re,m as ze,o as Be,r as Ve,t as He}from"./dist-ZrL34Ps4.js";import{t as Ue}from"./date-picker-XnE3iFhG.js";var X=e(t(),1),Z=n(),Q=r();function We(e){let t=(0,Z.c)(15),{sourceId:n,disabled:r}=e,i=r!==void 0&&r,a=c(qe)===`zh`,{sources:o,starting:s,start:l}=L(),u;t[0]!==n||t[1]!==o?(u=n?o.filter(e=>e.grantId===n):o,t[0]=n,t[1]=o,t[2]=u):u=t[2];let d=u,f;t[3]===d?f=t[4]:(f=d.some(Ke),t[3]=d,t[4]=f);let p=f,m=n&&d.some(Ge),h=p?a?`更新中`:`Updating`:m?a?`重试`:`Retry`:n?a?`更新理解`:`Update understanding`:a?`更新全部`:`Update all`,g=i||s||p,_;t[5]!==n||t[6]!==l?(_=()=>void l(n),t[5]=n,t[6]=l,t[7]=_):_=t[7];let v;t[8]===p?v=t[9]:(v=p?(0,Q.jsx)(he,{className:`size-3.5 animate-spin motion-reduce:animate-none`}):(0,Q.jsx)(be,{className:`size-3.5`}),t[8]=p,t[9]=v);let y;return t[10]!==h||t[11]!==g||t[12]!==_||t[13]!==v?(y=(0,Q.jsxs)(Y,{variant:`ghost`,className:`h-8 shrink-0 gap-1.5 px-2 text-xs`,disabled:g,onClick:_,children:[v,h]}),t[10]=h,t[11]=g,t[12]=_,t[13]=v,t[14]=y):y=t[14],y}function Ge(e){return e.status===`failed`||e.status===`partial`||e.status===`canceled`}function Ke(e){return e.status===`queued`||e.status===`running`}function qe(e){return e.language}function Je(e){let t=(0,Z.c)(22),{sourceId:n,lastCollectedAt:r}=e,i=c(Ye),a=i===`zh`,o;t[0]===n?o=t[1]:(o=e=>e.sources.find(e=>e.grantId===n),t[0]=n,t[1]=o);let s=L(o);if(!s){let e;t[2]!==i||t[3]!==r||t[4]!==a?(e=r?`${a?`上次更新:`:`Last updated: `}${new Date(r).toLocaleString(i)}`:a?`尚未分析`:`Not analyzed yet`,t[2]=i,t[3]=r,t[4]=a,t[5]=e):e=t[5];let n;return t[6]===e?n=t[7]:(n=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:e}),t[6]=e,t[7]=n),n}let l;t[8]===a?l=t[9]:(l=a?{queued:`等待更新`,waiting_desktop:`等待桌面端读取资料`,reading:`正在读取资料`,analyzing:`正在更新理解`}:{queued:`Queued`,waiting_desktop:`Waiting for desktop collection`,reading:`Reading source`,analyzing:`Updating understanding`},t[8]=a,t[9]=l);let u=l,d=s.status===`running`||s.status===`queued`,f=s.status===`failed`||s.status===`partial`||s.status===`canceled`,p=s.metadata.added,m=d?u[s.metadata.phase??`queued`]??u.queued:f?a?`更新未完成,可重试`:`Update incomplete; retry available`:p===0?a?`更新完成,暂无新增理解`:`Updated; no new understanding`:p===void 0?a?`更新完成`:`Updated`:a?`更新完成,新增 ${p} 条`:`Updated; ${p} added`,h;t[10]===m?h=t[11]:(h=(0,Q.jsx)(`p`,{children:m}),t[10]=m,t[11]=h);let g;t[12]!==i||t[13]!==s.completedAt?(g=s.completedAt?(0,Q.jsx)(`p`,{children:new Date(s.completedAt).toLocaleString(i)}):null,t[12]=i,t[13]=s.completedAt,t[14]=g):g=t[14];let _;t[15]!==f||t[16]!==s.errorMessage?(_=f&&s.errorMessage?(0,Q.jsx)(`p`,{className:`text-danger`,children:s.errorMessage}):null,t[15]=f,t[16]=s.errorMessage,t[17]=_):_=t[17];let v;return t[18]!==h||t[19]!==g||t[20]!==_?(v=(0,Q.jsxs)(`div`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,"aria-live":`polite`,children:[h,g,_]}),t[18]=h,t[19]=g,t[20]=_,t[21]=v):v=t[21],v}function Ye(e){return e.language}function Xe(e){let t=(0,Z.c)(87),{language:n,busy:r,statement:i,scope:a,onEdit:o,onDelete:s,onScopeChange:c}=e,[l,d]=(0,X.useState)(!1),[v,x]=(0,X.useState)(!1),S=n===`zh`,{data:C,isLoading:w,error:T}=Me(v?`memory-scope-options`:null,Ze),E;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(E={type:`global`},t[0]=E):E=t[0];let D=S?`所有协作`:`All work`,O=S?`任何助手和对话都可按需使用`:`Available when relevant across all work`,k;t[1]!==D||t[2]!==O?(k={value:E,icon:y,title:D,detail:O},t[1]=D,t[2]=O,t[3]=k):k=t[3];let A;if(t[4]!==a||t[5]!==C?.agents||t[6]!==C?.projects||t[7]!==k||t[8]!==S){let e;t[10]===S?e=t[11]:(e=e=>({value:{type:`agent`,id:e.id},icon:b,title:S?`仅助手:${e.name||e.id}`:`Assistant: ${e.name||e.id}`,detail:S?`不会分享给其他助手`:`Not shared with other assistants`}),t[10]=S,t[11]=e);let n;if(t[12]===S?n=t[13]:(n=e=>({value:{type:`project`,id:e.id},icon:y,title:S?`仅项目:${e.name}`:`Project: ${e.name}`,detail:S?`仅在此项目中按需使用`:`Available only in this project`}),t[12]=S,t[13]=n),A=[k,...(C?.agents??[]).map(e),...(C?.projects??[]).map(n)],a&&!A.some(e=>e.value.type===a.type&&e.value.id===a.id)){let e=S?`保留现有范围`:`Keep existing scope`,n;t[14]===S?n=t[15]:(n=S?{global:`所有协作`,agent:`指定助手`,workspace:`指定工作区`,project:`指定项目`,session:`指定会话`}:{global:`All work`,agent:`Assigned assistant`,workspace:`Assigned workspace`,project:`Assigned project`,session:`Assigned conversation`},t[14]=S,t[15]=n);let r=n[a.type],i;t[16]!==a||t[17]!==e||t[18]!==r?(i={value:a,icon:b,title:e,detail:r},t[16]=a,t[17]=e,t[18]=r,t[19]=i):i=t[19],A.push(i)}t[4]=a,t[5]=C?.agents,t[6]=C?.projects,t[7]=k,t[8]=S,t[9]=A}else A=t[9];let j=S?`修改或删除这条内容`:`Edit or delete this item`,M;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(de,{className:`size-4`,"aria-hidden":`true`}),t[20]=M):M=t[20];let ee;t[21]!==r||t[22]!==j?(ee=(0,Q.jsx)(ze,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:`size-11 shrink-0 p-0`,disabled:r,"aria-label":j,children:M})}),t[21]=r,t[22]=j,t[23]=ee):ee=t[23];let N;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(ve,{className:`size-4`,"aria-hidden":`true`}),t[24]=N):N=t[24];let te=S?`修改`:`Edit`,P;t[25]!==r||t[26]!==o||t[27]!==te?(P=(0,Q.jsxs)(Ve,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded-lg px-3 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,disabled:r,onSelect:o,children:[N,te]}),t[25]=r,t[26]=o,t[27]=te,t[28]=P):P=t[28];let F;t[29]!==r||t[30]!==c||t[31]!==a||t[32]!==S?(F=a&&c?(0,Q.jsxs)(Ve,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded-lg px-3 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,disabled:r,onSelect:()=>x(!0),children:[(0,Q.jsx)(Ce,{className:`size-4`,"aria-hidden":`true`}),S?`作用范围`:`Where it applies`]}):null,t[29]=r,t[30]=c,t[31]=a,t[32]=S,t[33]=F):F=t[33];let I,L;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>d(!0),L=(0,Q.jsx)(Ee,{className:`size-4`,"aria-hidden":`true`}),t[34]=I,t[35]=L):(I=t[34],L=t[35]);let R=S?`删除`:`Delete`,z;t[36]!==r||t[37]!==R?(z=(0,Q.jsxs)(Ve,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded-lg px-3 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,disabled:r,onSelect:I,children:[L,R]}),t[36]=r,t[37]=R,t[38]=z):z=t[38];let B;t[39]!==P||t[40]!==F||t[41]!==z?(B=(0,Q.jsx)(Be,{children:(0,Q.jsxs)(He,{align:`end`,sideOffset:4,className:`z-[100] min-w-36 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[P,F,z]})}),t[39]=P,t[40]=F,t[41]=z,t[42]=B):B=t[42];let ne;t[43]!==B||t[44]!==ee?(ne=(0,Q.jsxs)(Re,{modal:!1,children:[ee,B]}),t[43]=B,t[44]=ee,t[45]=ne):ne=t[45];let re;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Q.jsx)(u,{className:`fixed inset-0 z-[110] bg-scrim`}),t[46]=re):re=t[46];let ie=S?`删除这条内容?`:`Delete this item?`,ae;t[47]===ie?ae=t[48]:(ae=(0,Q.jsx)(g,{className:`font-semibold text-fg`,children:ie}),t[47]=ie,t[48]=ae);let oe=S?`删除后将不再使用这条记忆,原始对话和文件会保留。`:`This memory will no longer be used. Original conversations and files are kept.`,V;t[49]===oe?V=t[50]:(V=(0,Q.jsx)(f,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:oe}),t[49]=oe,t[50]=V);let H;t[51]!==ae||t[52]!==V?(H=(0,Q.jsxs)(`header`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[ae,V]}),t[51]=ae,t[52]=V,t[53]=H):H=t[53];let U;t[54]===i?U=t[55]:(U=(0,Q.jsx)(`p`,{className:`min-h-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words px-5 py-4 text-sm leading-6 text-fg`,children:i}),t[54]=i,t[55]=U);let W=S?`取消`:`Cancel`,se;t[56]===W?se=t[57]:(se=(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,children:W})}),t[56]=W,t[57]=se);let G;t[58]===s?G=t[59]:(G=()=>{d(!1),s()},t[58]=s,t[59]=G);let ce=S?`删除`:`Delete`,le;t[60]!==r||t[61]!==G||t[62]!==ce?(le=(0,Q.jsx)(Y,{disabled:r,onClick:G,children:ce}),t[60]=r,t[61]=G,t[62]=ce,t[63]=le):le=t[63];let ue;t[64]!==se||t[65]!==le?(ue=(0,Q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3`,children:[se,le]}),t[64]=se,t[65]=le,t[66]=ue):ue=t[66];let K;t[67]!==H||t[68]!==U||t[69]!==ue?(K=(0,Q.jsxs)(m,{children:[re,(0,Q.jsxs)(h,{className:`fixed left-1/2 top-1/2 z-[120] flex h-[min(22rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover`,children:[H,U,ue]})]}),t[67]=H,t[68]=U,t[69]=ue,t[70]=K):K=t[70];let q;t[71]!==l||t[72]!==ne||t[73]!==K?(q=(0,Q.jsxs)(_,{open:l,onOpenChange:d,children:[ne,K]}),t[71]=l,t[72]=ne,t[73]=K,t[74]=q):q=t[74];let J;t[75]!==r||t[76]!==A||t[77]!==c||t[78]!==a||t[79]!==T||t[80]!==w||t[81]!==v||t[82]!==S?(J=a&&c?(0,Q.jsx)(_,{open:v,onOpenChange:x,children:(0,Q.jsxs)(m,{children:[(0,Q.jsx)(u,{className:`fixed inset-0 z-[110] bg-scrim`}),(0,Q.jsxs)(h,{className:`fixed left-1/2 top-1/2 z-[120] flex h-[min(25rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover`,children:[(0,Q.jsxs)(`header`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[(0,Q.jsx)(g,{className:`font-semibold text-fg`,children:S?`这条记忆在哪里生效?`:`Where should this memory apply?`}),(0,Q.jsx)(f,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:S?`选择明确的助手或项目。工作区和会话范围也可在对应聊天中设置。`:`Choose an assistant or project. Workspace and conversation scopes can also be set in the corresponding chat.`})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-4`,children:[w?(0,Q.jsx)(je,{className:`h-20 w-full rounded-xl`}):null,T?(0,Q.jsx)(`p`,{role:`status`,className:`px-4 py-2 text-sm text-fg-muted`,children:S?`无法载入范围,请重试;现有范围未改变。`:`Could not load scopes. Your existing scope is unchanged.`}):null,A.map(e=>{let{value:t,icon:n,title:i,detail:o}=e,s=a.type===t.type&&(a.id??``)===(t.id??``);return(0,Q.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full items-center gap-3 rounded-xl px-4 py-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${s?`bg-surface-active`:`hover:bg-surface-hover`}`,disabled:r,onClick:()=>{x(!1),c(t)},children:[(0,Q.jsx)(n,{className:`size-5 shrink-0 text-fg-muted`,"aria-hidden":`true`}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:i}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:o})]}),s?(0,Q.jsx)(`span`,{className:`text-xs font-medium text-accent-fg`,children:S?`当前`:`Current`}):null]},`${t.type}:${t.id??``}`)})]}),(0,Q.jsx)(`footer`,{className:`flex shrink-0 justify-end border-t border-edge px-5 py-3`,children:(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,children:S?`取消`:`Cancel`})})})]})]})}):null,t[75]=r,t[76]=A,t[77]=c,t[78]=a,t[79]=T,t[80]=w,t[81]=v,t[82]=S,t[83]=J):J=t[83];let fe;return t[84]!==q||t[85]!==J?(fe=(0,Q.jsxs)(Q.Fragment,{children:[q,J]}),t[84]=q,t[85]=J,t[86]=fe):fe=t[86],fe}async function Ze(){let[e,t]=await Promise.all([l(s(`/api/agents`)),l(s(`/api/projects`))]);return{agents:e.payload?.agents??[],projects:t.items??[]}}function Qe(e,t){return e?new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en`,{dateStyle:`medium`}).format(e):null}function $e(e,t,n=new Date){let r=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i=new Date(r);i.setDate(r.getDate()-1);let a=new Map;for(let n of[...e].sort((e,t)=>t.recordedAt-e.recordedAt)){let e=n.recordedAt>=r.getTime()?t===`zh`?`今天`:`Today`:n.recordedAt>=i.getTime()?t===`zh`?`昨天`:`Yesterday`:Qe(n.recordedAt,t)??(t===`zh`?`更早`:`Earlier`),o=a.get(e)??[];o.push(n),a.set(e,o)}return[...a].map(([e,t])=>({label:e,items:t}))}function et(e,t){return(t===`zh`?{user_explicit:`你告诉我的`,user_observed:`从协作中观察到`,system_inferred:`xopc 的推测`,external_untrusted:`来自连接的信息`}:{user_explicit:`You told me`,user_observed:`Observed while working together`,system_inferred:`Inferred by xopc`,external_untrusted:`From connected information`})[e.authority]}function tt(e,t){if(e.validTo){let n=Qe(e.validTo,t);return t===`zh`?`适用至 ${n}`:`Applies until ${n}`}return(t===`zh`?{stable:`相对稳定`,slow:`会随时间复核`,dynamic:`近期状态`,event:`特定阶段`}:{stable:`Relatively stable`,slow:`Reviewed over time`,dynamic:`Current context`,event:`Specific period`})[e.volatility]}function nt(e,t){return e.authority===`user_explicit`?null:e.confidence>=.85?t===`zh`?`把握较高`:`High confidence`:e.confidence>=.65?t===`zh`?`把握中等`:`Medium confidence`:t===`zh`?`证据较少`:`Limited evidence`}function rt(e,t){return(t===`zh`?{global:`所有协作`,agent:`当前智能体`,workspace:`当前工作区`,project:`当前项目`,session:`当前会话`}:{global:`All work`,agent:`This agent`,workspace:`This workspace`,project:`This project`,session:`This conversation`})[e.type]}function it(e){let t=(0,Z.c)(25),{item:n,language:r,busy:i,editing:a,draft:o,onDraftChange:s,onEdit:c,onCancel:l,onDelete:u,onCorrect:d,onScopeChange:f}=e,p=(0,X.useId)(),[m,h]=(0,X.useState)(!1),g=r===`zh`,_;t[0]!==n||t[1]!==r?(_=nt(n,r),t[0]=n,t[1]=r,t[2]=_):_=t[2];let v=_,y;t[3]===n.sources?y=t[4]:(y=new Set(n.sources?.map(ot).filter(Boolean)),t[3]=n.sources,t[4]=y);let b;t[5]===y?b=t[6]:(b=[...y],t[5]=y,t[6]=b);let x=b,S=g?`修改`:`Edit`,C;return t[7]!==i||t[8]!==v||t[9]!==o||t[10]!==S||t[11]!==a||t[12]!==m||t[13]!==p||t[14]!==n||t[15]!==r||t[16]!==l||t[17]!==d||t[18]!==u||t[19]!==s||t[20]!==c||t[21]!==f||t[22]!==x||t[23]!==g?(C=(0,Q.jsx)(`article`,{className:`border-t border-edge-subtle px-4 py-3 first:border-t-0 sm:px-5 [content-visibility:auto] [contain-intrinsic-size:auto_100px]`,children:a?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`label`,{className:`text-sm font-medium text-fg`,htmlFor:p,children:g?`修改这条理解`:`Edit this understanding`}),(0,Q.jsx)(`textarea`,{id:p,value:o,disabled:i,onChange:e=>s(e.target.value),className:`mt-2 min-h-28 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-base leading-7 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(Y,{variant:`ghost`,disabled:i,onClick:l,children:g?`取消`:`Cancel`}),(0,Q.jsx)(Y,{variant:`primary`,disabled:!o.trim()||i,onClick:d,children:i?g?`保存中…`:`Saving…`:g?`保存修改`:`Save changes`})]})]}):(0,Q.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-2 sm:flex sm:gap-4`,children:[(0,Q.jsxs)(`div`,{className:`contents min-w-0 flex-1 pt-1.5 sm:block`,children:[(0,Q.jsx)(`p`,{className:`col-span-2 whitespace-pre-wrap break-words text-base leading-7 text-fg`,children:!m&&n.statement.length>240?`${n.statement.slice(0,240)}…`:n.statement}),n.statement.length>240?(0,Q.jsx)(`button`,{type:`button`,"aria-expanded":m,onClick:()=>h(!m),className:`col-span-2 mt-1 min-h-11 rounded-md text-left text-sm text-accent-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:m?g?`收起全文`:`Show less`:g?`展开全文`:`Read more`}):null,(0,Q.jsxs)(`div`,{className:`col-start-1 mt-1 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-xs leading-5 text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:et(n,r)}),n.usable===!1?(0,Q.jsx)(`span`,{children:g?`暂不使用`:`Not in use`}):null,n.validTo?(0,Q.jsx)(`span`,{children:tt(n,r)}):null,n.authority!==`user_explicit`&&n.confidence<.65?(0,Q.jsx)(`span`,{children:v}):null,(0,Q.jsxs)(`details`,{className:`open:basis-full`,children:[(0,Q.jsxs)(`summary`,{className:`flex min-h-11 w-fit cursor-pointer items-center rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,Q.jsx)(`span`,{className:`sm:hidden`,children:g?`查看来源`:`Sources`}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:g?`来源与使用方式`:`Sources & use`})]}),(0,Q.jsxs)(`div`,{className:`my-2 space-y-1 border-l-2 border-edge pl-3 text-sm leading-6`,children:[(0,Q.jsx)(`p`,{children:n.usable===!1?g?`目前不会用于回答。`:`Currently not used in responses.`:g?`回答相关问题时,xopc 会参考这条信息。`:`xopc can refer to this when answering related questions.`}),(0,Q.jsxs)(`p`,{children:[g?`适用范围:`:`Applies to: `,rt(n.scope,r)]}),n.validTo?(0,Q.jsx)(`p`,{children:tt(n,r)}):null,v?(0,Q.jsxs)(`p`,{children:[g?`确定程度:`:`Confidence: `,v]}):null,(0,Q.jsxs)(`p`,{children:[g?`最近记录:`:`Last noted: `,Qe(n.observedAt,r)]}),x.length?x.map(at):(0,Q.jsx)(`p`,{children:g?`暂无更详细的来源记录`:`No further source details available`})]})]})]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[(0,Q.jsx)(Y,{variant:`ghost`,className:`min-h-11 min-w-11 px-2`,disabled:i,onClick:c,children:S}),(0,Q.jsx)(Xe,{language:r,busy:i,statement:n.statement,scope:n.scope,onEdit:c,onDelete:u,onScopeChange:f})]})]})}),t[7]=i,t[8]=v,t[9]=o,t[10]=S,t[11]=a,t[12]=m,t[13]=p,t[14]=n,t[15]=r,t[16]=l,t[17]=d,t[18]=u,t[19]=s,t[20]=c,t[21]=f,t[22]=x,t[23]=g,t[24]=C):C=t[24],C}function at(e){return(0,Q.jsx)(`p`,{className:`break-words`,children:e},e)}function ot(e){return e.label}var st={zh:{eyebrow:`全局用户理解`,title:`xopc 如何形成对你的理解`,subtitle:`这里汇总跨项目、跨对话形成的认识,并说明它们来自哪些渠道。项目事实不会混入你的个人画像。`,channels:`理解渠道`,channelHint:`查看来源及其最近更新。`,noChannels:`尚未通过任何渠道形成可展示的全局理解。`,activeCount:`{{count}} 条已在使用`,pendingCount:`{{count}} 条暂不使用`,noUnderstanding:`暂无来自此渠道的全局理解`,pending:`最近更新`,pendingHint:`自动整理并按需使用,你可以随时修改或删除。`,nothingPending:`尚未形成全局理解。`,showAll:`查看全部 {{count}} 条`,showLess:`收起`,done:`完成`,updating:`正在从已授权渠道更新理解;你可以先查看已有内容。`,sourceKinds:{user:`你明确告诉我的`,conversation:`对话与协作`,connector:`连接的服务`,work_folder:`工作目录`,local_source:`本机来源`,inference:`综合整理`}},en:{eyebrow:`Global user understanding`,title:`How xopc forms its understanding of you`,subtitle:`This brings together understanding formed across projects and conversations, with the channel behind each item. Project facts stay out of your personal portrait.`,channels:`Understanding channels`,channelHint:`View sources and their latest updates.`,noChannels:`No channel has formed displayable global understanding yet.`,activeCount:`{{count}} in use`,pendingCount:`{{count}} not in use`,noUnderstanding:`No usable global understanding has formed from this channel yet`,pending:`Recent updates`,pendingHint:`Organized automatically and used when relevant. Edit or delete anytime.`,nothingPending:`No understanding has formed yet.`,showAll:`View all {{count}}`,showLess:`Show less`,done:`Done`,updating:`Updating from authorized channels. You can review existing understanding now.`,sourceKinds:{user:`You told me`,conversation:`Conversations and work`,connector:`Connected services`,work_folder:`Work folders`,local_source:`On-device sources`,inference:`Synthesized understanding`}}},ct={"local-recent-files":{en:`Recent files`,zh:`最近文件`},"chromium-bookmarks":{en:`Recent bookmarks`,zh:`最近书签`},"apple-notes":{en:`Apple Notes`,zh:`Apple 备忘录`},"apple-mail":{en:`Apple Mail`,zh:`Apple 邮件`},"apple-calendar":{en:`Apple Calendar`,zh:`Apple 日历`},"apple-reminders":{en:`Apple Reminders`,zh:`Apple 提醒事项`},"windows-recent-documents":{en:`Recent documents`,zh:`最近文档`},"linux-recent-documents":{en:`Recent documents`,zh:`最近文档`}},lt={user:Oe,conversation:_e,connector:le,work_folder:fe,local_source:K,inference:le},ut={files:fe,recent_documents:K,calendar:ie,tasks:me,notes:Te,mail:q,messages:_e,code_activity:pe};function $(e){let t=e.authority===`user_explicit`?`user`:e.authority===`user_observed`?`conversation`:e.authority===`external_untrusted`?`connector`:`inference`;return{id:t,kind:t,observedAt:e.observedAt}}function dt(e,t){return e.kind===`local_source`&&e.label?ct[e.label]?.[t]??e.label:e.kind===`work_folder`&&e.label?t===`zh`?`工作目录 · ${e.label}`:`Work folder · ${e.label}`:e.label?e.label:st[t].sourceKinds[e.kind]}function ft(e){return`${e.kind}:${e.adapterId}:${e.displayName}`}function pt(e){let t=(0,Z.c)(91),{assertions:n,configuredSources:r,activityRunning:i,language:a,busy:o,error:s,onReviewAssertion:c,onCompleted:l}=e,u=st[a],[d,f]=(0,X.useState)(!1),[p,m]=(0,X.useState)(null),[h,g]=(0,X.useState)(``),_;t[0]===n?_=t[1]:(_=n.filter(bt),t[0]=n,t[1]=_);let v=_,y;t[2]===v?y=t[3]:(y=[...v].sort(yt),t[2]=v,t[3]=y);let b=y,x;if(t[4]!==r||t[5]!==v||t[6]!==a){let e=new Map;for(let t of r){let n=t.kind===`local_source`?ct[t.adapterId]?.[a]??t.displayName:t.displayName,r=ft(t);e.set(r,{key:r,grantId:t.id,kind:t.kind,category:t.category,label:t.kind===`work_folder`?a===`zh`?`工作目录 · ${n}`:`Work folder · ${n}`:n,assertions:[],lastObservedAt:t.lastCollectedAt})}for(let t of v)for(let n of t.sources?.length?t.sources:[$(t)]){let r=dt(n,a),i=[...e.values()].find(e=>e.kind===n.kind&&e.label===r),o=i?.key??`${n.kind}:${r}`,s=i??e.get(o)??{key:o,kind:n.kind,category:n.category,label:r,assertions:[],lastObservedAt:n.observedAt};s.assertions.some(e=>e.id===t.id)||s.assertions.push(t),s.lastObservedAt=Math.max(s.lastObservedAt??0,n.observedAt),e.set(o,s)}x=[...e.values()].sort(vt),t[4]=r,t[5]=v,t[6]=a,t[7]=x}else x=t[7];let S=x,C;t[8]===c?C=t[9]:(C=async(e,t,n)=>{await c(e,t,n)&&m(null)},t[8]=c,t[9]=C);let w=C,T,E,D,O,k,A,j,M,ee;if(t[10]!==i||t[11]!==o||t[12]!==h||t[13]!==p||t[14]!==a||t[15]!==b||t[16]!==w||t[17]!==d||t[18]!==u.eyebrow||t[19]!==u.nothingPending||t[20]!==u.pending||t[21]!==u.pendingHint||t[22]!==u.showAll||t[23]!==u.showLess||t[24]!==u.subtitle||t[25]!==u.title||t[26]!==u.updating){let e=d?b:b.slice(0,5);T=`mx-auto w-full max-w-[42rem] pb-2`,E=`polite`;let n;t[36]===u.eyebrow?n=t[37]:(n=(0,Q.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-accent-fg`,children:u.eyebrow}),t[36]=u.eyebrow,t[37]=n);let r;t[38]===u.title?r=t[39]:(r=(0,Q.jsx)(`h2`,{className:`mt-3 text-2xl font-semibold tracking-tight text-fg sm:text-3xl`,children:u.title}),t[38]=u.title,t[39]=r);let s;t[40]===u.subtitle?s=t[41]:(s=(0,Q.jsx)(`p`,{className:`mx-auto mt-3 max-w-[38rem] text-sm leading-6 text-fg-muted`,children:u.subtitle}),t[40]=u.subtitle,t[41]=s),t[42]!==n||t[43]!==r||t[44]!==s?(D=(0,Q.jsxs)(`div`,{className:`text-center`,children:[n,r,s]}),t[42]=n,t[43]=r,t[44]=s,t[45]=D):D=t[45],t[46]!==i||t[47]!==u.updating?(O=i?(0,Q.jsxs)(`div`,{className:`mt-6 flex items-center gap-3 rounded-xl border border-accent/20 bg-accent-soft/55 px-4 py-3 text-sm text-accent-fg`,children:[(0,Q.jsx)(he,{className:`size-4 shrink-0 animate-spin motion-reduce:animate-none`}),(0,Q.jsx)(`p`,{children:u.updating})]}):null,t[46]=i,t[47]=u.updating,t[48]=O):O=t[48],k=`mt-8`,A=`understanding-updates-title`;let c=b.length?` · ${b.length}`:``;t[49]!==u.pending||t[50]!==c?(j=(0,Q.jsxs)(`h3`,{id:`understanding-updates-title`,className:`text-sm font-semibold text-fg`,children:[u.pending,c]}),t[49]=u.pending,t[50]=c,t[51]=j):j=t[51],t[52]===u.pendingHint?M=t[53]:(M=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:u.pendingHint}),t[52]=u.pendingHint,t[53]=M),ee=b.length?(0,Q.jsxs)(`div`,{className:`mt-3`,children:[$e(e,a).map(e=>{let{label:t,items:n}=e;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`border-b border-edge-subtle px-4 pb-2 pt-3 text-xs font-medium text-fg-muted`,children:t}),(0,Q.jsx)(`div`,{children:n.map(e=>(0,Q.jsx)(it,{item:e,language:a,busy:o,editing:p===e.id,draft:h,onDraftChange:g,onEdit:()=>{m(e.id),g(e.statement)},onCancel:()=>m(null),onCorrect:()=>void w(e,`edited`,h.trim()),onDelete:()=>void w(e,`deleted`)},e.id))})]},t)}),b.length>5?(0,Q.jsxs)(`button`,{type:`button`,className:`mx-auto flex items-center gap-1.5 px-3 py-2 text-xs font-medium text-accent-fg hover:underline`,onClick:()=>f(_t),children:[d?u.showLess:u.showAll.replace(`{{count}}`,String(b.length)),(0,Q.jsx)(oe,{className:Ae(`size-3.5 transition-transform`,d&&`rotate-180`)})]}):null]}):(0,Q.jsxs)(`div`,{className:`mt-3 flex items-start gap-3 rounded-xl border border-edge bg-surface-base/55 p-4`,children:[(0,Q.jsx)(G,{className:`mt-0.5 size-5 shrink-0 text-success`}),(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:u.nothingPending})]}),t[10]=i,t[11]=o,t[12]=h,t[13]=p,t[14]=a,t[15]=b,t[16]=w,t[17]=d,t[18]=u.eyebrow,t[19]=u.nothingPending,t[20]=u.pending,t[21]=u.pendingHint,t[22]=u.showAll,t[23]=u.showLess,t[24]=u.subtitle,t[25]=u.title,t[26]=u.updating,t[27]=T,t[28]=E,t[29]=D,t[30]=O,t[31]=k,t[32]=A,t[33]=j,t[34]=M,t[35]=ee}else T=t[27],E=t[28],D=t[29],O=t[30],k=t[31],A=t[32],j=t[33],M=t[34],ee=t[35];let N;t[54]!==k||t[55]!==A||t[56]!==j||t[57]!==M||t[58]!==ee?(N=(0,Q.jsxs)(`section`,{className:k,"aria-labelledby":A,children:[j,M,ee]}),t[54]=k,t[55]=A,t[56]=j,t[57]=M,t[58]=ee,t[59]=N):N=t[59];let te;t[60]!==S.length||t[61]!==u.channels?(te=(0,Q.jsxs)(`summary`,{className:`w-fit cursor-pointer rounded-md py-2 text-sm font-medium text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[u.channels,` · `,S.length]}),t[60]=S.length,t[61]=u.channels,t[62]=te):te=t[62];let P;t[63]===u.channelHint?P=t[64]:(P=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:u.channelHint}),t[63]=u.channelHint,t[64]=P);let F;t[65]!==S||t[66]!==u.activeCount||t[67]!==u.noChannels||t[68]!==u.noUnderstanding||t[69]!==u.pendingCount?(F=S.length?(0,Q.jsx)(`div`,{className:`mt-3 space-y-3`,children:S.map(e=>{let t=e.category?ut[e.category]??lt[e.kind]:lt[e.kind],n=e.assertions.filter(gt).length,r=e.assertions.filter(ht).length;return(0,Q.jsxs)(`article`,{className:`rounded-xl border border-edge bg-surface-base/55 px-4 py-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-surface-hover text-fg-muted`,children:(0,Q.jsx)(t,{className:`size-4`})}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h4`,{className:`truncate text-sm font-medium text-fg`,children:e.label}),e.grantId?(0,Q.jsx)(Je,{sourceId:e.grantId,lastCollectedAt:e.lastObservedAt}):null,e.assertions.length?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[n?u.activeCount.replace(`{{count}}`,String(n)):``,r?u.pendingCount.replace(`{{count}}`,String(r)):``].filter(Boolean).join(` · `)}):(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:u.noUnderstanding})]}),e.grantId?(0,Q.jsx)(We,{sourceId:e.grantId}):null]}),e.assertions.length?(0,Q.jsx)(`ul`,{className:`ml-12 mt-3 space-y-2 border-t border-edge-subtle pt-3 text-xs leading-5 text-fg-muted`,children:e.assertions.slice(0,5).map(mt)}):null]},e.key)})}):(0,Q.jsx)(`p`,{className:`mt-3 rounded-xl border border-edge bg-surface-base/55 p-4 text-sm text-fg-muted`,children:u.noChannels}),t[65]=S,t[66]=u.activeCount,t[67]=u.noChannels,t[68]=u.noUnderstanding,t[69]=u.pendingCount,t[70]=F):F=t[70];let I;t[71]!==te||t[72]!==P||t[73]!==F?(I=(0,Q.jsxs)(`details`,{className:`mt-6 border-t border-edge pt-4`,children:[te,P,F]}),t[71]=te,t[72]=P,t[73]=F,t[74]=I):I=t[74];let L;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(ae,{className:`size-4`}),t[75]=L):L=t[75];let R;t[76]!==o||t[77]!==l||t[78]!==u.done?(R=(0,Q.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,Q.jsxs)(Y,{variant:`primary`,disabled:o,onClick:l,children:[L,u.done]})}),t[76]=o,t[77]=l,t[78]=u.done,t[79]=R):R=t[79];let z;t[80]===s?z=t[81]:(z=s?(0,Q.jsx)(`p`,{className:`mt-5 text-sm text-danger`,role:`alert`,children:s}):null,t[80]=s,t[81]=z);let B;return t[82]!==T||t[83]!==E||t[84]!==D||t[85]!==O||t[86]!==N||t[87]!==I||t[88]!==R||t[89]!==z?(B=(0,Q.jsxs)(`section`,{className:T,"aria-live":E,children:[D,O,N,I,R,z]}),t[82]=T,t[83]=E,t[84]=D,t[85]=O,t[86]=N,t[87]=I,t[88]=R,t[89]=z,t[90]=B):B=t[90],B}function mt(e){return(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent/60`}),(0,Q.jsx)(`span`,{children:e.statement})]},e.id)}function ht(e){return!e.usable}function gt(e){return e.usable}function _t(e){return!e}function vt(e,t){return t.assertions.length-e.assertions.length||(t.lastObservedAt??0)-(e.lastObservedAt??0)}function yt(e,t){return t.recordedAt-e.recordedAt}function bt(e){return e.scope.type===`global`&&e.status!==`archived`&&e.status!==`rejected`}function xt(){let{pathname:e,search:t}=i(),n=c(e=>e.language),r=J(),[a,o]=(0,X.useState)(!1),[s,l]=(0,X.useState)(null),v=e===`/user-model`,{data:y,mutate:b}=Me(v?`/api/user-model`:null,M),x=L(e=>e.error),S=L(e=>e.sources.some(e=>e.status===`running`||e.status===`queued`)),C=n===`zh`;if((0,X.useEffect)(()=>{v&&new URLSearchParams(t).get(`workDiscovery`)===`review`&&J.getState().setDrawerOpen(!0)},[v,t]),(0,X.useEffect)(()=>{v&&r.status!==`running`&&b()},[b,v,r.directoryRun?.id,r.status]),!v)return null;let T=r.status===`running`||S,E=async(e,t,n)=>{o(!0),l(null);try{return t===`edited`&&n?await N(e.id,n):t===`deleted`&&await w(e.id),await b(),!0}catch(e){return l(e instanceof Error?e.message:String(e)),!1}finally{o(!1)}},D=e=>{if(!e&&y&&r.status!==`running`){r.finish();return}r.setDrawerOpen(e)};return(0,Q.jsxs)(_,{open:r.drawerOpen,onOpenChange:D,children:[(0,Q.jsx)(d,{asChild:!0,children:(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,className:Ae(`relative size-8 rounded-xl p-0`,Ne),title:C?`查看 xopc 对你的理解`:`Review what xopc understands`,"aria-label":C?`查看 xopc 对你的理解`:`Review what xopc understands`,children:T?(0,Q.jsx)(he,{className:`size-4 animate-spin motion-reduce:animate-none`}):(0,Q.jsx)(we,{className:`size-4 text-accent-fg`})})}),(0,Q.jsxs)(m,{children:[(0,Q.jsx)(u,{className:`fixed inset-0 z-[60] bg-scrim backdrop-blur-sm data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:backdrop-blur-none`}),(0,Q.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-[61] flex items-center justify-center p-3 sm:p-6`,children:(0,Q.jsxs)(h,{className:`xopc-understanding-center pointer-events-auto flex h-[min(42rem,calc(100dvh-1.5rem))] w-[min(44rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float outline-none sm:h-[min(42rem,calc(100dvh-3rem))] sm:w-[min(44rem,calc(100vw-3rem))]`,children:[(0,Q.jsxs)(`header`,{className:`flex h-16 shrink-0 items-center justify-between border-b border-edge-subtle px-5 sm:px-6`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(g,{className:`text-sm font-semibold text-fg`,children:T?C?`正在更新用户理解`:`Updating user understanding`:C?`用户理解`:`User understanding`}),(0,Q.jsx)(f,{className:`mt-0.5 text-xs text-fg-muted`,children:T?C?`关闭窗口也会在后台继续`:`You can close this window; work continues in the background`:C?`自动更新,可随时修改或删除`:`Updated automatically. Edit or delete anytime`})]}),(0,Q.jsx)(We,{disabled:!y?.sources?.length}),(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:`size-8 rounded-xl p-0`,"aria-label":C?`关闭`:`Close`,children:(0,Q.jsx)(ke,{className:`size-4`})})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-7 sm:px-9 sm:py-9`,children:y?(0,Q.jsx)(pt,{assertions:y.assertions,configuredSources:y.sources??[],activityRunning:T,language:n,busy:a,error:s??x??null,onReviewAssertion:E,onCompleted:()=>{D(!1)}}):(0,Q.jsxs)(`section`,{className:`space-y-4`,"aria-label":C?`正在加载用户理解`:`Loading user understanding`,children:[(0,Q.jsx)(je,{className:`h-8 w-2/3`}),(0,Q.jsx)(je,{className:`h-32 w-full`}),(0,Q.jsx)(je,{className:`h-32 w-full`})]})})]})})]})]})}function St(e){let t=(0,Z.c)(34),{language:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={refreshInterval:15e3},t[0]=r):r=t[0];let{data:i,error:a,isLoading:o}=Me(`memory-learning-status`,Nt,r);if(o){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(je,{className:`h-14 w-full rounded-xl`}),t[1]=e):e=t[1],e}if(a||!i?.jobs||!i?.coverage)return null;let s;t[2]===i.jobs?s=t[3]:(s=i.jobs.filter(Mt).reduce(jt,0),t[2]=i.jobs,t[3]=s);let c=s,l;t[4]===i.coverage?l=t[5]:(l=i.coverage.filter(At).reduce(kt,0),t[4]=i.coverage,t[5]=l);let u=l,d;t[6]===i.coverage?d=t[7]:(d=i.coverage.filter(Ot).reduce(Dt,0),t[6]=i.coverage,t[7]=d);let f=d,p;t[8]===i.jobs?p=t[9]:(p=i.jobs.filter(Et).reduce(Tt,0),t[8]=i.jobs,t[9]=p);let m=p,h;t[10]===i.jobs?h=t[11]:(h=i.jobs.filter(wt).reduce(Ct,0),t[10]=i.jobs,t[11]=h);let g=h,_=n===`zh`?`资料 ${f} 条 · 已生效记忆 ${u} 条`:`${f} sources · ${u} active memories`,v;t[12]!==n||t[13]!==c?(v=c>0?(0,Q.jsx)(`span`,{className:`ml-2`,children:n===`zh`?`${c} 项处理中`:`${c} processing`}):null,t[12]=n,t[13]=c,t[14]=v):v=t[14];let y=n===`zh`?`计数说明`:`About these counts`,b;t[15]===y?b=t[16]:(b=(0,Q.jsx)(`summary`,{className:`w-fit cursor-pointer rounded focus-visible:outline-accent`,children:y}),t[15]=y,t[16]=b);let x=n===`zh`?`仅统计已启用且有依据的工作记忆;管理列表包含其他状态。“关于你”单独计数。`:`Work memories must be active and supported. Management lists include other states. About you is counted separately.`,S;t[17]===x?S=t[18]:(S=(0,Q.jsx)(`p`,{className:`mt-1 leading-5`,children:x}),t[17]=x,t[18]=S);let C;t[19]!==b||t[20]!==S?(C=(0,Q.jsxs)(`details`,{className:`mt-1 text-xs`,children:[b,S]}),t[19]=b,t[20]=S,t[21]=C):C=t[21];let w;t[22]!==m||t[23]!==n?(w=m>0?(0,Q.jsx)(`span`,{className:`ml-2`,children:n===`zh`?`${m} 项处理失败`:`${m} failed jobs`}):null,t[22]=m,t[23]=n,t[24]=w):w=t[24];let T;t[25]!==n||t[26]!==g?(T=g>0?(0,Q.jsx)(`span`,{className:`ml-2`,children:n===`zh`?`${g} 项等待配置本地模型`:`${g} jobs require a local model`}):null,t[25]=n,t[26]=g,t[27]=T):T=t[27];let E;return t[28]!==C||t[29]!==w||t[30]!==T||t[31]!==_||t[32]!==v?(E=(0,Q.jsxs)(`div`,{className:`rounded-xl border border-edge bg-surface-base px-4 py-3 text-sm text-fg-muted`,role:`status`,children:[_,v,C,w,T]}),t[28]=C,t[29]=w,t[30]=T,t[31]=_,t[32]=v,t[33]=E):E=t[33],E}function Ct(e,t){return e+t.count}function wt(e){return e.errorCode===`local_model_required`}function Tt(e,t){return e+t.count}function Et(e){return e.state===`failed`}function Dt(e,t){return e+t.count}function Ot(e){return e.recordClass===`source_index`}function kt(e,t){return e+t.count}function At(e){return e.recordClass===`memory`&&e.status===`active`&&e.verification===`supported`}function jt(e,t){return e+t.count}function Mt(e){return[`queued`,`running`,`retry_wait`].includes(e.state)}function Nt(){return l(s(`/api/memory-learning/status`))}function Pt(e){let t=(0,Z.c)(12),{id:n,language:r}=e,i;t[0]===n?i=t[1]:(i=()=>l(s(`/api/knowledge-memory/${encodeURIComponent(n)}/evidence`)),t[0]=n,t[1]=i);let{data:a,error:o,isLoading:c}=Me(`knowledge-evidence:${n}`,i);if(c){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(je,{className:`mt-3 h-10 w-full rounded-lg`}),t[2]=e):e=t[2],e}if(o){let e=r===`zh`?`此条证据目前不可用于回答,请检查来源授权、有效期和读取范围。`:`Evidence is currently unavailable. Check source authorization, validity and read scope.`,n;return t[3]===e?n=t[4]:(n=(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:e}),t[3]=e,t[4]=n),n}if(!Array.isArray(a?.evidence)||!a.evidence.length)return null;let u;if(t[5]!==a.evidence||t[6]!==r){let e;t[8]===r?e=t[9]:(e=(e,t)=>(0,Q.jsxs)(`p`,{children:[r===`zh`?`证据`:`Evidence`,` · `,e.sourceType===`conversation`?r===`zh`?`对话`:`Conversation`:e.sourceType===`runtime`?r===`zh`?`执行记录`:`Execution receipt`:r===`zh`?`授权资料`:`Authorized source`,` · `,new Date(e.observedAt).toLocaleDateString(r),e.excerpt?(0,Q.jsx)(`span`,{className:`mt-1 block whitespace-pre-wrap break-words`,children:e.excerpt}):null]},t),t[8]=r,t[9]=e),u=a.evidence.map(e),t[5]=a.evidence,t[6]=r,t[7]=u}else u=t[7];let d;return t[10]===u?d=t[11]:(d=(0,Q.jsx)(`div`,{className:`mt-3 space-y-2 border-t border-edge-subtle pt-3 text-xs text-fg-muted`,children:u}),t[10]=u,t[11]=d),d}function Ft(e){let t=e.get(`tab`);return t===`understanding`&&e.get(`section`)===`work`?`work`:t===`understanding`||t===`work`||t===`privacy`?t:`overview`}var It={en:{pageTitle:`About you`,overview:`Overview`,understanding:`What xopc knows`,privacy:`Data & privacy`,knowledge:`Work memory`,editProfile:`Edit basics`,callName:`What should xopc call you?`,callNamePlaceholder:`For example: Alex, Joyce, or Dr. Chen`,role:`Your role`,rolePlaceholder:`For example: founder, designer, or engineer`,pronouns:`Pronouns (optional)`,pronounsPlaceholder:`For example: she/her, he/him, they/them`,timezone:`Timezone`,timezoneSearch:`Search timezones…`,timezoneNoMatch:`No matching timezone`,locale:`Language / locale`,useDeviceTimezone:`Use this device`,notProvided:`Not provided`,editProfileHint:`These are facts you provide directly. They remain separate from xopc’s observations and inferences.`,saveProfile:`Save`,saving:`Saving…`,explicit:`You told me`,explicitHint:`Facts and preferences you stated directly`,learned:`Learned together`,learnedHint:`Patterns formed from our work`,allUnderstanding:`All understanding`,understandingFilterHint:`Filter this view by how each item was formed.`,importantNow:`What matters now`,prioritySourceGoal:`From a goal you confirmed`,prioritySourceWork:`From your current work`,editPriority:`Edit focus`,addPriority:`Set current focus`,priorityTitle:`Current focus`,priorityTitlePlaceholder:`What matters most right now?`,priorityOutcome:`What a good outcome looks like`,priorityOutcomePlaceholder:`Describe the result you want…`,priorityUntil:`Focus through`,savePriority:`Save focus`,endPriority:`End focus`,endingPriority:`Ending…`,priorityHint:`This is used to keep xopc aligned with what deserves attention now.`,otherGoals:`Other active outcomes`,howWeWork:`How we work together`,noRules:`No collaboration preferences yet.`,seeAll:`See all`,workMemory:`What I remember from the work`,items:`items`,refresh:`Refresh`,refreshing:`Refreshing…`,refreshComplete:`Refreshed`,refreshFailed:`Refresh failed`,aboutYouTitle:`What xopc remembers about you`,aboutYouHint:`Review your background, preferences, and habits. Edit anything that no longer fits.`,identity:`Who you are`,preferences:`Preferences and working rhythm`,relationships:`People and relationships`,currentState:`Current context`,insights:`My current read`,emptyGroup:`No usable personal understanding yet. Ongoing preferences will build through collaboration; project facts and progress are in Work memory.`,correct:`Correct`,save:`Save correction`,cancel:`Cancel`,correctionPlaceholder:`Write the accurate version…`,searchPlaceholder:`Search work memory…`,allMemory:`All work memory`,memoryFilterHint:`Filter by memory type`,memoryLibraryHint:`Only distilled facts, decisions, lessons, commitments, and open questions appear here. Source records stay with their connector.`,noKnowledge:`No work memory has formed yet.`,noKnowledgeMatch:`No work memory matches this search.`,showMore:`Show more`,expand:`Show details`,collapse:`Hide details`,disable:`Disable`,disabled:`Not in use`,enable:`Enable`,loadFailed:`Could not load your understanding.`,tryAgain:`Try again`,actionFailed:`The change could not be saved. Please try again.`},zh:{pageTitle:`关于你`,overview:`总览`,understanding:`对我的了解`,privacy:`数据与隐私`,knowledge:`工作记忆`,editProfile:`编辑基本信息`,callName:`希望 xopc 如何称呼你?`,callNamePlaceholder:`例如:Mic、Joyce、张老师`,role:`你的角色`,rolePlaceholder:`例如:创业者、产品设计师、工程师`,pronouns:`代词(可选)`,pronounsPlaceholder:`例如:she/her、he/him、they/them`,timezone:`时区`,timezoneSearch:`搜索时区…`,timezoneNoMatch:`没有匹配的时区`,locale:`语言 / 地区`,useDeviceTimezone:`使用本机时区`,notProvided:`未填写`,editProfileHint:`这些是由你直接提供的事实,与 xopc 的观察和推断分开维护。`,saveProfile:`保存`,saving:`正在保存…`,explicit:`你告诉我的`,explicitHint:`你明确表达的事实与偏好`,learned:`协作中学到的`,learnedHint:`从实际协作中形成的认识`,allUnderstanding:`全部来源`,understandingFilterHint:`按内容来源筛选这份理解。`,importantNow:`你最近在关注什么`,prioritySourceGoal:`来自你确认的当前目标`,prioritySourceWork:`来自当前工作上下文`,editPriority:`编辑`,addPriority:`设置当前关注`,priorityTitle:`当前关注`,priorityTitlePlaceholder:`现在最重要的是什么?`,priorityOutcome:`期待结果`,priorityOutcomePlaceholder:`描述你希望达成的结果…`,priorityUntil:`关注至`,savePriority:`保存关注`,endPriority:`结束关注`,endingPriority:`正在结束…`,priorityHint:`这项内容会帮助 xopc 在协作中优先关注当前最重要的事情。`,otherGoals:`其他进行中的目标`,howWeWork:`我们怎样协作`,noRules:`还没有形成协作偏好。`,seeAll:`查看全部`,workMemory:`我在工作中记住的`,items:`条`,refresh:`刷新`,refreshing:`正在刷新…`,refreshComplete:`已刷新`,refreshFailed:`刷新失败`,aboutYouTitle:`xopc 记住的你`,aboutYouHint:`在这里查看你的背景、偏好和习惯。有不准确或已经变化的内容,可以直接修改。`,identity:`你的背景与能力`,preferences:`偏好与习惯`,relationships:`重要的人与关系`,currentState:`最近的状态`,insights:`其他观察`,emptyGroup:`还没有记住关于你的信息。你可以在聊天中告诉 xopc 你的背景或偏好,例如「回答时先给结论」。`,correct:`修正`,save:`保存修正`,cancel:`取消`,correctionPlaceholder:`写下更准确的说法…`,searchPlaceholder:`搜索工作记忆…`,allMemory:`全部工作记忆`,memoryFilterHint:`按记忆类型筛选`,memoryLibraryHint:`这里只显示提炼后的事实、决定、经验、承诺和待解问题;邮件、日历与文档原文保留在对应来源中。`,noKnowledge:`还没有形成工作记忆。`,noKnowledgeMatch:`没有符合搜索条件的工作记忆。`,showMore:`显示更多`,expand:`查看详情`,collapse:`收起详情`,disable:`停用`,disabled:`已停用`,enable:`启用`,loadFailed:`无法载入对你的理解。`,tryAgain:`重试`,actionFailed:`修改没有保存,请重试。`}},Lt=new Set([`identity.call_name`,`identity.role`,`identity.pronouns`,`preference.timezone`,`preference.locale`]),Rt=[`work_thread`,`project_fact`,`workspace_fact`,`decision`,`task_lesson`,`commitment`,`open_question`,`episode`,`note`],zt=`UTC.Africa/Cairo.Africa/Johannesburg.America/Chicago.America/Denver.America/Los_Angeles.America/Mexico_City.America/New_York.America/Sao_Paulo.America/Toronto.America/Vancouver.Asia/Bangkok.Asia/Dubai.Asia/Hong_Kong.Asia/Jakarta.Asia/Kolkata.Asia/Seoul.Asia/Shanghai.Asia/Singapore.Asia/Taipei.Asia/Tokyo.Australia/Melbourne.Australia/Perth.Australia/Sydney.Europe/Amsterdam.Europe/Berlin.Europe/London.Europe/Madrid.Europe/Paris.Europe/Rome.Pacific/Auckland.Pacific/Honolulu`.split(`.`);function Bt(){try{let e=Intl.supportedValuesOf(`timeZone`);return[...new Set([`UTC`,...e])]}catch{return[...zt]}}var Vt=Bt();function Ht(e){return e.map(e=>({value:e,label:e.replaceAll(`_`,` `),group:e.includes(`/`)?e.split(`/`)[0]:`UTC`}))}function Ut(e,t,n=!1){return e?new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,...n?{timeStyle:`short`}:{}}).format(e):null}function Wt(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function Gt(e){return{callName:Wt(e.profile.callName)??``,role:Wt(e.profile.role)??``,pronouns:Wt(e.profile.pronouns)??``,timezone:Wt(e.profile.timezone)??``,locale:Wt(e.profile.locale)??``}}function Kt(e,t){return{"zh-CN":{en:`Simplified Chinese`,zh:`简体中文`},"zh-TW":{en:`Traditional Chinese`,zh:`繁体中文`},"en-US":{en:`English (US)`,zh:`英语(美国)`},"en-GB":{en:`English (UK)`,zh:`英语(英国)`},"ja-JP":{en:`Japanese`,zh:`日语`}}[e]?.[t]??e}function qt(e,t){let n=Ut(e,t);return t===`zh`?`当前安排至 ${n}`:`Current plan through ${n}`}function Jt(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function Yt(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r,23,59,59,999).getTime()}function Xt(e,t){return(t===`zh`?{global:`所有协作`,agent:`当前智能体`,workspace:`当前工作区`,project:`当前项目`,session:`当前会话`}:{global:`All work`,agent:`This agent`,workspace:`This workspace`,project:`This project`,session:`This conversation`})[e.type]}function Zt(e,t){return(t===`zh`?{work_thread:`工作主线`,project_fact:`项目事实`,workspace_fact:`工作区事实`,decision:`已经决定`,task_lesson:`工作经验`,commitment:`承诺与约定`,open_question:`待解问题`,episode:`重要经历`,note:`其他记录`}:{work_thread:`Work threads`,project_fact:`Project facts`,workspace_fact:`Workspace facts`,decision:`Decisions`,task_lesson:`Lessons`,commitment:`Commitments`,open_question:`Open questions`,episode:`Episodes`,note:`Notes`})[e]}function Qt(e,t,n){if(e)return e.targetType===`goal`?t.find(t=>t.id===e.targetId)?.title:/^[0-9a-f]{8}-[0-9a-f-]{20,}$/i.test(e.targetId)?(n===`zh`?{project:`当前项目`,task:`当前任务`,assertion:`一项待处理的理解`,topic:`当前主题`}:{project:`Current project`,task:`Current task`,assertion:`An understanding to address`,topic:`Current topic`})[e.targetType]:e.targetId}function $t(e){let t=(0,Z.c)(16),{title:n,hint:r,action:i,children:a,className:o}=e,s=o===void 0?``:o,c;t[0]===n?c=t[1]:(c=(0,Q.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=r?(0,Q.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:r}):null,t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,Q.jsxs)(`div`,{children:[c,l]}),t[4]=c,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==i||t[8]!==u?(d=(0,Q.jsxs)(`header`,{className:`flex items-end justify-between gap-4 px-1 pb-3`,children:[u,i]}),t[7]=i,t[8]=u,t[9]=d):d=t[9];let f;t[10]===a?f=t[11]:(f=(0,Q.jsx)(`div`,{className:`overflow-hidden rounded-2xl bg-surface-panel`,children:a}),t[10]=a,t[11]=f);let p;return t[12]!==s||t[13]!==d||t[14]!==f?(p=(0,Q.jsxs)(`section`,{className:s,children:[d,f]}),t[12]=s,t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function en(e){let t=(0,Z.c)(7),{icon:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsx)(`span`,{className:`text-fg-subtle`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Q.jsx)(`p`,{children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-5 text-sm text-fg-muted`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function tn({open:e,profile:t,language:n,saving:r,onOpenChange:i,onSave:a}){let o=It[n],[s,c]=(0,X.useState)(t),[l,d]=(0,X.useState)(``);(0,X.useEffect)(()=>{e&&(c(t),d(``))},[e,t]);let v=e=>{e.preventDefault(),a({callName:s.callName.trim(),role:s.role.trim(),pronouns:s.pronouns.trim(),timezone:s.timezone.trim(),locale:s.locale.trim()})},y=(e,t,n)=>(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,Q.jsx)(`input`,{value:s[e],onChange:t=>c(n=>({...n,[e]:t.target.value})),placeholder:n,className:`h-10 w-full rounded-xl border border-edge bg-surface-base px-3 text-sm text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`})]}),b=[`zh-CN`,`zh-TW`,`en-US`,`en-GB`,`ja-JP`];s.locale&&!b.includes(s.locale)&&b.push(s.locale);let x=I(),S=(0,X.useMemo)(()=>[...new Set([...Vt,x,s.timezone].filter(Boolean))].sort(),[x,s.timezone]),C=l.trim().toLocaleLowerCase(),w=(0,X.useMemo)(()=>Ht(S.filter(e=>!C||e.toLocaleLowerCase().includes(C)||e.replaceAll(`_`,` `).toLocaleLowerCase().includes(C))),[S,C]);return(0,Q.jsx)(_,{open:e,onOpenChange:i,children:(0,Q.jsxs)(m,{children:[(0,Q.jsx)(u,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsx)(h,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] h-[min(40rem,calc(100vh-2rem))] w-[min(42rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:(0,Q.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col overflow-hidden [border-radius:inherit]`,onSubmit:v,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4 sm:px-6`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(g,{className:`font-semibold text-fg`,children:o.editProfile}),(0,Q.jsx)(f,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:o.editProfileHint})]}),(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":o.cancel,children:(0,Q.jsx)(ke,{className:`size-4`})})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5 sm:p-6`,children:(0,Q.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[y(`callName`,o.callName,o.callNamePlaceholder),y(`role`,o.role,o.rolePlaceholder),y(`pronouns`,o.pronouns,o.pronounsPlaceholder),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:o.locale}),(0,Q.jsxs)(H,{value:s.locale,onChange:e=>c(t=>({...t,locale:e.target.value})),children:[(0,Q.jsx)(U,{value:``,children:o.notProvided}),b.map(e=>(0,Q.jsx)(U,{value:e,children:Kt(e,n)},e))]})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm sm:col-span-2`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:o.timezone}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(W,{value:s.timezone,options:w,placeholder:I(),emptyLabel:o.notProvided,ariaLabel:o.timezone,selectedLabel:s.timezone||o.notProvided,searchPlaceholder:o.timezoneSearch,searchValue:l,onSearchChange:d,statusMessage:w.length?void 0:o.timezoneNoMatch,triggerClassName:`min-w-0 flex-1 rounded-xl bg-surface-base`,onChange:e=>{c(t=>({...t,timezone:e})),d(``)}}),(0,Q.jsx)(Y,{className:`shrink-0 whitespace-nowrap`,onClick:()=>c(e=>({...e,timezone:x})),children:o.useDeviceTimezone})]})]})]})}),(0,Q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3 sm:px-6`,children:[(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{disabled:r,children:o.cancel})}),(0,Q.jsxs)(Y,{type:`submit`,variant:`primary`,disabled:r,children:[r?(0,Q.jsx)(he,{className:`size-4 animate-spin`}):null,r?o.saving:o.saveProfile]})]})]})})]})})}function nn(e){let t=(0,Z.c)(94),{open:n,priority:r,title:i,outcome:a,language:o,saving:s,onOpenChange:c,onSave:l,onEnd:d}=e,v=It[o],[y,b]=(0,X.useState)(i),[x,S]=(0,X.useState)(a??``),C=r?.validTo??Date.now()+6048e5,w;t[0]===C?w=t[1]:(w=Jt(C),t[0]=C,t[1]=w);let T=w,[E,D]=(0,X.useState)(T),O,k;t[2]!==T||t[3]!==n||t[4]!==a||t[5]!==i?(O=()=>{n&&(b(i),S(a??``),D(T))},k=[T,n,a,i],t[2]=T,t[3]=n,t[4]=a,t[5]=i,t[6]=O,t[7]=k):(O=t[6],k=t[7]),(0,X.useEffect)(O,k);let A;t[8]!==x||t[9]!==y||t[10]!==E||t[11]!==l||t[12]!==r?.targetType?(A=e=>{e.preventDefault(),l({title:y.trim(),...r?.targetType===`goal`?{desiredOutcome:x.trim()}:{},validTo:Yt(E)})},t[8]=x,t[9]=y,t[10]=E,t[11]=l,t[12]=r?.targetType,t[13]=A):A=t[13];let j=A,M;t[14]!==x||t[15]!==y||t[16]!==E||t[17]!==r?.targetType?(M=y.trim()&&E&&(r?.targetType!==`goal`||x.trim()),t[14]=x,t[15]=y,t[16]=E,t[17]=r?.targetType,t[18]=M):M=t[18];let ee=!!M,N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(u,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[19]=N):N=t[19];let te=r?v.editPriority:v.addPriority,P;t[20]===te?P=t[21]:(P=(0,Q.jsx)(g,{className:`font-semibold text-fg`,children:te}),t[20]=te,t[21]=P);let F;t[22]===v.priorityHint?F=t[23]:(F=(0,Q.jsx)(f,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:v.priorityHint}),t[22]=v.priorityHint,t[23]=F);let I;t[24]!==F||t[25]!==P?(I=(0,Q.jsxs)(`div`,{children:[P,F]}),t[24]=F,t[25]=P,t[26]=I):I=t[26];let L;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(ke,{className:`size-4`}),t[27]=L):L=t[27];let R;t[28]===v.cancel?R=t[29]:(R=(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":v.cancel,children:L})}),t[28]=v.cancel,t[29]=R);let z;t[30]!==I||t[31]!==R?(z=(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4 sm:px-6`,children:[I,R]}),t[30]=I,t[31]=R,t[32]=z):z=t[32];let B;t[33]===v.priorityTitle?B=t[34]:(B=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:v.priorityTitle}),t[33]=v.priorityTitle,t[34]=B);let ne;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ne=e=>b(e.target.value),t[35]=ne):ne=t[35];let re;t[36]!==y||t[37]!==v.priorityTitlePlaceholder?(re=(0,Q.jsx)(`input`,{autoFocus:!0,value:y,onChange:ne,placeholder:v.priorityTitlePlaceholder,className:`h-10 w-full rounded-xl border border-edge bg-surface-base px-3 text-sm text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`}),t[36]=y,t[37]=v.priorityTitlePlaceholder,t[38]=re):re=t[38];let ie;t[39]!==B||t[40]!==re?(ie=(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[B,re]}),t[39]=B,t[40]=re,t[41]=ie):ie=t[41];let ae;t[42]!==x||t[43]!==r?.targetType||t[44]!==v.priorityOutcome||t[45]!==v.priorityOutcomePlaceholder?(ae=r?.targetType===`goal`?(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:v.priorityOutcome}),(0,Q.jsx)(`textarea`,{value:x,onChange:e=>S(e.target.value),placeholder:v.priorityOutcomePlaceholder,className:`min-h-28 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm leading-6 text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`})]}):null,t[42]=x,t[43]=r?.targetType,t[44]=v.priorityOutcome,t[45]=v.priorityOutcomePlaceholder,t[46]=ae):ae=t[46];let oe;t[47]===v.priorityUntil?oe=t[48]:(oe=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:v.priorityUntil}),t[47]=v.priorityUntil,t[48]=oe);let V;t[49]===r?.validFrom?V=t[50]:(V=r?.validFrom??Date.now(),t[49]=r?.validFrom,t[50]=V);let H;t[51]===V?H=t[52]:(H=Jt(V),t[51]=V,t[52]=H);let U;t[53]!==E||t[54]!==v.priorityUntil||t[55]!==H?(U=(0,Q.jsx)(Ue,{min:H,value:E,onChange:D,ariaLabel:v.priorityUntil,className:`rounded-xl border border-edge bg-surface-base hover:border-edge-strong hover:bg-surface-base`}),t[53]=E,t[54]=v.priorityUntil,t[55]=H,t[56]=U):U=t[56];let W;t[57]!==oe||t[58]!==U?(W=(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[oe,U]}),t[57]=oe,t[58]=U,t[59]=W):W=t[59];let se;t[60]!==ie||t[61]!==ae||t[62]!==W?(se=(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-5 sm:p-6`,children:[ie,ae,W]}),t[60]=ie,t[61]=ae,t[62]=W,t[63]=se):se=t[63];let G;t[64]!==d||t[65]!==r||t[66]!==s||t[67]!==v.endPriority||t[68]!==v.endingPriority?(G=r&&d?(0,Q.jsxs)(Y,{variant:`ghost`,className:`text-danger hover:text-danger`,disabled:s,onClick:d,children:[s?(0,Q.jsx)(he,{className:`size-4 animate-spin`}):null,s?v.endingPriority:v.endPriority]}):(0,Q.jsx)(`span`,{}),t[64]=d,t[65]=r,t[66]=s,t[67]=v.endPriority,t[68]=v.endingPriority,t[69]=G):G=t[69];let ce;t[70]!==s||t[71]!==v.cancel?(ce=(0,Q.jsx)(p,{asChild:!0,children:(0,Q.jsx)(Y,{disabled:s,children:v.cancel})}),t[70]=s,t[71]=v.cancel,t[72]=ce):ce=t[72];let le=!ee||s,ue;t[73]===s?ue=t[74]:(ue=s?(0,Q.jsx)(he,{className:`size-4 animate-spin`}):null,t[73]=s,t[74]=ue);let de;t[75]!==v.savePriority||t[76]!==le||t[77]!==ue?(de=(0,Q.jsxs)(Y,{type:`submit`,variant:`primary`,disabled:le,children:[ue,v.savePriority]}),t[75]=v.savePriority,t[76]=le,t[77]=ue,t[78]=de):de=t[78];let K;t[79]!==ce||t[80]!==de?(K=(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[ce,de]}),t[79]=ce,t[80]=de,t[81]=K):K=t[81];let q;t[82]!==G||t[83]!==K?(q=(0,Q.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-2 border-t border-edge px-5 py-3 sm:px-6`,children:[G,K]}),t[82]=G,t[83]=K,t[84]=q):q=t[84];let J;t[85]!==j||t[86]!==z||t[87]!==se||t[88]!==q?(J=(0,Q.jsxs)(m,{children:[N,(0,Q.jsx)(h,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] h-[min(34rem,calc(100vh-2rem))] w-[min(38rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:(0,Q.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col overflow-hidden [border-radius:inherit]`,onSubmit:j,children:[z,se,q]})})]}),t[85]=j,t[86]=z,t[87]=se,t[88]=q,t[89]=J):J=t[89];let fe;return t[90]!==c||t[91]!==n||t[92]!==J?(fe=(0,Q.jsx)(_,{open:n,onOpenChange:c,children:J}),t[90]=c,t[91]=n,t[92]=J,t[93]=fe):fe=t[93],fe}function rn(e){let t=(0,Z.c)(16),{rule:n,language:r,busy:i,onToggle:a}=e,o=It[r],s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(S,{className:`mt-0.5 size-4 shrink-0 text-fg-subtle`}),t[0]=s):s=t[0];let c;t[1]===n.statement?c=t[2]:(c=(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 text-sm leading-6 text-fg`,children:n.statement}),t[1]=n.statement,t[2]=c);let l;t[3]!==n.status||t[4]!==o.disabled?(l=n.status===`disabled`?(0,Q.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:o.disabled}):null,t[3]=n.status,t[4]=o.disabled,t[5]=l):l=t[5];let u=n.status===`active`?o.disable:o.enable,d;t[6]!==i||t[7]!==a||t[8]!==u?(d=(0,Q.jsx)(Y,{variant:`ghost`,className:`h-8`,disabled:i,onClick:a,children:u}),t[6]=i,t[7]=a,t[8]=u,t[9]=d):d=t[9];let f;t[10]!==l||t[11]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[l,d]}),t[10]=l,t[11]=d,t[12]=f):f=t[12];let p;return t[13]!==c||t[14]!==f?(p=(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 border-t border-edge-subtle px-5 py-3 first:border-t-0`,children:[s,c,f]}),t[13]=c,t[14]=f,t[15]=p):p=t[15],p}function an(e){let t=(0,Z.c)(15),{suggestion:n,language:r,busy:i,onConfirm:a}=e,o=r===`zh`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(we,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),t[0]=s):s=t[0];let c;t[1]===n.statement?c=t[2]:(c=(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:n.statement}),t[1]=n.statement,t[2]=c);let l=o?`根据你已确认的模式生成;确认前不会生效`:`Suggested from a pattern you confirmed; inactive until you approve`,u;t[3]===l?u=t[4]:(u=(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:l}),t[3]=l,t[4]=u);let d;t[5]!==c||t[6]!==u?(d=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[c,u]}),t[5]=c,t[6]=u,t[7]=d):d=t[7];let f=i?o?`启用中…`:`Enabling…`:o?`确认启用`:`Approve`,p;t[8]!==i||t[9]!==a||t[10]!==f?(p=(0,Q.jsx)(Y,{variant:`secondary`,className:`h-8 shrink-0`,disabled:i,onClick:a,children:f}),t[8]=i,t[9]=a,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==p?(m=(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 border-t border-edge-subtle px-5 py-3 first:border-t-0`,children:[s,d,p]}),t[12]=d,t[13]=p,t[14]=m):m=t[14],m}function on(e){let t=(0,Z.c)(27),{item:n,language:r,busy:i,expanded:a,onToggle:o,editing:s,draft:c,onDraftChange:l,onEdit:u,onCancel:d,onReview:f,onDelete:p,onScopeChange:m}=e,h=It[r],g=n.updatedAt??n.createdAt,_;t[0]!==r||t[1]!==g?(_=Ut(g,r),t[0]=r,t[1]=g,t[2]=_):_=t[2];let y=_,b;t[3]!==n.claimMode||t[4]!==n.content?(b=n.content.length>96||n.content.includes(`
|
|
2
|
-
`)||!!n.claimMode,t[3]=n.claimMode,t[4]=n.content,t[5]=b):b=t[5];let x=b,S;return t[6]!==i||t[7]!==x||t[8]!==y||t[9]!==c||t[10]!==s||t[11]!==a||t[12]!==n.claimMode||t[13]!==n.content||t[14]!==n.id||t[15]!==n.scope||t[16]!==n.verification||t[17]!==r||t[18]!==d||t[19]!==p||t[20]!==l||t[21]!==u||t[22]!==f||t[23]!==m||t[24]!==o||t[25]!==h?(S=(0,Q.jsx)(`article`,{className:`group border-t border-edge-subtle px-5 py-4 first:border-t-0 sm:px-6`,children:s?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`textarea`,{"aria-label":h.correctionPlaceholder,disabled:i,value:c,onChange:e=>l(e.target.value),className:`min-h-24 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm leading-6 text-fg outline-none transition focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(Y,{variant:`ghost`,className:`h-8`,onClick:d,children:h.cancel}),(0,Q.jsx)(Y,{variant:`primary`,className:`h-8`,disabled:!c.trim()||i,onClick:()=>f(`edit_and_approve`,c.trim()),children:h.save})]})]}):(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(v,{className:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-base leading-7 text-fg ${a?``:`line-clamp-2`}`,children:n.content}),(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-fg-subtle`,children:[(0,Q.jsx)(`span`,{children:Xt(n.scope,r)}),n.claimMode===`reported`?(0,Q.jsx)(`span`,{children:r===`zh`?`来源报告`:`Source report`}):null,n.verification===`tentative`?(0,Q.jsx)(`span`,{children:r===`zh`?`证据待补充`:`Evidence pending`}):null,y?(0,Q.jsx)(`span`,{children:y}):null]}),a?(0,Q.jsx)(Pt,{id:n.id,language:r}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[x?(0,Q.jsx)(Y,{variant:`ghost`,className:`size-11 p-0`,"aria-expanded":a,"aria-label":a?h.collapse:h.expand,onClick:o,children:(0,Q.jsx)(oe,{className:`size-3.5 transition-transform ${a?`rotate-180`:``}`})}):null,(0,Q.jsx)(Xe,{language:r,busy:i,statement:n.content,scope:n.scope,onScopeChange:m,onEdit:u,onDelete:p})]})]})}),t[6]=i,t[7]=x,t[8]=y,t[9]=c,t[10]=s,t[11]=a,t[12]=n.claimMode,t[13]=n.content,t[14]=n.id,t[15]=n.scope,t[16]=n.verification,t[17]=r,t[18]=d,t[19]=p,t[20]=l,t[21]=u,t[22]=f,t[23]=m,t[24]=o,t[25]=h,t[26]=S):S=t[26],S}function sn(){let e=c(e=>e.language),t=It[e],n=Fe(e=>e.setPageHeader),r=Fe(e=>e.clearPageHeader),[i,s]=a(),{data:l,error:u,isLoading:d,isValidating:f,mutate:p}=Me(`/api/user-model`,M),m=Ft(i),[h,g]=(0,X.useState)(),[_,v]=(0,X.useState)(),[y,b]=(0,X.useState)(``),[I,L]=(0,X.useState)(),[oe,W]=(0,X.useState)(``),[G,de]=(0,X.useState)(``),[K,q]=(0,X.useState)(24),[J,fe]=(0,X.useState)(),[pe,me]=(0,X.useState)(!1),[_e,Ce]=(0,X.useState)(!1),Te=i.get(`source`),Ee=Te===`explicit`||Te===`learned`?Te:`all`,Ae=i.get(`search`)??``,Ne=i.get(`category`)??`all`,[Re,ze]=(0,X.useState)(`all`),[Be,Ve]=(0,X.useState)(`idle`),He=(0,X.useRef)(void 0),Ue=e=>{if(e===m)return;let t=document.getElementById(`app-main-content`);typeof t?.scrollTo==`function`&&t.scrollTo({top:0,behavior:`auto`}),s(t=>{let n=new URLSearchParams(t);return n.delete(`section`),e===`overview`?n.delete(`tab`):n.set(`tab`,e),n})},Z=(e,t,n=!1)=>{s(n=>{let r=new URLSearchParams(n);return!t||t===`all`?r.delete(e):r.set(e,t),r},{replace:n})},We=(0,X.useCallback)(async()=>{if(!(Be===`refreshing`||f)){He.current&&window.clearTimeout(He.current),Ve(`refreshing`),v(void 0),b(t.refreshing);try{await p(),Ve(`success`),b(t.refreshComplete)}catch{Ve(`error`),b(``),v(t.refreshFailed)}finally{He.current=window.setTimeout(()=>Ve(`idle`),1600)}}},[f,p,Be,t]);(0,X.useEffect)(()=>()=>{He.current&&window.clearTimeout(He.current)},[]);let Ge=f||Be===`refreshing`,Ke=Ge?t.refreshing:Be===`success`?t.refreshComplete:Be===`error`?t.refreshFailed:t.refresh;(0,X.useEffect)(()=>(n({startExtra:null,main:(0,Q.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:t.pageTitle}),end:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(xt,{}),(0,Q.jsx)(Y,{variant:`secondary`,className:`size-9 p-0 ${Be===`success`?`text-success`:Be===`error`?`text-danger`:``}`,disabled:Ge,"aria-label":Ke,title:Ke,onClick:()=>void We(),children:Ge?(0,Q.jsx)(he,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}):Be===`success`?(0,Q.jsx)(ae,{className:`size-4`,"aria-hidden":`true`}):Be===`error`?(0,Q.jsx)(se,{className:`size-4`,"aria-hidden":`true`}):(0,Q.jsx)(be,{className:`size-4`,"aria-hidden":`true`})})]})}),r),[r,Ge,Be,Ke,We,n,t]);let qe=async(n,r)=>{g(n),v(void 0),b(``);try{await r(),await p(),b(e===`zh`?`已更新`:`Updated`)}catch{v(t.actionFailed)}finally{g(void 0)}},Je=e=>{qe(e.id,async()=>{await N(e.id,oe.trim()),L(void 0),W(``)})},Ye=async e=>{g(`profile`),v(void 0),b(``);try{await R(e),await p(),me(!1)}catch{v(t.actionFailed)}finally{g(void 0)}},Xe=async(n,r)=>{g(`priority:${n.id}`),v(void 0),b(``);try{await C(n.id,r),await p(),Ce(!1),b(e===`zh`?`当前关注已更新`:`Current focus updated`)}catch{v(t.actionFailed)}finally{g(void 0)}},Ze=async n=>{g(`priority:create`),v(void 0),b(``);try{await F(n),await p(),Ce(!1),b(e===`zh`?`当前关注已设置`:`Current focus set`)}catch{v(t.actionFailed)}finally{g(void 0)}},Qe=async n=>{g(`priority:${n.id}`),v(void 0),b(``);try{await C(n.id,{status:`completed`}),await p(),Ce(!1),b(e===`zh`?`当前关注已结束`:`Current focus ended`)}catch{v(t.actionFailed)}finally{g(void 0)}};if(d)return(0,Q.jsxs)(`div`,{className:`mx-auto w-full max-w-7xl space-y-5 px-4 pb-7 pt-3 sm:px-6 lg:px-8 lg:pb-9 lg:pt-4`,children:[(0,Q.jsx)(je,{className:`h-10 w-72 rounded-xl`}),(0,Q.jsx)(je,{className:`h-72 rounded-xl`}),(0,Q.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,Q.jsx)(je,{className:`h-80 rounded-xl`}),(0,Q.jsx)(je,{className:`h-80 rounded-xl`})]})]});if(u||!l)return(0,Q.jsxs)(`div`,{className:`mx-auto flex min-h-72 max-w-xl flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,Q.jsx)(z,{className:`size-6 text-fg-subtle`}),(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:t.loadFailed}),(0,Q.jsx)(Y,{onClick:()=>void p(),children:t.tryAgain})]});let $e=l.assertions.filter(e=>e.usable&&!Lt.has(e.predicate)).sort((e,t)=>{let n=e.declaredImportance??e.inferredImportance;return(t.declaredImportance??t.inferredImportance)-n||t.recordedAt-e.recordedAt}),et=l.assertions.filter(e=>[`candidate`,`needs_review`,`conflicted`].includes(e.status)).sort((e,t)=>t.recordedAt-e.recordedAt),tt=Gt(l),nt=tt.callName||(e===`zh`?`你`:`You`),rt=[{key:`identity`,title:t.identity,icon:Oe,kinds:[`identity`,`capability`]},{key:`preferences`,title:t.preferences,icon:x,kinds:[`preference`,`value`,`routine`]},{key:`relationships`,title:t.relationships,icon:S,kinds:[`relationship`]},{key:`current`,title:t.currentState,icon:ce,kinds:[`current_state`]},{key:`insights`,title:t.insights,icon:we,kinds:[`derived_insight`]}],at=rt.find(e=>e.key===Ne),ot=$e.filter(e=>(!at||at.kinds.includes(e.kind))&&(!Ae.trim()||e.statement.toLocaleLowerCase().includes(Ae.trim().toLocaleLowerCase()))),st=ot.filter(e=>e.authority===`user_explicit`).length,ct=ot.length-st,lt=ot.filter(e=>Ee===`explicit`?e.authority===`user_explicit`:Ee!==`learned`||e.authority!==`user_explicit`),ut=l.priorities.filter(e=>e.status===`active`&&e.validTo>Date.now()),$=ut.find(e=>e.rank===`primary`)??ut[0],dt=Qt($,l.goals,e),ft=$?.targetType===`goal`?l.goals.find(e=>e.id===$.targetId):void 0,pt=l.goals.filter(e=>e.status===`active`||e.status===`paused`).filter(e=>$?.targetType!==`goal`||e.id!==$.targetId),mt=l.rules.filter(e=>e.status!==`archived`),ht=l.ruleSuggestions??[],gt=l.knowledge.filter(e=>e.status!==`archived`&&e.status!==`rejected`),_t=G.trim().toLocaleLowerCase(),vt=gt.filter(e=>Re===`all`||e.kind===Re),yt=vt.filter(t=>!_t||t.content.toLocaleLowerCase().includes(_t)||Zt(t.kind,e).toLocaleLowerCase().includes(_t)),bt=rt.map(e=>({...e,items:lt.filter(t=>e.kinds.includes(t.kind))})).filter(e=>e.items.length>0),Ct=rt.map(e=>({...e,items:$e.filter(t=>e.kinds.includes(t.kind))})).filter(e=>e.items.length>0),wt=Rt.map(e=>({kind:e,count:gt.filter(t=>t.kind===e).length})).filter(e=>e.count>0),Tt=wt.slice(0,4),Et=Tt.length===1?`grid-cols-1`:`sm:grid-cols-2`,Dt=yt.slice(0,K),Ot=Rt.map(e=>({kind:e,items:Dt.filter(t=>t.kind===e),totalCount:yt.filter(t=>t.kind===e).length})).filter(e=>e.items.length>0),kt=[{id:`all`,label:t.allUnderstanding,count:ot.length},{id:`explicit`,label:t.explicit,count:st},{id:`learned`,label:t.learned,count:ct}],At=(e=`all`)=>{s(t=>{let n=new URLSearchParams(t);return n.set(`tab`,`understanding`),n.delete(`section`),n.delete(`source`),n.delete(`search`),e===`all`?n.delete(`category`):n.set(`category`,e),n})},jt=e=>{ze(e),de(``),q(24),Ue(`work`)},Mt=t=>(0,Q.jsx)(it,{item:t,language:e,busy:!!h,editing:I===t.id,draft:I===t.id?oe:``,onDraftChange:W,onEdit:()=>{L(t.id),W(t.statement)},onCancel:()=>{L(void 0),W(``)},onDelete:()=>void qe(t.id,()=>w(t.id)),onCorrect:()=>Je(t),onScopeChange:e=>void qe(t.id,()=>O(t.id,e,t.version))},t.id);return(0,Q.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl space-y-6 px-4 pb-4 pt-3 sm:space-y-8 sm:px-6 sm:pb-7 lg:px-8 lg:pb-10 lg:pt-4`,children:[(0,Q.jsx)(`div`,{className:`hidden px-1 sm:block`,children:(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:e===`zh`?`让 xopc 按你的习惯与你协作。记错了,随时改。`:`Help xopc work your way. You can correct what it remembers at any time.`})}),(0,Q.jsx)(Pe,{items:[{id:`overview`,label:t.overview,icon:we},{id:`understanding`,label:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?`记住的你`:`Memories`}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:t.understanding})]}),icon:Oe,count:$e.length},{id:`work`,label:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?`工作记忆`:`Work`}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:t.knowledge})]}),title:t.knowledge,icon:re,count:gt.length},{id:`privacy`,label:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?`隐私`:`Privacy`}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:t.privacy})]}),icon:Se}],activeTab:m,onChange:Ue,ariaLabel:t.pageTitle,tabIdPrefix:`understanding-tab`,panelIdPrefix:`understanding-panel`,className:`w-full max-w-full gap-1 rounded-full bg-surface-panel p-1 shadow-surface sm:w-fit`,buttonClassName:`min-h-11 min-w-0 flex-1 justify-center whitespace-nowrap rounded-full px-2 py-2 sm:min-h-9 sm:flex-none sm:px-3.5 [&_svg]:hidden sm:[&_svg]:block`,countClassName:`hidden sm:inline-flex`,selectedClassName:`bg-surface-active text-fg`,unselectedClassName:`text-fg-muted hover:bg-surface-hover hover:text-fg`}),(0,Q.jsx)(`p`,{role:`status`,className:`sr-only`,children:y}),_?(0,Q.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 rounded-xl border border-danger bg-danger-soft px-4 py-3 text-sm text-danger`,children:[(0,Q.jsx)(`span`,{children:_}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>v(void 0),"aria-label":t.cancel,children:(0,Q.jsx)(ke,{className:`size-4`})})]}):null,m===`overview`?(0,Q.jsxs)(`div`,{id:`understanding-panel-overview`,role:`tabpanel`,"aria-labelledby":`understanding-tab-overview`,className:`grid grid-cols-1 items-start gap-6 sm:gap-8 lg:grid-cols-[minmax(0,1fr)_minmax(20rem,24rem)]`,children:[(0,Q.jsx)(`section`,{"data-testid":`overview-hero`,className:`min-w-0 lg:col-start-1 lg:row-start-1`,children:(0,Q.jsxs)(`div`,{className:`min-w-0 px-1 sm:py-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 sm:flex-wrap sm:gap-5`,children:[(0,Q.jsx)(Ie,{className:`size-16 sm:size-20`,mood:_?`care`:Ge||h?`work`:`listen`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h2`,{className:`truncate text-xl font-semibold tracking-tight text-fg sm:text-3xl`,children:nt}),(0,Q.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg-muted`,children:tt.role||(e===`zh`?`从你的背景和偏好开始了解你`:`Your background and preferences, in one place`)})]}),(0,Q.jsxs)(Y,{variant:`ghost`,className:`size-11 shrink-0 px-0 sm:h-9 sm:w-auto sm:px-3`,onClick:()=>me(!0),children:[(0,Q.jsx)(ne,{className:`size-4`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:t.editProfile})]})]}),(0,Q.jsx)(`dl`,{className:`mt-6 hidden gap-x-8 gap-y-5 sm:grid sm:grid-cols-3`,children:[{icon:B,label:t.locale,value:tt.locale?Kt(tt.locale,e):``},{icon:T,label:t.timezone,value:tt.timezone},{icon:Oe,label:t.pronouns,value:tt.pronouns}].filter(({value:e})=>e).map(({icon:e,label:t,value:n})=>(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`dt`,{className:`flex items-center gap-1.5 text-xs text-fg-subtle`,children:[(0,Q.jsx)(e,{className:`size-3.5`,"aria-hidden":`true`}),t]}),(0,Q.jsx)(`dd`,{className:`mt-1.5 truncate text-sm font-medium text-fg`,children:n})]},t))})]})}),et.length?(0,Q.jsxs)(`section`,{className:`overflow-hidden rounded-2xl bg-accent-soft/70 shadow-surface lg:col-span-2`,"aria-label":e===`zh`?`需要你确认`:`Needs your review`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 px-5 py-4 sm:px-6`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-surface-panel text-accent-fg`,children:(0,Q.jsx)(we,{className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e===`zh`?`这条理解准确吗?`:`Needs your review`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e===`zh`?`xopc 还不确定,想请你确认。`:`xopc is unsure and would like your confirmation.`})]})]}),(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2.5 py-1 text-xs font-medium tabular-nums text-accent-fg`,children:et.length})]}),(0,Q.jsxs)(`div`,{className:`border-t border-accent/10 bg-surface-panel px-5 py-4 sm:flex sm:items-center sm:gap-4 sm:px-6`,children:[(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 text-sm leading-6 text-fg`,children:et[0].statement}),(0,Q.jsxs)(`div`,{className:`mt-3 flex shrink-0 gap-2 sm:mt-0`,children:[(0,Q.jsx)(Y,{variant:`ghost`,className:`min-h-11 flex-1 sm:flex-none`,disabled:h===et[0].id,onClick:()=>void qe(et[0].id,()=>P(et[0].id,`rejected`)),children:e===`zh`?`不是`:`No`}),(0,Q.jsx)(Y,{variant:`primary`,className:`min-h-11 flex-1 sm:flex-none`,disabled:h===et[0].id,onClick:()=>void qe(et[0].id,()=>P(et[0].id,`active`)),children:e===`zh`?`是的`:`That’s right`})]})]})]}):null,(0,Q.jsxs)(`section`,{"aria-label":t.aboutYouTitle,className:`space-y-3 sm:space-y-4 lg:col-span-2`,children:[(0,Q.jsxs)(`header`,{className:`flex items-start justify-between gap-3 px-1`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:e===`zh`?t.aboutYouTitle:`What xopc knows about me`}),(0,Q.jsxs)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:[(0,Q.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?`记错了,随时改。`:`You can correct anything.`}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:e===`zh`?`这些内容会帮助 xopc 更好地回应你。推测会单独标注。`:`These details help shape xopc’s responses. Inferences are labeled.`})]})]}),(0,Q.jsx)(Y,{variant:`ghost`,className:`min-h-11 shrink-0`,onClick:()=>At(),children:t.seeAll})]}),Ct.length?(0,Q.jsx)(`div`,{className:`grid items-start gap-5 lg:grid-cols-2`,children:Ct.map(({key:t,title:n,icon:r,items:i})=>(0,Q.jsxs)(`section`,{className:`min-w-0 overflow-hidden rounded-2xl bg-surface-panel`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center justify-between gap-3 px-5 pb-2 pt-4`,children:[(0,Q.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-medium text-fg-muted`,children:[(0,Q.jsx)(r,{className:`size-4`,"aria-hidden":`true`}),n]}),(0,Q.jsxs)(Y,{variant:`ghost`,className:`min-h-11 shrink-0 px-2 text-fg-muted`,"aria-label":`${n}: ${i.length}`,onClick:()=>At(t),children:[(0,Q.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?`${i.length} 条`:i.length}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:e===`zh`?`查看全部 ${i.length} 条`:`View all ${i.length}`}),(0,Q.jsx)(V,{className:`size-4`,"aria-hidden":`true`})]})]}),i.slice(0,2).map(Mt)]},t))}):(0,Q.jsxs)(`div`,{className:`rounded-2xl bg-surface-panel px-5 py-6`,children:[(0,Q.jsx)(`p`,{className:`max-w-xl text-sm leading-7 text-fg-muted`,children:t.emptyGroup}),(0,Q.jsx)(Y,{variant:`secondary`,className:`mt-4`,onClick:()=>me(!0),children:t.editProfile})]})]}),(0,Q.jsxs)(`aside`,{"data-testid":`priority-panel`,className:`flex min-h-0 flex-col rounded-[1.4rem] bg-surface-panel p-5 shadow-surface sm:p-6 lg:col-start-2 lg:row-start-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:t.importantNow}),$?(0,Q.jsxs)(`p`,{className:`mt-1.5 flex items-center gap-1.5 text-xs text-fg-muted`,children:[(0,Q.jsx)(re,{className:`size-3.5`,"aria-hidden":`true`}),$.targetType===`goal`?t.prioritySourceGoal:t.prioritySourceWork]}):null]}),$&&dt?(0,Q.jsxs)(Y,{variant:`ghost`,className:`h-8 shrink-0 px-2.5`,onClick:()=>Ce(!0),children:[(0,Q.jsx)(ve,{className:`size-3.5`,"aria-hidden":`true`}),t.editPriority]}):null]}),dt?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`mt-3 text-lg font-semibold leading-7 tracking-tight text-fg`,children:dt}),ft?.desiredOutcome?(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:ft.desiredOutcome}):null,$?(0,Q.jsxs)(`p`,{className:`mt-auto flex items-center gap-1.5 pt-4 text-xs text-fg-subtle`,children:[(0,Q.jsx)(ie,{className:`size-3.5`,"aria-hidden":`true`}),qt($.validTo,e)]}):null]}):(0,Q.jsxs)(`div`,{className:`mt-2 space-y-4 text-sm leading-6 text-fg-muted`,children:[(0,Q.jsx)(`p`,{children:e===`zh`?`告诉 xopc 当前最重要的事,让协作更贴近你的目标。`:`Tell xopc what matters most so it can keep your goals in mind.`}),(0,Q.jsxs)(Y,{variant:`primary`,onClick:()=>Ce(!0),children:[(0,Q.jsx)(ye,{className:`size-4`,"aria-hidden":`true`}),t.addPriority]})]}),pt.length?(0,Q.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:t.otherGoals}),(0,Q.jsx)(`div`,{className:`mt-2 space-y-2`,children:pt.slice(0,3).map(e=>(0,Q.jsx)(`p`,{className:`text-sm text-fg`,children:e.title},e.id))})]}):null]}),(0,Q.jsxs)(`div`,{className:`grid items-start gap-6 sm:gap-8 lg:col-span-2 lg:grid-cols-2`,children:[(0,Q.jsx)($t,{title:t.howWeWork,className:`min-w-0`,children:mt.length||ht.length?(0,Q.jsxs)(Q.Fragment,{children:[mt.slice(0,3).map(t=>(0,Q.jsx)(rn,{rule:t,language:e,busy:h===t.id,onToggle:()=>void qe(t.id,()=>A(t.id,t.status===`active`?`disabled`:`active`))},t.id)),ht.slice(0,2).map(t=>(0,Q.jsx)(an,{suggestion:t,language:e,busy:h===t.id,onConfirm:()=>void qe(t.id,()=>j(t))},t.id))]}):(0,Q.jsx)(en,{icon:(0,Q.jsx)(S,{className:`size-5`}),children:t.noRules})}),(0,Q.jsx)($t,{title:t.workMemory,className:`min-w-0`,action:(0,Q.jsx)(Y,{variant:`ghost`,className:`h-8 shrink-0`,onClick:()=>jt(`all`),children:t.seeAll}),children:wt.length?(0,Q.jsx)(`div`,{"data-testid":`memory-summary-grid`,className:`grid gap-3 bg-surface-base ${Et}`,children:Tt.map(({kind:n,count:r})=>(0,Q.jsxs)(`button`,{type:`button`,className:`group flex min-h-28 cursor-pointer items-start justify-between rounded-2xl bg-surface-panel px-5 py-5 text-left transition-colors hover:bg-surface-hover focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>jt(n),"aria-label":`${Zt(n,e)}: ${r}`,children:[(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsxs)(`span`,{className:`block text-xs font-medium text-fg-muted`,children:[Zt(n,e),` · `,r,` `,t.items]}),(0,Q.jsx)(`span`,{className:`mt-2 block line-clamp-3 break-words text-sm leading-6 text-fg`,children:gt.find(e=>e.kind===n)?.content})]}),(0,Q.jsx)(V,{className:`mt-1 size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5 group-hover:text-fg-muted motion-reduce:transform-none`,"aria-hidden":`true`})]},n))}):(0,Q.jsx)(en,{icon:(0,Q.jsx)(le,{className:`size-5`}),children:t.noKnowledge})})]})]}):null,m===`understanding`?(0,Q.jsxs)(`div`,{id:`understanding-panel-understanding`,role:`tabpanel`,"aria-labelledby":`understanding-tab-understanding`,className:`mx-auto max-w-3xl space-y-7`,children:[(0,Q.jsxs)(`div`,{className:`px-1 pt-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(z,{className:`mt-0.5 size-5 shrink-0 text-accent-fg`,"aria-hidden":`true`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`font-semibold text-fg`,children:t.aboutYouTitle}),(0,Q.jsxs)(`p`,{className:`mt-1 max-w-3xl text-sm leading-6 text-fg-muted`,children:[(0,Q.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?`你的偏好与背景,都可以在这里修改。`:`Review and edit your preferences here.`}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:t.aboutYouHint})]})]})]}),(0,Q.jsxs)(`div`,{className:`mt-4 grid grid-cols-[minmax(0,1fr)_7rem] gap-2 sm:flex sm:gap-3`,children:[(0,Q.jsxs)(`label`,{className:`relative block min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`sr-only`,children:e===`zh`?`搜索关于你的信息`:`Search what xopc knows`}),(0,Q.jsx)(xe,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-muted`,"aria-hidden":`true`}),(0,Q.jsx)(`input`,{type:`search`,value:Ae,onChange:e=>Z(`search`,e.target.value,!0),placeholder:e===`zh`?`搜索记忆`:`Search memories`,className:`min-h-11 w-full rounded-xl border border-edge bg-surface-panel pl-10 pr-3 text-base text-fg placeholder:text-fg-muted sm:text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`})]}),(0,Q.jsxs)(H,{"aria-label":e===`zh`?`内容分类`:`Category`,value:rt.some(e=>e.key===Ne)?Ne:`all`,onChange:e=>Z(`category`,e.target.value),triggerClassName:`min-h-11 w-full text-base sm:w-48 sm:text-sm`,children:[(0,Q.jsx)(U,{value:`all`,children:e===`zh`?`全部`:`All`}),rt.map(t=>(0,Q.jsx)(U,{value:t.key,children:e===`zh`?{identity:`背景`,preferences:`偏好`,relationships:`关系`,current:`近况`,insights:`观察`}[t.key]:{identity:`Profile`,preferences:`Habits`,relationships:`People`,current:`Now`,insights:`Notes`}[t.key]},t.key))]})]}),(0,Q.jsx)(Le,{className:`mt-3 flex flex-wrap gap-2`,role:`group`,"aria-label":t.understandingFilterHint,indicatorClassName:`rounded-full bg-surface-active`,children:kt.map(t=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":Ee===t.id,className:`touch-target inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${Ee===t.id?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>Z(`source`,t.id),children:[(0,Q.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?{all:`全部`,explicit:`你说过的`,learned:`协作中发现`}[t.id]:{all:`All`,explicit:`You said`,learned:`Observed`}[t.id]}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:t.label}),(0,Q.jsx)(`span`,{className:`hidden tabular-nums text-fg-muted sm:inline`,children:t.count})]},t.id))})]}),bt.length?bt.map(({key:e,title:t,icon:n,items:r})=>(0,Q.jsx)($t,{title:t,action:(0,Q.jsx)(n,{className:`size-4 text-fg-subtle`,"aria-hidden":`true`}),children:(0,Q.jsx)(`div`,{children:r.map(Mt)})},e)):(0,Q.jsxs)(`div`,{className:`rounded-2xl bg-surface-panel`,children:[(0,Q.jsx)(en,{icon:(0,Q.jsx)(z,{className:`size-5`}),children:$e.length?e===`zh`?`没有找到符合条件的内容,试试其他关键词或清除筛选。`:`No matching details. Try another search or clear the filters.`:t.emptyGroup}),$e.length?(0,Q.jsx)(Y,{variant:`ghost`,className:`mb-4 ml-4`,onClick:()=>At(),children:e===`zh`?`清除筛选`:`Clear filters`}):null]})]}):null,m===`work`?(0,Q.jsxs)(`div`,{id:`understanding-panel-work`,role:`tabpanel`,"aria-labelledby":`understanding-tab-work`,className:`space-y-8`,children:[(0,Q.jsx)(St,{language:e}),(0,Q.jsxs)(`div`,{className:`px-1 pt-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,Q.jsx)(`h2`,{className:`font-semibold text-fg`,children:Re===`all`?t.allMemory:Zt(Re,e)}),(0,Q.jsxs)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:[vt.length,` `,t.items,` · `,e===`zh`?`当前筛选的工作资料记录数,包含未启用或待核验项;不同于顶部已启用且有依据的记忆数。`:`Work records matching this filter, including inactive or unverified items; separate from active, supported memories above.`,` · `,t.memoryLibraryHint]})]}),(0,Q.jsxs)(`label`,{className:`relative block sm:w-80`,children:[(0,Q.jsx)(xe,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:t.searchPlaceholder}),(0,Q.jsx)(`input`,{type:`search`,value:G,onChange:e=>{de(e.target.value),q(24)},placeholder:t.searchPlaceholder,className:`h-10 w-full rounded-xl border border-edge bg-surface-base pl-9 pr-3 text-sm text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`})]})]}),(0,Q.jsxs)(Le,{className:`mt-4 flex flex-wrap gap-2`,role:`group`,"aria-label":t.memoryFilterHint,indicatorClassName:`rounded-full bg-surface-active`,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":Re===`all`,className:`touch-target inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${Re===`all`?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>ze(`all`),children:[t.allMemory,(0,Q.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:gt.length})]}),wt.map(({kind:t,count:n})=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":Re===t,className:`touch-target inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${Re===t?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>ze(t),children:[Zt(t,e),(0,Q.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:n})]},t))]})]}),yt.length?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`space-y-8`,children:Ot.map(({kind:t,items:n,totalCount:r})=>(0,Q.jsxs)(`section`,{className:`overflow-hidden rounded-2xl bg-surface-panel`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center justify-between px-5 pb-1 pt-4 sm:px-6`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:Zt(t,e)}),(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:r})]}),(0,Q.jsx)(`div`,{children:n.map(t=>(0,Q.jsx)(on,{item:t,language:e,busy:!!h,expanded:J===t.id,onToggle:()=>fe(e=>e===t.id?void 0:t.id),editing:I===`knowledge:${t.id}`,draft:oe,onDraftChange:W,onEdit:()=>{L(`knowledge:${t.id}`),W(t.content)},onCancel:()=>{L(void 0),W(``)},onDelete:()=>void qe(t.id,()=>te(t.id)),onScopeChange:e=>void qe(t.id,()=>ee(t,e)),onReview:(e,n)=>void qe(t.id,async()=>{await D(t,e,n),L(void 0),W(``)})},t.id))})]},t))}),yt.length>K?(0,Q.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,Q.jsx)(Y,{onClick:()=>q(e=>e+24),children:t.showMore})}):null]}):(0,Q.jsx)(`div`,{className:`rounded-2xl bg-surface-panel`,children:(0,Q.jsx)(en,{icon:(0,Q.jsx)(xe,{className:`size-5`}),children:G.trim()?t.noKnowledgeMatch:t.noKnowledge})})]}):null,m===`privacy`?(0,Q.jsxs)(`div`,{id:`understanding-panel-privacy`,role:`tabpanel`,"aria-labelledby":`understanding-tab-privacy`,className:`space-y-8`,children:[(0,Q.jsx)(`div`,{className:`px-1 pt-1`,children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(Se,{className:`mt-0.5 size-5 shrink-0 text-accent-fg`,"aria-hidden":`true`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`font-semibold text-fg`,children:e===`zh`?`你的信息,由你掌控`:`Your information, under your control`}),(0,Q.jsx)(`p`,{className:`mt-1 max-w-3xl text-sm leading-6 text-fg-muted`,children:e===`zh`?`决定 xopc 可以记住什么、从哪里了解你,以及如何迁移你的数据。`:`Decide what xopc can remember, where it learns from, and how your data moves.`})]})]})}),(0,Q.jsx)($t,{title:e===`zh`?`记忆与使用`:`Memory & use`,children:(0,Q.jsxs)(`div`,{className:`divide-y divide-edge-subtle`,children:[[{key:`memory`,icon:z,title:e===`zh`?`长期记忆`:`Long-term memory`,detail:e===`zh`?`记住长期有用的信息,减少重复说明。`:`Remember useful information so you do not have to repeat yourself.`,enabled:l.settings.memoryEnabled},{key:`references`,icon:we,title:e===`zh`?`回答中的记忆引用`:`Memory references in answers`,detail:e===`zh`?`当个人信息影响回答时,显示本次参考内容。`:`Show what personal context was referenced when it shapes an answer.`,enabled:l.settings.showMemoryReferences}].map(({key:e,icon:t,title:n,detail:r,enabled:i})=>(0,Q.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":i,disabled:!!h,className:`flex min-h-20 w-full items-center gap-4 px-5 py-4 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent disabled:opacity-60 sm:px-6`,onClick:()=>void qe(`setting:${e}`,()=>k(e===`memory`?{memoryEnabled:!i}:{showMemoryReferences:!i})),children:[(0,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(t,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:n}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:r})]}),(0,Q.jsx)(`span`,{className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${i?`bg-accent`:`bg-surface-active`}`,"aria-hidden":`true`,children:(0,Q.jsx)(`span`,{className:`absolute top-0.5 size-5 rounded-full bg-white shadow-sm transition-transform ${i?`translate-x-5`:`translate-x-0.5`}`})})]},e)),(0,Q.jsxs)(`div`,{className:`flex min-h-20 items-center gap-4 px-5 py-4 sm:px-6`,children:[(0,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(ge,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e===`zh`?`敏感信息`:`Sensitive information`}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e===`zh`?`控制健康、财务等信息是否可以保存。`:`Control whether health, financial, and similar information can be saved.`})]}),(0,Q.jsxs)(H,{"aria-label":e===`zh`?`敏感信息策略`:`Sensitive information policy`,value:l.settings.sensitiveWritePolicy,disabled:!!h,onChange:e=>void qe(`setting:sensitive`,()=>k({sensitiveWritePolicy:e.target.value})),children:[(0,Q.jsx)(U,{value:`confirm`,children:e===`zh`?`先询问`:`Ask first`}),(0,Q.jsx)(U,{value:`deny`,children:e===`zh`?`不保存`:`Never save`}),(0,Q.jsx)(U,{value:`allow`,children:e===`zh`?`允许`:`Allow`})]})]})]})}),(0,Q.jsx)($t,{title:e===`zh`?`数据管理`:`Data management`,children:(0,Q.jsxs)(`div`,{className:`divide-y divide-edge-subtle`,children:[(0,Q.jsxs)(o,{to:`/settings/imports`,className:`flex min-h-20 items-center gap-4 px-5 py-4 hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent sm:px-6`,children:[(0,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(De,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e===`zh`?`从其他 AI 导入`:`Import from another AI`}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e===`zh`?`导入前预览新增、重复和冲突内容。`:`Preview new, duplicate, and conflicting items before import.`})]}),(0,Q.jsx)(V,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]}),(0,Q.jsxs)(`button`,{type:`button`,disabled:!!h,className:`flex min-h-20 w-full items-center gap-4 px-5 py-4 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent disabled:opacity-60 sm:px-6`,onClick:()=>void qe(`export`,E),children:[(0,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(ue,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e===`zh`?`下载我的记忆`:`Download my memory`}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e===`zh`?`导出为可阅读、可迁移的数据包。`:`Export a readable, portable archive.`})]}),(0,Q.jsx)(V,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]})]})}),(0,Q.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel px-5 py-5 sm:px-6`,children:[(0,Q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e===`zh`?`纠正与忘记`:`Correct and forget`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:e===`zh`?`在“记忆”中打开任意一条内容的菜单,即可修改、调整作用范围或彻底删除。`:`Open any item in Memory to edit it, change where it applies, or delete it permanently.`}),(0,Q.jsx)(Y,{variant:`ghost`,className:`mt-3`,onClick:()=>{Ue(`understanding`)},children:e===`zh`?`管理记忆`:`Manage memory`})]})]}):null,(0,Q.jsx)(tn,{open:pe,profile:tt,language:e,saving:h===`profile`,onOpenChange:me,onSave:e=>void Ye(e)}),(0,Q.jsx)(nn,{open:_e,priority:$,title:dt??``,outcome:ft?.desiredOutcome,language:e,saving:h===($?`priority:${$.id}`:`priority:create`),onOpenChange:Ce,onSave:e=>$?void Xe($,e):void Ze(e),onEnd:$?()=>void Qe($):void 0})]})}export{sn as UserModelPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e}from"./locale-store-Dy1EByeG.js";var t=e(e=>({agentId:``,setAgentId:t=>e({agentId:t})}));export{t};
|