@xopcai/xopc 0.0.480 → 0.0.481
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/manifest.json +1 -1
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/feishu/src/transport/client/install-sdk.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +1 -1
- package/dist/extensions/weixin/src/cdn/upload.js +1 -1
- package/dist/extensions/weixin/src/media/data-url.js +1 -1
- package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
- package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
- package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
- package/dist/gateway/server/chunks.bin +583 -583
- package/dist/gateway/server/chunks.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-9wMoZ4Ok.js → activity-store-zMwJQbPV.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-TrALdAg_.js → agent-avatar-dicebear-VUJHrVXo.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-BiHRFRo2.js → agent-avatar-display-umdw-BQZ.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DLopBKfN.js → agent-defaults-settings-panel-2JEkjXQB.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-wisFd2cR.js → agent-plugin-dialog-Cz08StU4.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-CzgZX_E9.js → agents-BXVjWw0p.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-Crvl6IB4.js → agents-admin-api-C1Ab97Mn.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CJvZsRen.js → api-5GGJYrzC.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DQVcF1zq.js → api-B2QJSgN6.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CYwY9a8P.js → app-management-settings-panel-IaAONzFg.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-8clf9SDY.js → appearance-settings-BFo0Yk57.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-B2qv9gWd.js → apps-page-aVZLDS59.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-Bu1nF6Lg.js → archive-plugin-BgX_1X6q.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-HQmKv0Sm.js → automation-api-DtFbVh6a.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-CMjfyY6p.js → automation-result-state-CBfGJb7v.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-wlGMBYYv.js → automation-run-list-C-nOpY2_.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-2EsZ1jBs.js → automation-task-card-BgS9JQeL.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BUtoiUiH.js → automations-page-C6dw7Nqb.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-CW_8-0Cb.js → automations-workspace-CKCsL5wQ.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-Dz62GXI_.js → binary-plugins-DX9lDAWC.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CA66tdm3.js → block-editor-DRNtaARK.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-hAttQ9qS.js → browser-settings-page-Btf2a-_0.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BNmDs-Ca.js → capabilities-C5MLP2Rx.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BcgSEYc5.js → capabilities-SIty9Vcz.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-CT6qMkqA.js → capabilities-page-BnTgeZB3.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-7MsgsVvQ.js +8 -0
- package/dist/gateway/static/root/assets/capability-presentation-DlJQUUlM.js +1 -0
- package/dist/gateway/static/root/assets/{channels-CFmGXibE.js → channels-CLpOmzO5.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-LVSL686y.js → chat-agents-api-JoSvbwve.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-Drmp5p0m.js → chat-chart-block-D1XpCNA5.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-qrdWReZ2.js → chat-page-sPNbEboB.js} +31 -31
- package/dist/gateway/static/root/assets/{chat-terminal-dock-twWNRsuW.js → chat-terminal-dock-BDHq9kj3.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-B27c_GTI.js → command-palette-api-C2IaBEe4.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-model-config-control-DdxZ-1U4.js → composer-model-config-control-C5hjuJQc.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-Dd64p5ZI.js → composer-notifications-BSboNnS6.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-Cbkv-F26.js → composer-payload-handoff-D5CvsQWj.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-B8UkO-mU.js → computer-settings-page-CwB7HgUb.js} +1 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-DPJ_E0_Y.js +1 -0
- package/dist/gateway/static/root/assets/{connection-usage-guide-CNB9P9jg.js → connection-usage-guide-DWj6jcFA.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-DkifsBTl.js → connector-service-page-DEnQE7bH.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-DjIpuBCy.js → connectors-api-BRGeDfyP.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-oGveGlkI.js → connectors-page--3zYHSCM.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-_G6tIiGk.js → date-picker-jqmqOuOL.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-B3lS-ZGW.js → date-time-picker-B3n_gScw.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BAKyq-sn.js → desktop-pet-D8Tz4lEu.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DGpu4hH_.js → desktop-pet-settings-24N6UYdz.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-DqYjZFu1.js → dev-view-store-DMaKk2H5.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CIvmpDvo.js → device-pairing-wizard-CUMh0ui_.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BAsEQvG4.js → directory-picker-path-field-DqknuyWo.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-authoritative-grants-BmlRcbhA.js → extension-authoritative-grants-Choc5BaY.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page--EU_kb8E.js → extension-debug-page-8tHOJM-0.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-CcspWP4N.js → extension-iframe-host-crHrHgry.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-BQIfGFSy.js → extension-marketplace-api-3vDR-EC4.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-f7v82b69.js → extension-message-router-CBdW5Mi0.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CJxtbXQj.js → extension-page-ouZIIOwR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-htRLPCBf.js → extension-provider-CJJRG7Gq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CKui11ZQ.js → extension-settings-page-BO8VsTJF.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-Cwy9Cgaq.js → file-preview-surface-zEJDQWOT.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-abWJ0Q_y.js → gateway-config-swr-CNzw8MWj.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-PYDAppcy.js → gateway-realtime-BCghEC3U.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CQygYU9S.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-BtAJNIO-.js → gateway-restart-DaKNDKV9.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BvD8fcB2.js → gateway-settings-BxBJ1zGZ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Cza1BaL8.js → gateway-startup-retry-CSY11ude.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-BIa73mvy.js → global-defaults-api-C0qPO4zT.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DzSLTEJf.js +8 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BCU7Uxyy.js → image-generation-api-CD1tNChr.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-Clh0polM.js → imports-page-DHWKf1n3.js} +1 -1
- package/dist/gateway/static/root/assets/index-B9_yImuQ.css +1 -0
- package/dist/gateway/static/root/assets/index-BrXVoLVe.js +11 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-DSkXYsng.js → install-connector-dialog-B3A7BKlp.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Crf76ecq.js → keyboard-shortcuts-settings-BZaTvMnH.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-WudNXl41.js → local-app-workbench-page-DH1zWMav.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Br9ZO7Ad.js → local-apps-page-CSnxRVm2.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-BHrHLZJJ.js → local-session-drafts-CfgBHtlt.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-5DzxIIeq.js → locale-store-CeEXxDaP.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-BqUeqzPB.js → logs-page-fF3rKMVM.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-DHCpR1ma.js → management-api-iUbR1cSS.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BccKy8tW.js → management-settings-BWJ-4D2j.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BwbjZnQ6.js → markdown-view-BQw7H2MV.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-DxZ-KH6B.js → mcp-conversation-setup-page-CJdg6fgZ.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DissTT0S.js → media-plugins-B_0Q_dY0.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-CGGOcV9B.js → messages-L7tv_OPK.js} +2 -2
- package/dist/gateway/static/root/assets/{model-selector-DsCLjn_X.js → model-selector-CMsLur91.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-B0Y9Frop.js → models-hub-cache-DI9vvuFx.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-DEz8I-eN.js → note-detail-panel-BhJM-EYy.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-y9OBo4Kv.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-CdC4jVPP.js → notes-api-Ck4Yvy_j.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CC5-BWmA.js → notes-page-qellAl3o.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-CAPuqZdT.js → oauth-api-3nGo5FdC.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-7i3NoKo4.js → oauth-provider-connect-wtw_Oup3.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-BcSfcOme.js → page-context-capture-button-Bm8TI2e0.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-BJ2cY1Us.js → page-context-draft-D7Wh_S2e.js} +1 -1
- package/dist/gateway/static/root/assets/{page-header-store-xgXJVGDC.js → page-header-store-hCKJckdJ.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-avatar-CidTaDAv.js → personal-avatar-CW6MOp9q.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-BlxApjBh.js → personal-page-YTJfXUqr.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-profile-settings-D1TpPIVg.js → personal-profile-settings-Qn6MR0gu.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-BXKSkUoc.js → personal-settings-panel-DgGTnduT.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-_7leySaj.js → phone-dependencies-card-CiLziQ8R.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-CVI6GGMF.js → phone-model-connection-DjQJIS33.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-qP1Sh-eA.js → phone-model-picker-BaHl_-yf.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-BAKOJllx.js → phone-settings-page-DEvyfoAt.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-CDtfKAUX.js → phone-workspace-store-9hDVXN9z.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-BpPMZLLz.js → plugin-details-dialog-BI--oe7J.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-BS-XMhb4.js → preference-select-fields-DAhA9Z56.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-runtime-D8kxmrLV.js → preview-runtime-DNxSgx2a.js} +3 -3
- package/dist/gateway/static/root/assets/{product-automation-feedback-CDjJlwol.js → product-automation-feedback-ChMWhk-X.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BUqA67HG.js → product-open-page-KyiYh48g.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-CowHxHNk.js → product-preview-content-BSj9eoc8.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-BJDwL7x3.js → product-preview-modal-DhONFWvj.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-CJQuslC9.js → project-detail-page-DA11E8Iz.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-eH4uN6k8.js → project-understanding-DjOdtNHh.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-DFo_ESE9.js → projects-page-3Y7Bj3vP.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-Df4w723e.js → providers-api-BKDzcCQr.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-DnRi2KQ5.js → recording-upload-Bg_HBFTj.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Dw8Ou9VV.js → registry-api-C91pIb6J.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-B7jGK_WY.js → remote-access-hub-DZjxntjM.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-CZV8cItD.js → resource-unavailable-D8FrMGjx.js} +1 -1
- package/dist/gateway/static/root/assets/{right-workspace-store-DOyKalyG.js → right-workspace-store-D3nQJkDG.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-B_CMsS70.js +2 -0
- package/dist/gateway/static/root/assets/routine-panel-BTuii051.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-2sksjMtE.js → runtime-tools-api-CbVocuF5.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DPX5htrV.js → runtime-tools-settings-panel-BVcSYWWj.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-BnJcjQuF.js → service-recommendation-list-DEIaJSOU.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CUkWJyfm.js → session-api-M4P3knYu.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-BRzFtnn4.js → session-manager-DQ0fiEo9.js} +2 -2
- package/dist/gateway/static/root/assets/{sessions-page-PjTnKj7l.js → sessions-page-UTEjz3V0.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cnkvm_q6.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-Bponzv_k.js → settings-advanced-section-BRNFkPxE.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-BtgmaA-P.js → settings-mode-store-va_oX_Q8.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C1USPFgf.js → settings-page-BVFv8SOp.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-B8nLRdnY.js → settings-page-header-Wx54i9EL.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DhOLVJYv.js → settings-page-layout-DDTKMXIb.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-CyEO6jAM.js → setup-interaction-page-CaHdjPKk.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CNpRqxnq.js → setup-status-panel-D1XJedVC.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-kZSUpbBN.js → share-link-dialog-C8bVavnr.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-9-aTa7_a.js → share-preview-page-3QEwX9TP.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-BxQqmxkq.js → shares-api-Dp6g-bfj.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DoMMw8Ud.js → shares-settings-BbxnfBhc.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-V3Y6pTog.js → skill-api-BTiymSB8.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-BSHfM0qb.js → skill-list-api-BM8u0Bs_.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-Dq3F9pqP.js → skill-reload-api-BP2ecrz2.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DGWy1Jns.js → skills-page-DTrONo3c.js} +1 -1
- package/dist/gateway/static/root/assets/{space-api-BkXqM2MT.js → space-api-Ix7mfZDi.js} +1 -1
- package/dist/gateway/static/root/assets/space-page-Dpy0BPbT.js +2 -0
- package/dist/gateway/static/root/assets/{space-workbook-7S_FfalA.js → space-workbook-CxV64kNP.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DSmwwU8o.js → system-settings-panel-C2BWOeNW.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DqgGOX0M.js +3 -0
- package/dist/gateway/static/root/assets/{task-header-title-DAwu5vni.js → task-header-title-Di5TvRaj.js} +1 -1
- package/dist/gateway/static/root/assets/task-run-issue-notice-FMMn1lE6.js +1 -0
- package/dist/gateway/static/root/assets/{terminal-panel-store-IpKmyQVN.js → terminal-panel-store-mDqqa0EW.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-B75oCec7.js → theme-store-kQ-dt8qP.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-CVj7aLAl.js → tracing-settings-page-BYAYhuS8.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-TWW8dGwO.js → tunnel-api-XScou7Y8.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-NgjWPD55.js → understanding-activity-store-NVT8M3Rv.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-CN-7T5G5.js → understanding-refresh-store-D5pgGLiW.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-D6mzQviK.js → usage-page-CWMg8m0Q.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BYtW_pgF.js → use-autosave-Iy9pO3fa.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-Dn6X6xAP.js → use-composer-attachments-DfSh4D1i.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-BT0pss9g.js → use-file-preview-expanded-BFw8CA51.js} +1 -1
- package/dist/gateway/static/root/assets/{use-generated-media-CuhMqXFp.js → use-generated-media-MuDDqdB3.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-profile-DxE21oPS.js → use-personal-profile-Csm85ZFS.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-work-j8AH0g9w.js → use-personal-work-CVmHKsJn.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-CNG2yeaO.js → use-realtime-voice-D1zQbDnk.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-BohZkOOW.js → use-workspace-tree-B_do34-j.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-Dlm-Mmo4.js → user-model-page-BlBvDtwt.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-D_o-xx9v.js → voice-api-key-field-DRlguUPt.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-BX2Q9Cgb.js → voice-config-api-B2AO_uL_.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-qbqLMfW_.js → voice-input-shortcut-events-jLnl_86X.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-player-store-z-upb7lD.js → voice-player-store-C8BTMBVX.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-BEhihzNq.js → voice-settings-D8Snr-5R.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-ClPiLw1F.js → work-discovery-overlay-C0oaToAM.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BohjMx1A.js → work-discovery-page-IEKvSp0W.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-CcD0smT0.js → working-directory-picker-modal-ppDpY-AP.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Bpq_rBZM.js → workspace-api-C85sEgvX.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CNPlB8xY.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BjJEOajj.js → workspace-file-preview-dialog-DGsFnZh-.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-Bc8qK8WA.js → workspace-open-location-menu-CGe_tu1_.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-preview-store-QUX-jyAL.js → workspace-preview-store-D8eGmciG.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-BWdmU4iy.js → xopc-cloud-account-card-L-HD-Zf7.js} +1 -1
- package/dist/gateway/static/root/index.html +95 -94
- package/dist/package.js +1 -1
- package/dist/src/activity/emitter.js +1 -1
- package/dist/src/activity/index.js +1 -1
- package/dist/src/agent/agent-manager.js +6 -6
- package/dist/src/agent/agent-scope.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -1
- package/dist/src/agent/coding/repository-instructions.js +1 -1
- package/dist/src/agent/coding/workspace-revision.js +2 -2
- package/dist/src/agent/commands/command-registry.js +3 -3
- package/dist/src/agent/commands/commandMounts.js +1 -1
- package/dist/src/agent/context/workspace-seed.js +2 -2
- package/dist/src/agent/context/workspace-state.js +1 -1
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/codemode-output.js +4 -4
- package/dist/src/agent/embedded/run-for-session.js +2 -2
- package/dist/src/agent/embedded/run-turn.js +1 -1
- package/dist/src/agent/embedded/session-runner.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +2 -2
- package/dist/src/agent/external-tools/composio-provider.js +1 -1
- package/dist/src/agent/image/load-image-media.js +2 -2
- package/dist/src/agent/mcp/connection-drafts.d.ts +1 -1
- package/dist/src/agent/mcp/connection-drafts.js +15 -2
- package/dist/src/agent/mcp/native-mcp.js +1 -1
- package/dist/src/agent/memory/compaction.js +1 -1
- package/dist/src/agent/memory/plugin-discovery.js +1 -1
- package/dist/src/agent/prompt/response-language.js +1 -1
- package/dist/src/agent/reply/post-compaction-context.js +1 -1
- package/dist/src/agent/reply/workspace-boundary-read.js +1 -1
- package/dist/src/agent/sandbox/fileAccess.js +1 -1
- package/dist/src/agent/sandbox/native-command.js +1 -1
- package/dist/src/agent/sandbox/path-policy.js +2 -2
- package/dist/src/agent/service/process-direct-streaming.js +2 -2
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/skills/config.js +1 -1
- package/dist/src/agent/skills/hub-hash.js +2 -2
- package/dist/src/agent/skills/hub-pull.js +4 -4
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-sources.js +2 -2
- package/dist/src/agent/starter-agents.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +1 -1
- package/dist/src/agent/tools/create-share-tool.js +1 -1
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +1 -1
- package/dist/src/agent/tools/personal-memory-tool.js +1 -1
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/scoped-workspace-tools.js +2 -2
- package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
- package/dist/src/agent/tools/tool-media.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +3 -3
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/agent-catalog/service.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth/openai.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/automations/service/action-executor.js +1 -1
- package/dist/src/automations/service/automation-service.js +1 -1
- package/dist/src/backup/archive.js +5 -5
- package/dist/src/browser/cache-dir-policy.js +1 -1
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +7 -7
- package/dist/src/browser/providers/playwright-doctor.js +2 -2
- package/dist/src/browser/runtime/browser-runtime.js +1 -1
- package/dist/src/capabilities/capability-catalog.js +1 -1
- package/dist/src/channels/catalog/channel-catalog-service.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +1 -1
- package/dist/src/channels/pairing/pairing-store.js +2 -2
- package/dist/src/cli/commands/doctor/checks/config-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +2 -2
- package/dist/src/cli/commands/doctor/checks/state-integrity.js +1 -1
- package/dist/src/cli/commands/doctor/checks/workspace-status.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
- package/dist/src/cli/commands/extension-create.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension-pack.js +3 -3
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/gateway/logs.js +1 -1
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/mcp.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +2 -2
- package/dist/src/config/config-file.js +1 -1
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/paths-state.js +1 -1
- package/dist/src/config/workspace-path.js +1 -1
- package/dist/src/connectors/cli/assets.js +1 -1
- package/dist/src/connectors/cli/installer.js +3 -3
- package/dist/src/connectors/connected-source-ingestion.js +1 -1
- package/dist/src/connectors/content-enrichment.js +2 -2
- package/dist/src/connectors/plugin-connection.js +1 -1
- package/dist/src/daemon/constants.js +1 -1
- package/dist/src/daemon/install-plan.js +2 -2
- package/dist/src/daemon/launchd.js +3 -3
- package/dist/src/daemon/schtasks.js +2 -2
- package/dist/src/daemon/systemd.js +3 -3
- package/dist/src/discussions/action-tasks.js +1 -1
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/recording.js +3 -3
- package/dist/src/discussions/repository.js +1 -1
- package/dist/src/discussions/sealer.js +2 -2
- package/dist/src/discussions/service.js +1 -1
- package/dist/src/endpoint-tools/bridge-host.js +1 -1
- package/dist/src/endpoint-tools/delegation.js +1 -1
- package/dist/src/endpoint-tools/provider-operation-journal.js +1 -1
- package/dist/src/endpoint-tools/runtime.js +1 -1
- package/dist/src/endpoint-tools/upload-service.js +2 -2
- package/dist/src/execution-environments/local-worktree-manager.js +3 -3
- package/dist/src/execution-environments/store.js +1 -1
- package/dist/src/execution-environments/worktree-safety.js +1 -1
- package/dist/src/extensions/agent-plugins/auth.js +2 -2
- package/dist/src/extensions/agent-plugins/branding.js +2 -2
- package/dist/src/extensions/agent-plugins/capability-access.js +1 -1
- package/dist/src/extensions/agent-plugins/cli-authorization.js +3 -3
- package/dist/src/extensions/agent-plugins/contained-path.js +1 -1
- package/dist/src/extensions/agent-plugins/credentials.js +1 -1
- package/dist/src/extensions/agent-plugins/formats.js +1 -1
- package/dist/src/extensions/agent-plugins/inventory.js +1 -1
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +3 -3
- package/dist/src/extensions/agent-plugins/resources.js +2 -2
- package/dist/src/extensions/agent-plugins/setup.js +4 -4
- package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
- package/dist/src/extensions/agent-plugins/source-catalog.js +3 -3
- package/dist/src/extensions/agent-plugins/sources.js +2 -2
- package/dist/src/extensions/agent-plugins/store.js +5 -5
- package/dist/src/extensions/agent-plugins/user-config.js +2 -2
- package/dist/src/extensions/agent-plugins/validation.js +2 -2
- package/dist/src/extensions/connector-dependencies.js +1 -1
- package/dist/src/extensions/install-transaction.js +1 -1
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/loader.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/update.js +2 -2
- package/dist/src/files/file-service.js +4 -4
- package/dist/src/files/file-versions.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/static-ui.js +2 -2
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/browser.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/extension-ui-assets.js +1 -1
- package/dist/src/gateway/hono/routes/host-fs.js +1 -1
- package/dist/src/gateway/hono/routes/local-apps.js +2 -2
- package/dist/src/gateway/hono/routes/location-sharing.js +1 -1
- package/dist/src/gateway/hono/routes/memory-learning.js +1 -1
- package/dist/src/gateway/hono/routes/mobile-capability-panels.d.ts +3 -1
- package/dist/src/gateway/hono/routes/mobile-capability-panels.js +121 -44
- package/dist/src/gateway/hono/routes/notes.js +1 -1
- package/dist/src/gateway/hono/routes/personal-agent.js +1 -1
- package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
- package/dist/src/gateway/hono/routes/phone.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/provider-setup.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +2 -2
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/video-generation.js +1 -1
- package/dist/src/gateway/lock.js +2 -2
- package/dist/src/gateway/next-turn-suggestions/snapshot.js +1 -1
- package/dist/src/gateway/security/device-request-proof.js +1 -1
- package/dist/src/gateway/security/phone-access.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +1 -1
- package/dist/src/gateway/service/session-input-coordinator.js +1 -1
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/gateway/session-context-summary.js +1 -1
- package/dist/src/gateway/workspace-editor-path.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/follow-ups.js +1 -1
- package/dist/src/home-intelligence/host.js +1 -1
- package/dist/src/home-intelligence/repository.js +1 -1
- package/dist/src/home-intelligence/routines.js +1 -1
- package/dist/src/imports/files.js +3 -3
- package/dist/src/imports/importService.js +3 -3
- package/dist/src/imports/inventory.js +2 -2
- package/dist/src/imports/planner.js +2 -2
- package/dist/src/imports/productImport.js +1 -1
- package/dist/src/imports/scanner.js +2 -2
- package/dist/src/imports/sources.js +2 -2
- package/dist/src/infra/brew.js +1 -1
- package/dist/src/infra/package-runtime-check.js +2 -2
- package/dist/src/infra/path-env.js +2 -2
- package/dist/src/infra/process-diagnostics.js +1 -1
- package/dist/src/infra/restart.js +1 -1
- package/dist/src/infra/update-check.js +1 -1
- package/dist/src/infra/update-global.js +1 -1
- package/dist/src/infra/update-lock.js +1 -1
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/infra/write-file-atomic.js +2 -2
- package/dist/src/knowledge/local-folder-adapter.js +1 -1
- package/dist/src/local-apps/acceptance.js +1 -1
- package/dist/src/local-apps/artifact-files.js +2 -2
- package/dist/src/local-apps/execution-authority.js +1 -1
- package/dist/src/local-apps/p1-services.js +3 -3
- package/dist/src/local-apps/preview-fixtures.js +1 -1
- package/dist/src/local-apps/preview-sessions.js +2 -2
- package/dist/src/local-apps/preview-worker.js +2 -2
- package/dist/src/local-apps/public-assets.js +2 -2
- package/dist/src/local-apps/scaffold.js +1 -1
- package/dist/src/local-apps/service.js +5 -5
- package/dist/src/local-apps/snapshot-store.js +1 -1
- package/dist/src/local-apps/store.js +1 -1
- package/dist/src/media/session-references.js +1 -1
- package/dist/src/media/store.js +1 -1
- package/dist/src/memory-learning/source-learning.js +1 -1
- package/dist/src/memory-learning/task-receipts.js +1 -1
- package/dist/src/migrations/runner.js +1 -1
- package/dist/src/music-generation/artifact.js +2 -2
- package/dist/src/notes/capabilities/write.js +1 -1
- package/dist/src/notes/service.js +2 -2
- package/dist/src/notes/store.js +2 -2
- package/dist/src/notifications/harmony-push.js +1 -1
- package/dist/src/notifications/store.js +1 -1
- package/dist/src/observability/store.js +1 -1
- package/dist/src/personal-agent/proactivity/repository.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +2 -2
- package/dist/src/personal-agent/reply-composer.js +3 -3
- package/dist/src/personal-agent/request-delivery.js +1 -1
- package/dist/src/personal-agent/request-service.js +1 -1
- package/dist/src/personal-agent/result-reader.js +3 -3
- package/dist/src/personal-agent/unread.js +1 -1
- package/dist/src/pets/factory.js +1 -1
- package/dist/src/pets/validator.js +1 -1
- package/dist/src/phone/adb-driver.js +3 -3
- package/dist/src/phone/assistance-service.js +1 -1
- package/dist/src/phone/assistance.js +1 -1
- package/dist/src/phone/cloud-adb-connection.js +1 -1
- package/dist/src/phone/execution-trace.js +1 -1
- package/dist/src/phone/hdc-driver.js +3 -3
- package/dist/src/phone/hdc-video-tools.js +2 -2
- package/dist/src/phone/location-baseline-store.js +1 -1
- package/dist/src/phone/location-environment.js +1 -1
- package/dist/src/phone/repository.js +1 -1
- package/dist/src/phone/ui-session.js +2 -2
- package/dist/src/project-trust/trust-store.js +2 -2
- package/dist/src/projects/project-kind.js +1 -1
- package/dist/src/projects/project-service.js +1 -1
- package/dist/src/projects/project-skill-service.js +1 -1
- package/dist/src/projects/workspace-project.js +2 -2
- package/dist/src/providers/auth-runtime/auth-profile-store.js +1 -1
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/xopc-cloud-credit-budget.js +1 -1
- package/dist/src/runtime-tools/archive.js +2 -2
- package/dist/src/runtime-tools/downloader.js +2 -2
- package/dist/src/runtime-tools/harmony-dependencies.js +1 -1
- package/dist/src/runtime-tools/manager.js +1 -1
- package/dist/src/runtime-tools/manifest-store.js +1 -1
- package/dist/src/runtime-tools/phone-dependencies.js +1 -1
- package/dist/src/session/init-session-turn.js +1 -1
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/share/hosted-note-publication.js +1 -1
- package/dist/src/share/hosted-session-share.js +2 -2
- package/dist/src/share/hosted-static-site-publication.js +2 -2
- package/dist/src/share/note-share-service.js +1 -1
- package/dist/src/share/session-share-service.js +2 -2
- package/dist/src/share/share-auto.js +2 -2
- package/dist/src/share/share-store.js +2 -2
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/share/site-static-serve.js +1 -1
- package/dist/src/space/budget-workbook.js +1 -1
- package/dist/src/space/ingest.js +1 -1
- package/dist/src/space/repository.js +3 -3
- package/dist/src/space/workbook-turn.js +1 -1
- package/dist/src/space/worker.js +1 -1
- package/dist/src/storage/sqlite/ai-usage-repository.js +1 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.js +2 -2
- package/dist/src/storage/sqlite/connection.js +3 -3
- package/dist/src/storage/sqlite/conversation-repository.js +2 -2
- package/dist/src/storage/sqlite/desktop-execution-repository.js +1 -1
- package/dist/src/storage/sqlite/desktop-execution-stop-repository.js +1 -1
- package/dist/src/storage/sqlite/device-access-repository.js +1 -1
- package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
- package/dist/src/storage/sqlite/index.js +1 -1
- package/dist/src/storage/sqlite/offline-access.js +1 -1
- package/dist/src/storage/sqlite/schema-upgrade.js +3 -3
- package/dist/src/storage/sqlite/session-creation-repository.js +1 -1
- package/dist/src/storage/sqlite/session-input-control-repository.js +1 -1
- package/dist/src/storage/sqlite/session-repository.js +1 -1
- package/dist/src/storage/sqlite/sql-assets.js +1 -1
- package/dist/src/storage/sqlite/windows-database-owners.js +1 -1
- package/dist/src/tasks/capabilities/management.js +1 -1
- package/dist/src/tasks/capabilities/relations.js +1 -1
- package/dist/src/tasks/task-allocation-service.js +2 -2
- package/dist/src/tasks/task-application-service.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +2 -2
- package/dist/src/tasks/task-criterion-review-repository.js +1 -1
- package/dist/src/tasks/task-deliverables.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-handoff.js +8 -8
- package/dist/src/tasks/task-json-acceptance.js +2 -2
- package/dist/src/tasks/task-research-repair.js +2 -2
- package/dist/src/tasks/task-research-result.js +2 -2
- package/dist/src/tasks/task-result-delivery-repository.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +2 -2
- package/dist/src/tasks/task-run-coordinator.js +2 -2
- package/dist/src/tasks/task-run-repository.js +1 -1
- package/dist/src/tasks/task-signal-service.js +1 -1
- package/dist/src/tasks/task-workspace-verification.js +3 -3
- package/dist/src/tui/backends/embedded-backend.js +5 -5
- package/dist/src/tui/backends/embedded-drafts.js +2 -2
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/clipboard-image.js +3 -3
- package/dist/src/tui/theme-manager.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-keybindings-file.js +1 -1
- package/dist/src/tui/tui-scoped-models.js +1 -1
- package/dist/src/tui/tui-settings.js +1 -1
- package/dist/src/tui/tui.js +3 -3
- package/dist/src/tunnel/frpc-binary.js +2 -2
- package/dist/src/tunnel/frpc-config.js +1 -1
- package/dist/src/tunnel/frpc-extract.js +2 -2
- package/dist/src/tunnel/tunnel-state.js +1 -1
- package/dist/src/user-context/access-policy.js +1 -1
- package/dist/src/user-context/changes.d.ts +1 -1
- package/dist/src/user-model/repository.js +1 -1
- package/dist/src/utils/index.js +1 -1
- package/dist/src/utils/logger/index.js +1 -1
- package/dist/src/utils/logger.js +1 -1
- package/dist/src/video-generation/artifact.js +2 -2
- package/dist/src/video-generation/repository.js +1 -1
- package/dist/src/voice/audio/normalize.js +2 -2
- package/dist/src/voice/realtime/memory-context.d.ts +1 -1
- package/dist/src/voice/realtime/memory-context.js +12 -10
- package/dist/src/voice/realtime/omniEngine.js +32 -12
- package/dist/src/voice/realtime/omniRoute.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/runtime.js +16 -12
- package/dist/src/voice/tts/providers/edge-speech.js +2 -2
- package/dist/src/work-discovery/candidate-discovery.js +3 -3
- package/dist/src/work-discovery/probe.js +4 -4
- package/dist/src/work-discovery/service.js +2 -2
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-9lLzGQ-F.js +0 -8
- package/dist/gateway/static/root/assets/connected-providers-grid-ds0J-7Qc.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DTcS5Hqk.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CwUc6499.js +0 -8
- package/dist/gateway/static/root/assets/index-BWJ0tePz.js +0 -11
- package/dist/gateway/static/root/assets/index-C-4H3NhI.css +0 -1
- package/dist/gateway/static/root/assets/note-image-lightbox-D-7a_BCN.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-N7Ieq1wB.js +0 -2
- package/dist/gateway/static/root/assets/routine-panel-BvBR3khG.js +0 -2
- package/dist/gateway/static/root/assets/settings-advanced-gate-JrndQtAT.js +0 -1
- package/dist/gateway/static/root/assets/space-page-BAp28k1I.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-15Qm8kNq.js +0 -3
- package/dist/gateway/static/root/assets/task-result-evidence-BqAt23uk.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-BkCt8mdN.js +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/workspace-file-preview-dialog-DGsFnZh-.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/locale-store-CeEXxDaP.js","assets/messages-L7tv_OPK.js","assets/use-file-preview-expanded-BFw8CA51.js","assets/chunk-KS7C4IRE-DIIvxCDx.js","assets/preload-helper-Czpn1I53.js","assets/createLucideIcon-DPHK1VkS.js","assets/app-window-DXFNqt_0.js","assets/check-DUBLcKHA.js","assets/chevron-down-ccbiQQz_.js","assets/copy-Dv6d4Dvw.js","assets/download-Dk-ZjtO6.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/eye-CABVeTq0.js","assets/folder-open-CyzJ19I9.js","assets/link-2-D_ZKYUW7.js","assets/loader-circle-CifKLtgG.js","assets/markdown-view-BQw7H2MV.js","assets/diagnostics-Bo0Z42P_.js","assets/dist-DlirbHVs.js","assets/es2015-CFqg57eW.js","assets/dist-CDSvxjOh.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/app-link-Ji4uewEG.js","assets/product-delivery-4gEqUIsK.js","assets/schemas-CCWMleym.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-DG8DDkEA.css","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/paperclip-f1HujQY1.js","assets/pencil-DmIY3Oa-.js","assets/refresh-cw-BRlGaq2w.js","assets/save-DRDABU--.js","assets/preview-runtime-DNxSgx2a.js","assets/rotate-cw-LIg3Am9S.js","assets/search-DA7gz22f.js","assets/skeleton-DzdOeGYz.js","assets/turn-outcome-BSbEJx8h.js","assets/attachment-utils-core-BPYdUI6y.js","assets/electron-env-DHOGevH3.js","assets/use-async-resource-BHFGZCY2.js","assets/workspace-api-C85sEgvX.js","assets/files-GdwDamkp.js","assets/index.module-Cd9ENXfk.js","assets/session-api-M4P3knYu.js","assets/gateway-startup-retry-CSY11ude.js","assets/constants-D5Z-mUto.js","assets/interaction-BdhHBbYa.js","assets/composer-notifications-BSboNnS6.js","assets/activity-store-zMwJQbPV.js","assets/app-chrome-BeB4KgOf.js","assets/sliding-tab-list-CmcrqRzN.js","assets/sliding-indicator-hwz0sx3h.js","assets/dist-DaFr5KMw.js","assets/dist-DSRLZhL9.js","assets/floating-ui.dom-CiMnRY5O.js","assets/floating-ui.react-dom-Gx6CM22l.js","assets/share-link-dialog-C8bVavnr.js","assets/popover-select-hRG1EzAY.js","assets/dist-BSVQC3i_.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/globe-DSSGFWFn.js","assets/button-C5tRaJxt.js","assets/copy-text-row-gqdh0Bg1.js","assets/right-workspace-store-D3nQJkDG.js","assets/phone-workspace-store-9hDVXN9z.js","assets/theme-store-kQ-dt8qP.js","assets/middleware-Pd0e8Igk.js","assets/file-preview-surface-zEJDQWOT.js","assets/shares-api-Dp6g-bfj.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{_ as a,d as o,f as s,t as c}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{i as l,n as u,o as d}from"./locale-store-CeEXxDaP.js";import{t as f}from"./messages-L7tv_OPK.js";import{a as p,i as m,n as h,o as g,r as _,s as v,t as y}from"./dist-DlirbHVs.js";import{t as b}from"./arrow-right-DSSvoX71.js";import{f as x}from"./automation-display-DaVDNZz8.js";import{t as S}from"./check-DUBLcKHA.js";import{t as C}from"./chevron-down-ccbiQQz_.js";import{t as w}from"./chevron-right-BweFrslA.js";import{t as T}from"./circle-alert-BEjgurr2.js";import{t as E}from"./circle-check-C23XjkUj.js";import{t as D}from"./circle-pause-CN9jYH2s.js";import{t as O}from"./clock-3-DnrAnuyZ.js";import{t as k}from"./external-link-DjqjBmc3.js";import{t as A}from"./file-text-D12HbeVy.js";import{t as j}from"./grip-horizontal-CqVA8V1e.js";import{t as M}from"./history-DXH_9jsE.js";import{t as N}from"./list-todo-CTVRto8O.js";import{t as P}from"./lock-keyhole-DEK5kH0u.js";import{N as F,t as I}from"./markdown-view-BQw7H2MV.js";import{t as L}from"./message-circle-Badhj-4D.js";import{t as R}from"./message-square-fVE7Ghj1.js";import{t as z}from"./panels-top-left-BKvp2Dag.js";import{t as B}from"./paperclip-f1HujQY1.js";import{t as V}from"./plus-Q2yW6OE7.js";import{t as H}from"./refresh-cw-BRlGaq2w.js";import{t as U}from"./search-DA7gz22f.js";import{t as W}from"./settings-2-D-csvaET.js";import{t as ee}from"./sparkles-DHlfQFAF.js";import{t as G}from"./undo-2-6IMTwK4M.js";import{t as te}from"./x-B_N4OPjy.js";import{t as K}from"./cn-0WouolD0.js";import{t as q}from"./skeleton-DzdOeGYz.js";import{o as ne}from"./turn-outcome-BSbEJx8h.js";import{i as re,l as ie,s as ae}from"./capabilities-SIty9Vcz.js";import{i as J}from"./vendor-swr-CdRzEUwF.js";import{S as oe,b as se,c as ce,g as le,h as ue,m as de,n as fe,s as pe,v as me,w as he,y as ge}from"./workspace-preview-store-D8eGmciG.js";import{t as Y}from"./button-C5tRaJxt.js";import{a as _e,c as ve,i as ye,o as be,r as xe,s as Se,t as Ce}from"./composer-payload-handoff-D5CvsQWj.js";import{t as we}from"./use-realtime-voice-D1zQbDnk.js";import{t as Te}from"./page-header-store-hCKJckdJ.js";import{t as Ee}from"./automation-api-DtFbVh6a.js";import{r as De}from"./composer-handoff-params-DBpzHuNo.js";import{t as Oe}from"./sliding-tab-list-CmcrqRzN.js";import{n as ke,t as Ae}from"./use-composer-attachments-DfSh4D1i.js";import{n as je,r as Me}from"./voice-input-shortcut-events-jLnl_86X.js";import{n as Ne}from"./date-formatters-DukWSVwc.js";import{a as X,i as Pe,o as Fe,r as Ie,t as Le}from"./routine-panel-BTuii051.js";import{i as Re,n as ze,o as Be,r as Ve,t as He}from"./task-run-issue-notice-FMMn1lE6.js";import{n as Ue}from"./tab-completion-input-CxtEp0aP.js";var We=n(),Z=e(t(),1);function Ge(e,t,n=!1){let[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(!0),[s,c]=(0,Z.useState)(null),l=(0,Z.useRef)(0),u=(0,Z.useCallback)(async()=>{let t=++l.current;c(null);try{let r=await(n?de(e,!0):de(e));t===l.current&&i(r)}catch(e){t===l.current&&c(e instanceof Error?e.message:String(e))}finally{t===l.current&&o(!1)}},[e,n]);return(0,Z.useEffect)(()=>(u(),()=>{l.current++}),[u,t]),(0,Z.useEffect)(()=>{let e,t=1/0,n=n=>{let r=Date.now()+n;r>=t||(window.clearTimeout(e),t=r,e=window.setTimeout(()=>{e=void 0,t=1/0,u()},n))},r=()=>n(100),i=()=>n(750),a=()=>{document.visibilityState===`visible`&&r()},o=[`task-changed-v2`,`task-updated`,`session-created`,`agent-run-started`,`agent-run-ended`,`automation-run-completed`,`home-advisor-updated`,`gateway-realtime-connected`,`realtime-gap`,`focus`],s=[`session-updated`,`session-transcript-updated`];return o.forEach(e=>window.addEventListener(e,r)),s.forEach(e=>window.addEventListener(e,i)),document.addEventListener(`visibilitychange`,a),()=>{o.forEach(e=>window.removeEventListener(e,r)),s.forEach(e=>window.removeEventListener(e,i)),document.removeEventListener(`visibilitychange`,a),window.clearTimeout(e)}},[u]),{home:r,loading:a,loadError:s,setLoadError:c,load:u}}var Q=r(),Ke=12e3;function qe(e){let t=(0,We.c)(107),{variant:n,inputId:r,inputRef:i,intent:a,labels:o,attachments:s,isDragging:c,attachmentBusy:l,attachmentsFull:u,voice:d,chat:f,cancelAction:p,onIntentChange:m,onPickFiles:h,onRemoveAttachment:g,onPaste:_,onDragOver:v,onDragLeave:y,onDrop:b,onSubmit:x}=e,S=n===`inline`,C;t[0]!==s||t[1]!==a?(C=!!a.trim()||s.length>0,t[0]=s,t[1]=a,t[2]=C):C=t[2];let w=C,T=d.voiceActive&&d.phase!==`error`,E;t[3]!==x||t[4]!==d.voiceActive?(E=e=>{if(d.voiceActive){e.preventDefault();return}x(e)},t[3]=x,t[4]=d.voiceActive,t[5]=E):E=t[5];let D=S?`mx-auto mt-6 w-full overflow-hidden rounded-xl border border-edge bg-surface-base p-2 text-left shadow-surface transition-colors focus-within:border-accent focus-within:ring-2 focus-within:ring-accent/15 sm:mt-8`:`flex min-h-0 flex-1 flex-col`,O;t[6]===D?O=t[7]:(O=K(`relative`,D),t[6]=D,t[7]=O);let k;t[8]!==S||t[9]!==c||t[10]!==o.dropFiles?(k=c?(0,Q.jsx)(`div`,{className:K(`pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-accent-soft/90 text-sm font-medium text-accent-fg backdrop-blur-[1px]`,S&&`rounded-2xl`),children:o.dropFiles}):null,t[8]=S,t[9]=c,t[10]=o.dropFiles,t[11]=k):k=t[11];let A=!S&&`flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-4`,j;t[12]===A?j=t[13]:(j=K(A),t[12]=A,t[13]=j);let M=S?`sr-only`:`mb-2 shrink-0 text-sm font-medium text-fg`,N;t[14]!==r||t[15]!==o.intentLabel||t[16]!==M?(N=(0,Q.jsx)(`label`,{htmlFor:r,className:M,children:o.intentLabel}),t[14]=r,t[15]=o.intentLabel,t[16]=M,t[17]=N):N=t[17];let P;t[18]!==l||t[19]!==f||t[20]!==d.audioLevel||t[21]!==d.cancelVoiceInput||t[22]!==d.confirmVoiceInput||t[23]!==d.elapsedLabel||t[24]!==d.error||t[25]!==d.finalTranscript||t[26]!==d.partialTranscript||t[27]!==d.phase||t[28]!==d.recordedDictation||t[29]!==d.retryVoiceInput||t[30]!==d.settingsRequired||t[31]!==d.voiceActive?(P=d.voiceActive?(0,Q.jsx)(xe,{phase:d.phase,elapsedLabel:d.elapsedLabel,recordedDictation:d.recordedDictation,audioLevel:d.audioLevel,partialTranscript:d.partialTranscript,finalTranscript:d.finalTranscript,error:d.error,settingsRequired:d.settingsRequired,disabled:l,chat:f,onCancel:d.cancelVoiceInput,onConfirm:d.confirmVoiceInput,onRetry:d.retryVoiceInput}):null,t[18]=l,t[19]=f,t[20]=d.audioLevel,t[21]=d.cancelVoiceInput,t[22]=d.confirmVoiceInput,t[23]=d.elapsedLabel,t[24]=d.error,t[25]=d.finalTranscript,t[26]=d.partialTranscript,t[27]=d.phase,t[28]=d.recordedDictation,t[29]=d.retryVoiceInput,t[30]=d.settingsRequired,t[31]=d.voiceActive,t[32]=P):P=t[32];let F=T&&`hidden`,I=S?`min-h-24 bg-transparent px-3 py-2`:`min-h-32 flex-1 rounded-xl border border-edge bg-surface-base p-3 focus:border-accent focus:ring-2 focus:ring-accent/20`,L;t[33]!==F||t[34]!==I?(L=K(`w-full resize-none text-sm font-normal leading-6 text-fg outline-none placeholder:text-fg-subtle`,F,I),t[33]=F,t[34]=I,t[35]=L):L=t[35];let R;t[36]===m?R=t[37]:(R=e=>m(e.target.value),t[36]=m,t[37]=R);let z=!S,V;t[38]!==r||t[39]!==i||t[40]!==a||t[41]!==o.intentPlaceholder||t[42]!==o.intentSuggestion||t[43]!==m||t[44]!==_||t[45]!==L||t[46]!==R||t[47]!==z?(V=(0,Q.jsx)(Ue,{ref:i,id:r,className:L,value:a,onChange:R,onPaste:_,suggestion:o.intentSuggestion,onAcceptSuggestion:m,onKeyDown:Je,placeholder:o.intentPlaceholder,maxLength:Ke,autoFocus:z}),t[38]=r,t[39]=i,t[40]=a,t[41]=o.intentPlaceholder,t[42]=o.intentSuggestion,t[43]=m,t[44]=_,t[45]=L,t[46]=R,t[47]=z,t[48]=V):V=t[48];let H=S?`border-b-0 bg-transparent px-3 pb-2 pt-0`:`mt-3 border-b-0 bg-transparent px-0 pb-0`,U;t[49]!==s||t[50]!==g||t[51]!==H?(U=(0,Q.jsx)(ke,{attachments:s,topPadded:!1,onRemove:g,className:H}),t[49]=s,t[50]=g,t[51]=H,t[52]=U):U=t[52];let W;t[53]!==S||t[54]!==a.length||t[55]!==o.shortcut?(W=S?null:(0,Q.jsxs)(`div`,{className:`mt-2 flex shrink-0 items-center justify-between gap-3 text-[11px] text-fg-subtle`,children:[(0,Q.jsx)(`span`,{children:o.shortcut}),(0,Q.jsxs)(`span`,{className:`tabular-nums`,children:[a.length.toLocaleString(),` / `,Ke.toLocaleString()]})]}),t[53]=S,t[54]=a.length,t[55]=o.shortcut,t[56]=W):W=t[56];let G;t[57]!==P||t[58]!==V||t[59]!==U||t[60]!==W||t[61]!==j||t[62]!==N?(G=(0,Q.jsxs)(`div`,{className:j,children:[N,P,V,U,W]}),t[57]=P,t[58]=V,t[59]=U,t[60]=W,t[61]=j,t[62]=N,t[63]=G):G=t[63];let te=S?`border-edge-subtle px-1 pt-2`:`border-edge px-5 py-4`,q;t[64]===te?q=t[65]:(q=K(`flex shrink-0 items-center gap-2 border-t`,te),t[64]=te,t[65]=q);let ne=!S&&`mr-auto`,re;t[66]===ne?re=t[67]:(re=K(`flex items-center gap-1`,ne),t[66]=ne,t[67]=re);let ie=l||u,ae;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Q.jsx)(B,{className:`size-4`,"aria-hidden":!0}),t[68]=ae):ae=t[68];let J;t[69]!==o.attachTitle||t[70]!==h||t[71]!==ie?(J=(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,className:`size-9 rounded-lg p-0`,disabled:ie,title:o.attachTitle,"aria-label":o.attachTitle,onClick:h,children:ae}),t[69]=o.attachTitle,t[70]=h,t[71]=ie,t[72]=J):J=t[72];let oe;t[73]!==l||t[74]!==f||t[75]!==d.startVoiceInput||t[76]!==d.voiceActive?(oe=d.voiceActive?null:(0,Q.jsx)(be,{disabled:l,chat:f,onStart:d.startVoiceInput}),t[73]=l,t[74]=f,t[75]=d.startVoiceInput,t[76]=d.voiceActive,t[77]=oe):oe=t[77];let se;t[78]!==re||t[79]!==J||t[80]!==oe?(se=(0,Q.jsxs)(`div`,{className:re,children:[J,oe]}),t[78]=re,t[79]=J,t[80]=oe,t[81]=se):se=t[81];let ce;t[82]!==p||t[83]!==S||t[84]!==o.shortcut?(ce=S?(0,Q.jsx)(`span`,{className:`hidden text-[11px] text-fg-subtle sm:inline`,children:o.shortcut}):p,t[82]=p,t[83]=S,t[84]=o.shortcut,t[85]=ce):ce=t[85];let le=S?`ml-auto h-9 rounded-lg px-3.5 text-xs`:`min-w-32`,ue=!w||l||d.voiceActive,de=S?`size-3.5`:`size-4`,fe;t[86]===de?fe=t[87]:(fe=(0,Q.jsx)(ee,{className:de,"aria-hidden":!0}),t[86]=de,t[87]=fe);let pe;t[88]!==o.submit||t[89]!==le||t[90]!==ue||t[91]!==fe?(pe=(0,Q.jsxs)(Y,{type:`submit`,variant:`primary`,className:le,disabled:ue,children:[fe,o.submit]}),t[88]=o.submit,t[89]=le,t[90]=ue,t[91]=fe,t[92]=pe):pe=t[92];let me;t[93]!==q||t[94]!==se||t[95]!==ce||t[96]!==pe?(me=(0,Q.jsxs)(`div`,{className:q,children:[se,ce,pe]}),t[93]=q,t[94]=se,t[95]=ce,t[96]=pe,t[97]=me):me=t[97];let he;return t[98]!==y||t[99]!==v||t[100]!==b||t[101]!==E||t[102]!==G||t[103]!==me||t[104]!==O||t[105]!==k?(he=(0,Q.jsxs)(`form`,{onSubmit:E,onDragOver:v,onDragLeave:y,onDrop:b,className:O,children:[k,G,me]}),t[98]=y,t[99]=v,t[100]=b,t[101]=E,t[102]=G,t[103]=me,t[104]=O,t[105]=k,t[106]=he):he=t[106],he}function Je(e){e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}function Ye(e){let t=(0,We.c)(12),{href:n,children:r,onOpen:i}=e,a=o();if(n&&/^https?:\/\//i.test(n)){let e;return t[0]!==r||t[1]!==n?(e=(0,Q.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`rounded-sm text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r}),t[0]=r,t[1]=n,t[2]=e):e=t[2],e}if(n?.startsWith(`/`)&&!n.startsWith(`//`)){let e=`${a.pathname}${a.search}`,o;t[3]!==n||t[4]!==e?(o=F(e,n),t[3]=n,t[4]=e,t[5]=o):o=t[5];let s;return t[6]!==r||t[7]!==i||t[8]!==o?(s=(0,Q.jsx)(c,{to:o,className:`rounded-sm text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:i,children:r}),t[6]=r,t[7]=i,t[8]=o,t[9]=s):s=t[9],s}let s;return t[10]===r?s=t[11]:(s=(0,Q.jsx)(`span`,{children:r}),t[10]=r,t[11]=s),s}function Xe(e){let t=(0,We.c)(6),{opportunity:n,onOpen:r}=e,i=u(Ze),a,o;if(t[0]!==i||t[1]!==r||t[2]!==n.evidence||t[3]!==n.evidencePresentation){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=f(i).projectsPage.home.advisorEvidenceCopy,t=n.evidencePresentation,s=t?.locale===i?t.groups:void 0,c=new Intl.DateTimeFormat(i===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),l=t=>(0,Q.jsx)(`ul`,{className:`mt-2 space-y-3 border-l border-edge pl-3 text-xs leading-5 text-fg-muted`,children:t.map(t=>{let n=!!(t.href&&(/^https?:\/\//i.test(t.href)||t.href.startsWith(`/`)&&!t.href.startsWith(`//`)));return(0,Q.jsxs)(`li`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,Q.jsxs)(`p`,{className:`text-fg-subtle`,children:[e.sources[t.sourceType],` · `,(0,Q.jsx)(`time`,{dateTime:new Date(t.observedAt).toISOString(),children:c.format(t.observedAt)})]}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap`,children:t.observation}),(0,Q.jsx)(`p`,{className:`mt-1`,children:n?(0,Q.jsx)(Ye,{href:t.href,onOpen:r,children:e.openSource}):e.noSource})]},t.id)})}),u=(t,r)=>(0,Q.jsxs)(`li`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,Q.jsx)(`p`,{className:`text-fg-muted`,children:t.summary}),(0,Q.jsxs)(`details`,{className:`mt-1`,children:[(0,Q.jsxs)(`summary`,{className:`min-h-9 cursor-pointer rounded-sm py-2 text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[e.originals,` · `,e.sourceCount.replace(`{{count}}`,String(t.evidenceIds.length))]}),l(n.evidence.filter(e=>t.evidenceIds.includes(e.id)))]})]},r);if(!s){o=(0,Q.jsxs)(`div`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:[(0,Q.jsx)(`p`,{children:e.unavailable}),(0,Q.jsxs)(`details`,{children:[(0,Q.jsx)(`summary`,{className:`min-h-9 cursor-pointer rounded-sm py-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:e.originals}),l(n.evidence)]})]});break bb0}a=(0,Q.jsxs)(`div`,{className:`mt-2 text-xs leading-5`,children:[(0,Q.jsx)(`p`,{className:`mb-3 text-fg-subtle`,children:e.aiNote}),(0,Q.jsx)(`ul`,{className:`space-y-3 border-l border-edge pl-3`,children:s.slice(0,3).map(u)}),s.length>3?(0,Q.jsxs)(`details`,{className:`mt-2`,children:[(0,Q.jsx)(`summary`,{className:`min-h-9 cursor-pointer rounded-sm py-2 text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:e.more.replace(`{{count}}`,String(s.length-3))}),(0,Q.jsx)(`ul`,{className:`space-y-3 border-l border-edge pl-3`,children:s.slice(3).map(u)})]}):null]})}t[0]=i,t[1]=r,t[2]=n.evidence,t[3]=n.evidencePresentation,t[4]=a,t[5]=o}else a=t[4],o=t[5];return o===Symbol.for(`react.early_return_sentinel`)?a:o}function Ze(e){return e.language}function Qe(e){let t=(0,We.c)(4),{label:n,onClick:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(M,{className:`size-3.5`,"aria-hidden":!0}),t[0]=i):i=t[0];let a;return t[1]!==n||t[2]!==r?(a=(0,Q.jsxs)(`button`,{type:`button`,className:`inline-flex min-h-9 items-center gap-1.5 rounded-lg px-2 text-xs font-medium text-fg-muted transition-colors duration-150 hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:r,children:[i,n]}),t[1]=n,t[2]=r,t[3]=a):a=t[3],a}function $e(e){let t=(0,We.c)(67),{opportunity:n,copy:r,onOpenHistory:i}=e,[a,o]=(0,Z.useState)(!1),s,c,l,u,d,f;if(t[0]!==r.aiLabel||t[1]!==r.automationAction||t[2]!==r.automationHint||t[3]!==r.history||t[4]!==r.minutes||t[5]!==r.needsSetup||t[6]!==r.why||t[7]!==i||t[8]!==n.capabilities||t[9]!==n.continuation||t[10]!==n.estimatedMinutes||t[11]!==n.outcome||t[12]!==n.rationale||t[13]!==n.title){let e=n.capabilities.filter(et),a;t[20]===r.aiLabel?a=t[21]:(a=(0,Q.jsx)(`span`,{children:r.aiLabel}),t[20]=r.aiLabel,t[21]=a);let o;t[22]!==r.minutes||t[23]!==n.estimatedMinutes?(o=n.estimatedMinutes?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Q.jsx)(O,{className:`size-3.5`,"aria-hidden":!0}),n.estimatedMinutes,` `,r.minutes]}):null,t[22]=r.minutes,t[23]=n.estimatedMinutes,t[24]=o):o=t[24];let p;t[25]!==a||t[26]!==o?(p=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-subtle`,children:[a,o]}),t[25]=a,t[26]=o,t[27]=p):p=t[27];let m;t[28]!==r.history||t[29]!==i?(m=(0,Q.jsx)(Qe,{label:r.history,onClick:i}),t[28]=r.history,t[29]=i,t[30]=m):m=t[30],t[31]!==m||t[32]!==p?(s=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[p,m]}),t[31]=m,t[32]=p,t[33]=s):s=t[33],t[34]===n.title?c=t[35]:(c=(0,Q.jsx)(`h3`,{className:`mt-3 text-xl font-semibold leading-7 tracking-tight text-fg`,children:n.title}),t[34]=n.title,t[35]=c),t[36]===n.outcome?l=t[37]:(l=(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n.outcome}),t[36]=n.outcome,t[37]=l);let h;t[38]===r.why?h=t[39]:(h=(0,Q.jsxs)(`span`,{className:`font-medium text-fg`,children:[r.why,`:`]}),t[38]=r.why,t[39]=h),t[40]!==n.rationale||t[41]!==h?(u=(0,Q.jsxs)(`p`,{className:`mt-4 text-sm leading-6 text-fg-muted`,children:[h,n.rationale]}),t[40]=n.rationale,t[41]=h,t[42]=u):u=t[42],t[43]!==r.automationAction||t[44]!==r.automationHint||t[45]!==n.continuation?(d=n.continuation?.kind===`automation`?(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 rounded-xl border border-edge bg-surface-subtle p-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:r.automationHint}),(0,Q.jsx)(`a`,{href:`#${n.continuation.href}`,className:`inline-flex min-h-11 shrink-0 items-center rounded-lg px-3 text-xs font-medium text-accent hover:bg-accent-soft focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r.automationAction})]}):null,t[43]=r.automationAction,t[44]=r.automationHint,t[45]=n.continuation,t[46]=d):d=t[46],f=e.length>0?(0,Q.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,"aria-label":r.needsSetup,children:e.map(e=>(0,Q.jsxs)(`a`,{href:`#${e.recoveryPath??`/settings`}`,className:`rounded-full border border-accent/25 bg-accent-soft px-2.5 py-1 text-xs text-accent hover:border-accent/50`,children:[r.needsSetup,` · `,e.capability]},`${e.kind}:${e.capability}`))}):null,t[0]=r.aiLabel,t[1]=r.automationAction,t[2]=r.automationHint,t[3]=r.history,t[4]=r.minutes,t[5]=r.needsSetup,t[6]=r.why,t[7]=i,t[8]=n.capabilities,t[9]=n.continuation,t[10]=n.estimatedMinutes,t[11]=n.outcome,t[12]=n.rationale,t[13]=n.title,t[14]=s,t[15]=c,t[16]=l,t[17]=u,t[18]=d,t[19]=f}else s=t[14],c=t[15],l=t[16],u=t[17],d=t[18],f=t[19];let p;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(w,{className:`size-3.5`,"aria-hidden":!0}),t[47]=p):p=t[47];let m;t[48]===r.evidence?m=t[49]:(m=(0,Q.jsxs)(Y,{type:`button`,variant:`ghost`,className:`mt-3 text-xs`,children:[r.evidence,p]}),t[48]=r.evidence,t[49]=m);let h;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>o(!1),t[50]=h):h=t[50];let g;t[51]===n?g=t[52]:(g=(0,Q.jsx)(Xe,{opportunity:n,onOpen:h}),t[51]=n,t[52]=g);let _;t[53]!==r.evidence||t[54]!==a||t[55]!==n.title||t[56]!==g||t[57]!==m?(_=(0,Q.jsx)(X,{title:r.evidence,subtitle:n.title,open:a,onOpenChange:o,trigger:m,children:g}),t[53]=r.evidence,t[54]=a,t[55]=n.title,t[56]=g,t[57]=m,t[58]=_):_=t[58];let v;return t[59]!==s||t[60]!==_||t[61]!==c||t[62]!==l||t[63]!==u||t[64]!==d||t[65]!==f?(v=(0,Q.jsxs)(Q.Fragment,{children:[s,c,l,u,d,f,_]}),t[59]=s,t[60]=_,t[61]=c,t[62]=l,t[63]=u,t[64]=d,t[65]=f,t[66]=v):v=t[66],v}function et(e){return e.readiness!==`ready`}function tt(e){let t=(0,We.c)(150),{advisor:n,copy:r,busy:i,onRefresh:a,onAction:o,onFeedback:s,onClarification:c,onOpenHistory:l,preflight:u,receipt:d,inDialog:f}=e,p=f!==void 0&&f,[m,h]=(0,Z.useState)(),[g,_]=(0,Z.useState)(!1),v;t[0]!==n.alternatives||t[1]!==n.primary||t[2]!==n.state?(v=n.state===`ready`?[n.primary,...n.alternatives]:[],t[0]=n.alternatives,t[1]=n.primary,t[2]=n.state,t[3]=v):v=t[3];let y=v,b;t[4]!==y||t[5]!==m?(b=y.find(e=>e.id===m)??y[0],t[4]=y,t[5]=m,t[6]=b):b=t[6];let x=b,S;t[7]===y[0]?.id?S=t[8]:(S=()=>h(y[0]?.id),t[7]=y[0]?.id,t[8]=S);let C=y[0]?.id,T;if(t[9]!==n.state||t[10]!==C?(T=[n.state,C],t[9]=n.state,t[10]=C,t[11]=T):T=t[11],(0,Z.useEffect)(S,T),n.state===`disabled`)return null;if(d){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(E,{className:`size-5 shrink-0 text-success`,"aria-hidden":!0}),t[12]=e):e=t[12];let n;t[13]===d.title?n=t[14]:(n=(0,Q.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:d.title}),t[13]=d.title,t[14]=n);let i;t[15]===d.detail?i=t[16]:(i=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:d.detail}),t[15]=d.detail,t[16]=i);let a;t[17]!==n||t[18]!==i?(a=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[n,i]}),t[17]=n,t[18]=i,t[19]=a):a=t[19];let o;t[20]!==r.history||t[21]!==l?(o=(0,Q.jsx)(Qe,{label:r.history,onClick:l}),t[20]=r.history,t[21]=l,t[22]=o):o=t[22];let s=`#${d.href}`,c;t[23]!==r.viewProgress||t[24]!==s?(c=(0,Q.jsx)(Y,{asChild:!0,variant:`secondary`,className:`min-h-10 text-xs`,children:(0,Q.jsx)(`a`,{href:s,children:r.viewProgress})}),t[23]=r.viewProgress,t[24]=s,t[25]=c):c=t[25];let u;t[26]!==o||t[27]!==c?(u=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[o,c]}),t[26]=o,t[27]=c,t[28]=u):u=t[28];let f;return t[29]!==a||t[30]!==u?(f=(0,Q.jsx)(`section`,{className:`mt-7 rounded-2xl border border-success/25 bg-success-soft px-5 py-4`,role:`status`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center`,children:[e,a,u]})}),t[29]=a,t[30]=u,t[31]=f):f=t[31],f}if(n.state===`quiet`||n.state===`refreshing`)return null;if(n.state===`clarification`){let e=p?void 0:`mt-7 rounded-2xl border border-accent/25 bg-surface-base px-5 py-5`,a;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),t[32]=a):a=t[32];let o;t[33]===r.aiLabel?o=t[34]:(o=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-accent`,children:[a,r.aiLabel]}),t[33]=r.aiLabel,t[34]=o);let s;t[35]!==r.history||t[36]!==l?(s=(0,Q.jsx)(Qe,{label:r.history,onClick:l}),t[35]=r.history,t[36]=l,t[37]=s):s=t[37];let u;t[38]!==s||t[39]!==o?(u=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[o,s]}),t[38]=s,t[39]=o,t[40]=u):u=t[40];let d;t[41]===n.question.question?d=t[42]:(d=(0,Q.jsx)(`h3`,{id:`home-advisor-question`,className:`mt-3 text-lg font-semibold text-fg`,children:n.question.question}),t[41]=n.question.question,t[42]=d);let f;if(t[43]!==n.question.options||t[44]!==n.question.question||t[45]!==i||t[46]!==c){let e;t[48]!==n.question.question||t[49]!==i||t[50]!==c?(e=e=>(0,Q.jsx)(Y,{type:`button`,variant:`secondary`,className:`min-h-11`,disabled:i,onClick:()=>c(n.question.question,e.label),children:e.label},e.id),t[48]=n.question.question,t[49]=i,t[50]=c,t[51]=e):e=t[51],f=n.question.options.map(e),t[43]=n.question.options,t[44]=n.question.question,t[45]=i,t[46]=c,t[47]=f}else f=t[47];let m;t[52]===f?m=t[53]:(m=(0,Q.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:f}),t[52]=f,t[53]=m);let h;return t[54]!==u||t[55]!==d||t[56]!==m||t[57]!==e?(h=(0,Q.jsxs)(`section`,{className:e,"aria-labelledby":`home-advisor-question`,children:[u,d,m]}),t[54]=u,t[55]=d,t[56]=m,t[57]=e,t[58]=h):h=t[58],h}if(!x)return null;let D=u?.opportunityId===x.id?u.value:void 0,O=p?void 0:`mt-7 rounded-2xl border border-accent/25 bg-surface-base`,k=p?void 0:`px-5 py-5 sm:px-6`,A;t[59]!==n.stale||t[60]!==r.refreshing?(A=n.stale?(0,Q.jsxs)(`p`,{className:`mb-3 inline-flex items-center gap-2 text-xs text-accent`,children:[(0,Q.jsx)(H,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),r.refreshing]}):null,t[59]=n.stale,t[60]=r.refreshing,t[61]=A):A=t[61];let j;t[62]!==r||t[63]!==l||t[64]!==x?(j=(0,Q.jsx)($e,{opportunity:x,copy:r,onOpenHistory:l}),t[62]=r,t[63]=l,t[64]=x,t[65]=j):j=t[65];let M;t[66]!==i||t[67]!==r.configure||t[68]!==r.degradedStart||t[69]!==r.setupHint||t[70]!==r.setupTitle||t[71]!==o||t[72]!==x||t[73]!==D?(M=D?.state===`needs_setup`?(0,Q.jsx)(`div`,{className:`mt-5 rounded-xl border border-accent/25 bg-accent-soft/40 p-4`,role:`alert`,"aria-live":`polite`,children:(0,Q.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Q.jsx)(W,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:r.setupTitle}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:r.setupHint}),(0,Q.jsx)(`ul`,{className:`mt-2 space-y-1 text-xs leading-5 text-fg-muted`,children:D.blockers.map(nt)}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[D.recoveryActions.map(e=>(0,Q.jsxs)(`a`,{href:`#${e.href}`,className:`inline-flex min-h-11 items-center rounded-lg border border-accent/30 px-3 text-xs font-medium text-accent hover:bg-accent-soft focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[r.configure,` · `,e.capability]},e.capability)),D.degradedAction?(0,Q.jsx)(Y,{type:`button`,variant:`secondary`,className:`min-h-11`,disabled:i,onClick:()=>o(x,`degraded_start`),children:r.degradedStart}):null]})]})]})}):null,t[66]=i,t[67]=r.configure,t[68]=r.degradedStart,t[69]=r.setupHint,t[70]=r.setupTitle,t[71]=o,t[72]=x,t[73]=D,t[74]=M):M=t[74];let N;t[75]!==i||t[76]!==r.start||t[77]!==o||t[78]!==x?(N=x.actions.canStart?(0,Q.jsxs)(Y,{type:`button`,variant:`primary`,className:`min-h-11`,disabled:i,onClick:()=>o(x,`start`),children:[(0,Q.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),r.start]}):null,t[75]=i,t[76]=r.start,t[77]=o,t[78]=x,t[79]=N):N=t[79];let P;t[80]!==i||t[81]!==r.discuss||t[82]!==o||t[83]!==x?(P=x.actions.canDiscuss?(0,Q.jsxs)(Y,{type:`button`,variant:`secondary`,className:`min-h-11`,disabled:i,onClick:()=>o(x,`discuss`),children:[(0,Q.jsx)(L,{className:`size-4`,"aria-hidden":!0}),r.discuss]}):null,t[80]=i,t[81]=r.discuss,t[82]=o,t[83]=x,t[84]=P):P=t[84];let F;t[85]!==N||t[86]!==P?(F=(0,Q.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-2`,children:[N,P]}),t[85]=N,t[86]=P,t[87]=F):F=t[87];let I;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(w,{className:`size-3.5`,"aria-hidden":!0}),t[88]=I):I=t[88];let R;t[89]===r.more?R=t[90]:(R=(0,Q.jsxs)(Y,{type:`button`,variant:`ghost`,className:`mt-1 text-xs`,children:[r.more,I]}),t[89]=r.more,t[90]=R);let z;t[91]===a?z=t[92]:(z=()=>{_(!1),a()},t[91]=a,t[92]=z);let B;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Q.jsx)(H,{className:`size-4`,"aria-hidden":!0}),t[93]=B):B=t[93];let V;t[94]!==i||t[95]!==r.refresh||t[96]!==z?(V=(0,Q.jsxs)(Y,{type:`button`,variant:`secondary`,disabled:i,onClick:z,children:[B,r.refresh]}),t[94]=i,t[95]=r.refresh,t[96]=z,t[97]=V):V=t[97];let U;t[98]===r.feedback?U=t[99]:(U=(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.feedback}),t[98]=r.feedback,t[99]=U);let G;t[100]===r.alreadyDone?G=t[101]:(G=[`already_done`,r.alreadyDone],t[100]=r.alreadyDone,t[101]=G);let te;t[102]===r.irrelevant?te=t[103]:(te=[`irrelevant`,r.irrelevant],t[102]=r.irrelevant,t[103]=te);let K;t[104]===r.later?K=t[105]:(K=[`too_early`,r.later],t[104]=r.later,t[105]=K);let q;t[106]===r.sourceIncorrect?q=t[107]:(q=[`source_incorrect`,r.sourceIncorrect],t[106]=r.sourceIncorrect,t[107]=q);let ne;t[108]===r.lessLikeThis?ne=t[109]:(ne=[`less_like_this`,r.lessLikeThis],t[108]=r.lessLikeThis,t[109]=ne);let re;t[110]!==G||t[111]!==te||t[112]!==K||t[113]!==q||t[114]!==ne?(re=[G,te,K,q,ne],t[110]=G,t[111]=te,t[112]=K,t[113]=q,t[114]=ne,t[115]=re):re=t[115];let ie=re,ae;t[116]!==i||t[117]!==s||t[118]!==x||t[119]!==ie?(ae=(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:ie.map(e=>{let[t,n]=e;return(0,Q.jsx)(Y,{type:`button`,variant:`secondary`,disabled:i,onClick:()=>{_(!1),s(x,t)},children:n},t)})}),t[116]=i,t[117]=s,t[118]=x,t[119]=ie,t[120]=ae):ae=t[120];let J;t[121]!==U||t[122]!==ae?(J=(0,Q.jsxs)(`div`,{children:[U,ae]}),t[121]=U,t[122]=ae,t[123]=J):J=t[123];let oe;t[124]!==i||t[125]!==r.alternatives||t[126]!==y||t[127]!==x.id?(oe=y.length>1?(0,Q.jsxs)(`div`,{className:`border-t border-edge pt-4`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.alternatives}),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:y.filter(e=>e.id!==x.id).map(e=>(0,Q.jsx)(Y,{type:`button`,variant:`secondary`,disabled:i,onClick:()=>{h(e.id),_(!1)},children:e.title},e.id))})]}):null,t[124]=i,t[125]=r.alternatives,t[126]=y,t[127]=x.id,t[128]=oe):oe=t[128];let se;t[129]!==V||t[130]!==J||t[131]!==oe?(se=(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[V,J,oe]}),t[129]=V,t[130]=J,t[131]=oe,t[132]=se):se=t[132];let ce;t[133]!==r.more||t[134]!==g||t[135]!==x.title||t[136]!==R||t[137]!==se?(ce=(0,Q.jsx)(X,{title:r.more,subtitle:x.title,open:g,onOpenChange:_,trigger:R,children:se}),t[133]=r.more,t[134]=g,t[135]=x.title,t[136]=R,t[137]=se,t[138]=ce):ce=t[138];let le;t[139]!==j||t[140]!==M||t[141]!==F||t[142]!==ce||t[143]!==k||t[144]!==A?(le=(0,Q.jsxs)(`div`,{className:k,children:[A,j,M,F,ce]}),t[139]=j,t[140]=M,t[141]=F,t[142]=ce,t[143]=k,t[144]=A,t[145]=le):le=t[145];let ue;return t[146]!==r.aiLabel||t[147]!==le||t[148]!==O?(ue=(0,Q.jsx)(`section`,{className:O,"aria-label":r.aiLabel,children:le}),t[146]=r.aiLabel,t[147]=le,t[148]=O,t[149]=ue):ue=t[149],ue}function nt(e){return(0,Q.jsx)(`li`,{children:e.message},`${e.kind}:${e.capability}`)}function rt(e){let t=(0,We.c)(11),{observation:n,language:r,onUpdated:i}=e,a=r===`zh`,o=n.followUps??[],[s,c]=(0,Z.useState)(!1),[u,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(``),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=[],t[0]=_):_=t[0];let[v,y]=(0,Z.useState)(_),[b,x]=(0,Z.useState)(!0),[S,C]=(0,Z.useState)(!1),[w,T]=(0,Z.useState)(``),E=a?`设为持续目标`:`Set up a continuing goal`,D=a?`已结束的目标`:`Past goals`,O;t[1]!==n.topics||t[2]!==a?(O=e=>{f(e?.goal??``),g(e?.firstStep??(a?`先整理已有线索、已知事实和资料缺口,再提出下一步建议。`:`Organize existing evidence, known facts and missing material, then propose the next step.`)),m(``),y(e?[e.topicId]:n.topics.slice(0,3).map(ut)),c(!0),T(``)},t[1]=n.topics,t[2]=a,t[3]=O):O=t[3];let k=O,A;t[4]!==r||t[5]!==i?(A=e=>(0,Q.jsx)(dt,{followUp:e,language:r,onUpdated:i},e.id),t[4]=r,t[5]=i,t[6]=A):A=t[6];let j=o.filter(lt).map(A),M=n.status===`active`?(0,Q.jsxs)(Q.Fragment,{children:[o.some(ct)?null:(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:`text-base font-semibold text-fg`,children:a?`把一件事推进到完成`:`Keep one goal moving until it is done`}),(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:a?`记住目标和进展,一步步整理证据、查清问题。有新资料继续推进,遇到阻塞会告诉你缺什么。`:`Keep the goal and its progress together. Work through the evidence, continue when input arrives, and make blockers clear.`})]}),(n.followUpCandidates??[]).map(e=>(0,Q.jsxs)(`div`,{className:`space-y-2 rounded-lg bg-surface-inset p-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`这条请求可能需要继续跟进,请先确认目标`:`This request may need follow-through. Confirm the goal first.`}),(0,Q.jsx)(`p`,{className:`line-clamp-2 text-sm text-fg`,children:e.goal}),(0,Q.jsx)(Y,{variant:`tonal`,"aria-haspopup":`dialog`,onClick:()=>k(e),children:E})]},e.topicId)),(0,Q.jsx)(Y,{"aria-haspopup":`dialog`,variant:o.some(st)?`ghost`:`primary`,onClick:()=>k(),children:o.some(ot)?a?`再交给我一件事`:`Add another goal`:a?`交给我持续推进一件事`:`Keep a goal moving`}),(0,Q.jsx)(X,{title:E,open:s,onOpenChange:c,busy:S,children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),!S&&(C(!0),T(``),d(l(`/api/home/follow-ups`),{method:`POST`,body:JSON.stringify({goal:u,criteria:p.split(`
|
|
3
|
+
`).map(at).filter(Boolean),firstStep:h,topicIds:v,autoContinue:b,stepBudget:3,locale:r,expectedObservationRevision:n.revision,idempotencyKey:crypto.randomUUID()})}).then(e=>{ne.parse(e),c(!1),i()}).catch(e=>{T(e instanceof Error?e.message:String(e)),i()}).finally(()=>C(!1)))},children:[(0,Q.jsxs)(`label`,{className:`block text-sm text-fg`,children:[a?`希望最终达成什么?`:`What outcome should we reach?`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:1e3,value:u,onChange:e=>f(e.target.value),placeholder:a?`例如:查清 connector 重复请求的原因,并整理可验证的解决方案。`:`For example: understand duplicate connector requests and prepare a verifiable resolution.`,className:`mt-1 min-h-20 w-full rounded-lg border border-edge bg-surface-panel p-2`})]}),(0,Q.jsxs)(`label`,{className:`block text-sm text-fg`,children:[a?`达到什么标准才算完成?每行一条,最多 10 项`:`What counts as done? One criterion per line`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:1e4,value:p,onChange:e=>m(e.target.value),placeholder:a?`明确复现条件
|
|
4
|
+
原因有日志或代码证据支持
|
|
5
|
+
给出修复后需要通过的验证项`:`Reproduction conditions are clear
|
|
6
|
+
Evidence supports the cause
|
|
7
|
+
Verification checks are defined`,className:`mt-1 min-h-24 w-full rounded-lg border border-edge bg-surface-panel p-2`})]}),(0,Q.jsxs)(`label`,{className:`block text-sm text-fg`,children:[a?`现在先推进哪一步?`:`What is the first step?`,(0,Q.jsx)(`input`,{required:!0,maxLength:1e3,value:h,onChange:e=>g(e.target.value),placeholder:a?`整理现有线索、已知事实和缺少的日志。`:`Organize existing reports, known facts and missing logs.`,className:`mt-1 w-full rounded-lg border border-edge bg-surface-panel p-2`})]}),(0,Q.jsxs)(`details`,{children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:a?`参考资料范围:已选 ${v.length} 段对话`:`Source scope: ${v.length} selected conversations`}),(0,Q.jsx)(`div`,{className:`mt-2 max-h-40 space-y-2 overflow-y-auto`,children:n.topics.map(e=>(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:v.includes(e.id),disabled:!v.includes(e.id)&&v.length>=8,onChange:t=>y(t.target.checked?[...v,e.id]:v.filter(t=>t!==e.id))}),(0,Q.jsx)(`span`,{className:`truncate`,children:e.title})]},e.id))})]}),n.topics.length?null:(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`先在对话里提供这件事的背景资料,开启观察后再选为参考来源。`:`First provide the background in a chat, then select it as a source.`}),(0,Q.jsxs)(`label`,{className:`flex items-start gap-2 text-xs leading-5 text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:b,onChange:e=>x(e.target.checked),className:`mt-1`}),a?`资料齐备时自动继续本轮分析,最多 3 步;缺资料或检查未通过就停下。只整理资料和分析,不修改外部服务。`:`Continue private analysis automatically, up to 3 steps this round. Stop for missing input or failed checks. No changes to external services.`]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`一份阶段结果不等于整个目标完成。最终由你对照完成标准验收,随时可以暂停或结束。`:`A step result does not complete the goal. You review the final criteria, and can pause or end at any time.`}),w?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:w}):null,(0,Q.jsx)(Y,{variant:`primary`,type:`submit`,disabled:S||!v.length,children:a?`确认目标,开始第一步`:`Confirm goal and start`}),(0,Q.jsx)(Y,{variant:`ghost`,disabled:S,onClick:()=>c(!1),children:a?`取消`:`Cancel`})]})})]}):null,N=o.some(it)?(0,Q.jsx)(X,{title:D,trigger:(0,Q.jsx)(Y,{variant:`ghost`,children:D}),children:(0,Q.jsx)(`div`,{className:`space-y-3`,children:o.filter($).map(e=>(0,Q.jsx)(dt,{followUp:e,language:r,onUpdated:i},e.id))})}):null,P;return t[7]!==j||t[8]!==M||t[9]!==N?(P=(0,Q.jsxs)(`div`,{className:`mt-3 space-y-4`,children:[j,M,N]}),t[7]=j,t[8]=M,t[9]=N,t[10]=P):P=t[10],P}function $(e){return[`done`,`ended`].includes(e.status)}function it(e){return[`done`,`ended`].includes(e.status)}function at(e){return e.trim()}function ot(e){return![`done`,`ended`].includes(e.status)}function st(e){return![`done`,`ended`].includes(e.status)}function ct(e){return![`done`,`ended`].includes(e.status)}function lt(e){return![`done`,`ended`].includes(e.status)}function ut(e){return e.id}function dt(e){let t=(0,We.c)(104),{followUp:n,language:r,onUpdated:i}=e,a=r===`zh`,[o,s]=(0,Z.useState)(),[c,u]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(),[S,C]=(0,Z.useState)(!1),[w,T]=(0,Z.useState)(!1),E;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[0]=E):E=t[0];let[D,O]=(0,Z.useState)(E),[k,A]=(0,Z.useState)(``),j=o&&o.revision>n.revision?o:n,M;t[1]===j.steps?M=t[2]:(M=j.steps.at(-1),t[1]=j.steps,t[2]=M);let N=M,P;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(P=[`done`,`ended`],t[3]=P):P=t[3];let F=P.includes(j.status),I=N?.status===`queued`?a?`下一步已安排`:`Next step queued`:N&&[`succeeded`,`failed`,`cancelled`].includes(N.status)?a?`正在整理本步结果`:`Processing the step result`:a?`正在推进`:`In progress`,L=a?`等资料 / 待处理`:`Waiting for input`,R=a?`等你确认下一步`:`Review next step`,z=a?`已暂停`:`Paused`,B=a?`已由你验收完成`:`Accepted by you`,V=a?`已结束`:`Ended`,H;t[4]!==I||t[5]!==L||t[6]!==R||t[7]!==z||t[8]!==B||t[9]!==V?(H={working:I,waiting:L,review:R,paused:z,done:B,ended:V},t[4]=I,t[5]=L,t[6]=R,t[7]=z,t[8]=B,t[9]=V,t[10]=H):H=t[10];let U=H[j.status],W=a?`调整下一步`:`Adjust next step`,ee=a?`验收整个目标`:`Review goal completion`,G=a?`结束跟进`:`End follow-up`,te=a?`完成标准与推进记录`:`Acceptance criteria and step history`,K;t[11]!==c||t[12]!==j.id||t[13]!==j.revision||t[14]!==i||t[15]!==a?(K=e=>{c||(u(!0),p(``),d(l(`/api/home/follow-ups/${encodeURIComponent(j.id)}/command`),{method:`POST`,body:JSON.stringify({expectedRevision:j.revision,idempotencyKey:crypto.randomUUID(),command:e})}).then(t=>{s(ne.parse(t)),e.kind===`add_input`&&h(``),y(!1),C(!1),T(!1),i()}).catch(e=>{let t=e instanceof Error?e.message:String(e);p(/changed/i.test(t)?a?`这条目标有新进展,已刷新。请确认后再操作。`:`Progress changed. Review the refreshed goal and try again.`:t),i()}).finally(()=>u(!1)))},t[11]=c,t[12]=j.id,t[13]=j.revision,t[14]=i,t[15]=a,t[16]=K):K=t[16];let q=K,re=a?`持续推进的目标`:`Continuing goal`,ie=a?`持续推进`:`Continuing goal`,ae;t[17]===ie?ae=t[18]:(ae=(0,Q.jsx)(`p`,{className:`text-xs font-medium text-accent-fg`,children:ie}),t[17]=ie,t[18]=ae);let J;t[19]===U?J=t[20]:(J=(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,role:`status`,children:U}),t[19]=U,t[20]=J);let oe;t[21]!==ae||t[22]!==J?(oe=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[ae,J]}),t[21]=ae,t[22]=J,t[23]=oe):oe=t[23];let se;t[24]===j.goal?se=t[25]:(se=(0,Q.jsx)(`h4`,{className:`break-words text-base font-semibold text-fg`,children:j.goal}),t[24]=j.goal,t[25]=se);let ce;t[26]===f?ce=t[27]:(ce=f?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:f}):null,t[26]=f,t[27]=ce);let le;t[28]!==j.stopPending||t[29]!==a?(le=j.stopPending?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`已停止安排新步骤,正在确认上一步是否终止。`:`No new steps will start until the previous execution is confirmed stopped.`}):null,t[28]=j.stopPending,t[29]=a,t[30]=le):le=t[30];let ue;t[31]!==j.summary||t[32]!==a?(ue=j.summary?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`最近进展`:`Latest progress`}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words text-sm text-fg`,children:j.summary})]}):null,t[31]=j.summary,t[32]=a,t[33]=ue):ue=t[33];let de;t[34]!==j.waitingFor||t[35]!==a?(de=j.waitingFor?(0,Q.jsxs)(`div`,{className:`rounded-lg bg-surface-panel p-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`当前需要`:`What is needed`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:j.waitingFor===`Source scope or goal contract needs review`?a?`参考资料或目标要求已变更,请先检查。`:`Source scope or goal requirements need review.`:j.waitingFor===`Step history changed; review before resuming`?a?`一步历史结果已删除,目标已暂停。请确认下一步后再继续。`:`A step was deleted. Review the next action before resuming.`:j.waitingFor===`New material awaits review`?a?`有新增资料还没核对,请先推进下一步。`:`New material needs review before goal acceptance.`:j.waitingFor})]}):null,t[34]=j.waitingFor,t[35]=a,t[36]=de):de=t[36];let fe;t[37]!==j.nextStep||t[38]!==j.status||t[39]!==a?(fe=j.nextStep?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:j.status===`working`?a?`当前这一步`:`Current step`:a?`建议下一步`:`Proposed next step`}),(0,Q.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:j.nextStep})]}):null,t[37]=j.nextStep,t[38]=j.status,t[39]=a,t[40]=fe):fe=t[40];let pe;t[41]!==N||t[42]!==a?(pe=N?(0,Q.jsx)(Y,{variant:`secondary`,"aria-haspopup":`dialog`,onClick:()=>x(N.taskId),children:a?`查看第 ${N.number} 步的进度与结果`:`Review step ${N.number}`}):null,t[41]=N,t[42]=a,t[43]=pe):pe=t[43];let me;t[44]!==ee||t[45]!==k||t[46]!==S||t[47]!==q||t[48]!==c||t[49]!==D||t[50]!==w||t[51]!==v||t[52]!==G||t[53]!==F||t[54]!==f||t[55]!==j.autoContinue||t[56]!==j.criteria||t[57]!==j.nextStep||t[58]!==j.remainingSteps||t[59]!==j.status||t[60]!==j.stopPending||t[61]!==N?.verified||t[62]!==g||t[63]!==W||t[64]!==m||t[65]!==a?(me=F?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:j.autoContinue?a?`本轮还可自动推进 ${j.remainingSteps} 步。每步结果都会保留,遇到资料缺口会停下。`:`Up to ${j.remainingSteps} more automatic steps this round. Missing input stops progress.`:a?`每个下一步都由你确认后再执行。`:`You confirm each next step before it runs.`}),j.status===`review`&&!j.stopPending?(0,Q.jsx)(Y,{variant:`primary`,disabled:c,"aria-haspopup":`dialog`,onClick:()=>{_(j.nextStep),y(!0)},children:j.nextStep?a?`确认或调整下一步`:`Confirm or adjust next step`:a?`安排下一步`:`Set the next step`}):null,(0,Q.jsx)(X,{title:W,open:v,onOpenChange:y,busy:c,children:(0,Q.jsxs)(`form`,{className:`space-y-2`,onSubmit:e=>{e.preventDefault(),q({kind:`continue`,nextStep:g,stepBudget:j.autoContinue?3:1})},children:[(0,Q.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[a?`下一步要完成什么?`:`What should the next step deliver?`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:1e3,value:g,onChange:e=>_(e.target.value),className:`mt-1 min-h-20 w-full rounded-lg border border-edge bg-surface-inset p-2 text-sm text-fg`})]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:j.autoContinue?a?`确认后,本轮最多再推进 3 步。`:`Confirm up to 3 more private steps this round.`:a?`确认后仅执行这一步。`:`Confirm this step only.`}),(0,Q.jsx)(Y,{type:`submit`,variant:`primary`,disabled:c,children:a?`确认继续推进`:`Continue with this step`}),f?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:f}):null]})}),(0,Q.jsxs)(`form`,{className:`space-y-2`,onSubmit:e=>{e.preventDefault(),q({kind:`add_input`,text:m})},children:[(0,Q.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[a?`补充资料或最新情况`:`Add evidence or an update`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:8e3,value:m,onChange:e=>h(e.target.value),placeholder:a?`粘贴复现条件、日志片段,或说明有什么新进展。`:`Add reproduction steps, logs or new progress.`,className:`mt-1 min-h-16 w-full rounded-lg border border-edge bg-surface-inset p-2 text-sm text-fg`})]}),(0,Q.jsx)(Y,{variant:j.status===`waiting`?`primary`:`secondary`,disabled:c||!m.trim(),type:`submit`,children:j.status===`waiting`&&j.autoContinue&&j.remainingSteps>0&&N?.verified?a?`补充资料,继续推进`:`Add evidence and continue`:a?`补充到这条目标`:`Add to this goal`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[j.status===`waiting`&&!j.stopPending?(0,Q.jsx)(Y,{variant:`ghost`,"aria-haspopup":`dialog`,onClick:()=>{_(j.nextStep),y(!0)},children:a?`调整下一步`:`Adjust next step`}):null,(0,Q.jsx)(Y,{variant:`ghost`,disabled:c,onClick:()=>q({kind:j.status===`paused`?`resume`:`pause`}),children:j.status===`paused`?a?`恢复推进`:`Resume`:a?`暂停推进`:`Pause`}),N?.verified&&j.status!==`working`&&!j.stopPending?(0,Q.jsx)(Y,{variant:`ghost`,"aria-haspopup":`dialog`,onClick:()=>C(!0),children:a?`验收整个目标`:`Review goal completion`}):null,(0,Q.jsx)(Y,{variant:`ghost`,"aria-haspopup":`dialog`,onClick:()=>T(!0),children:a?`结束跟进`:`End follow-up`})]}),(0,Q.jsx)(X,{title:G,open:w,onOpenChange:T,size:`compact`,busy:c,children:(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`停止后续推进并请求取消当前步骤,保留已有结果。`:`Stop further work and cancel the current step. Keep previous results.`}),(0,Q.jsx)(Y,{disabled:c,onClick:()=>q({kind:`end`}),children:a?`确认结束跟进`:`Confirm end`}),f?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:f}):null]})}),(0,Q.jsx)(X,{title:ee,open:S,onOpenChange:C,busy:c,children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),q({kind:`complete`,confirmedCriteria:D,note:k})},children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:a?`请对照结果逐项确认,阶段产出不代表目标已完成。`:`Confirm each criterion against the results. A completed step is not a completed goal.`}),j.criteria.map((e,t)=>(0,Q.jsxs)(`label`,{className:`flex items-start gap-2 text-sm text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:D.includes(t),onChange:e=>O(e.target.checked?[...D,t]:D.filter(e=>e!==t))}),e]},t)),(0,Q.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[a?`验收依据`:`Acceptance evidence`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:1e3,value:k,onChange:e=>A(e.target.value),className:`mt-1 w-full rounded-lg border border-edge bg-surface-panel p-2 text-sm`})]}),(0,Q.jsx)(Y,{type:`submit`,variant:`primary`,disabled:c||D.length!==j.criteria.length||!k.trim(),children:a?`确认目标已完成`:`Accept completed goal`}),f?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:f}):null]})})]}),t[44]=ee,t[45]=k,t[46]=S,t[47]=q,t[48]=c,t[49]=D,t[50]=w,t[51]=v,t[52]=G,t[53]=F,t[54]=f,t[55]=j.autoContinue,t[56]=j.criteria,t[57]=j.nextStep,t[58]=j.remainingSteps,t[59]=j.status,t[60]=j.stopPending,t[61]=N?.verified,t[62]=g,t[63]=W,t[64]=m,t[65]=a,t[66]=me):me=t[66];let he;t[67]===te?he=t[68]:(he=(0,Q.jsx)(Y,{variant:`ghost`,children:te}),t[67]=te,t[68]=he);let ge;t[69]===j.criteria?ge=t[70]:(ge=j.criteria.map(ft),t[69]=j.criteria,t[70]=ge);let _e;t[71]===ge?_e=t[72]:(_e=(0,Q.jsx)(`ul`,{className:`mt-2 list-disc pl-4 text-sm text-fg-muted`,children:ge}),t[71]=ge,t[72]=_e);let ve;if(t[73]!==j.steps||t[74]!==a){let e;t[76]===a?e=t[77]:(e=e=>(0,Q.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2 border-l border-edge pl-3 text-xs text-fg-muted`,children:[(0,Q.jsxs)(`span`,{children:[e.number,`. `,e.action,` · `,e.verified?a?`本步检查通过`:`Step checked`:a?`结果待核查`:`Needs review`]}),(0,Q.jsx)(Y,{variant:`ghost`,"aria-haspopup":`dialog`,onClick:()=>x(e.taskId),children:a?`查看`:`Review`})]},e.number),t[76]=a,t[77]=e),ve=j.steps.map(e),t[73]=j.steps,t[74]=a,t[75]=ve}else ve=t[75];let ye;t[78]!==te||t[79]!==he||t[80]!==_e||t[81]!==ve?(ye=(0,Q.jsxs)(X,{title:te,trigger:he,children:[_e,ve]}),t[78]=te,t[79]=he,t[80]=_e,t[81]=ve,t[82]=ye):ye=t[82];let be;t[83]!==r||t[84]!==i||t[85]!==b?(be=b?(0,Q.jsx)(Pe,{taskId:b,language:r,onClose:()=>x(void 0),onComplete:i},b):null,t[83]=r,t[84]=i,t[85]=b,t[86]=be):be=t[86];let xe=`#/tasks/${encodeURIComponent(j.rootTaskId)}`,Se=a?`查看完整目标与子任务`:`View the goal and its child tasks`,Ce;t[87]!==xe||t[88]!==Se?(Ce=(0,Q.jsx)(`a`,{className:`inline-block text-xs text-accent-fg`,href:xe,children:Se}),t[87]=xe,t[88]=Se,t[89]=Ce):Ce=t[89];let we;return t[90]!==re||t[91]!==oe||t[92]!==se||t[93]!==ce||t[94]!==le||t[95]!==ue||t[96]!==de||t[97]!==fe||t[98]!==pe||t[99]!==me||t[100]!==ye||t[101]!==be||t[102]!==Ce?(we=(0,Q.jsxs)(`section`,{className:`space-y-3 rounded-lg bg-surface-inset p-3`,"aria-label":re,children:[oe,se,ce,le,ue,de,fe,pe,me,ye,be,Ce]}),t[90]=re,t[91]=oe,t[92]=se,t[93]=ce,t[94]=le,t[95]=ue,t[96]=de,t[97]=fe,t[98]=pe,t[99]=me,t[100]=ye,t[101]=be,t[102]=Ce,t[103]=we):we=t[103],we}function ft(e){return(0,Q.jsx)(`li`,{children:e},e)}function pt(e){let t=(0,We.c)(50),{starters:n,revision:r,language:i,onStarted:a,onUpdated:o}=e,s=i===`zh`,[c,u]=(0,Z.useState)(),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(``),g,_,v,y,b,x,S,C,w,T;if(t[0]!==f||t[1]!==m||t[2]!==i||t[3]!==a||t[4]!==o||t[5]!==r||t[6]!==c||t[7]!==n||t[8]!==s){let e;t[19]===c?e=t[20]:(e=e=>e.kind===c,t[19]=c,t[20]=e);let E=n.find(e),D=E&&ie[E.kind][i];S=`mt-3 space-y-3`;let O=s?`这些工作,可以先帮你整理一份`:`Here is work I can prepare for you`;t[21]===O?C=t[22]:(C=(0,Q.jsx)(`p`,{className:`text-base font-semibold text-fg`,children:O}),t[21]=O,t[22]=C);let k=s?`从近期的相关请求中整理资料和待办,先给你看结果,再决定是否定期交给我。`:`Turn recent requests into useful drafts. Review the result before deciding whether to make it recurring.`;t[23]===k?w=t[24]:(w=(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:k}),t[23]=k,t[24]=w);let A;if(t[25]!==f||t[26]!==i||t[27]!==n||t[28]!==s){let e;t[30]!==f||t[31]!==i||t[32]!==s?(e=e=>{let t=ie[e.kind][i];return(0,Q.jsxs)(`article`,{className:`flex min-w-0 flex-col items-start gap-2 rounded-lg border border-edge p-3`,children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:t.title}),(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:t.output}),(0,Q.jsx)(`p`,{className:`mt-auto text-xs text-fg-subtle`,children:s?`最近有 ${e.requestCount} 条相关请求`:`${e.requestCount} related recent requests`}),(0,Q.jsx)(Y,{disabled:f,"aria-haspopup":`dialog`,onClick:()=>{u(e.kind),h(``)},children:s?`看看会做什么`:`See what I will prepare`})]},e.kind)},t[30]=f,t[31]=i,t[32]=s,t[33]=e):e=t[33],A=n.map(e),t[25]=f,t[26]=i,t[27]=n,t[28]=s,t[29]=A}else A=t[29];t[34]===A?T=t[35]:(T=(0,Q.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:A}),t[34]=A,t[35]=T),g=X,_=D?.title??(s?`看看会做什么`:`See what I will prepare`),v=!!E,t[36]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{e||u(void 0)},t[36]=y):y=t[36],b=f,x=E&&D?(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),!f&&(p(!0),h(``),d(l(`/api/home/observation/prepare`),{method:`POST`,body:JSON.stringify({kind:E.kind,topicIds:E.topicIds,expectedRevision:r,idempotencyKey:crypto.randomUUID(),locale:i})}).then(e=>{let t=re.parse(e);if(t.outcome!==`task`)throw Error(s?`暂时无法开始,请稍后重试。`:`Could not start this draft.`);a(t.taskId),u(void 0),o()}).catch(e=>{let t=e instanceof Error?e.message:String(e);h(/revision|Refresh|available/i.test(t)?s?`工作记录有更新,已刷新可用任务,请重新确认。`:`Work has changed. Review the refreshed task and try again.`:t),o()}).finally(()=>p(!1)))},children:[(0,Q.jsx)(`ul`,{className:`list-disc space-y-1 pl-4 text-sm text-fg-muted`,children:D.deliverables.map(ht)}),(0,Q.jsxs)(`details`,{className:`text-xs text-fg-muted`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:s?`这次参考的请求`:`Requests used for this draft`}),E.previews.map(mt)]}),(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:s?`先准备私人草稿,资料不足会标出来。不发消息,也不自动设定时。`:`Prepare a private draft and flag missing material. No messages or recurring runs.`}),m?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:m}):null,(0,Q.jsx)(Y,{variant:`primary`,type:`submit`,disabled:f,children:f?s?`正在创建任务…`:`Starting…`:s?`先生成一份`:`Prepare this draft`}),(0,Q.jsx)(Y,{variant:`ghost`,disabled:f,onClick:()=>u(void 0),children:s?`取消`:`Cancel`})]}):null,t[0]=f,t[1]=m,t[2]=i,t[3]=a,t[4]=o,t[5]=r,t[6]=c,t[7]=n,t[8]=s,t[9]=g,t[10]=_,t[11]=v,t[12]=y,t[13]=b,t[14]=x,t[15]=S,t[16]=C,t[17]=w,t[18]=T}else g=t[9],_=t[10],v=t[11],y=t[12],b=t[13],x=t[14],S=t[15],C=t[16],w=t[17],T=t[18];let E;t[37]!==g||t[38]!==_||t[39]!==v||t[40]!==y||t[41]!==b||t[42]!==x?(E=(0,Q.jsx)(g,{title:_,open:v,onOpenChange:y,busy:b,children:x}),t[37]=g,t[38]=_,t[39]=v,t[40]=y,t[41]=b,t[42]=x,t[43]=E):E=t[43];let D;return t[44]!==E||t[45]!==S||t[46]!==C||t[47]!==w||t[48]!==T?(D=(0,Q.jsxs)(`div`,{className:S,children:[C,w,T,E]}),t[44]=E,t[45]=S,t[46]=C,t[47]=w,t[48]=T,t[49]=D):D=t[49],D}function mt(e,t){return(0,Q.jsx)(`p`,{className:`mt-2 break-words`,children:e},t)}function ht(e){return(0,Q.jsx)(`li`,{children:e},e)}function gt({observation:e,advisor:t,language:n,emphasizeStart:r=!0,onUpdated:i}){let a=n===`zh`,[o,s]=(0,Z.useState)(!1),[c,u]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(`once`),[b,x]=(0,Z.useState)(),[S,C]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(),[D,O]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(),[j,M]=(0,Z.useState)(!1),N=t.state===`ready`?t.primary:void 0,F=N?.evidence.map(e=>/^observation:([^:]+):/.exec(e.id)?.[1]).find(Boolean),I=e.topics.filter(e=>e.feedback.some(e=>e.status===`active`)||e.trials.length||e.routine),L=I.find(e=>e.id===T),R=b?e.topics.find(e=>e.id===b):e.topics.find(e=>e.routine&&e.routine.status!==`ended`)??e.topics.find(e=>e.trials.length)??e.topics.find(e=>e.id===F)??e.topics[0],z=e.status===`active`&&R?.id===F?N:void 0,B=R?.trials[0],V=!!(R?.routine||B||z),H=t.state===`quiet`&&[`model_unavailable`,`generation_failed`,`budget_exhausted`].includes(t.reason),U=async e=>{if(!o){s(!0),u(``),p(``);try{await e(),i()}catch(e){u(e instanceof Error?e.message:String(e)),i()}finally{s(!1)}}},W=async t=>ae.parse(await d(l(`/api/home/observation/command`),{method:`POST`,body:JSON.stringify({expectedRevision:e.revision,idempotencyKey:crypto.randomUUID(),command:t})})),G=()=>{R&&(x(R.id),C(!0))},te=()=>R&&void U(async()=>{let t=await d(l(`/api/home/observation/discussion`),{method:`POST`,body:JSON.stringify({topicId:R.id,expectedRevision:e.revision,idempotencyKey:crypto.randomUUID()})});window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:t}))}),K=a?`一次性整理与定期安排`:`One-off drafts and recurring work`,q=a?`记录与设置`:`History and settings`,ne=a?`为什么推荐这件事`:`Why this suggestion`,J=(0,Q.jsxs)(Q.Fragment,{children:[!V&&e.status===`active`&&e.starters?.length?(0,Q.jsx)(pt,{starters:e.starters,revision:e.revision,language:n,onStarted:A,onUpdated:i}):V?R?.routine?(0,Q.jsx)(Ie,{routine:R.routine,language:n,onUpdated:i},R.routine.id):B?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:[`review`,`closed`].includes(B.phase)?a?`先看看这次做得怎么样`:`Review the first result`:a?`先做一次,再决定是否定期交给我`:`Try it once before making it recurring`}),(0,Q.jsx)(`p`,{className:`text-base font-medium text-fg`,children:B.title}),(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`满意后再决定要不要定期交给我。`:`Review the result before deciding whether to make it recurring.`}),(0,Q.jsx)(Y,{variant:`primary`,"aria-haspopup":`dialog`,onClick:()=>A(B.taskId),children:a?`查看这次结果`:`Review this result`}),[`review`,`closed`].includes(B.phase)?(0,Q.jsx)(Le,{topicId:R.id,trial:B,language:n,onUpdated:i},B.taskId):null]}):z&&R?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`这件事,可以先让我试试`:`Here is something I could try`}),(0,Q.jsx)(`p`,{className:`text-base font-medium text-fg`,children:z.title}),(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:z.outcome}),z.risk===`analysis`?(0,Q.jsx)(Y,{variant:`primary`,disabled:o,onClick:()=>void U(async()=>{let t=re.parse(await d(l(`/api/home/observation/trial`),{method:`POST`,body:JSON.stringify({topicId:R.id,opportunityId:z.id,expectedRevision:e.revision,expectedOpportunityRevision:z.revision,idempotencyKey:crypto.randomUUID()})}));if(t.outcome===`task`)A(t.taskId);else throw Error(a?`请先完成相关能力配置。`:`Set up the required capabilities first.`)}),children:a?`先帮我做一次`:`Try it once`}):(0,Q.jsx)(Y,{variant:`primary`,disabled:o,onClick:te,children:a?`先确认怎么做`:`Discuss the approach`}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:z.risk===`analysis`?a?`先生成私人草稿,由你查看后决定下一步。`:`Start with a private draft for you to review.`:a?`这件事需要外部服务,先一起确认范围。`:`This needs an external service. Agree on the scope first.`}),(0,Q.jsxs)(X,{title:ne,trigger:(0,Q.jsx)(Y,{variant:`ghost`,children:ne}),children:[(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:z.rationale}),z.evidence.map(e=>(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:e.observation},e.id))]})]}):null:(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-base font-medium text-fg`,children:a?`先做一件具体的事`:`Start with a concrete task`}),(0,Q.jsx)(`p`,{className:`max-w-prose text-sm leading-6 text-fg-muted`,children:e.status===`paused`?a?`已暂停寻找新建议。你也可以直接告诉我,哪件事最想少做一点。`:`New suggestions are paused. You can still tell me what you would like to spend less time on.`:H?a?`暂时无法生成新建议,已有记录和反馈都已保留。你也可以直接说说想交给我的事。`:`New suggestions are temporarily unavailable. Your records and feedback are saved. You can still tell me what you would like help with.`:a?`例如整理 PR 审查清单、汇总问题线索,或写一份工作进展草稿。先准备一次,满意后再设为定期执行。`:`Prepare a PR review checklist, collect issue reports, or draft a work update. Try it once before making it recurring.`}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[`pr_review`,`issue_digest`,`work_summary`].map(e=>{let t=ie[e][n],r=a?`请帮我准备「${t.title}」。\n目标:${t.output}\n\n要参考的资料或链接:\n\n先生成私人草稿;缺少资料时明确告诉我,不要开启定时执行。`:`Prepare ${t.title}.\n${t.output}\n\nSource material or links:\n\nCreate a private draft and flag missing information. Do not create recurring runs.`;return(0,Q.jsx)(Y,{asChild:!0,children:(0,Q.jsx)(`a`,{href:`#/chat/new?${new URLSearchParams({draft:r})}`,children:t.title})},e)})}),e.status===`paused`?(0,Q.jsx)(Y,{variant:`ghost`,onClick:()=>M(!0),children:a?`恢复寻找建议`:`Resume suggestions`}):null]}),V&&R&&e.status===`active`?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-1`,children:[(0,Q.jsx)(Y,{variant:`ghost`,disabled:o,"aria-haspopup":`dialog`,onClick:G,children:a?`调整做法`:`Refine the approach`}),(0,Q.jsx)(Y,{variant:`ghost`,disabled:o,onClick:te,children:a?`聊聊这件事`:`Discuss this task`})]}):null]});return(0,Q.jsxs)(`section`,{className:`rounded-xl bg-surface-panel p-4`,"aria-labelledby":`home-observation-title`,"aria-busy":o,"data-workbench-panel":!0,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-accent-soft text-accent-fg`,children:(0,Q.jsx)(ee,{className:`size-4`,"aria-hidden":!0})}),(0,Q.jsx)(`h2`,{id:`home-observation-title`,className:`text-base font-semibold tracking-tight text-fg`,children:a?`交给我`:`Let me handle it`})]}),(0,Q.jsx)(X,{title:q,trigger:(0,Q.jsxs)(Y,{variant:`ghost`,className:`gap-1 rounded-lg px-2 text-xs`,children:[q,(0,Q.jsx)(w,{className:`size-3.5 shrink-0`,"aria-hidden":!0})]}),children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,role:`status`,children:e.status===`disabled`?a?`尚未开启`:`Not enabled`:e.status===`paused`?a?`已暂停寻找新建议`:`Suggestions paused`:e.analyzedRevision<e.revision?a?`正在整理最近的工作记录`:`Reviewing recent work`:a?`有新发现时会在这里告诉你`:`New suggestions will appear here`}),(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:a?`只查看已授权的 xopc 私人会话和相关任务结果。暂停寻找建议不会停止已经确认的定期安排。`:`Uses authorized private xopc chats and related task results. Pausing suggestions does not stop confirmed recurring tasks.`}),e.status===`disabled`?null:(0,Q.jsx)(Y,{disabled:o,variant:`ghost`,onClick:()=>e.status===`active`?void U(async()=>{await W({kind:`pause`})}):M(!0),children:e.status===`active`?a?`暂停寻找建议`:`Pause suggestions`:a?`恢复寻找建议`:`Resume suggestions`}),I.length?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:a?`已保存的要求与试做`:`Saved preferences and trials`}),(0,Q.jsx)(`div`,{className:`space-y-2`,children:I.map(e=>(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-lg bg-surface-panel p-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-sm text-fg`,children:e.routine?.title||e.trials[0]?.title||(a?`已保存的工作要求`:`Saved work preferences`)}),(0,Q.jsx)(Y,{variant:`ghost`,disabled:!!g&&e.id!==R?.id,onClick:()=>{E(e.id),x(e.id),O(!1)},children:a?`管理`:`Manage`})]},e.id))}),L?(0,Q.jsxs)(`div`,{className:`space-y-2 rounded-lg bg-surface-panel p-3`,children:[e.status===`active`?(0,Q.jsx)(Y,{variant:`ghost`,disabled:o,onClick:G,children:a?`调整要求`:`Edit preferences`}):null,L.feedback.filter(e=>e.status===`active`).map(e=>(0,Q.jsxs)(`div`,{className:`text-xs text-fg`,children:[(0,Q.jsx)(`p`,{children:e.text}),(0,Q.jsx)(Y,{disabled:o,variant:`ghost`,onClick:()=>void U(async()=>{await W({kind:`retract`,topicId:L.id,feedbackId:e.id})}),children:a?`撤回要求`:`Retract preference`})]},e.id)),L.trials.map(e=>(0,Q.jsxs)(Y,{variant:`ghost`,onClick:()=>A(e.taskId),children:[a?`查看结果:`:`Review result: `,e.title]},e.taskId)),(0,Q.jsx)(Y,{variant:`ghost`,disabled:o,onClick:()=>O(!0),children:a?`不再参考这件事`:`Stop using this work history`}),(0,Q.jsx)(X,{title:a?`不再参考这件事`:`Stop using this work history`,open:D,onOpenChange:O,size:`compact`,busy:o,children:(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg`,children:a?`清除关于这件事的理解和要求。原始记录、已有任务和自动化保留。`:`Forget this understanding and saved preferences. Original records, tasks and automations remain.`}),(0,Q.jsx)(Y,{disabled:o,onClick:()=>void U(async()=>{await W({kind:`forget`,topicId:L.id}),x(void 0),E(void 0),O(!1),_(``),C(!1),A(void 0)}),children:a?`确认不再参考`:`Confirm exclusion`}),c?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:c}):null]})})]}):null]}):(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`你确认的要求与试做结果会保存在这里。普通聊天记录仍在原对话中查看。`:`Your saved preferences and trial results will appear here. View ordinary work history in its original chat.`}),c?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:c}):null]})})]}),c?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:c}):null,f?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-sm text-fg-muted`,children:f}):null,b&&!R&&g?(0,Q.jsxs)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:[a?`这件事已不在记录中。未保存的内容:`:`This item is no longer available. Your unsaved note: `,g]}):null,(0,Q.jsx)(rt,{observation:e,language:n,onUpdated:i}),e.status===`active`||e.status===`paused`&&V?(0,Q.jsxs)(X,{title:K,open:m,onOpenChange:h,trigger:(0,Q.jsx)(Y,{className:`mt-3`,variant:`ghost`,children:K}),children:[J,c?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:c}):null]}):e.status===`disabled`?(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsx)(`h3`,{className:`text-balance text-lg font-semibold leading-snug tracking-tight text-fg`,children:a?`把重复的事,慢慢交给我`:`Let me take recurring work off your hands`}),(0,Q.jsx)(`p`,{className:`mt-2 max-w-prose text-sm leading-6 text-fg-muted`,children:a?`我会结合你在 xopc 中的工作记录,寻找可以代劳的事情。有合适的建议时,先做一次给你看。`:`I can look through your work in xopc for tasks I could take on, then offer a first draft for you to review.`}),(0,Q.jsx)(Y,{className:`mt-3 rounded-lg text-xs sm:shadow-none`,variant:r?`primary`:`tonal`,disabled:o,onClick:()=>void U(async()=>{await W({kind:`start`,backfillDays:30})}),children:a?`帮我发现重复工作`:`Find recurring work`}),(0,Q.jsxs)(`p`,{className:`mt-4 flex items-start gap-2 text-xs leading-5 text-fg-muted`,children:[(0,Q.jsx)(P,{className:`mt-1 size-3 shrink-0`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:a?`仅查看最近 30 天已授权的私人会话及后续工作记录。不扫描屏幕,定期执行前会请你确认。`:`Uses up to 30 days of authorized private chats and new work. No screen recording. Recurring runs need your confirmation.`})]})]}):J,(0,Q.jsx)(X,{title:a?`恢复寻找建议`:`Resume suggestions`,open:j,onOpenChange:M,size:`compact`,busy:o,children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`恢复后,要补看暂停期间的工作吗?`:`Include work from while suggestions were paused?`}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[`catch_up`,`new_only`].map(e=>(0,Q.jsx)(Y,{disabled:o,onClick:()=>void U(async()=>{await W({kind:`resume`,mode:e}),M(!1)}),children:e===`catch_up`?a?`一起补看`:`Include earlier work`:a?`只看之后的工作`:`New work only`},e))}),c?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:c}):null]})}),(0,Q.jsx)(X,{title:a?`调整做法`:`Refine the approach`,open:S&&!!R,onOpenChange:e=>{C(e),e||(_(``),y(`once`))},busy:o,children:R?(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),U(async()=>{await W({kind:`feedback`,topicId:R.id,text:g,scope:v}),_(``),C(!1),p(a?`已记下。改变定期做法前,会先请你确认。`:`Preference saved. I will ask before changing the recurring approach.`)})},children:[(0,Q.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[a?`关于「${R.title}」,希望我怎么做?`:`How should I handle “${R.title}”?`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:1e3,value:g,onChange:e=>_(e.target.value),placeholder:a?`例如:先列出未解决的阻塞,每项附上来源。`:`For example: list unresolved blockers first and include sources.`,className:`mt-1 min-h-24 w-full rounded-lg border border-edge bg-surface-inset p-2 text-sm text-fg`})]}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,role:`group`,"aria-label":a?`反馈范围`:`Feedback scope`,children:[`once`,`project`,`similar`].filter(e=>e!==`project`||R.projectId).map(e=>(0,Q.jsx)(Y,{type:`button`,variant:e===v?`secondary`:`ghost`,"aria-pressed":e===v,onClick:()=>y(e),children:e===`once`?a?`仅这一次`:`Just this time`:e===`project`?a?`这个项目都适用`:`This project`:a?`以后这类事都适用`:`Similar future work`},e))}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`记下你的要求;改变定期安排前,仍会请你确认。`:`I will remember your preference and ask before changing a recurring arrangement.`}),(0,Q.jsx)(Y,{type:`submit`,variant:`primary`,disabled:o||!g.trim(),children:a?`记住这个要求`:`Save preference`}),(0,Q.jsx)(Y,{variant:`ghost`,onClick:()=>{C(!1),_(``),y(`once`)},children:a?`取消`:`Cancel`}),c?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:c}):null]}):null}),k?(0,Q.jsx)(Pe,{taskId:k,language:n,onClose:()=>A(void 0),onComplete:i},k):null]})}var _t=new Set([`started`,`discussing`,`completed`]);function vt(){let e=(0,We.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[0,1,2].map(yt)}),e[0]=t):t=e[0],t}function yt(e){return(0,Q.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-edge-subtle p-4`,children:[(0,Q.jsx)(q,{className:`h-4 w-24 rounded`}),(0,Q.jsx)(q,{className:`h-5 w-4/5 rounded`}),(0,Q.jsx)(q,{className:`h-4 w-3/5 rounded`})]},e)}function bt(e){let t=(0,We.c)(11),{open:n,refreshKey:r,onOpenChange:i,onReevaluate:a}=e,o=u(xt),c=f(o).projectsPage.home,l=s(),[d,b]=(0,Z.useState)(`all`),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],t[0]=x):x=t[0];let[S,w]=(0,Z.useState)(x),[T,E]=(0,Z.useState)(!1),[D,A]=(0,Z.useState)(),j;t[1]===n?j=t[2]:(j=()=>{if(!n)return;let e=!0;return E(!0),A(void 0),ue().then(t=>{e&&w(t.items)}).catch(t=>{e&&A(t instanceof Error?t.message:String(t))}).finally(()=>{e&&E(!1)}),()=>{e=!1}},t[1]=n,t[2]=j);let N;t[3]!==n||t[4]!==r?(N=[n,r],t[3]=n,t[4]=r,t[5]=N):N=t[5],(0,Z.useEffect)(j,N);let P=S.filter(e=>d===`all`||(d===`adopted`?_t.has(e.status):!_t.has(e.status))),I=new Intl.DateTimeFormat(o===`zh`?`zh-CN`:`en`,{dateStyle:`medium`}),L=new Intl.DateTimeFormat(o===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),R=new Map;for(let e of P){let t=I.format(new Date(e.updatedAt));R.set(t,[...R.get(t)??[],e])}let z=[...R.entries()],B=e=>e.feedbackKind===`already_done`?c.advisorHistoryStatusCompleted:e.feedbackKind===`irrelevant`?c.advisorHistoryStatusIrrelevant:e.feedbackKind===`source_incorrect`?c.advisorHistoryStatusSourceIncorrect:e.feedbackKind===`less_like_this`?c.advisorHistoryStatusLessLikeThis:{available:c.advisorHistoryStatusAvailable,started:c.advisorHistoryStatusStarted,discussing:c.advisorHistoryStatusDiscussing,completed:c.advisorHistoryStatusCompleted,snoozed:c.advisorHistoryStatusSnoozed,dismissed:c.advisorHistoryStatusDismissed,expired:c.advisorHistoryStatusExpired,superseded:c.advisorHistoryStatusSuperseded}[e.status],V=e=>{if(e.href){i(!1),l(F(`/`,e.href));return}e.status===`discussing`&&(i(!1),l(`/chat/new?${new URLSearchParams({draft:e.opportunity.actionPrompt}).toString()}`))},U;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim`}),t[6]=U):U=t[6];let W;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(M,{className:`mt-0.5 size-5 shrink-0 text-accent`,"aria-hidden":!0}),t[7]=W):W=t[7];let ee;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(te,{className:`size-4`,"aria-hidden":!0}),t[8]=ee):ee=t[8];let G=T?(0,Q.jsx)(vt,{}):D?(0,Q.jsxs)(`div`,{className:`rounded-xl border border-danger/25 bg-danger-soft p-4 text-sm text-danger`,children:[(0,Q.jsx)(`p`,{children:c.advisorHistoryLoadFailed}),(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,className:`mt-2`,onClick:()=>i(!1),children:c.advisorHistoryClose})]}):z.length===0?(0,Q.jsxs)(`div`,{className:`py-16 text-center`,children:[(0,Q.jsx)(M,{className:`mx-auto size-6 text-fg-subtle`,"aria-hidden":!0}),(0,Q.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:c.advisorHistoryEmpty}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:c.advisorHistoryEmptyHint})]}):(0,Q.jsx)(`div`,{className:`space-y-6`,children:z.map(e=>{let[t,n]=e;return(0,Q.jsxs)(`section`,{"aria-label":t,children:[(0,Q.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-fg-subtle`,children:t}),(0,Q.jsx)(`div`,{className:`space-y-2`,children:n.map(e=>{let t=!!e.href||e.status===`discussing`,n=[`snoozed`,`dismissed`,`expired`,`superseded`].includes(e.status);return(0,Q.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-accent`,children:B(e)}),(0,Q.jsx)(`h4`,{className:`mt-1.5 text-sm font-semibold leading-5 text-fg`,children:e.opportunity.title}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:e.opportunity.outcome})]}),(0,Q.jsx)(`time`,{className:`shrink-0 text-[11px] text-fg-subtle`,dateTime:new Date(e.updatedAt).toISOString(),children:L.format(new Date(e.updatedAt))})]}),e.snoozedUntil?(0,Q.jsxs)(`p`,{className:`mt-2 inline-flex items-center gap-1 text-xs text-fg-muted`,children:[(0,Q.jsx)(O,{className:`size-3.5`,"aria-hidden":!0}),c.advisorHistoryReturnsAt,` `,L.format(new Date(e.snoozedUntil))]}):null,(0,Q.jsxs)(`details`,{className:`group mt-3`,children:[(0,Q.jsxs)(`summary`,{className:`flex min-h-8 cursor-pointer list-none items-center gap-1 text-xs font-medium text-fg-muted hover:text-fg`,children:[c.advisorHistoryEvidence,(0,Q.jsx)(C,{className:`size-3.5 transition-transform duration-200 group-open:rotate-180 motion-reduce:transition-none`,"aria-hidden":!0})]}),(0,Q.jsx)(Xe,{opportunity:e.opportunity,onOpen:()=>i(!1)})]}),t||n?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[t?(0,Q.jsxs)(Y,{type:`button`,variant:`secondary`,className:`min-h-9 text-xs`,onClick:()=>V(e),children:[(0,Q.jsx)(k,{className:`size-3.5`,"aria-hidden":!0}),e.status===`discussing`?c.advisorHistoryContinueDiscussion:c.advisorHistoryViewProgress]}):null,n?(0,Q.jsxs)(Y,{type:`button`,variant:`ghost`,className:`min-h-9 text-xs`,onClick:()=>{i(!1),a()},children:[(0,Q.jsx)(H,{className:`size-3.5`,"aria-hidden":!0}),c.advisorHistoryReevaluate]}):null]}):null]},e.opportunity.id)})})]},t)})}),K;return t[9]===G?K=t[10]:(K=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:G}),t[9]=G,t[10]=K),(0,Q.jsx)(y,{open:n,onOpenChange:i,children:(0,Q.jsxs)(g,{children:[U,(0,Q.jsxs)(_,{className:`xopc-drawer-right fixed right-0 top-0 z-[90] flex size-full max-w-lg flex-col overflow-hidden border-l border-edge bg-surface-overlay shadow-popover outline-none`,"aria-describedby":`home-advisor-history-description`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start gap-3 border-b border-edge px-5 py-4`,children:[W,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(v,{className:`text-base font-semibold text-fg`,children:c.advisorHistoryTitle}),(0,Q.jsx)(m,{id:`home-advisor-history-description`,className:`mt-1 text-xs leading-5 text-fg-muted`,children:c.advisorHistoryDescription})]}),(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,className:`-mr-2 size-9 shrink-0 p-0`,"aria-label":c.advisorHistoryClose,children:ee})})]}),(0,Q.jsx)(`div`,{className:`shrink-0 border-b border-edge-subtle px-5 py-3`,children:(0,Q.jsx)(Oe,{className:`inline-flex rounded-lg bg-surface-inset p-1`,role:`group`,"aria-label":c.advisorHistoryFilterLabel,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[[`all`,c.advisorHistoryFilterAll],[`adopted`,c.advisorHistoryFilterAdopted],[`other`,c.advisorHistoryFilterOther]].map(e=>{let[t,n]=e;return(0,Q.jsx)(`button`,{type:`button`,className:`min-h-9 rounded-md px-3 text-xs font-medium transition-colors duration-150 ${d===t?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`}`,"aria-pressed":d===t,onClick:()=>b(t),children:n},t)})})}),K]})]})})}function xt(e){return e.language}function St(e,t){return e.replace(`{{count}}`,String(t))}function Ct(e,t){if(e.state===`disabled`)return null;if(e.state===`ready`){let n=1+e.alternatives.length;return{label:St(t.ready,n),detail:e.primary.title,tone:`accent`,refreshing:!!e.stale}}return e.state===`clarification`?{label:t.clarification,detail:e.question.question,tone:`accent`,refreshing:!1}:e.state===`refreshing`?{label:t.refreshing,detail:e.previous?.title??t.refreshingDetail,tone:`accent`,refreshing:!0}:e.reason===`generation_failed`?{label:t.generationFailed,detail:t.generationFailedDetail,tone:`danger`,refreshing:!1}:e.reason===`budget_exhausted`?{label:t.budgetExhausted,detail:t.budgetExhaustedDetail,tone:`warning`,refreshing:!1}:e.reason===`model_unavailable`?{label:t.modelUnavailable,detail:t.modelUnavailableDetail,tone:`warning`,refreshing:!1}:{label:t.idle,detail:t.idleDetail,tone:`neutral`,refreshing:!1}}var wt={accent:`bg-accent`,danger:`bg-danger`,neutral:`bg-fg-subtle`,warning:`bg-warning`};function Tt(e){let t=(0,We.c)(44),{advisor:n,busy:r,copy:i,onOpenHistory:a,onRefresh:o}=e,[s,c]=(0,Z.useState)(!1),l;t[0]!==n||t[1]!==i?(l=Ct(n,i),t[0]=n,t[1]=i,t[2]=l):l=t[2];let u=l;if(!u)return null;let d=n.state!==`refreshing`,f=n.state===`ready`?i.findAnother:i.retry,p=`${i.label}:${u.label}`,m;t[3]===u.refreshing?m=t[4]:(m=u.refreshing?(0,Q.jsx)(H,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,Q.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),t[3]=u.refreshing,t[4]=m);let h;t[5]!==u.refreshing||t[6]!==u.tone?(h=u.tone!==`neutral`&&!u.refreshing?(0,Q.jsx)(`span`,{className:K(`absolute right-1.5 top-1.5 size-1.5 rounded-full`,wt[u.tone]),"aria-hidden":!0}):null,t[5]=u.refreshing,t[6]=u.tone,t[7]=h):h=t[7];let g;t[8]!==p||t[9]!==m||t[10]!==h?(g=(0,Q.jsxs)(Y,{type:`button`,variant:`ghost`,className:`relative size-9 rounded-lg p-0 data-[state=open]:bg-surface-hover data-[state=open]:text-fg`,"aria-label":p,title:p,children:[m,h]}),t[8]=p,t[9]=m,t[10]=h,t[11]=g):g=t[11];let _;t[12]===a?_=t[13]:(_=()=>{c(!1),a()},t[12]=a,t[13]=_);let v;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(M,{className:`size-3.5`,"aria-hidden":!0}),t[14]=v):v=t[14];let y;t[15]!==i.history||t[16]!==_?(y=(0,Q.jsxs)(Y,{type:`button`,variant:`ghost`,className:`h-9 rounded-lg text-xs`,onClick:_,children:[v,i.history]}),t[15]=i.history,t[16]=_,t[17]=y):y=t[17];let b;t[18]!==r||t[19]!==d||t[20]!==o||t[21]!==f?(b=d?(0,Q.jsxs)(Y,{type:`button`,variant:`secondary`,className:`h-9 rounded-lg text-xs`,disabled:r,onClick:()=>{c(!1),o()},children:[(0,Q.jsx)(H,{className:`size-3.5`,"aria-hidden":!0}),f]}):null,t[18]=r,t[19]=d,t[20]=o,t[21]=f,t[22]=b):b=t[22];let x;t[23]!==y||t[24]!==b?(x=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1`,children:[y,b]}),t[23]=y,t[24]=b,t[25]=x):x=t[25];let S;t[26]===u.refreshing?S=t[27]:(S=(0,Q.jsx)(`span`,{className:`mt-1 flex size-7 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-accent`,children:u.refreshing?(0,Q.jsx)(H,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,Q.jsx)(ee,{className:`size-4`,"aria-hidden":!0})}),t[26]=u.refreshing,t[27]=S);let C;t[28]===u.label?C=t[29]:(C=(0,Q.jsx)(`p`,{className:`font-semibold text-fg`,children:u.label}),t[28]=u.label,t[29]=C);let w;t[30]===u.detail?w=t[31]:(w=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:u.detail}),t[30]=u.detail,t[31]=w);let T;t[32]!==C||t[33]!==w?(T=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[C,w]}),t[32]=C,t[33]=w,t[34]=T):T=t[34];let E;t[35]!==S||t[36]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[S,T]}),t[35]=S,t[36]=T,t[37]=E):E=t[37];let D;return t[38]!==i.label||t[39]!==s||t[40]!==E||t[41]!==g||t[42]!==x?(D=(0,Q.jsx)(X,{title:i.label,open:s,onOpenChange:c,size:`compact`,trigger:g,footer:x,children:E}),t[38]=i.label,t[39]=s,t[40]=E,t[41]=g,t[42]=x,t[43]=D):D=t[43],D}var Et=(0,Z.lazy)(()=>i(()=>import(`./workspace-file-preview-dialog-DGsFnZh-.js`).then(e=>e.n).then(e=>({default:e.WorkspaceFilePreviewPanel})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79])));function Dt(e){let t=(0,We.c)(42),{item:n,language:r,primary:i,showNew:a,onOpen:o}=e,s=a!==void 0&&a,c;t[0]===r?c=t[1]:(c=f(r),t[0]=r,t[1]=c);let l=c.projectsPage.home.workbench,u;t[2]!==n.summary||t[3]!==r?(u=Re(n.summary,r),t[2]=n.summary,t[3]=r,t[4]=u):u=t[4];let d=u,p;t[5]===s?p=t[6]:(p=s?(0,Q.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,Q.jsx)(A,{className:`size-4`,"aria-hidden":!0})}):null,t[5]=s,t[6]=p);let m;t[7]===n.title?m=t[8]:(m=(0,Q.jsx)(`p`,{className:`break-words text-sm font-semibold text-fg`,children:n.title}),t[7]=n.title,t[8]=m);let h;t[9]!==l.newDelivery||t[10]!==s?(h=s?(0,Q.jsx)(`span`,{className:`mr-2 font-medium text-accent-fg`,children:l.newDelivery}):null,t[9]=l.newDelivery,t[10]=s,t[11]=h):h=t[11];let g;t[12]===n.completedAt?g=t[13]:(g=new Date(n.completedAt).toISOString(),t[12]=n.completedAt,t[13]=g);let _;t[14]!==n.completedAt||t[15]!==r?(_=Ne(new Date(n.completedAt),r),t[14]=n.completedAt,t[15]=r,t[16]=_):_=t[16];let v;t[17]!==g||t[18]!==_?(v=(0,Q.jsx)(`time`,{dateTime:g,children:_}),t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;t[20]!==h||t[21]!==v?(y=(0,Q.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[h,v]}),t[20]=h,t[21]=v,t[22]=y):y=t[22];let b;t[23]===d?b=t[24]:(b=d?(0,Q.jsx)(`p`,{className:`mt-1 line-clamp-2 break-words text-xs leading-5 text-fg-muted`,children:d}):null,t[23]=d,t[24]=b);let x;t[25]!==y||t[26]!==b||t[27]!==m?(x=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[m,y,b]}),t[25]=y,t[26]=b,t[27]=m,t[28]=x):x=t[28];let S;t[29]!==x||t[30]!==p?(S=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 basis-48 items-start gap-3`,children:[p,x]}),t[29]=x,t[30]=p,t[31]=S):S=t[31];let C=i?`primary`:s?`ghost`:`tonal`,T;t[32]===s?T=t[33]:(T=s?(0,Q.jsx)(w,{className:`size-3.5`,"aria-hidden":!0}):null,t[32]=s,t[33]=T);let E;t[34]!==l.openDelivery||t[35]!==o||t[36]!==C||t[37]!==T?(E=(0,Q.jsxs)(Y,{variant:C,className:`min-h-9 shrink-0 gap-1 rounded-lg px-2.5 text-xs sm:shadow-none`,onClick:o,children:[l.openDelivery,T]}),t[34]=l.openDelivery,t[35]=o,t[36]=C,t[37]=T,t[38]=E):E=t[38];let D;return t[39]!==S||t[40]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 py-3.5`,children:[S,E]}),t[39]=S,t[40]=E,t[41]=D):D=t[41],D}function Ot({view:e,items:t,language:n,onSelect:r,onClose:i,onRead:a,onOpenFull:o,onRestoreFocus:s}){let c=f(n).projectsPage.home,[l,u]=(0,Z.useState)(!1),[d,m]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(null),S=(0,Z.useRef)(!1),C=e&&e!==`history`?e:null,{data:w,error:T,mutate:E}=J(C?[`home-delivery`,C.id]:null,async()=>{if(!C)return;if(C.kind===`automation`){let{run:e}=await Ee.getRun(C.subjectId);return{kind:`automation`,summary:e.summary}}let e=await le(C.subjectId),t=e.receipts.find(e=>`task:${e.runId}`===C.id);if(!t)throw Error(c.workbench.deliveryFailed);return{kind:`task`,detail:e,receipt:t}},{shouldRetryOnError:!1}),D=w?.kind===`task`?Ve(w.receipt,n):void 0,O=w?.kind===`task`||!!w?.summary?.trim();async function k(e){if(!S.current){S.current=!0,u(!0),m(!1);try{e.kind===`automation`&&!e.read&&await Ee.markRunRead(e.subjectId),a(e)}catch{m(!0)}finally{S.current=!1,u(!1)}}}return(0,Q.jsx)(y,{open:e!==null,onOpenChange:e=>{!e&&!S.current&&(m(!1),i())},children:(0,Q.jsxs)(g,{children:[(0,Q.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim`}),(0,Q.jsxs)(_,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(36rem,calc(100dvh-2rem))] w-[min(42rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay outline-none`,"aria-describedby":void 0,onCloseAutoFocus:e=>{e.preventDefault(),s()},children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[(0,Q.jsx)(v,{className:`truncate text-base font-semibold text-fg`,children:C?.title??c.workbench.deliveryHistory}),(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:`size-9 p-0`,disabled:l,"aria-label":n===`zh`?`关闭`:`Close`,children:(0,Q.jsx)(te,{className:`size-4`})})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:e===`history`?t.length?(0,Q.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:t.map(e=>(0,Q.jsx)(Dt,{item:e,language:n,onOpen:()=>{m(!1),r(e)}},e.id))}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:c.workbench.deliveryEmpty}):T?(0,Q.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-sm text-danger`,children:[(0,Q.jsx)(`p`,{children:c.workbench.deliveryFailed}),(0,Q.jsx)(Y,{variant:`secondary`,onClick:()=>void E(),children:c.retry})]}):w?w.kind===`task`?(0,Q.jsxs)(Q.Fragment,{children:[D?.issue?(0,Q.jsx)(He,{issue:D.issue}):null,D?.summary?(0,Q.jsx)(Be,{content:D.summary,contentKey:w.receipt.runId,language:n}):null,(0,Q.jsx)(ze,{evidence:w.receipt.evidence,projectId:w.detail.task.projectId,conversationId:w.detail.conversation.activeConversationId??void 0,language:n,onOpenFile:x}),(0,Q.jsx)(y,{open:b!==null,onOpenChange:e=>{e||x(null)},children:(0,Q.jsxs)(g,{children:[(0,Q.jsx)(p,{className:`fixed inset-0 z-[90] bg-scrim`}),(0,Q.jsxs)(_,{className:`fixed left-1/2 top-1/2 z-[100] flex h-[min(54rem,calc(100dvh-2rem))] w-[min(72rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel outline-none`,"aria-describedby":void 0,children:[(0,Q.jsx)(v,{className:`sr-only`,children:b}),(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(q,{className:`m-4 min-h-24`}),children:(0,Q.jsx)(Et,{filePath:b,projectId:w.detail.task.projectId,conversationId:w.detail.conversation.activeConversationId,onClose:()=>x(null)})})]})]})})]}):w.kind===`automation`&&w.summary?(0,Q.jsx)(I,{content:Re(w.summary,n)}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:c.workbench.noSummary}):(0,Q.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,Q.jsx)(q,{className:`h-5 w-2/3`}),(0,Q.jsx)(q,{className:`h-24`})]})}),C?(0,Q.jsxs)(`footer`,{className:`shrink-0 space-y-2 border-t border-edge px-4 py-3`,children:[d?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:c.workbench.readFailed}):null,(0,Q.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,Q.jsx)(Y,{variant:`ghost`,disabled:l,onClick:()=>o(C),children:c.workbench.openFullResult}),(0,Q.jsx)(Y,{variant:`primary`,disabled:!!T||!O||l,onClick:()=>void k(C),children:c.workbench.markRead})]})]}):null]})]})})}var kt=[`attention`,`delivery`,`resume`,`background`,`observation`],At=[`left`,`right`,`full`],jt=`xopc.workbench.layout`,Mt=`application/x-xopc-workbench-card`,Nt=24,Pt=340,Ft=304,It=864,Lt=1/1.57,Rt=260,zt=72,Bt=1600,Vt={order:[...kt],lanes:{},sizes:{},ratio:Lt};function Ht(){try{let e=JSON.parse(localStorage.getItem(jt)??`{}`),t=Array.isArray(e?.order)?kt.filter(t=>e.order.includes(t)).sort((t,n)=>e.order.indexOf(t)-e.order.indexOf(n)):[],n={},r={};for(let t of kt){let i=e?.lanes?.[t];At.includes(i)&&(n[t]=i);let{width:a,height:o}=e?.sizes?.[t]??{},s=Number.isFinite(a)&&a>=Rt,c=Number.isFinite(o)&&o>=zt&&o<=Bt;(s||c)&&(r[t]={width:s?a:void 0,height:c?o:void 0})}let i=typeof e?.ratio==`number`&&e.ratio>0&&e.ratio<1?e.ratio:Lt;return{order:[...new Set([...t,...kt])],lanes:n,sizes:r,ratio:i}}catch{return Vt}}var Ut=`w-full justify-start rounded-md px-2.5 text-sm text-fg`;function Wt(e,t,n){return Math.round(Math.min(n,Math.max(t,e)))}function Gt({cards:e,editing:t,language:n}){let r=n===`zh`,[i,a]=(0,Z.useState)(Ht),[o,s]=(0,Z.useState)({width:0,heights:{}}),[c,l]=(0,Z.useState)(),[u,d]=(0,Z.useState)(),[f,p]=(0,Z.useState)(),[m,g]=(0,Z.useState)(),[_,v]=(0,Z.useState)(``),y=(0,Z.useRef)(null),b=(0,Z.useRef)(null),x=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!f)try{localStorage.setItem(jt,JSON.stringify(i))}catch{}},[i,f]),(0,Z.useEffect)(()=>{let e=y.current,t=e?.closest(`[data-workbench-page-scroll]`);if(!e||!t)return;let n=e=>{let n=e.target instanceof Element?e.target.closest(`[data-workbench-card-scroll]`):null;n&&_e(e,n,t,{handoffOnly:!0})};return e.addEventListener(`wheel`,n,{passive:!1}),()=>e.removeEventListener(`wheel`,n)},[]);let S=o.width-Nt,C=Math.max(Pt,S-Ft),w=Math.max(Pt,Math.min(C,Math.round(S*i.ratio))),T=new Map(e.map(e=>[e.id,e])),E=At.map(e=>i.order.flatMap(t=>{let n=T.get(t);return n&&(i.lanes[t]??n.lane)===e?[n]:[]})),D=e.some(({id:e})=>i.lanes[e]===`left`||i.lanes[e]===`right`),O=o.width>=It,k=O&&(t||D||E[0].length>0&&E[1].length>0);(0,Z.useLayoutEffect)(()=>{let e=y.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>{let t=e.clientWidth,n={};for(let t of e.children)t instanceof HTMLElement&&t.dataset.workbenchItem&&(n[t.dataset.workbenchItem]=Math.ceil(t.getBoundingClientRect().height));s(e=>e.width===t&&Object.keys(e.heights).length===Object.keys(n).length&&Object.entries(n).every(([t,n])=>e.heights[t]===n)?e:{width:t,heights:n})},n=new ResizeObserver(t);n.observe(e);for(let t of e.children)n.observe(t);return t(),()=>n.disconnect()},[e,t,k,w]);function A(e,t){let{lane:n,anchor:o,after:s}=t;g(i),a(t=>{let r=t.order.filter(t=>t!==e);return r.splice(o?r.indexOf(o)+ +!!s:r.length,0,e),{...t,order:r,lanes:{...t.lanes,[e]:n}}}),v(r?`已移动「${T.get(e)?.label}」`:`Moved ${T.get(e)?.label}`)}function M(){l(void 0),d(void 0)}function N(e,t){!c||e.dataTransfer.getData(Mt)!==c||t.anchor===c||(e.preventDefault(),A(c,t),M())}function P(e,t){!c||t.anchor===c||(e.preventDefault(),e.dataTransfer.dropEffect=`move`,d(e=>e?.lane===t.lane&&e.anchor===t.anchor&&e.after===t.after?e:t))}function F(e,t,n){let r=e.currentTarget.getBoundingClientRect();return{lane:t,anchor:n,after:e.clientY>=r.top+r.height/2}}function I(e){let t=Wt(e,Pt,C);t!==w&&a(e=>({...e,ratio:t/S}))}function L(e){let t=b.current;t&&(b.current=null,p(void 0),e?a(t.before):i.ratio!==t.before.ratio&&g(t.before))}function R(e,t){a(n=>{let r=n.sizes[e];if(r?.width===t.width&&r?.height===t.height)return n;let i={...n.sizes,[e]:t};return t.width===void 0&&t.height===void 0&&delete i[e],{...n,sizes:i}})}function z(e){i.sizes[e.id]&&(g(i),R(e.id,{}),v(r?`「${e.label}」已恢复自动尺寸`:`${e.label} restored to automatic size`))}function B(e,t){let n=x.current;if(n)if(x.current=null,p(void 0),t)a(n.before);else{let t=n.before.sizes[e.id],a=i.sizes[e.id];(a?.width!==t?.width||a?.height!==t?.height)&&(g(n.before),v(r?`已调整「${e.label}」大小`:`Resized ${e.label}`))}}let V=r?[`左栏`,`右栏`,`全宽`]:[`Left column`,`Right column`,`Full width`],H=[0,0,0],U=new Map,W=At.filter((e,n)=>t&&E[n].length===0);for(let[e,t]of At.entries()){let n=e===1?w+Nt:0,r=e===0?w:e===1?S-w:o.width;t===`full`&&(H[2]=Math.max(H[0],H[1]));let i=E[e].map(e=>e.id);W.includes(t)&&i.push(t);for(let t of i)U.set(t,{top:H[e],left:n,width:r}),H[e]+=(o.heights[t]??0)+Nt}return(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`sr-only`,role:`status`,children:_}),t?(0,Q.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-x-3 text-xs text-fg-muted`,children:[(0,Q.jsx)(`p`,{children:r?`拖动上方手柄移动卡片,拖动右下角调整大小。`:`Drag the top handle to move a card, or its bottom-right corner to resize.`}),(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsxs)(Y,{variant:`ghost`,className:`rounded-lg text-xs`,disabled:!m,onClick:()=>{m&&(a(m),g(void 0),v(r?`已撤销布局调整`:`Layout change undone`))},children:[(0,Q.jsx)(G,{className:`size-3.5`,"aria-hidden":!0}),r?`撤销`:`Undo`]}),(0,Q.jsx)(Y,{variant:`ghost`,className:`rounded-lg text-xs`,onClick:()=>{g(i),a(Vt)},children:r?`恢复默认布局`:`Reset layout`})]})]}):null,(0,Q.jsxs)(`div`,{ref:y,className:K(`relative min-w-0`,!k&&`flex flex-col gap-6`,f&&`select-none`),style:k?{height:Math.max(0,H[2]-Nt)}:void 0,children:[k?(0,Q.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":r?`调整左右栏宽度`:`Resize workbench columns`,"aria-valuemin":Pt,"aria-valuemax":C,"aria-valuenow":w,tabIndex:0,title:r?`左右拖动调整栏宽,双击恢复默认`:`Drag to resize columns, double-click to reset`,className:`group absolute top-0 z-10 flex w-6 touch-none cursor-col-resize items-start justify-center rounded-lg pt-3 focus-visible:outline-2 focus-visible:outline-accent`,style:{left:w,height:Math.max(0,Math.max(H[0],H[1])-Nt)},onPointerDown:e=>{e.button!==0||f||(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),b.current={id:e.pointerId,x:e.clientX,width:w,before:i},p(`columns`))},onPointerMove:e=>{let t=b.current;t?.id===e.pointerId&&I(t.width+e.clientX-t.x)},onPointerUp:()=>L(!1),onPointerCancel:()=>L(!0),onLostPointerCapture:()=>L(!0),onDoubleClick:()=>{g(i),a(e=>({...e,ratio:Lt}))},onKeyDown:e=>{let t={ArrowLeft:w-16,ArrowRight:w+16,Home:Pt,End:C};Object.hasOwn(t,e.key)&&(e.preventDefault(),g(i),I(t[e.key]))},children:(0,Q.jsx)(`span`,{"aria-hidden":!0,className:K(`h-8 w-px rounded-full bg-edge-strong motion-safe:transition-colors group-hover:bg-accent`,f===`columns`&&`bg-accent`)})}):null,E.flatMap((e,n)=>e.map((a,s)=>{let m=At[n],_=u?.anchor===a.id,y=r?`移动「${a.label}」`:`Move ${a.label}`,b=r?`调整「${a.label}」大小`:`Resize ${a.label}`,S=U.get(a.id),C=(k?S?.width:o.width)??o.width,w=i.sizes[a.id],T=O&&w?.width!==void 0?Math.min(C,w.width):void 0,E=w?.height,D=f===a.id,I=`home-workbench-content-${a.id}`;return(0,Q.jsxs)(`div`,{"data-workbench-item":a.id,"data-workbench-lane":m,className:K(`relative min-w-0`,k&&`absolute`,c===a.id&&`opacity-50`,t&&`rounded-xl bg-surface-panel pb-3 pointer-coarse:pb-8`,t&&`[&_[data-workbench-panel]]:bg-transparent`,D&&`ring-2 ring-accent`),style:k?{...S,width:T??S?.width}:{width:T},onDragOver:c?e=>P(e,F(e,m,a.id)):void 0,onDrop:c?e=>N(e,F(e,m,a.id)):void 0,onDragLeave:e=>{e.relatedTarget instanceof Node&&e.currentTarget.contains(e.relatedTarget)||d(e=>e?.anchor===a.id?void 0:e)},children:[_?(0,Q.jsx)(`span`,{"aria-hidden":!0,className:K(`pointer-events-none absolute inset-x-0 z-10 h-0.5 rounded-full bg-accent`,u.after?`-bottom-2`:`-top-2`)}):null,t?(0,Q.jsx)(`div`,{className:`flex justify-start px-2 pt-1`,children:(0,Q.jsx)(X,{title:y,size:`compact`,trigger:(0,Q.jsx)(Y,{variant:`ghost`,className:`h-7 cursor-grab rounded-lg px-3 py-0 active:cursor-grabbing`,"aria-label":y,title:y,draggable:!0,onDragStart:e=>{let t=e.currentTarget.closest(`[data-workbench-item]`);if(t){let n=t.getBoundingClientRect();e.dataTransfer.setDragImage(t,e.clientX-n.left,e.clientY-n.top)}e.dataTransfer.setData(Mt,a.id),e.dataTransfer.effectAllowed=`move`,l(a.id)},onDragEnd:M,children:(0,Q.jsx)(j,{className:`size-4`,"aria-hidden":!0})}),children:(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:Ut,disabled:s===0,onClick:()=>A(a.id,{lane:m,anchor:e[s-1]?.id}),children:r?`上移`:`Move up`})}),(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:Ut,disabled:s===e.length-1,onClick:()=>A(a.id,{lane:m,anchor:e[s+1]?.id,after:!0}),children:r?`下移`:`Move down`})}),At.map((e,t)=>(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:Ut,disabled:e===m,onClick:()=>A(a.id,{lane:e}),children:r?`移到${V[t]}`:`Move to ${V[t].toLowerCase()}`})},e)),(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:Ut,disabled:!w,onClick:()=>z(a),children:r?`恢复自动尺寸`:`Restore automatic size`})})]})})}):null,(0,Q.jsx)(`div`,{id:I,"data-workbench-card-scroll":E===void 0?void 0:``,className:K(`min-w-0 rounded-xl`,t&&(a.id===`delivery`||a.id===`resume`)&&`px-3`,E!==void 0&&`overflow-auto overscroll-y-auto focus-visible:outline-2 focus-visible:outline-accent [&>section]:min-h-full [&>section:has(>[data-workbench-fill])]:flex [&>section:has(>[data-workbench-fill])]:flex-col [&>section>[data-workbench-fill]]:grow`),style:{height:E},role:E===void 0?void 0:`group`,"aria-label":E===void 0?void 0:a.label,tabIndex:E===void 0?void 0:0,children:a.content}),t?(0,Q.jsxs)(Q.Fragment,{children:[D?(0,Q.jsxs)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute bottom-2 right-9 z-10 rounded-md bg-accent-soft px-2 py-1 text-xs tabular-nums text-accent-fg`,children:[O?`${T??C} × `:``,E??x.current?.height,` px`]}):null,(0,Q.jsx)(Y,{variant:`segmented`,className:K(`absolute bottom-0 right-0 z-10 size-8 touch-none rounded-none rounded-br-xl p-0 active:scale-100`,`pointer-fine:[clip-path:polygon(0_75%,75%_75%,75%_0,100%_0,100%_100%,0_100%)]`,`after:pointer-events-none after:absolute after:inset-0 after:rounded-br-xl after:border-b-2 after:border-r-2 after:border-accent after:opacity-0 motion-safe:after:transition-opacity hover:after:opacity-100 focus-visible:after:opacity-100`,O?`cursor-nwse-resize`:`cursor-ns-resize`,D&&`after:opacity-100`),"aria-label":b,"aria-controls":I,title:r?`拖动或使用方向键调整大小,双击恢复自动尺寸`:`Drag or use arrow keys to resize. Double-click to restore automatic size.`,onPointerDown:e=>{if(e.button!==0||f)return;let t=document.getElementById(I)?.getBoundingClientRect();t&&(e.currentTarget.focus({preventScroll:!0}),e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),x.current={pointer:e.pointerId,x:e.clientX,y:e.clientY,width:Math.round(t.width),height:Math.round(t.height),before:i},p(a.id))},onPointerMove:e=>{let t=x.current;if(t?.pointer!==e.pointerId)return;let n=t.before.sizes[a.id],r=e.clientX-t.x,i=e.clientY-t.y;R(a.id,{width:O&&r!==0?Wt(t.width+r,Rt,C):n?.width,height:i===0?n?.height:Wt(t.height+i,zt,Bt)})},onPointerUp:()=>B(a,!1),onPointerCancel:()=>B(a,!0),onLostPointerCapture:()=>B(a,!0),onDoubleClick:()=>z(a),onKeyDown:e=>{if(e.key===`Escape`&&D){e.preventDefault();let t=x.current?.pointer;B(a,!0),t!==void 0&&e.currentTarget.hasPointerCapture(t)&&e.currentTarget.releasePointerCapture(t);return}if(e.key===`Home`||e.key===`Enter`||e.key===` `){e.preventDefault(),z(a);return}let t=e.key===`ArrowLeft`||e.key===`ArrowRight`,n=e.key===`ArrowUp`||e.key===`ArrowDown`;if((!t||!O)&&!n)return;let o=document.getElementById(I)?.getBoundingClientRect();if(!o)return;e.preventDefault();let s=e.key===`ArrowLeft`||e.key===`ArrowUp`?-16:16;g(i),R(a.id,{width:t?Wt((T??o.width)+s,Rt,C):w?.width,height:n?Wt((E??o.height)+s,zt,Bt):w?.height}),v(r?`已调整「${a.label}」大小`:`Resized ${a.label}`)}})]}):null]},a.id)})),W.map(e=>(0,Q.jsx)(`div`,{"data-workbench-item":e,className:K(`grid min-h-16 place-items-center rounded-xl border border-dashed border-edge-strong text-xs text-fg-muted`,k&&`absolute`,u?.lane===e&&!u.anchor&&`border-accent bg-accent-soft text-accent-fg`),style:k?U.get(e):void 0,onDragOver:t=>P(t,{lane:e}),onDrop:t=>N(t,{lane:e}),onDragLeave:()=>d(t=>t?.lane===e&&!t.anchor?void 0:t),children:V[At.indexOf(e)]},e))]})]})}function Kt(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}var qt=`xopc-home-read-deliveries`,Jt=`min-w-0 rounded-xl bg-surface-panel`,Yt=`text-base font-semibold tracking-tight text-fg`,Xt=`@min-[54rem]/workbench:grid-cols-[minmax(0,1fr)_minmax(19rem,0.57fr)]`;function Zt(){try{let e=JSON.parse(localStorage.getItem(qt)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`).slice(0,300):[]}catch{return[]}}function Qt(){let e=(0,We.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(q,{className:`h-56 rounded-xl`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`div`,{className:`grid items-start gap-6 ${Xt}`,"aria-busy":!0,children:[(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[t,(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(q,{className:`h-5 w-28 rounded-md`}),(0,Q.jsx)(q,{className:`h-24 rounded-xl`})]})]}),(0,Q.jsx)(q,{className:`h-44 rounded-xl`})]}),e[1]=n):n=e[1],n}function $t(e){if(e.primaryAction?.type===`task_review`||e.primaryAction?.type===`retry_task`)return e.primaryAction.taskId;let t=e.openAction??e.primaryAction,n=t?.type===`open`?/^\/tasks\/([^/?#]+)/.exec(t.href):null;if(n)try{return decodeURIComponent(n[1])}catch{return n[1]}}function en(e){let t=(0,We.c)(80),{item:n,busy:r,primary:i,dueLabel:a,failureLabel:o,locale:s,onAction:c,onOpenReview:l,actionError:u}=e,d;t[0]===n?d=t[1]:(d=$t(n),t[0]=n,t[1]=d);let p=d,[m,h]=(0,Z.useState)(!1),g;t[2]===s?g=t[3]:(g=f(s),t[2]=s,t[3]=g);let _=g.projectsPage.home.workbench,v=n.primaryAction?.type===`connector_decision`,y;t[4]!==a||t[5]!==n.dueAt||t[6]!==s?(y=n.dueAt===void 0?null:`${a} ${Ne(n.dueAt,s)}`,t[4]=a,t[5]=n.dueAt,t[6]=s,t[7]=y):y=t[7];let b=y,x;t[8]!==v||t[9]!==n.summary||t[10]!==s?(x=v?n.summary.split(`
|
|
8
|
+
`)[0]:Re(n.summary,s),t[8]=v,t[9]=n.summary,t[10]=s,t[11]=x):x=t[11];let S;t[12]!==n.projectName||t[13]!==x?(S=[n.projectName,x].filter(Boolean),t[12]=n.projectName,t[13]=x,t[14]=S):S=t[14];let C=S.join(` · `),w=!!(p&&(n.primaryAction?.type===`task_review`||n.primaryAction?.type===`open`)),T;t[15]!==n.id||t[16]!==c?(T=async e=>{await c(e,n.id)&&h(!1)},t[15]=n.id,t[16]=c,t[17]=T):T=t[17];let E=T,D;t[18]!==n.id||t[19]!==n.openAction||t[20]!==n.title||t[21]!==c?(D=n.openAction?(0,Q.jsx)(`button`,{type:`button`,className:`touch-target min-w-0 break-words rounded-sm text-left text-sm font-semibold text-fg hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent`,onClick:()=>c(n.openAction,n.id),children:n.title}):(0,Q.jsx)(`span`,{className:`break-words text-sm font-semibold text-fg`,children:n.title}),t[18]=n.id,t[19]=n.openAction,t[20]=n.title,t[21]=c,t[22]=D):D=t[22];let O;t[23]!==b||t[24]!==o||t[25]!==n.kind?(O=b||n.kind===`failure`?(0,Q.jsx)(`span`,{className:`rounded-md bg-warning-soft px-1.5 py-0.5 text-xs text-fg-muted`,children:b??o}):null,t[23]=b,t[24]=o,t[25]=n.kind,t[26]=O):O=t[26];let k;t[27]!==D||t[28]!==O?(k=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1`,children:[D,O]}),t[27]=D,t[28]=O,t[29]=k):k=t[29];let A;t[30]===C?A=t[31]:(A=(0,Q.jsx)(`p`,{className:`mt-1 line-clamp-2 break-words text-xs leading-5 text-fg-muted`,children:C}),t[30]=C,t[31]=A);let j;t[32]!==A||t[33]!==k?(j=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 basis-52`,children:[k,A]}),t[32]=A,t[33]=k,t[34]=j):j=t[34];let M;t[35]!==n.primaryAction?.type||t[36]!==s||t[37]!==l||t[38]!==p?(M=p&&n.primaryAction?.type===`retry_task`?(0,Q.jsx)(Y,{variant:`ghost`,className:`min-h-9 px-2 text-xs`,"aria-haspopup":`dialog`,onClick:e=>l(p,e.currentTarget),children:s===`zh`?`查看结果与依据`:`View result and evidence`}):null,t[35]=n.primaryAction?.type,t[36]=s,t[37]=l,t[38]=p,t[39]=M):M=t[39];let N;t[40]!==v||t[41]!==r||t[42]!==n.id||t[43]!==n.primaryAction||t[44]!==c||t[45]!==l||t[46]!==w||t[47]!==i||t[48]!==p||t[49]!==_?(N=n.primaryAction?(0,Q.jsx)(Y,{type:`button`,variant:i?`primary`:`tonal`,className:`min-h-9 shrink-0 rounded-lg px-3 text-xs sm:shadow-none`,disabled:r,"aria-haspopup":v||w?`dialog`:void 0,onClick:e=>{v?h(!0):w&&p?l(p,e.currentTarget):c(n.primaryAction,n.id)},children:v?_.viewScope:n.primaryAction.label}):null,t[40]=v,t[41]=r,t[42]=n.id,t[43]=n.primaryAction,t[44]=c,t[45]=l,t[46]=w,t[47]=i,t[48]=p,t[49]=_,t[50]=N):N=t[50];let P;t[51]!==M||t[52]!==N?(P=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[M,N]}),t[51]=M,t[52]=N,t[53]=P):P=t[53];let F;t[54]!==j||t[55]!==P?(F=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[j,P]}),t[54]=j,t[55]=P,t[56]=F):F=t[56];let I;t[57]!==u||t[58]!==v||t[59]!==r||t[60]!==E||t[61]!==n.primaryAction||t[62]!==n.secondaryActions||t[63]!==n.summary||t[64]!==n.title||t[65]!==m||t[66]!==_?(I=v?(0,Q.jsxs)(X,{title:_.viewScope,subtitle:n.title,open:m,onOpenChange:h,busy:r,size:`compact`,footer:(0,Q.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[n.secondaryActions.map(e=>(0,Q.jsx)(Y,{disabled:r,onClick:()=>void E(e),children:e.label},e.label)),(0,Q.jsx)(Y,{variant:`primary`,disabled:r,onClick:()=>void E(n.primaryAction),children:n.primaryAction?.label})]}),children:[(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm text-fg-muted`,children:n.summary}),u?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:u}):null]}):null,t[57]=u,t[58]=v,t[59]=r,t[60]=E,t[61]=n.primaryAction,t[62]=n.secondaryActions,t[63]=n.summary,t[64]=n.title,t[65]=m,t[66]=_,t[67]=I):I=t[67];let L;t[68]!==v||t[69]!==r||t[70]!==n.id||t[71]!==n.secondaryActions||t[72]!==c||t[73]!==w?(L=!v&&!w&&n.secondaryActions.length?(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:n.secondaryActions.filter(tn).map(e=>(0,Q.jsx)(Y,{variant:`ghost`,disabled:r,onClick:()=>void c(e,n.id),children:e.label},e.label))}):null,t[68]=v,t[69]=r,t[70]=n.id,t[71]=n.secondaryActions,t[72]=c,t[73]=w,t[74]=L):L=t[74];let R;return t[75]!==r||t[76]!==F||t[77]!==I||t[78]!==L?(R=(0,Q.jsxs)(`article`,{className:`px-4 py-3.5 sm:px-5 sm:py-4`,"aria-busy":r,children:[F,I,L]}),t[75]=r,t[76]=F,t[77]=I,t[78]=L,t[79]=R):R=t[79],R}function tn(e){return e.type!==`open`}function nn(e){let t=(0,We.c)(32),{item:n,onAction:r,language:i,onOpenReview:a}=e,o;t[0]===n?o=t[1]:(o=$t(n),t[0]=n,t[1]=o);let s=o,c;t[2]!==n.backgroundState||t[3]!==n.kind?(c=n.kind===`scheduled`?(0,Q.jsx)(x,{className:`size-4`,"aria-hidden":!0}):n.backgroundState===`paused`?(0,Q.jsx)(D,{className:`size-4`,"aria-hidden":!0}):(0,Q.jsx)(`span`,{className:`size-1.5 rounded-full bg-fg-subtle`,"aria-hidden":!0}),t[2]=n.backgroundState,t[3]=n.kind,t[4]=c):c=t[4];let l=c,u=!n.openAction,d=s?`dialog`:void 0,f;t[5]!==n.id||t[6]!==n.openAction||t[7]!==r||t[8]!==a||t[9]!==s?(f=e=>s?a(s,e.currentTarget):n.openAction&&void r(n.openAction,n.id),t[5]=n.id,t[6]=n.openAction,t[7]=r,t[8]=a,t[9]=s,t[10]=f):f=t[10];let p;t[11]===l?p=t[12]:(p=(0,Q.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-inset text-fg-muted`,children:l}),t[11]=l,t[12]=p);let m;t[13]===n.title?m=t[14]:(m=(0,Q.jsx)(`span`,{className:`block line-clamp-2 break-words text-sm font-medium text-fg`,children:n.title}),t[13]=n.title,t[14]=m);let h;t[15]!==n.kind||t[16]!==n.summary||t[17]!==n.updatedAt||t[18]!==i?(h=n.kind===`scheduled`?(0,Q.jsx)(`time`,{className:`block text-xs text-fg-muted`,dateTime:new Date(n.updatedAt).toISOString(),children:Ne(n.updatedAt,i)}):(0,Q.jsx)(`span`,{className:`block truncate text-xs text-fg-muted`,children:Re(n.summary,i)}),t[15]=n.kind,t[16]=n.summary,t[17]=n.updatedAt,t[18]=i,t[19]=h):h=t[19];let g;t[20]!==m||t[21]!==h?(g=(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[m,h]}),t[20]=m,t[21]=h,t[22]=g):g=t[22];let _;t[23]===n.openAction?_=t[24]:(_=n.openAction?(0,Q.jsxs)(`span`,{className:`flex max-w-[35%] shrink-0 items-center gap-1 text-right text-xs leading-4 text-fg-muted group-hover:text-fg`,children:[(0,Q.jsx)(`span`,{children:n.openAction.label}),(0,Q.jsx)(w,{className:`size-3.5 shrink-0`,"aria-hidden":!0})]}):null,t[23]=n.openAction,t[24]=_);let v;return t[25]!==_||t[26]!==u||t[27]!==d||t[28]!==f||t[29]!==p||t[30]!==g?(v=(0,Q.jsxs)(`button`,{type:`button`,className:`group flex min-h-12 w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left motion-safe:transition-colors enabled:hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-accent`,disabled:u,"aria-haspopup":d,onClick:f,children:[p,g,_]}),t[25]=_,t[26]=u,t[27]=d,t[28]=f,t[29]=p,t[30]=g,t[31]=v):v=t[31],v}function rn(){let e=u(e=>e.language),t=f(e),n=t.projectsPage,r=ve(e),i=s(),l=o(),[d,x]=a(),C=d.get(`reviewTask`),E=(0,Z.useRef)(null),D=(e,t)=>{E.current=t,x(t=>{let n=new URLSearchParams(t);return n.set(`reviewTask`,e),n})},O=()=>{x(e=>{let t=new URLSearchParams(e);return t.delete(`reviewTask`),t},{replace:!0})},k=Te(e=>e.setPageHeader),A=Te(e=>e.clearPageHeader),[j,M]=(0,Z.useState)(!1),[P,I]=(0,Z.useState)(!1),{home:L,loading:B,loadError:H,setLoadError:W,load:G}=Ge(e,l.key,!0),K=n.home.workbench,q=(0,Z.useRef)(null),[ne,re]=(0,Z.useState)(null),[ie,ae]=(0,Z.useState)(Zt),J=(0,Z.useRef)(null),[le,ue]=(0,Z.useState)(!1),[de,_e]=(0,Z.useState)(!1),[be,xe]=(0,Z.useState)(``),Ee=(0,Z.useRef)(!1),[Oe,ke]=(0,Z.useState)(),[Ie,Le]=(0,Z.useState)(!1),[ze,Be]=(0,Z.useState)(null),[Ve,He]=(0,Z.useState)(!1),[Ue,We]=(0,Z.useState)(),[Ke,Je]=(0,Z.useState)(!1),[Ye,Xe]=(0,Z.useState)(0),[Ze,Qe]=(0,Z.useState)(),[$e,et]=(0,Z.useState)(),[nt,rt]=(0,Z.useState)(!1),$=Ae({chat:t.chat}),it=(0,Z.useRef)(null),at=we({disabled:nt,chat:t.chat,onTranscript:e=>{xe(t=>ye(t,e)),window.setTimeout(()=>it.current?.focus(),0)}}),{phase:ot,voiceActive:st,startVoiceInput:ct,cancelVoiceInput:lt,confirmVoiceInput:ut,retryVoiceInput:dt}=at;(0,Z.useEffect)(()=>{if(!Ze)return;let e=window.setTimeout(()=>Qe(void 0),8e3);return()=>window.clearTimeout(e)},[Ze]);let ft=(0,Z.useCallback)(async e=>{if(!(e.length===0||nt)){rt(!0);try{await $.processFiles(e)}finally{rt(!1)}}},[nt,$.processFiles]),pt=(0,Z.useCallback)(async e=>{let t=Se(e.clipboardData);t.length!==0&&(e.preventDefault(),await ft(t))},[ft]),mt=(0,Z.useCallback)(e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,$.setIsDragging(!0))},[$.setIsDragging]),ht=(0,Z.useCallback)(e=>{let t=e.relatedTarget;(!(t instanceof Node)||!e.currentTarget.contains(t))&&$.setIsDragging(!1)},[$.setIsDragging]),_t=(0,Z.useCallback)(async e=>{e.preventDefault(),$.setIsDragging(!1),await ft(Array.from(e.dataTransfer.files))},[$.setIsDragging,ft]),vt=(0,Z.useCallback)(e=>{e.preventDefault();let t=$.wireAttachmentsPayload(),n=t.length>0?Ce(t):void 0,r=De(be,n,{projectScope:`none`});r&&(_e(!1),xe(``),$.clearAttachments(),i(r))},[$.clearAttachments,$.wireAttachmentsPayload,be,i]),yt=$.attachments.length>=10,xt={attachTitle:yt?Kt(t.chat.maxAttachmentsReached,{max:10}):`${t.chat.attachFile} (${$.attachments.length}/10)`,dropFiles:t.chat.dropFiles,intentLabel:r.intentLabel,intentPlaceholder:r.intentPlaceholder,intentSuggestion:r.intentSuggestion,shortcut:n.home.submitShortcut,submit:r.newWork},St=(0,Z.useMemo)(()=>({label:n.home.advisorStatusLabel,ready:n.home.advisorStatusReady,clarification:n.home.advisorStatusClarification,refreshing:n.home.advisorStatusRefreshing,refreshingDetail:n.home.advisorRefreshing,idle:n.home.advisorStatusIdle,idleDetail:n.home.advisorUnavailableTitle,generationFailed:n.home.advisorStatusGenerationFailed,budgetExhausted:n.home.advisorStatusBudgetExhausted,modelUnavailable:n.home.advisorStatusModelUnavailable,generationFailedDetail:n.home.advisorGenerationFailed,budgetExhaustedDetail:n.home.advisorBudgetExhausted,modelUnavailableDetail:n.home.advisorModelUnavailable,history:n.home.advisorHistory,retry:n.home.retry,findAnother:n.home.advisorRefresh}),[n.home]),Ct=(L?.recentDeliveries??[]).map(e=>ie.includes(e.id)?{...e,read:!0}:e),wt=Date.now(),Et=Ct.filter(e=>!e.read&&e.completedAt>=wt-10080*6e4),kt=L?.resumable??[],At=(L?.needsUser.length??0)+(L?.attentionPolicy?.suppressedAttentionCount??0)+(L?.attentionPolicy?.suppressedDecisionCount??0),jt=new Date(wt);jt.setHours(24,0,0,0);let Mt=L?.needsUser.filter(e=>e.dueAt!==void 0&&e.dueAt>=wt&&e.dueAt<jt.getTime()).length??0,Nt=L?.background??[],Pt=C?L?.needsUser.find(e=>$t(e)===C):void 0,Ft=Pt??(C?Nt.find(e=>$t(e)===C):void 0),It=Nt.filter(e=>e.kind!==`scheduled`),Lt=Nt.filter(e=>e.kind===`scheduled`),Rt=L?.advisor.state===`ready`||L?.advisor.state===`clarification`||!!Ue;(0,Z.useEffect)(()=>{if(!Ue)return;let e=window.setTimeout(()=>We(void 0),8e3);return()=>window.clearTimeout(e)},[Ue]);let zt=L?At>0?`attention`:Et.length>0?`delivery`:kt.length>0||It.length>0||L.runningConversations?.length||Rt?`resume`:`idle`:void 0,Bt=zt===`idle`,Vt=Bt&&!de,Ht=Vt||de,Ut=(0,Z.useRef)(zt),Wt=(0,Z.useRef)(!1);(0,Z.useLayoutEffect)(()=>{let e=Ut.current;if(Ut.current=zt,!e||!zt||zt===e||(Wt.current&&(Wt.current=!1,document.activeElement===document.body&&q.current?.focus({preventScroll:!0})),window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches))return;let t=q.current?.animate?.([{opacity:.7,transform:`translateY(4px)`},{opacity:1,transform:`translateY(0)`}],{duration:180,easing:`ease-out`});return()=>t?.cancel()},[zt]),(0,Z.useEffect)(()=>{let e=e=>{(e.key===qt||e.key===null)&&ae(Zt())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]);let Xt=(0,Z.useCallback)(e=>{ae(t=>[...new Set([e,...t])].slice(0,300));try{localStorage.setItem(qt,JSON.stringify([...new Set([e,...Zt()])].slice(0,300)))}catch{}},[]);(0,Z.useEffect)(()=>{!Ht&&st&<()},[lt,Ht,st]),(0,Z.useEffect)(()=>{let e=e=>{let t=e.detail?.target;t&&t!==`chat`||!Ht||nt||(e.preventDefault(),ot===`recording`?ut():ot===`idle`?(it.current?.focus(),ct()):ot===`error`&&dt())},t=e=>{let t=e.detail?.target;t&&t!==`chat`||!Ht||!st||(e.preventDefault(),lt(),it.current?.focus())};return window.addEventListener(Me,e),window.addEventListener(je,t),()=>{window.removeEventListener(Me,e),window.removeEventListener(je,t)}},[nt,lt,Ht,ut,dt,ct,st,ot]);let tn=(0,Z.useCallback)(e=>{e||lt(),_e(e)},[lt]),rn=(0,Z.useCallback)(async(t,n)=>{if(t.type===`open`)return i(F(`/`,t.href)),!0;if(t.type===`task_review`||Ee.current)return!1;Ee.current=!0,Be(n);let r=L?.needsUser.findIndex(e=>e.id===n)??-1,a=r<0?void 0:{item:L?.needsUser[r],slot:r};ke(void 0),W(null);try{if(t.type===`retry_task`)await Fe(t.taskId,e),ke({...a,message:e===`zh`?`任务已重新开始,可查看执行进度。`:`Task restarted. View progress.`,href:F(`/`,`/tasks/${encodeURIComponent(t.taskId)}`)});else if(t.type===`connector_decision`)await ge({kind:`connector_approval`,approvalId:t.approvalId},t.decision),ke({...a,message:e===`zh`?t.decision===`approve`?`已批准授权,任务状态将自动更新。`:`已拒绝授权。`:t.decision===`approve`?`Permission approved. Task status will update.`:`Permission denied.`});else if(t.type===`retry_run`){let n=await se({kind:t.subjectKind,runId:t.runId});ke({...a,message:e===`zh`?`已发起重试,可查看新的执行结果。`:`Retry started. Follow the new execution.`,href:n.conversationId?`/chat/${encodeURIComponent(n.conversationId)}`:`/automations?run=${encodeURIComponent(n.runId)}`})}else t.type===`acknowledge_run`&&(await pe({kind:t.subjectKind,runId:t.runId}),ke({...a,message:e===`zh`?`已确认此异常,已从待处理事项移除。`:`Issue acknowledged and removed from pending items.`}));return Wt.current=!0,await G(),!0}catch(e){return W(e instanceof Error?e.message:String(e)),!1}finally{Ee.current=!1,Be(null)}},[L,e,G,i]),an=(0,Z.useCallback)((t,n)=>{let r=t.task.phase===`closed`&&t.task.resolution===`done`?fe(t):void 0;r&&Xt(`task:${r.runId}`),Wt.current=!0;let i=n?L?.needsUser.findIndex(e=>e.id===n.id):void 0;ke({item:n,slot:i,message:e===`zh`?t.task.phase===`closed`?`任务已验收完成。`:`操作已保存,任务状态已更新。`:t.task.phase===`closed`?`Task accepted.`:`Action saved. Task status updated.`,href:F(`/`,`/tasks/${encodeURIComponent(t.task.id)}`)}),G()},[L,e,G,Xt]),on=(0,Z.useCallback)(()=>{He(!0),We(void 0),et(void 0),W(null),me(e).then(()=>G()).catch(e=>W(e instanceof Error?e.message:String(e))).finally(()=>He(!1))},[e,G]),sn=(0,Z.useCallback)((e,t)=>{He(!0),W(null),ce(e,t).then(async t=>{if(t.outcome===`needs_setup`){et({opportunityId:e.id,value:t.preflight});return}if(et(void 0),Xe(e=>e+1),t.outcome===`task`){ue(!1),We({title:n.home.advisorStartedTitle,detail:Kt(n.home.advisorStartedDetail,{title:e.title}),href:F(`/`,t.href)}),await G();return}i(t.href)}).catch(e=>W(e instanceof Error?e.message:String(e))).finally(()=>He(!1))},[G,i,n.home.advisorStartedDetail,n.home.advisorStartedTitle]),cn=(0,Z.useCallback)((e,t)=>{He(!0),We(void 0),et(void 0),W(null),oe(e,{kind:t,snoozedUntil:t===`too_early`?Date.now()+4320*6e4:void 0}).then(({idempotencyKey:t})=>(ue(!1),Qe({opportunityId:e.id,idempotencyKey:t}),Xe(e=>e+1),G())).catch(e=>W(e instanceof Error?e.message:String(e))).finally(()=>He(!1))},[G]),ln=(0,Z.useCallback)(()=>{if(!Ze)return;let e=Ze;Qe(void 0),He(!0),W(null),he(e.opportunityId,e.idempotencyKey).then(()=>(Xe(e=>e+1),G())).catch(t=>{Qe(e),W(t instanceof Error?t.message:String(t))}).finally(()=>He(!1))},[Ze,G]),un=(0,Z.useCallback)((e,t)=>{i(`/chat/new?${new URLSearchParams({draft:`${e}\n\n${t}`}).toString()}`)},[i]),dn=e=>{J.current=document.activeElement instanceof HTMLElement?document.activeElement:null,re(e)},fn=e=>{Xt(e.id),re(null),ke({message:K.deliverySaved}),G()},pn=L?.needsUser.slice(0,2)??[],mn=At-pn.length,hn=Oe?(0,Q.jsxs)(`div`,{className:`mb-3 flex w-full flex-wrap items-center justify-between gap-2 rounded-lg bg-success-soft px-3 py-1.5 text-xs text-fg`,children:[(0,Q.jsx)(`span`,{children:Oe.message}),Oe.href?(0,Q.jsx)(Y,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>i(Oe.href),children:e===`zh`?`查看进展与结果`:`View progress and result`}):null]}):null,gn=Oe?.item&&!L?.needsUser.some(e=>e.id===Oe.item?.id)&&(Oe.slot??1/0)<2?Oe.item:void 0,_n=[...pn];gn&&_n.splice(Oe?.slot??0,0,gn);let vn=(L?.runningConversations??[]).map(t=>({id:t.runId,kind:`running`,title:t.title??(e===`zh`?`对话正在执行`:`Conversation in progress`),summary:K.inProgress,updatedAt:t.updatedAt,secondaryActions:[],openAction:{type:`open`,label:K.inProgress,href:`/chat/${encodeURIComponent(t.conversationId)}`}})),yn=[...It,...vn].sort((e,t)=>t.updatedAt-e.updatedAt),bn=zt===`attention`&&!Ue,xn=L?.advisor.state===`ready`?L.advisor.primary.title:L?.advisor.state===`clarification`?L.advisor.question.question:void 0,Sn=Et.length>0?(0,Q.jsxs)(`section`,{className:`space-y-2`,"aria-labelledby":`home-delivery-title`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-9 flex-wrap items-center justify-between gap-x-3 pl-1`,children:[(0,Q.jsx)(`h2`,{id:`home-delivery-title`,className:Yt,children:K.progress}),(0,Q.jsxs)(Y,{variant:`ghost`,className:`rounded-lg px-2 text-xs`,onClick:()=>dn(`history`),children:[K.deliveryHistory,(0,Q.jsx)(b,{className:`size-3.5`,"aria-hidden":!0})]})]}),(0,Q.jsx)(`div`,{className:`${Jt} space-y-1`,"data-workbench-fill":!0,"data-workbench-panel":!0,children:Et.slice(0,zt===`attention`?1:3).map((t,n)=>(0,Q.jsx)(Dt,{item:t,language:e,showNew:!0,primary:zt===`delivery`&&n===0,onOpen:()=>dn(t)},t.id))})]}):null,Cn=[{title:K.inProgress,items:yn.filter(e=>!e.backgroundState&&!e.statusLabel)},{title:K.waiting,items:yn.filter(e=>e.backgroundState===`waiting`||!e.backgroundState&&e.statusLabel)},{title:K.paused,items:yn.filter(e=>e.backgroundState===`paused`)},{title:K.scheduled,items:Lt}].filter(e=>e.items.length>0),wn=zt===`attention`?1:3,Tn=t=>Cn.map(({title:n,items:r})=>(0,Q.jsxs)(`div`,{className:`pt-3`,children:[(0,Q.jsx)(`h3`,{className:`mb-1 px-2 text-xs font-medium text-fg-muted`,children:n}),(0,Q.jsx)(`div`,{className:`space-y-1`,children:(t===void 0?r:r.slice(0,t)).map(t=>(0,Q.jsx)(nn,{item:t,language:e,onAction:rn,onOpenReview:D},t.id))})]},n)),En=Cn.length?(0,Q.jsxs)(`section`,{className:Jt,"aria-labelledby":`home-background-title`,"data-workbench-panel":!0,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 px-4 pb-1 pt-4`,children:[(0,Q.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,Q.jsx)(N,{className:`size-4`,"aria-hidden":!0})}),(0,Q.jsx)(`h2`,{id:`home-background-title`,className:Yt,children:K.background})]}),(0,Q.jsxs)(`div`,{className:`px-3 pb-3`,children:[Tn(wn),Cn.some(({items:e})=>e.length>wn)?(0,Q.jsx)(X,{title:K.background,open:Ie,onOpenChange:Le,trigger:(0,Q.jsxs)(Y,{variant:`ghost`,className:`mt-2 w-full justify-start rounded-lg px-2 text-xs`,children:[e===`zh`?`查看全部 ${yn.length+Lt.length} 项`:`View all ${yn.length+Lt.length} items`,(0,Q.jsx)(w,{className:`size-3.5`,"aria-hidden":!0})]}),children:Tn()}):null]})]}):null,Dn=!L?.observation&&Rt,On=(t,i)=>(0,Q.jsx)(en,{item:t,primary:i,busy:ze!==null,dueLabel:n.home.dueLabel,failureLabel:r.runAttention,locale:e,onAction:rn,onOpenReview:D,actionError:Re(H??void 0,e)},t.id),kn=At>0?(0,Q.jsxs)(`section`,{className:Jt,"aria-labelledby":`home-needs-user-title`,"data-workbench-panel":!0,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-2 px-4 pb-1 pt-4 sm:px-5`,children:[(0,Q.jsx)(`span`,{className:`mr-0.5 grid size-9 shrink-0 place-items-center rounded-lg bg-warning-soft text-fg`,children:(0,Q.jsx)(T,{className:`size-[18px]`,"aria-hidden":!0})}),(0,Q.jsx)(`h2`,{id:`home-needs-user-title`,className:`text-lg font-semibold tracking-tight text-fg sm:text-xl`,children:K.attention}),(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2 py-0.5 text-xs font-semibold tabular-nums text-fg-muted`,"aria-live":`polite`,"aria-label":Kt(n.home.attentionTitle,{count:At}),children:At}),Mt>0?(0,Q.jsx)(`span`,{className:`ml-auto rounded-md bg-warning-soft px-2 py-1 text-xs text-fg-muted`,children:Kt(K.dueToday,{count:Mt})}):null]}),(0,Q.jsxs)(`div`,{className:`space-y-1 pb-2`,children:[_n.map((t,n)=>t===gn?(0,Q.jsxs)(`div`,{className:`flex min-h-16 items-center justify-between gap-3 px-4 py-3 text-sm text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:t.title}),(0,Q.jsx)(S,{className:`size-4 shrink-0 text-success`,"aria-label":e===`zh`?`已处理`:`Handled`})]},t.id):On(t,n===0||n===1&&_n[0]===gn)),mn>0?(0,Q.jsx)(`div`,{className:`px-2 py-1.5 sm:px-3`,children:(0,Q.jsxs)(X,{title:K.attention,open:j,onOpenChange:M,trigger:(0,Q.jsxs)(Y,{variant:`ghost`,className:`w-full justify-start rounded-lg px-2 text-xs`,children:[Kt(K.remaining,{count:mn}),(0,Q.jsx)(w,{className:`size-3.5`,"aria-hidden":!0})]}),children:[H?(0,Q.jsx)(`p`,{role:`alert`,className:`mb-3 text-sm text-danger`,children:Re(H,e)}):null,(0,Q.jsx)(`div`,{role:`status`,children:hn}),L?.needsUser.map((e,t)=>On(e,t===0))]})}):null]})]}):null,An=Dn&&L?(0,Q.jsx)(tt,{advisor:L.advisor,busy:Ve,copy:{aiLabel:n.home.advisorAiLabel,why:n.home.advisorWhy,evidence:n.home.advisorEvidence,needsSetup:n.home.advisorNeedsSetup,start:n.home.advisorStart,discuss:n.home.advisorDiscuss,refresh:n.home.advisorRefresh,refreshing:n.home.advisorRefreshing,history:n.home.advisorHistory,viewProgress:n.home.advisorViewProgress,alternatives:n.home.advisorAlternatives,more:K.moreSuggestionActions,feedback:n.home.advisorFeedback,alreadyDone:n.home.advisorAlreadyDone,irrelevant:n.home.advisorIrrelevant,later:n.home.advisorLater,lessLikeThis:n.home.advisorLessLikeThis,sourceIncorrect:n.home.advisorSourceIncorrect,minutes:n.home.advisorMinutes,setupTitle:n.home.advisorSetupTitle,setupHint:n.home.advisorSetupHint,configure:n.home.advisorConfigure,degradedStart:n.home.advisorDegradedStart,automationHint:n.home.advisorAutomationHint,automationAction:n.home.advisorAutomationAction},onRefresh:()=>{ue(!1),on()},onAction:sn,onFeedback:cn,onClarification:un,onOpenHistory:()=>{ue(!1),Je(!0)},preflight:$e,receipt:Ue,inDialog:bn}):null,jn=L&&(kt.length>0||Dn)?(0,Q.jsxs)(`section`,{className:`space-y-2`,"aria-labelledby":`home-resume-title`,children:[(0,Q.jsx)(`h2`,{id:`home-resume-title`,className:`flex min-h-9 items-center pl-1 ${Yt}`,children:K.resume}),kt.length>0?(0,Q.jsx)(`div`,{className:`${Jt} space-y-1 p-2`,"data-workbench-fill":!0,"data-workbench-panel":!0,children:kt.slice(0,zt===`attention`?1:3).map(t=>(0,Q.jsxs)(c,{className:`group flex w-full flex-wrap items-center gap-x-3 gap-y-2 rounded-lg p-2 text-left motion-safe:transition-colors hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-accent`,to:F(`/`,t.href),children:[(0,Q.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-surface-inset text-fg-muted`,children:t.kind===`task`?(0,Q.jsx)(N,{className:`size-4`,"aria-hidden":!0}):(0,Q.jsx)(R,{className:`size-4`,"aria-hidden":!0})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block break-words text-sm font-semibold text-fg`,children:t.title}),(0,Q.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:[t.projectName,t.summary||Kt(K.lastActive,{time:Ne(t.updatedAt,e)})].filter(Boolean).join(` · `)})]}),(0,Q.jsxs)(`span`,{className:`flex max-w-[35%] shrink-0 items-center gap-1 text-right text-xs leading-4 text-fg-muted group-hover:text-fg`,children:[t.kind===`task`?K.continueTask:K.continueChat,(0,Q.jsx)(w,{className:`size-3.5 shrink-0`,"aria-hidden":!0})]})]},`${t.kind}:${t.id}`))}):null,An&&bn&&xn?(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-lg bg-surface-inset px-3 py-1`,children:[(0,Q.jsxs)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-fg-muted`,children:[(0,Q.jsx)(ee,{className:`size-4 shrink-0 text-accent`,"aria-hidden":!0}),(0,Q.jsxs)(`span`,{className:`truncate`,children:[n.home.advisorStatusLabel,` · `,xn]})]}),(0,Q.jsxs)(X,{title:K.viewSuggestion,open:le,onOpenChange:ue,trigger:(0,Q.jsx)(Y,{variant:`ghost`,children:K.viewSuggestion}),children:[An,H?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:Re(H,e)}):null]})]}):An]}):null,Mn=[{id:`attention`,label:K.attention,lane:`left`,content:kn},{id:`delivery`,label:K.progress,lane:`left`,content:Sn},{id:`resume`,label:K.resume,lane:`left`,content:jn},{id:`background`,label:K.background,lane:`right`,content:En},{id:`observation`,label:e===`zh`?`交给我`:`Let me handle it`,lane:`right`,content:L?.observation?(0,Q.jsx)(gt,{observation:L.observation,advisor:L.advisor,language:e,emphasizeStart:zt!==`attention`&&zt!==`delivery`,onUpdated:()=>void G()}):null}].filter(e=>e.content),Nn=Mn.length>0,Pn=e===`zh`?`布局`:`Layout`,Fn=e===`zh`?`完成布局`:`Done`,In=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[L&&!Bt?(0,Q.jsx)(Tt,{advisor:L.advisor,busy:Ve,copy:St,onOpenHistory:()=>Je(!0),onRefresh:on}):null,Nn?(0,Q.jsxs)(Y,{type:`button`,variant:`ghost`,className:P?`h-9 w-9 gap-1.5 rounded-lg bg-accent-soft p-0 text-accent-fg sm:w-auto sm:px-2.5`:`size-9 rounded-lg p-0`,"aria-label":P?Fn:Pn,title:P?Fn:Pn,onClick:()=>I(e=>!e),children:[P?(0,Q.jsx)(S,{className:`size-4 shrink-0`,"aria-hidden":!0}):(0,Q.jsx)(z,{className:`size-4`,"aria-hidden":!0}),P?(0,Q.jsx)(`span`,{className:`hidden whitespace-nowrap sm:inline`,children:Fn}):null]}):null,Bt?null:(0,Q.jsxs)(Y,{type:`button`,variant:`primary`,className:`ml-1 h-9 gap-1.5 whitespace-nowrap rounded-lg px-2.5 sm:shadow-none`,onClick:()=>_e(!0),children:[(0,Q.jsx)(V,{className:`size-4 shrink-0`,"aria-hidden":!0}),r.newWork]})]}),[Ve,St,Nn,r.newWork,Fn,P,L,Bt,Pn,on]);return(0,Z.useLayoutEffect)(()=>(k({startExtra:null,main:(0,Q.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:n.title}),end:In}),()=>A()),[A,In,k,n.title]),(0,Q.jsxs)(`div`,{className:`@container/workbench mx-auto flex w-full min-w-0 max-w-7xl flex-1 flex-col px-4 pb-8 pt-5 sm:px-6 sm:pt-7 lg:px-8`,children:[(0,Q.jsx)(`input`,{ref:$.fileInputRef,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{let t=e.target.files;t&&ft(Array.from(t)),e.target.value=``}}),(0,Q.jsx)(y,{open:de,onOpenChange:tn,children:(0,Q.jsxs)(g,{children:[(0,Q.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(_,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(31rem,calc(100dvh-1.5rem))] w-[min(36rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float focus:outline-none`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start gap-4 border-b border-edge px-5 py-4`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(v,{className:`text-base font-semibold text-fg`,children:r.dialogTitle}),(0,Q.jsx)(m,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:r.dialogDescription})]}),(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,className:`-mr-2 -mt-1 size-8 shrink-0 rounded-lg p-0`,title:n.cancel,"aria-label":n.cancel,children:(0,Q.jsx)(te,{className:`size-4`,"aria-hidden":!0})})})]}),(0,Q.jsx)(qe,{variant:`dialog`,inputId:`new-conversation-intent`,inputRef:it,intent:be,labels:{...xt,submit:r.submit},attachments:$.attachments,isDragging:$.isDragging,attachmentBusy:nt,attachmentsFull:yt,voice:at,chat:t.chat,cancelAction:(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,children:n.cancel})}),onIntentChange:xe,onPickFiles:()=>$.fileInputRef.current?.click(),onRemoveAttachment:$.removeAttachment,onPaste:e=>void pt(e),onDragOver:mt,onDragLeave:ht,onDrop:e=>void _t(e),onSubmit:vt})]})]})}),(0,Q.jsx)(bt,{open:Ke,refreshKey:Ye,onOpenChange:Je,onReevaluate:on}),H?(0,Q.jsxs)(`div`,{role:`alert`,className:`mb-6 flex items-center justify-between gap-3 rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:[(0,Q.jsx)(`span`,{children:Re(H,e)}),(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void G(),children:n.home.retry})]}):null,(0,Q.jsx)(Ot,{view:ne,items:Ct,language:e,onSelect:re,onClose:()=>re(null),onRead:fn,onOpenFull:e=>{re(null),i(F(`/`,e.href))},onRestoreFocus:()=>{(J.current?.isConnected?J.current:q.current)?.focus({preventScroll:!0})}}),(0,Q.jsx)(`div`,{role:`status`,children:hn}),B?(0,Q.jsx)(Qt,{}):L?(0,Q.jsxs)(`div`,{ref:q,tabIndex:-1,className:`flex min-h-0 w-full flex-1 flex-col gap-4 outline-none`,children:[At===0?(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,"aria-live":`polite`,children:K.noAttention}):null,Vt?(0,Q.jsxs)(`section`,{className:`mx-auto flex w-full max-w-[640px] flex-1 flex-col justify-center pb-12 pt-10 text-center sm:pb-20 sm:pt-16`,children:[(0,Q.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight text-fg sm:text-3xl`,children:K.startTitle}),(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:K.startHint}),(0,Q.jsx)(qe,{variant:`inline`,inputId:`home-conversation-intent`,inputRef:it,intent:be,labels:{...xt,intentPlaceholder:K.startExample},attachments:$.attachments,isDragging:$.isDragging,attachmentBusy:nt,attachmentsFull:yt,voice:at,chat:t.chat,onIntentChange:xe,onPickFiles:()=>$.fileInputRef.current?.click(),onRemoveAttachment:$.removeAttachment,onPaste:e=>void pt(e),onDragOver:mt,onDragLeave:ht,onDrop:e=>void _t(e),onSubmit:vt}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-center gap-2`,children:[(0,Q.jsxs)(Y,{variant:`ghost`,onClick:()=>window.dispatchEvent(new Event(`open-command-palette`)),children:[(0,Q.jsx)(U,{className:`size-4`,"aria-hidden":!0}),K.findWork]}),(0,Q.jsx)(Y,{variant:`ghost`,onClick:()=>dn(`history`),children:K.deliveryHistory})]})]}):null,(0,Q.jsx)(Gt,{cards:Mn,editing:P,language:e}),!Bt&&!Sn&&Ct.length>0?(0,Q.jsx)(Y,{variant:`ghost`,className:`self-start px-2 text-xs`,onClick:()=>dn(`history`),children:K.deliveryHistory}):null]}):null,C?(0,Q.jsx)(Pe,{taskId:C,taskTitle:Ft?.title,language:e,onClose:O,onUpdated:e=>an(e,Pt),restoreFocus:()=>{let e=E.current;(e?.isConnected?e:q.current)?.focus({preventScroll:!0})}},C):null,Ze?(0,Q.jsxs)(`div`,{role:`status`,className:`fixed bottom-5 left-1/2 z-[100] flex -translate-x-1/2 items-center gap-4 rounded-lg border border-edge bg-surface-overlay px-4 py-3 text-sm text-fg shadow-float`,children:[(0,Q.jsx)(`span`,{children:n.home.advisorFeedbackSaved}),(0,Q.jsx)(`button`,{type:`button`,className:`font-medium text-accent-fg hover:underline`,onClick:ln,children:n.home.advisorUndo})]}):null]})}export{rn as HomePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{i as r,o as i}from"./locale-store-
|
|
1
|
+
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{i as r,o as i}from"./locale-store-CeEXxDaP.js";import{t as a}from"./x-B_N4OPjy.js";import{t as o}from"./skeleton-DzdOeGYz.js";import{n as s}from"./model-selector-CMsLur91.js";var c=t();e();var l=n();function u(e){let t=(0,c.c)(30),{primary:n,value:r,models:i,loading:u,error:d,zh:f,onChange:p}=e,m;if(t[0]!==i||t[1]!==n||t[2]!==r){let e;t[4]!==n||t[5]!==r?(e=e=>e.id!==n&&!r.includes(e.id),t[4]=n,t[5]=r,t[6]=e):e=t[6],m=i.filter(e),t[0]=i,t[1]=n,t[2]=r,t[3]=m}else m=t[3];let h=m,g=f?`回退顺序`:`Fallback order`,_;t[7]===g?_=t[8]:(_=(0,l.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:g}),t[7]=g,t[8]=_);let v=f?`主模型不可用时,按从左到右的顺序尝试。`:`Tried from left to right when the primary model is unavailable.`,y;t[9]===v?y=t[10]:(y=(0,l.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:v}),t[9]=v,t[10]=y);let b;t[11]!==_||t[12]!==y?(b=(0,l.jsx)(`div`,{className:`flex items-center justify-between gap-3`,children:(0,l.jsxs)(`div`,{children:[_,y]})}),t[11]=_,t[12]=y,t[13]=b):b=t[13];let x;t[14]!==i||t[15]!==p||t[16]!==r||t[17]!==f?(x=r.length>0?(0,l.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:r.map((e,t)=>(0,l.jsxs)(`span`,{className:`inline-flex items-center gap-2 rounded-full bg-surface-base/70 py-1 pl-2.5 pr-1 text-xs text-fg`,children:[(0,l.jsx)(`span`,{className:`text-fg-subtle`,children:t+1}),(0,l.jsx)(`span`,{children:i.find(t=>t.id===e)?.name??e}),(0,l.jsx)(`button`,{type:`button`,"aria-label":f?`移除 ${e}`:`Remove ${e}`,className:`rounded-full p-1 text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:()=>p(r.filter(t=>t!==e)),children:(0,l.jsx)(a,{className:`size-3`})})]},e))}):(0,l.jsx)(`p`,{className:`mt-3 text-xs text-fg-subtle`,children:f?`未设置回退模型。`:`No fallback models configured.`}),t[14]=i,t[15]=p,t[16]=r,t[17]=f,t[18]=x):x=t[18];let S;t[19]!==h||t[20]!==d||t[21]!==u||t[22]!==p||t[23]!==r||t[24]!==f?(S=u?(0,l.jsx)(o,{className:`mt-3 h-11 w-full max-w-md rounded-lg`}):(0,l.jsx)(s,{value:``,models:h,modelsLoading:u,modelsError:d,placeholder:f?`添加回退模型`:`Add fallback model`,searchPlaceholder:f?`搜索模型或服务商`:`Search models or providers`,noMatches:f?`没有可添加的模型`:`No models available to add`,showProviderInTrigger:!1,contentAlign:`start`,className:`mt-3 w-full max-w-md`,ariaLabel:f?`添加回退模型`:`Add fallback model`,onChange:e=>{e&&p([...r,e])}}),t[19]=h,t[20]=d,t[21]=u,t[22]=p,t[23]=r,t[24]=f,t[25]=S):S=t[25];let C;return t[26]!==b||t[27]!==x||t[28]!==S?(C=(0,l.jsxs)(`div`,{children:[b,x,S]}),t[26]=b,t[27]=x,t[28]=S,t[29]=C):C=t[29],C}async function d(){let e=await i(r(`/api/image-generation/catalog`));if(!Array.isArray(e.payload?.providers))throw Error(`Invalid image provider catalog`);return e.payload.providers}async function f(){let e=await i(r(`/api/image-generation/custom-providers`));if(!Array.isArray(e.payload?.providers))throw Error(`Invalid custom image provider list`);return e.payload.providers}async function p(e,t){await i(r(`/api/image-generation/custom-providers/${encodeURIComponent(e)}`),{method:`PUT`,body:JSON.stringify(t)})}async function m(e){await i(r(`/api/image-generation/custom-providers/${encodeURIComponent(e)}`),{method:`DELETE`})}async function h(e,t){await i(r(`/api/image-generation/providers/${encodeURIComponent(e)}/credential`),{method:`PUT`,body:JSON.stringify({apiKey:t})})}async function g(e,t){let n=await i(r(`/api/image-generation/providers/${encodeURIComponent(e)}/test`),{method:`POST`,body:JSON.stringify({modelId:t})});if(!Array.isArray(n.payload?.images))throw Error(`Invalid image generation test response`);return{images:n.payload.images}}export{h as a,p as i,f as n,g as o,d as r,u as s,m as t};
|
package/dist/gateway/static/root/assets/{imports-page-Clh0polM.js → imports-page-DHWKf1n3.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{i as a,n as o,o as s}from"./locale-store-5DzxIIeq.js";import{t as c}from"./messages-CGGOcV9B.js";import{a as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./dist-DlirbHVs.js";import{t as g}from"./braces-Cfmtagno.js";import{t as _}from"./check-DUBLcKHA.js";import{t as v}from"./chevron-down-ccbiQQz_.js";import{t as y}from"./download-Dk-ZjtO6.js";import{t as b}from"./folder-kanban-CpLlFI1o.js";import{t as x}from"./package-wATCyihJ.js";import{t as S}from"./plug-DKYPEgkR.js";import{t as C}from"./search-DA7gz22f.js";import{t as w}from"./settings-2-D-csvaET.js";import{t as T}from"./x-B_N4OPjy.js";import{t as E}from"./cn-0WouolD0.js";import{t as D}from"./button-C5tRaJxt.js";import{i as O,o as k}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as A}from"./settings-loading-skeleton-CAoOV17i.js";import{n as j,t as M}from"./settings-page-header-B8nLRdnY.js";import"./settings-page-layout-DhOLVJYv.js";var N=e(t(),1);async function P(e,t,n){return(await s(a(`/api/imports${e}`),{...t===void 0?{}:{method:`POST`,body:JSON.stringify(t)},signal:n})).data}var F=n();function I(e){return e.kind!==`connection`&&(e.status===`ready`||e.status===`conflict`||e.kind===`project`&&e.status===`existing`)}function L(e,t){let n=e.filter(I),r=n.filter(e=>t.has(e.id)).length;return{checked:n.length>0&&r===n.length,indeterminate:r>0&&r<n.length,selectedCount:r,availableCount:n.length}}function R(e,t,n,r){return n.reduce((t,n)=>z(e,t,n,r),new Set(t))}function z(e,t,n,r){let i=new Set(t);if(!I(n))return i;if(r){if(i.add(n.id),n.parentId&&i.add(n.parentId),n.kind===`project`)for(let t of e.candidates)t.parentId===n.id&&t.kind===`skill`&&t.suggested&&I(t)&&i.add(t.id)}else if(i.delete(n.id),n.kind===`project`)for(let t of e.candidates)t.parentId===n.id&&i.delete(t.id);return i}var B=r();function V(e){let t=(0,F.c)(34),{open:n,sourceName:r,inventory:i,selected:a,onSelected:s,busy:_,locked:v,error:y,onClose:S,onRefresh:C,onSubmit:j}=e,M=c(o(ue)).imports,[P,I]=(0,N.useState)(!0),[L,V]=(0,N.useState)(!1),U;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(U=()=>{I(!0),V(!1)},t[0]=U):U=t[0];let fe=i?.id,W;t[1]===fe?W=t[2]:(W=[fe],t[1]=fe,t[2]=W),(0,N.useEffect)(U,W);let G=i?.candidates.filter(le)??[],K;t[3]===i?.candidates?K=t[4]:(K=i?.candidates.filter(ce)??[],t[3]=i?.candidates,t[4]=K);let q=K,he;t[5]===i?.candidates?he=t[6]:(he=i?.candidates.filter(se)??[],t[5]=i?.candidates,t[6]=he);let ge=he,J;if(t[7]!==i?.candidates){J=new Map;for(let e of i?.candidates??[]){if(!e.parentId)continue;let t=J.get(e.parentId)??[];t.push(e),J.set(e.parentId,t)}t[7]=i?.candidates,t[8]=J}else J=t[8];let ve=J,ye=i?.candidates.filter(e=>a.has(e.id))??[],be=M.selected.replace(`{skills}`,String(ye.filter(oe).length)).replace(`{context}`,String(ye.filter(ae).length)).replace(`{projects}`,String(ye.filter(ie).length)),xe;t[9]!==i||t[10]!==s||t[11]!==a?(xe=(e,t)=>{i&&s(z(i,a,e,t))},t[9]=i,t[10]=s,t[11]=a,t[12]=xe):xe=t[12];let Se=xe,Ce;t[13]!==i||t[14]!==s||t[15]!==a?(Ce=(e,t)=>{i&&s(R(i,a,e,t))},t[13]=i,t[14]=s,t[15]=a,t[16]=Ce):Ce=t[16];let we=Ce,Y;t[17]===S?Y=t[18]:(Y=e=>{e||S()},t[17]=S,t[18]=Y);let X;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,B.jsx)(l,{className:`xopc-dialog-overlay fixed inset-0 bg-scrim ${k}`}),t[19]=X):X=t[19];let Z;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(Z=E(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(calc(100dvh-2rem),760px)] w-[min(calc(100%-2rem),720px)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay outline-none`,`max-sm:bottom-0 max-sm:left-0 max-sm:top-auto max-sm:h-[min(92dvh,760px)] max-sm:w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none`,O),t[20]=Z):Z=t[20];let Q;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,B.jsx)(T,{"aria-hidden":`true`,className:`h-4 w-4`}),t[21]=Q):Q=t[21];let Te=y&&(0,B.jsxs)(`div`,{role:`alert`,className:`space-y-3 rounded-xl border border-edge bg-surface-inset p-4 text-sm text-fg`,children:[(0,B.jsx)(`p`,{children:y}),(0,B.jsx)(D,{variant:`secondary`,disabled:v,onClick:C,children:M.refresh})]}),$;t[22]!==y||t[23]!==i?($=!i&&!y&&(0,B.jsx)(A,{sections:2}),t[22]=y,t[23]=i,t[24]=$):$=t[24];let Ee=i&&(0,B.jsxs)(B.Fragment,{children:[!i.complete&&(0,B.jsx)(`p`,{className:`rounded-lg bg-surface-inset p-3 text-sm text-fg-muted`,children:M.incomplete}),G.length>0&&(0,B.jsxs)(pe,{icon:w,title:M.personalSetup,description:M.personalSetupHint,items:G,selected:a,open:P,disabled:v,onOpenChange:I,onCheckedChange:e=>we(G,e),children:[(0,B.jsx)(me,{icon:x,title:M.kinds.skill,items:G.filter(re),inventoryId:i.id,selected:a,disabled:v,onToggle:Se,onToggleAll:e=>we(G.filter(ne),e)}),(0,B.jsx)(me,{icon:g,title:M.kinds.context,items:G.filter(te),inventoryId:i.id,selected:a,disabled:v,onToggle:Se,onToggleAll:e=>we(G.filter(ee),e)})]}),q.length>0&&(0,B.jsx)(pe,{icon:b,title:M.kinds.project,description:M.projectsHint.replace(`{count}`,String(q.length)),items:q,selected:a,open:L,disabled:v,onOpenChange:V,children:(0,B.jsx)(_e,{inventoryId:i.id,projects:q,projectChildren:ve,selected:a,disabled:v,onToggle:Se})}),ge.length>0&&(0,B.jsx)(de,{inventoryId:i.id,items:ge}),!i.candidates.length&&(0,B.jsx)(`p`,{className:`rounded-xl bg-surface-inset p-5 text-sm text-fg-muted`,children:M.noContent}),!!i.notices.length&&(0,B.jsxs)(`details`,{className:`rounded-xl border border-edge bg-surface-inset p-4 text-sm text-fg-muted`,children:[(0,B.jsxs)(`summary`,{className:`cursor-pointer font-medium text-fg`,children:[M.scanNotices,` (`,i.notices.length,`)`]}),(0,B.jsx)(`ul`,{className:`mt-3 space-y-2`,children:i.notices.map(H)})]})]}),De;t[25]!==Te||t[26]!==$||t[27]!==Ee?(De=(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4 sm:p-6`,children:[Te,$,Ee]}),t[25]=Te,t[26]=$,t[27]=Ee,t[28]=De):De=t[28];let Oe=D,ke=!i||!a.size||_,Ae=_?M.importing:v?M.retry:M.importCount.replace(`{count}`,String(a.size)),je;return t[29]!==Oe||t[30]!==j||t[31]!==ke||t[32]!==Ae?(je=(0,B.jsx)(Oe,{variant:`primary`,disabled:ke,onClick:j,children:Ae}),t[29]=Oe,t[30]=j,t[31]=ke,t[32]=Ae,t[33]=je):je=t[33],(0,B.jsx)(h,{open:n,onOpenChange:Y,children:(0,B.jsxs)(f,{children:[X,(0,B.jsxs)(p,{className:Z,children:[(0,B.jsx)(`header`,{className:`shrink-0 space-y-2 border-b border-edge p-5 sm:p-6`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(m,{className:`text-xl font-semibold text-fg`,children:M.chooseTitle.replace(`{source}`,r)}),(0,B.jsx)(u,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:M.chooseHint})]}),(0,B.jsx)(d,{asChild:!0,children:(0,B.jsx)(D,{variant:`ghost`,"aria-label":M.close,className:`h-10 w-10 shrink-0 p-0`,children:Q})})]})}),De,(0,B.jsx)(`footer`,{className:`shrink-0 border-t border-edge bg-surface-overlay p-4 sm:px-6 sm:py-5`,children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`text-sm text-fg-muted`,children:be}),_&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:M.runningHint}),v&&!_&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:M.retryHint})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2`,children:[(0,B.jsx)(D,{variant:`ghost`,onClick:S,children:_?M.close:M.cancel}),je]})]})})]})]})})}function H(e,t){return(0,B.jsx)(`li`,{className:`break-words`,children:e},t)}function ee(e){return e.kind===`context`}function te(e){return e.kind===`context`}function ne(e){return e.kind===`skill`}function re(e){return e.kind===`skill`}function ie(e){return e.kind===`project`}function ae(e){return e.kind===`context`}function oe(e){return e.kind===`skill`}function se(e){return e.kind===`connection`}function ce(e){return e.kind===`project`}function le(e){return!e.parentId&&(e.kind===`skill`||e.kind===`context`)}function ue(e){return e.language}function de(e){let t=(0,F.c)(13),{inventoryId:n,items:r}=e,a=c(o(fe)).imports,[s,l]=(0,N.useState)(!1),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>l(U),t[0]=u):u=t[0];let d;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,B.jsx)(`span`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-surface-panel text-fg`,children:(0,B.jsx)(S,{"aria-hidden":`true`,className:`h-5 w-5`})}),t[1]=d):d=t[1];let f=a.connectionsHint.replace(`{count}`,String(r.length)),p;t[2]===f?p=t[3]:(p=(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-xs font-normal text-fg-muted`,children:f}),t[2]=f,t[3]=p);let m=s&&`rotate-180`,h;t[4]===m?h=t[5]:(h=E(`h-4 w-4 shrink-0 text-fg-muted transition-transform duration-200 motion-reduce:transition-none`,m),t[4]=m,t[5]=h);let g;t[6]===h?g=t[7]:(g=(0,B.jsx)(v,{"aria-hidden":`true`,className:h}),t[6]=h,t[7]=g);let _;return t[8]!==n||t[9]!==r||t[10]!==s||t[11]!==a?(_=s&&(0,B.jsxs)(`div`,{className:`space-y-2 border-t border-edge bg-surface-overlay p-3 sm:p-4`,children:[r.map(e=>(0,B.jsx)(W,{inventoryId:n,item:e},e.id)),(0,B.jsx)(D,{asChild:!0,variant:`secondary`,children:(0,B.jsx)(i,{to:`/capabilities/connectors`,children:a.connectionsAction})})]}),t[8]=n,t[9]=r,t[10]=s,t[11]=a,t[12]=_):_=t[12],(0,B.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge bg-surface-inset`,children:[(0,B.jsx)(`div`,{className:`flex min-h-16 items-center gap-3 px-3 py-2 sm:px-4`,children:(0,B.jsxs)(D,{variant:`ghost`,className:`min-w-0 flex-1 justify-start gap-3 px-1 text-left`,"aria-expanded":s,onClick:u,children:[d,(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:a.kinds.connection}),p]}),g]})}),_]})}function U(e){return!e}function fe(e){return e.language}function W(e){let t=(0,F.c)(34),{inventoryId:n,item:r}=e,i=o(K),a;t[0]===i?a=t[1]:(a=c(i),t[0]=i,t[1]=a);let s=a.imports,[l,u]=(0,N.useState)(),[d,f]=(0,N.useState)(!1),[p,m]=(0,N.useState)(``),h;t[2]!==n||t[3]!==r.id||t[4]!==l?(h=async function(){if(f(G),!l)try{u(await P(`/inventories/${n}/items/${r.id}/preview`))}catch(e){let t=e;m(t instanceof Error?t.message:String(t))}},t[2]=n,t[3]=r.id,t[4]=l,t[5]=h):h=t[5];let g=h,_;t[6]===r.name?_=t[7]:(_=(0,B.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r.name}),t[6]=r.name,t[7]=_);let v;t[8]===r.displayPath?v=t[9]:(v=(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,title:r.displayPath,children:r.displayPath}),t[8]=r.displayPath,t[9]=v);let y=s.statuses[r.status],b;t[10]===y?b=t[11]:(b=(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:y}),t[10]=y,t[11]=b);let x;t[12]!==_||t[13]!==v||t[14]!==b?(x=(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[_,v,b]}),t[12]=_,t[13]=v,t[14]=b,t[15]=x):x=t[15];let S;t[16]===g?S=t[17]:(S=()=>void g(),t[16]=g,t[17]=S);let C;t[18]!==s.preview||t[19]!==S?(C=(0,B.jsx)(D,{variant:`ghost`,className:`h-9 shrink-0 px-2`,onClick:S,children:s.preview}),t[18]=s.preview,t[19]=S,t[20]=C):C=t[20];let w;t[21]!==C||t[22]!==x?(w=(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[x,C]}),t[21]=C,t[22]=x,t[23]=w):w=t[23];let T;t[24]===r.reason?T=t[25]:(T=r.reason&&(0,B.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:r.reason}),t[24]=r.reason,t[25]=T);let E;t[26]!==p||t[27]!==d||t[28]!==l?(E=d&&(0,B.jsx)(`div`,{className:`mt-3 rounded-lg bg-surface-inset p-3`,children:p?(0,B.jsx)(`p`,{role:`alert`,className:`text-xs text-fg-muted`,children:p}):l?(0,B.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-words text-xs text-fg`,children:l.text}):(0,B.jsx)(A,{sections:1})}),t[26]=p,t[27]=d,t[28]=l,t[29]=E):E=t[29];let O;return t[30]!==w||t[31]!==T||t[32]!==E?(O=(0,B.jsxs)(`div`,{className:`rounded-xl border border-edge p-3`,children:[w,T,E]}),t[30]=w,t[31]=T,t[32]=E,t[33]=O):O=t[33],O}function G(e){return!e}function K(e){return e.language}function pe(e){let t=(0,F.c)(40),{icon:n,title:r,description:i,items:a,selected:o,open:s,disabled:c,onOpenChange:l,onCheckedChange:u,children:d}=e,f;t[0]!==a||t[1]!==u||t[2]!==o?(f=u?L(a,o):void 0,t[0]=a,t[1]=u,t[2]=o,t[3]=f):f=t[3];let p=f,m;t[4]!==l||t[5]!==s?(m=()=>l(!s),t[4]=l,t[5]=s,t[6]=m):m=t[6];let h;t[7]===n?h=t[8]:(h=(0,B.jsx)(`span`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-surface-panel text-fg`,children:(0,B.jsx)(n,{"aria-hidden":`true`,className:`h-5 w-5`})}),t[7]=n,t[8]=h);let g;t[9]===r?g=t[10]:(g=(0,B.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:r}),t[9]=r,t[10]=g);let _;t[11]===i?_=t[12]:(_=(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-xs font-normal text-fg-muted`,children:i}),t[11]=i,t[12]=_);let y;t[13]!==g||t[14]!==_?(y=(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[g,_]}),t[13]=g,t[14]=_,t[15]=y):y=t[15];let b=s&&`rotate-180`,x;t[16]===b?x=t[17]:(x=E(`h-4 w-4 shrink-0 text-fg-muted transition-transform duration-200 motion-reduce:transition-none`,b),t[16]=b,t[17]=x);let S;t[18]===x?S=t[19]:(S=(0,B.jsx)(v,{"aria-hidden":`true`,className:x}),t[18]=x,t[19]=S);let C;t[20]!==s||t[21]!==m||t[22]!==h||t[23]!==y||t[24]!==S?(C=(0,B.jsxs)(D,{variant:`ghost`,className:`min-w-0 flex-1 justify-start gap-3 px-1 text-left`,"aria-expanded":s,onClick:m,children:[h,y,S]}),t[20]=s,t[21]=m,t[22]=h,t[23]=y,t[24]=S,t[25]=C):C=t[25];let w;t[26]!==c||t[27]!==u||t[28]!==p||t[29]!==r?(w=p&&u&&(0,B.jsx)(X,{label:r,checked:p.checked,indeterminate:p.indeterminate,disabled:c||!p.availableCount,onChange:u}),t[26]=c,t[27]=u,t[28]=p,t[29]=r,t[30]=w):w=t[30];let T;t[31]!==C||t[32]!==w?(T=(0,B.jsxs)(`div`,{className:`flex min-h-16 items-center gap-3 px-3 py-2 sm:px-4`,children:[C,w]}),t[31]=C,t[32]=w,t[33]=T):T=t[33];let O;t[34]!==d||t[35]!==s?(O=s&&(0,B.jsx)(`div`,{className:`space-y-2 border-t border-edge bg-surface-overlay p-3 sm:p-4`,children:d}),t[34]=d,t[35]=s,t[36]=O):O=t[36];let k;return t[37]!==T||t[38]!==O?(k=(0,B.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge bg-surface-inset`,children:[T,O]}),t[37]=T,t[38]=O,t[39]=k):k=t[39],k}function me(e){let t=(0,F.c)(34),{icon:n,title:r,items:i,inventoryId:a,selected:s,disabled:l,onToggle:u,onToggleAll:d}=e,f=c(o(ge)).imports,[p,m]=(0,N.useState)(!1),[h,g]=(0,N.useState)(``),[_,y]=(0,N.useState)(60);if(!i.length)return null;let b;t[0]!==i||t[1]!==s?(b=L(i,s),t[0]=i,t[1]=s,t[2]=b):b=t[2];let x=b,S=Y(i,h),C=S.slice(0,_),w;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>m(he),t[3]=w):w=t[3];let T;t[4]===n?T=t[5]:(T=(0,B.jsx)(n,{"aria-hidden":`true`,className:`h-5 w-5 shrink-0 text-fg-muted`}),t[4]=n,t[5]=T);let O;t[6]!==i.length||t[7]!==r?(O=(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-fg`,children:[r,` (`,i.length,`)`]}),t[6]=i.length,t[7]=r,t[8]=O):O=t[8];let k;t[9]!==x.availableCount||t[10]!==x.selectedCount?(k=(0,B.jsxs)(`span`,{className:`text-xs font-normal text-fg-muted`,children:[x.selectedCount,`/`,x.availableCount]}),t[9]=x.availableCount,t[10]=x.selectedCount,t[11]=k):k=t[11];let A=p&&`rotate-180`,j;t[12]===A?j=t[13]:(j=E(`h-4 w-4 shrink-0 text-fg-muted transition-transform duration-200 motion-reduce:transition-none`,A),t[12]=A,t[13]=j);let M;t[14]===j?M=t[15]:(M=(0,B.jsx)(v,{"aria-hidden":`true`,className:j}),t[14]=j,t[15]=M);let P;t[16]!==p||t[17]!==T||t[18]!==O||t[19]!==k||t[20]!==M?(P=(0,B.jsxs)(D,{variant:`ghost`,className:`min-w-0 flex-1 justify-start px-1 text-left`,"aria-expanded":p,onClick:w,children:[T,O,k,M]}),t[16]=p,t[17]=T,t[18]=O,t[19]=k,t[20]=M,t[21]=P):P=t[21];let I=l||!x.availableCount,R;t[22]!==d||t[23]!==x.checked||t[24]!==x.indeterminate||t[25]!==I||t[26]!==r?(R=(0,B.jsx)(X,{label:r,checked:x.checked,indeterminate:x.indeterminate,disabled:I,onChange:d}),t[22]=d,t[23]=x.checked,t[24]=x.indeterminate,t[25]=I,t[26]=r,t[27]=R):R=t[27];let z;t[28]!==P||t[29]!==R?(z=(0,B.jsxs)(`div`,{className:`flex min-h-14 items-center gap-2 px-3 py-2`,children:[P,R]}),t[28]=P,t[29]=R,t[30]=z):z=t[30];let V=p&&(0,B.jsxs)(`div`,{className:`space-y-2 border-t border-edge p-2`,children:[i.length>8&&(0,B.jsx)(we,{value:h,label:f.searchWithin.replace(`{group}`,r),onChange:e=>{g(e),y(60)}}),(0,B.jsx)(`div`,{className:`space-y-1`,children:C.map(e=>(0,B.jsx)(Z,{inventoryId:a,item:e,checked:s.has(e.id),disabled:l,onChange:t=>u(e,t)},e.id))}),!S.length&&(0,B.jsx)(`p`,{className:`p-3 text-sm text-fg-muted`,children:f.noMatches}),C.length<S.length&&(0,B.jsx)(D,{variant:`ghost`,className:`w-full`,onClick:()=>y(q),children:f.showMore.replace(`{count}`,String(S.length-C.length))})]}),H;return t[31]!==z||t[32]!==V?(H=(0,B.jsxs)(`div`,{className:`rounded-xl border border-edge`,children:[z,V]}),t[31]=z,t[32]=V,t[33]=H):H=t[33],H}function q(e){return e+60}function he(e){return!e}function ge(e){return e.language}function _e(e){let t=(0,F.c)(15),{inventoryId:n,projects:r,projectChildren:i,selected:a,disabled:s,onToggle:l}=e,u=c(o(ve)).imports,[d,f]=(0,N.useState)(``),[p,m]=(0,N.useState)(60),h;t[0]===i?h=t[1]:(h=e=>i.get(e.id)??[],t[0]=i,t[1]=h);let g=Y(r,d,h),_=g.slice(0,p),v=r.length>8&&(0,B.jsx)(we,{value:d,label:u.searchWithin.replace(`{group}`,u.kinds.project),onChange:e=>{f(e),m(60)}}),y;t[2]!==s||t[3]!==n||t[4]!==l||t[5]!==i||t[6]!==a?(y=e=>(0,B.jsx)(ye,{inventoryId:n,project:e,children:i.get(e.id)??[],selected:a,disabled:s,onToggle:l},e.id),t[2]=s,t[3]=n,t[4]=l,t[5]=i,t[6]=a,t[7]=y):y=t[7];let b=_.map(y),x;t[8]===b?x=t[9]:(x=(0,B.jsx)(`div`,{className:`space-y-2`,children:b}),t[8]=b,t[9]=x);let S=!g.length&&(0,B.jsx)(`p`,{className:`p-3 text-sm text-fg-muted`,children:u.noMatches}),C=_.length<g.length&&(0,B.jsx)(D,{variant:`ghost`,className:`w-full`,onClick:()=>m(J),children:u.showMore.replace(`{count}`,String(g.length-_.length))}),w;return t[10]!==v||t[11]!==x||t[12]!==S||t[13]!==C?(w=(0,B.jsxs)(`div`,{className:`space-y-2`,children:[v,x,S,C]}),t[10]=v,t[11]=x,t[12]=S,t[13]=C,t[14]=w):w=t[14],w}function J(e){return e+60}function ve(e){return e.language}function ye(e){let t=(0,F.c)(39),{inventoryId:n,project:r,children:i,selected:a,disabled:s,onToggle:l}=e,u=c(o(Ce)).imports,[d,f]=(0,N.useState)(!1),p;if(t[0]!==i||t[1]!==a){let e;t[3]===a?e=t[4]:(e=e=>a.has(e.id),t[3]=a,t[4]=e),p=i.filter(e),t[0]=i,t[1]=a,t[2]=p}else p=t[2];let m=p.length,h;t[5]===r.name?h=t[6]:(h=(0,B.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:r.name}),t[5]=r.name,t[6]=h);let g;t[7]===r.displayPath?g=t[8]:(g=(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-xs font-normal text-fg-muted`,title:r.displayPath,children:r.displayPath}),t[7]=r.displayPath,t[8]=g);let _;t[9]!==h||t[10]!==g?(_=(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[h,g]}),t[9]=h,t[10]=g,t[11]=_):_=t[11];let y=_,b=i.length>0?(0,B.jsxs)(D,{variant:`ghost`,className:`min-w-0 flex-1 justify-start px-2 text-left`,"aria-expanded":d,onClick:()=>f(Se),children:[y,(0,B.jsxs)(`span`,{className:`text-xs font-normal text-fg-muted`,children:[u.projectContents.replace(`{skills}`,String(i.filter(xe).length)).replace(`{context}`,String(i.filter(be).length)),` · `,u.chosenCount.replace(`{count}`,String(m))]}),(0,B.jsx)(v,{"aria-hidden":`true`,className:E(`h-4 w-4 shrink-0 text-fg-muted transition-transform duration-200 motion-reduce:transition-none`,d&&`rotate-180`)})]}):(0,B.jsx)(`div`,{className:`min-w-0 flex-1 px-2`,children:y}),x=r.name,S;t[12]!==r.id||t[13]!==a?(S=a.has(r.id),t[12]=r.id,t[13]=a,t[14]=S):S=t[14];let C;t[15]!==s||t[16]!==r?(C=s||!I(r),t[15]=s,t[16]=r,t[17]=C):C=t[17];let w;t[18]!==l||t[19]!==r?(w=e=>l(r,e.target.checked),t[18]=l,t[19]=r,t[20]=w):w=t[20];let T;t[21]!==r.name||t[22]!==C||t[23]!==w||t[24]!==S?(T=(0,B.jsx)(`input`,{type:`checkbox`,"aria-label":x,checked:S,disabled:C,onChange:w}),t[21]=r.name,t[22]=C,t[23]=w,t[24]=S,t[25]=T):T=t[25];let O;t[26]!==T||t[27]!==b?(O=(0,B.jsxs)(`div`,{className:`flex items-center gap-2 p-2`,children:[b,T]}),t[26]=T,t[27]=b,t[28]=O):O=t[28];let k;t[29]!==i||t[30]!==s||t[31]!==n||t[32]!==l||t[33]!==d||t[34]!==a?(k=d&&(0,B.jsx)(`div`,{className:`border-t border-edge p-2`,children:(0,B.jsx)(`div`,{className:`space-y-1`,children:i.map(e=>(0,B.jsx)(Z,{inventoryId:n,item:e,checked:a.has(e.id),disabled:s,onChange:t=>l(e,t)},e.id))})}),t[29]=i,t[30]=s,t[31]=n,t[32]=l,t[33]=d,t[34]=a,t[35]=k):k=t[35];let A;return t[36]!==O||t[37]!==k?(A=(0,B.jsxs)(`div`,{className:`rounded-xl border border-edge`,children:[O,k]}),t[36]=O,t[37]=k,t[38]=A):A=t[38],A}function be(e){return e.kind===`context`}function xe(e){return e.kind===`skill`}function Se(e){return!e}function Ce(e){return e.language}function we(e){let t=(0,F.c)(13),{value:n,label:r,onChange:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,B.jsx)(C,{"aria-hidden":`true`,className:`h-4 w-4 shrink-0 text-fg-muted`}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=(0,B.jsx)(`span`,{className:`sr-only`,children:r}),t[1]=r,t[2]=o);let s=`${r}…`,c;t[3]===i?c=t[4]:(c=e=>i(e.target.value),t[3]=i,t[4]=c);let l;t[5]!==r||t[6]!==s||t[7]!==c||t[8]!==n?(l=(0,B.jsx)(`input`,{type:`search`,autoComplete:`off`,value:n,placeholder:s,"aria-label":r,onChange:c,className:`min-w-0 flex-1 border-0 bg-transparent px-0 py-2 text-sm text-fg placeholder:text-fg-subtle`}),t[5]=r,t[6]=s,t[7]=c,t[8]=n,t[9]=l):l=t[9];let u;return t[10]!==o||t[11]!==l?(u=(0,B.jsxs)(`label`,{className:`flex items-center gap-2 rounded-lg border border-edge bg-surface-panel px-3 focus-within:border-accent focus-within:ring-1 focus-within:ring-accent`,children:[a,o,l]}),t[10]=o,t[11]=l,t[12]=u):u=t[12],u}function Y(e,t,n=()=>[]){let r=t.trim().toLocaleLowerCase();if(!r)return e;let i=e=>`${e.name} ${e.description} ${e.displayPath}`.toLocaleLowerCase().includes(r);return e.filter(e=>i(e)||n(e).some(i))}function X(e){let t=(0,F.c)(10),{label:n,checked:r,indeterminate:i,disabled:a,onChange:o}=e,s=(0,N.useRef)(null),c,l;t[0]===i?(c=t[1],l=t[2]):(c=()=>{s.current&&(s.current.indeterminate=i)},l=[i],t[0]=i,t[1]=c,t[2]=l),(0,N.useEffect)(c,l);let u;t[3]===o?u=t[4]:(u=e=>o(e.target.checked),t[3]=o,t[4]=u);let d;return t[5]!==r||t[6]!==a||t[7]!==n||t[8]!==u?(d=(0,B.jsx)(`input`,{ref:s,type:`checkbox`,"aria-label":n,checked:r,disabled:a,onChange:u}),t[5]=r,t[6]=a,t[7]=n,t[8]=u,t[9]=d):d=t[9],d}function Z(e){let t=(0,F.c)(52),{inventoryId:n,item:r,checked:i,disabled:a,onChange:s}=e,l=o(Te),u;t[0]===l?u=t[1]:(u=c(l),t[0]=l,t[1]=u);let d=u.imports,[f,p]=(0,N.useState)(),[m,h]=(0,N.useState)(``),[g,_]=(0,N.useState)(!1),v;t[2]!==n||t[3]!==r.id||t[4]!==f?(v=async function(){if(_(Q),!f)try{p(await P(`/inventories/${n}/items/${r.id}/preview`))}catch(e){let t=e;h(t instanceof Error?t.message:String(t))}},t[2]=n,t[3]=r.id,t[4]=f,t[5]=v):v=t[5];let y=v,b;t[6]!==a||t[7]!==r?(b=a||!I(r),t[6]=a,t[7]=r,t[8]=b):b=t[8];let x;t[9]===s?x=t[10]:(x=e=>s(e.target.checked),t[9]=s,t[10]=x);let S;t[11]!==i||t[12]!==b||t[13]!==x?(S=(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-0.5`,checked:i,disabled:b,onChange:x}),t[11]=i,t[12]=b,t[13]=x,t[14]=S):S=t[14];let C;t[15]===r.name?C=t[16]:(C=(0,B.jsx)(`span`,{className:`block break-words text-sm font-medium text-fg`,children:r.name}),t[15]=r.name,t[16]=C);let w;t[17]===r.displayPath?w=t[18]:(w=(0,B.jsx)(`span`,{className:`block truncate text-xs text-fg-muted`,title:r.displayPath,children:r.displayPath}),t[17]=r.displayPath,t[18]=w);let T;t[19]!==C||t[20]!==w?(T=(0,B.jsxs)(`span`,{className:`min-w-0`,children:[C,w]}),t[19]=C,t[20]=w,t[21]=T):T=t[21];let E;t[22]!==S||t[23]!==T?(E=(0,B.jsxs)(`label`,{className:`flex min-w-0 flex-1 cursor-pointer items-start gap-3 py-1`,children:[S,T]}),t[22]=S,t[23]=T,t[24]=E):E=t[24];let O;t[25]!==r.name||t[26]!==r.status||t[27]!==d||t[28]!==y?(O=r.status!==`blocked`&&(0,B.jsx)(D,{variant:`ghost`,"aria-label":`${d.preview}: ${r.name}`,className:`h-9 shrink-0 px-2`,onClick:()=>void y(),children:d.preview}),t[25]=r.name,t[26]=r.status,t[27]=d,t[28]=y,t[29]=O):O=t[29];let k;t[30]!==E||t[31]!==O?(k=(0,B.jsxs)(`div`,{className:`flex items-start gap-2`,children:[E,O]}),t[30]=E,t[31]=O,t[32]=k):k=t[32];let j;t[33]===r.description?j=t[34]:(j=r.description&&(0,B.jsx)(`p`,{className:`pl-7 text-xs text-fg-muted`,children:r.description}),t[33]=r.description,t[34]=j);let M;t[35]!==r.status||t[36]!==r.targetName||t[37]!==d?(M=r.status!==`ready`&&(0,B.jsxs)(`p`,{className:`pl-7 text-xs text-fg-muted`,children:[d.statuses[r.status],r.status===`conflict`?` → ${r.targetName}`:``]}),t[35]=r.status,t[36]=r.targetName,t[37]=d,t[38]=M):M=t[38];let L;t[39]===r.reason?L=t[40]:(L=r.reason&&(0,B.jsx)(`p`,{className:`break-words pl-7 text-xs text-fg-muted`,children:r.reason}),t[39]=r.reason,t[40]=L);let R;t[41]!==f||t[42]!==m||t[43]!==g||t[44]!==d?(R=g&&(0,B.jsx)(`div`,{className:`ml-7 mt-2 rounded-lg border border-edge bg-surface-inset p-3`,children:m?(0,B.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:m}):f?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`pre`,{className:`max-h-60 overflow-auto whitespace-pre-wrap break-words text-xs text-fg`,children:f.text}),f.truncated&&(0,B.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:d.previewTruncated})]}):(0,B.jsx)(A,{sections:1})}),t[41]=f,t[42]=m,t[43]=g,t[44]=d,t[45]=R):R=t[45];let z;return t[46]!==k||t[47]!==j||t[48]!==M||t[49]!==L||t[50]!==R?(z=(0,B.jsxs)(`div`,{className:`min-w-0 rounded-lg px-2 py-1.5 hover:bg-surface-hover/60`,children:[k,j,M,L,R]}),t[46]=k,t[47]=j,t[48]=M,t[49]=L,t[50]=R,t[51]=z):z=t[51],z}function Q(e){return!e}function Te(e){return e.language}function $(){let e=c(o(e=>e.language)).imports,[t,n]=(0,N.useState)(),[r,i]=(0,N.useState)(),[a,s]=(0,N.useState)(!1),[l,u]=(0,N.useState)(),[d,f]=(0,N.useState)(new Set),[p,m]=(0,N.useState)(!1),[h,g]=(0,N.useState)(),[v,b]=(0,N.useState)(),[x,S]=(0,N.useState)(``),[C,w]=(0,N.useState)(``),[T,E]=(0,N.useState)(0),O=(0,N.useRef)(null),k=(0,N.useRef)(!1);(0,N.useEffect)(()=>{let e=new AbortController;return S(``),P(`/sources`,void 0,e.signal).then(e=>n(e.sources)).catch(t=>{e.signal.aborted||S(t instanceof Error?t.message:String(t))}),()=>{e.abort(),O.current?.abort()}},[T]);let F=(t?.flatMap(e=>e.lastImport?.status===`running`?[e.lastImport.id]:[])??[]).join(`,`);(0,N.useEffect)(()=>{if(!F)return;let e=new AbortController,t,n=async()=>{for(let t of F.split(`,`))try{let n=await P(`/runs/${t}`,void 0,e.signal);e.signal.aborted||I(n)}catch{}e.signal.aborted||(t=setTimeout(()=>void n(),3e3))};return t=setTimeout(()=>void n(),1500),()=>{e.abort(),clearTimeout(t)}},[F]);function I(e){n(t=>t?.map(t=>t.id===e.source?{...t,lastImport:e}:t)),e.status!==`running`&&g(t=>t?.requestId===e.id?void 0:t)}async function L(e){O.current?.abort();let t=new AbortController;O.current=t,i(e),s(!0),u(void 0),f(new Set),w(``),b(void 0),g(void 0);try{let n=await P(`/sources/${e}/scan`,{},t.signal);t.signal.aborted||(u(n),f(new Set(n.candidates.filter(e=>!e.parentId&&e.suggested).map(e=>e.id))))}catch(e){t.signal.aborted||w(e instanceof Error?e.message:String(e))}}async function R(){if(!l||!d.size||k.current)return;k.current=!0,m(!0),w(``),S(``);let e=h??{inventoryId:l.id,candidateIds:[...d],requestId:crypto.randomUUID(),retryOf:v};g(e);try{I(await P(`/runs`,e)),s(!1)}catch(e){let t=e instanceof Error?e.message:String(e);w(t),S(t);let n=e.body?.code;n&&[`invalid_input`,`inventory_stale`,`invalid_selection`,`missing_parent`,`not_found`,`conflict`].includes(n)&&g(void 0)}finally{k.current=!1,m(!1)}}async function z(e){i(e.source),s(!0),u(void 0),f(new Set),w(``),g(void 0),b(e.id),O.current?.abort();let t=new AbortController;O.current=t;try{let n=await P(`/inventories/${e.inventoryId}`,void 0,t.signal);if(t.signal.aborted)return;let r=new Set(e.items.filter(e=>e.status===`failed`).map(e=>e.candidateId));n.candidates.forEach(e=>{r.has(e.id)&&e.parentId&&r.add(e.parentId)}),u({...n,candidates:n.candidates.filter(e=>r.has(e.id))}),f(r)}catch(e){t.signal.aborted||w(e instanceof Error?e.message:String(e))}}let H=t?.filter(e=>e.detected||e.lastImport);return(0,B.jsxs)(j,{children:[(0,B.jsx)(M,{title:e.title,subtitle:e.subtitle}),x&&(0,B.jsxs)(`div`,{role:`alert`,className:`rounded-xl bg-danger-soft p-4 text-sm text-danger`,children:[(0,B.jsx)(`p`,{children:x}),!t&&(0,B.jsx)(D,{variant:`ghost`,onClick:()=>E(e=>e+1),children:e.retry})]}),!t&&!x&&(0,B.jsx)(A,{sections:1}),t&&(0,B.jsxs)(`section`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-base font-medium text-fg`,children:e.apps}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.detectedHint})]}),H?.length?(0,B.jsx)(`div`,{className:`flex flex-col gap-1 overflow-hidden rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:H.map(t=>(0,B.jsxs)(`article`,{className:`space-y-3 p-5 sm:p-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-surface-hover text-fg`,children:(0,B.jsx)(y,{className:`h-5 w-5`})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`h3`,{className:`font-medium text-fg`,children:t.name}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.includes})]}),(0,B.jsx)(D,{variant:`secondary`,disabled:p||!t.detected||!!h&&r!==t.id||t.lastImport?.status===`running`,onClick:()=>{S(``),h&&r===t.id?s(!0):L(t.id)},children:p&&r===t.id?e.importing:h&&r===t.id?e.retry:t.lastImport?e.importAgain:e.import})]}),t.lastImport&&(0,B.jsxs)(`div`,{role:`status`,className:`space-y-2 text-sm text-fg-muted`,children:[(0,B.jsxs)(`p`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(_,{className:`h-4 w-4 shrink-0`}),t.lastImport.status===`running`?e.importing:t.lastImport.issues.length?e.finishedWithIssues:e.finished]}),(0,B.jsxs)(`p`,{children:[e.summary.replace(`{skills}`,String(t.lastImport.skills)).replace(`{context}`,String(t.lastImport.context)).replace(`{projects}`,String(t.lastImport.projects)),t.lastImport.skipped>0&&` · ${e.skipped.replace(`{count}`,String(t.lastImport.skipped))}`]}),!!t.lastImport.issues.length&&(0,B.jsxs)(`details`,{children:[(0,B.jsxs)(`summary`,{className:`cursor-pointer text-fg`,children:[e.details,` (`,t.lastImport.issues.length,`)`]}),(0,B.jsx)(`ul`,{className:`mt-2 space-y-2`,children:t.lastImport.issues.map((e,t)=>(0,B.jsxs)(`li`,{className:`break-words`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:e.name}),` — `,e.reason]},t))})]}),t.lastImport.status===`partial`&&(0,B.jsx)(D,{variant:`ghost`,disabled:p||!!h,onClick:()=>void z(t.lastImport),children:e.retryFailed})]})]},t.id))}):(0,B.jsxs)(`div`,{className:`rounded-xl bg-surface-hover/20 p-6 text-sm text-fg-muted`,children:[(0,B.jsx)(`p`,{children:e.empty}),(0,B.jsx)(D,{variant:`ghost`,className:`mt-3`,onClick:()=>E(e=>e+1),children:e.refresh})]}),(0,B.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:e.footnote})]}),(0,B.jsx)(V,{open:a,sourceName:t?.find(e=>e.id===r)?.name??``,inventory:l,selected:d,onSelected:f,busy:p,locked:p||!!h,error:C,onClose:()=>{O.current?.abort(),s(!1)},onRefresh:()=>{r&&L(r)},onSubmit:()=>void R()})]})}export{$ as ImportsPage};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{i as a,n as o,o as s}from"./locale-store-CeEXxDaP.js";import{t as c}from"./messages-L7tv_OPK.js";import{a as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./dist-DlirbHVs.js";import{t as g}from"./braces-Cfmtagno.js";import{t as _}from"./check-DUBLcKHA.js";import{t as v}from"./chevron-down-ccbiQQz_.js";import{t as y}from"./download-Dk-ZjtO6.js";import{t as b}from"./folder-kanban-CpLlFI1o.js";import{t as x}from"./package-wATCyihJ.js";import{t as S}from"./plug-DKYPEgkR.js";import{t as C}from"./search-DA7gz22f.js";import{t as w}from"./settings-2-D-csvaET.js";import{t as T}from"./x-B_N4OPjy.js";import{t as E}from"./cn-0WouolD0.js";import{t as D}from"./button-C5tRaJxt.js";import{i as O,o as k}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as A}from"./settings-loading-skeleton-CAoOV17i.js";import{n as j,t as M}from"./settings-page-header-Wx54i9EL.js";import"./settings-page-layout-DDTKMXIb.js";var N=e(t(),1);async function P(e,t,n){return(await s(a(`/api/imports${e}`),{...t===void 0?{}:{method:`POST`,body:JSON.stringify(t)},signal:n})).data}var F=n();function I(e){return e.kind!==`connection`&&(e.status===`ready`||e.status===`conflict`||e.kind===`project`&&e.status===`existing`)}function L(e,t){let n=e.filter(I),r=n.filter(e=>t.has(e.id)).length;return{checked:n.length>0&&r===n.length,indeterminate:r>0&&r<n.length,selectedCount:r,availableCount:n.length}}function R(e,t,n,r){return n.reduce((t,n)=>z(e,t,n,r),new Set(t))}function z(e,t,n,r){let i=new Set(t);if(!I(n))return i;if(r){if(i.add(n.id),n.parentId&&i.add(n.parentId),n.kind===`project`)for(let t of e.candidates)t.parentId===n.id&&t.kind===`skill`&&t.suggested&&I(t)&&i.add(t.id)}else if(i.delete(n.id),n.kind===`project`)for(let t of e.candidates)t.parentId===n.id&&i.delete(t.id);return i}var B=r();function V(e){let t=(0,F.c)(34),{open:n,sourceName:r,inventory:i,selected:a,onSelected:s,busy:_,locked:v,error:y,onClose:S,onRefresh:C,onSubmit:j}=e,M=c(o(ue)).imports,[P,I]=(0,N.useState)(!0),[L,V]=(0,N.useState)(!1),U;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(U=()=>{I(!0),V(!1)},t[0]=U):U=t[0];let fe=i?.id,W;t[1]===fe?W=t[2]:(W=[fe],t[1]=fe,t[2]=W),(0,N.useEffect)(U,W);let G=i?.candidates.filter(le)??[],K;t[3]===i?.candidates?K=t[4]:(K=i?.candidates.filter(ce)??[],t[3]=i?.candidates,t[4]=K);let q=K,he;t[5]===i?.candidates?he=t[6]:(he=i?.candidates.filter(se)??[],t[5]=i?.candidates,t[6]=he);let ge=he,J;if(t[7]!==i?.candidates){J=new Map;for(let e of i?.candidates??[]){if(!e.parentId)continue;let t=J.get(e.parentId)??[];t.push(e),J.set(e.parentId,t)}t[7]=i?.candidates,t[8]=J}else J=t[8];let ve=J,ye=i?.candidates.filter(e=>a.has(e.id))??[],be=M.selected.replace(`{skills}`,String(ye.filter(oe).length)).replace(`{context}`,String(ye.filter(ae).length)).replace(`{projects}`,String(ye.filter(ie).length)),xe;t[9]!==i||t[10]!==s||t[11]!==a?(xe=(e,t)=>{i&&s(z(i,a,e,t))},t[9]=i,t[10]=s,t[11]=a,t[12]=xe):xe=t[12];let Se=xe,Ce;t[13]!==i||t[14]!==s||t[15]!==a?(Ce=(e,t)=>{i&&s(R(i,a,e,t))},t[13]=i,t[14]=s,t[15]=a,t[16]=Ce):Ce=t[16];let we=Ce,Y;t[17]===S?Y=t[18]:(Y=e=>{e||S()},t[17]=S,t[18]=Y);let X;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,B.jsx)(l,{className:`xopc-dialog-overlay fixed inset-0 bg-scrim ${k}`}),t[19]=X):X=t[19];let Z;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(Z=E(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(calc(100dvh-2rem),760px)] w-[min(calc(100%-2rem),720px)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay outline-none`,`max-sm:bottom-0 max-sm:left-0 max-sm:top-auto max-sm:h-[min(92dvh,760px)] max-sm:w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none`,O),t[20]=Z):Z=t[20];let Q;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,B.jsx)(T,{"aria-hidden":`true`,className:`h-4 w-4`}),t[21]=Q):Q=t[21];let Te=y&&(0,B.jsxs)(`div`,{role:`alert`,className:`space-y-3 rounded-xl border border-edge bg-surface-inset p-4 text-sm text-fg`,children:[(0,B.jsx)(`p`,{children:y}),(0,B.jsx)(D,{variant:`secondary`,disabled:v,onClick:C,children:M.refresh})]}),$;t[22]!==y||t[23]!==i?($=!i&&!y&&(0,B.jsx)(A,{sections:2}),t[22]=y,t[23]=i,t[24]=$):$=t[24];let Ee=i&&(0,B.jsxs)(B.Fragment,{children:[!i.complete&&(0,B.jsx)(`p`,{className:`rounded-lg bg-surface-inset p-3 text-sm text-fg-muted`,children:M.incomplete}),G.length>0&&(0,B.jsxs)(pe,{icon:w,title:M.personalSetup,description:M.personalSetupHint,items:G,selected:a,open:P,disabled:v,onOpenChange:I,onCheckedChange:e=>we(G,e),children:[(0,B.jsx)(me,{icon:x,title:M.kinds.skill,items:G.filter(re),inventoryId:i.id,selected:a,disabled:v,onToggle:Se,onToggleAll:e=>we(G.filter(ne),e)}),(0,B.jsx)(me,{icon:g,title:M.kinds.context,items:G.filter(te),inventoryId:i.id,selected:a,disabled:v,onToggle:Se,onToggleAll:e=>we(G.filter(ee),e)})]}),q.length>0&&(0,B.jsx)(pe,{icon:b,title:M.kinds.project,description:M.projectsHint.replace(`{count}`,String(q.length)),items:q,selected:a,open:L,disabled:v,onOpenChange:V,children:(0,B.jsx)(_e,{inventoryId:i.id,projects:q,projectChildren:ve,selected:a,disabled:v,onToggle:Se})}),ge.length>0&&(0,B.jsx)(de,{inventoryId:i.id,items:ge}),!i.candidates.length&&(0,B.jsx)(`p`,{className:`rounded-xl bg-surface-inset p-5 text-sm text-fg-muted`,children:M.noContent}),!!i.notices.length&&(0,B.jsxs)(`details`,{className:`rounded-xl border border-edge bg-surface-inset p-4 text-sm text-fg-muted`,children:[(0,B.jsxs)(`summary`,{className:`cursor-pointer font-medium text-fg`,children:[M.scanNotices,` (`,i.notices.length,`)`]}),(0,B.jsx)(`ul`,{className:`mt-3 space-y-2`,children:i.notices.map(H)})]})]}),De;t[25]!==Te||t[26]!==$||t[27]!==Ee?(De=(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4 sm:p-6`,children:[Te,$,Ee]}),t[25]=Te,t[26]=$,t[27]=Ee,t[28]=De):De=t[28];let Oe=D,ke=!i||!a.size||_,Ae=_?M.importing:v?M.retry:M.importCount.replace(`{count}`,String(a.size)),je;return t[29]!==Oe||t[30]!==j||t[31]!==ke||t[32]!==Ae?(je=(0,B.jsx)(Oe,{variant:`primary`,disabled:ke,onClick:j,children:Ae}),t[29]=Oe,t[30]=j,t[31]=ke,t[32]=Ae,t[33]=je):je=t[33],(0,B.jsx)(h,{open:n,onOpenChange:Y,children:(0,B.jsxs)(f,{children:[X,(0,B.jsxs)(p,{className:Z,children:[(0,B.jsx)(`header`,{className:`shrink-0 space-y-2 border-b border-edge p-5 sm:p-6`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(m,{className:`text-xl font-semibold text-fg`,children:M.chooseTitle.replace(`{source}`,r)}),(0,B.jsx)(u,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:M.chooseHint})]}),(0,B.jsx)(d,{asChild:!0,children:(0,B.jsx)(D,{variant:`ghost`,"aria-label":M.close,className:`h-10 w-10 shrink-0 p-0`,children:Q})})]})}),De,(0,B.jsx)(`footer`,{className:`shrink-0 border-t border-edge bg-surface-overlay p-4 sm:px-6 sm:py-5`,children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`text-sm text-fg-muted`,children:be}),_&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:M.runningHint}),v&&!_&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:M.retryHint})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2`,children:[(0,B.jsx)(D,{variant:`ghost`,onClick:S,children:_?M.close:M.cancel}),je]})]})})]})]})})}function H(e,t){return(0,B.jsx)(`li`,{className:`break-words`,children:e},t)}function ee(e){return e.kind===`context`}function te(e){return e.kind===`context`}function ne(e){return e.kind===`skill`}function re(e){return e.kind===`skill`}function ie(e){return e.kind===`project`}function ae(e){return e.kind===`context`}function oe(e){return e.kind===`skill`}function se(e){return e.kind===`connection`}function ce(e){return e.kind===`project`}function le(e){return!e.parentId&&(e.kind===`skill`||e.kind===`context`)}function ue(e){return e.language}function de(e){let t=(0,F.c)(13),{inventoryId:n,items:r}=e,a=c(o(fe)).imports,[s,l]=(0,N.useState)(!1),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>l(U),t[0]=u):u=t[0];let d;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,B.jsx)(`span`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-surface-panel text-fg`,children:(0,B.jsx)(S,{"aria-hidden":`true`,className:`h-5 w-5`})}),t[1]=d):d=t[1];let f=a.connectionsHint.replace(`{count}`,String(r.length)),p;t[2]===f?p=t[3]:(p=(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-xs font-normal text-fg-muted`,children:f}),t[2]=f,t[3]=p);let m=s&&`rotate-180`,h;t[4]===m?h=t[5]:(h=E(`h-4 w-4 shrink-0 text-fg-muted transition-transform duration-200 motion-reduce:transition-none`,m),t[4]=m,t[5]=h);let g;t[6]===h?g=t[7]:(g=(0,B.jsx)(v,{"aria-hidden":`true`,className:h}),t[6]=h,t[7]=g);let _;return t[8]!==n||t[9]!==r||t[10]!==s||t[11]!==a?(_=s&&(0,B.jsxs)(`div`,{className:`space-y-2 border-t border-edge bg-surface-overlay p-3 sm:p-4`,children:[r.map(e=>(0,B.jsx)(W,{inventoryId:n,item:e},e.id)),(0,B.jsx)(D,{asChild:!0,variant:`secondary`,children:(0,B.jsx)(i,{to:`/capabilities/connectors`,children:a.connectionsAction})})]}),t[8]=n,t[9]=r,t[10]=s,t[11]=a,t[12]=_):_=t[12],(0,B.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge bg-surface-inset`,children:[(0,B.jsx)(`div`,{className:`flex min-h-16 items-center gap-3 px-3 py-2 sm:px-4`,children:(0,B.jsxs)(D,{variant:`ghost`,className:`min-w-0 flex-1 justify-start gap-3 px-1 text-left`,"aria-expanded":s,onClick:u,children:[d,(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:a.kinds.connection}),p]}),g]})}),_]})}function U(e){return!e}function fe(e){return e.language}function W(e){let t=(0,F.c)(34),{inventoryId:n,item:r}=e,i=o(K),a;t[0]===i?a=t[1]:(a=c(i),t[0]=i,t[1]=a);let s=a.imports,[l,u]=(0,N.useState)(),[d,f]=(0,N.useState)(!1),[p,m]=(0,N.useState)(``),h;t[2]!==n||t[3]!==r.id||t[4]!==l?(h=async function(){if(f(G),!l)try{u(await P(`/inventories/${n}/items/${r.id}/preview`))}catch(e){let t=e;m(t instanceof Error?t.message:String(t))}},t[2]=n,t[3]=r.id,t[4]=l,t[5]=h):h=t[5];let g=h,_;t[6]===r.name?_=t[7]:(_=(0,B.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r.name}),t[6]=r.name,t[7]=_);let v;t[8]===r.displayPath?v=t[9]:(v=(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,title:r.displayPath,children:r.displayPath}),t[8]=r.displayPath,t[9]=v);let y=s.statuses[r.status],b;t[10]===y?b=t[11]:(b=(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:y}),t[10]=y,t[11]=b);let x;t[12]!==_||t[13]!==v||t[14]!==b?(x=(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[_,v,b]}),t[12]=_,t[13]=v,t[14]=b,t[15]=x):x=t[15];let S;t[16]===g?S=t[17]:(S=()=>void g(),t[16]=g,t[17]=S);let C;t[18]!==s.preview||t[19]!==S?(C=(0,B.jsx)(D,{variant:`ghost`,className:`h-9 shrink-0 px-2`,onClick:S,children:s.preview}),t[18]=s.preview,t[19]=S,t[20]=C):C=t[20];let w;t[21]!==C||t[22]!==x?(w=(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[x,C]}),t[21]=C,t[22]=x,t[23]=w):w=t[23];let T;t[24]===r.reason?T=t[25]:(T=r.reason&&(0,B.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:r.reason}),t[24]=r.reason,t[25]=T);let E;t[26]!==p||t[27]!==d||t[28]!==l?(E=d&&(0,B.jsx)(`div`,{className:`mt-3 rounded-lg bg-surface-inset p-3`,children:p?(0,B.jsx)(`p`,{role:`alert`,className:`text-xs text-fg-muted`,children:p}):l?(0,B.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-words text-xs text-fg`,children:l.text}):(0,B.jsx)(A,{sections:1})}),t[26]=p,t[27]=d,t[28]=l,t[29]=E):E=t[29];let O;return t[30]!==w||t[31]!==T||t[32]!==E?(O=(0,B.jsxs)(`div`,{className:`rounded-xl border border-edge p-3`,children:[w,T,E]}),t[30]=w,t[31]=T,t[32]=E,t[33]=O):O=t[33],O}function G(e){return!e}function K(e){return e.language}function pe(e){let t=(0,F.c)(40),{icon:n,title:r,description:i,items:a,selected:o,open:s,disabled:c,onOpenChange:l,onCheckedChange:u,children:d}=e,f;t[0]!==a||t[1]!==u||t[2]!==o?(f=u?L(a,o):void 0,t[0]=a,t[1]=u,t[2]=o,t[3]=f):f=t[3];let p=f,m;t[4]!==l||t[5]!==s?(m=()=>l(!s),t[4]=l,t[5]=s,t[6]=m):m=t[6];let h;t[7]===n?h=t[8]:(h=(0,B.jsx)(`span`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-surface-panel text-fg`,children:(0,B.jsx)(n,{"aria-hidden":`true`,className:`h-5 w-5`})}),t[7]=n,t[8]=h);let g;t[9]===r?g=t[10]:(g=(0,B.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:r}),t[9]=r,t[10]=g);let _;t[11]===i?_=t[12]:(_=(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-xs font-normal text-fg-muted`,children:i}),t[11]=i,t[12]=_);let y;t[13]!==g||t[14]!==_?(y=(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[g,_]}),t[13]=g,t[14]=_,t[15]=y):y=t[15];let b=s&&`rotate-180`,x;t[16]===b?x=t[17]:(x=E(`h-4 w-4 shrink-0 text-fg-muted transition-transform duration-200 motion-reduce:transition-none`,b),t[16]=b,t[17]=x);let S;t[18]===x?S=t[19]:(S=(0,B.jsx)(v,{"aria-hidden":`true`,className:x}),t[18]=x,t[19]=S);let C;t[20]!==s||t[21]!==m||t[22]!==h||t[23]!==y||t[24]!==S?(C=(0,B.jsxs)(D,{variant:`ghost`,className:`min-w-0 flex-1 justify-start gap-3 px-1 text-left`,"aria-expanded":s,onClick:m,children:[h,y,S]}),t[20]=s,t[21]=m,t[22]=h,t[23]=y,t[24]=S,t[25]=C):C=t[25];let w;t[26]!==c||t[27]!==u||t[28]!==p||t[29]!==r?(w=p&&u&&(0,B.jsx)(X,{label:r,checked:p.checked,indeterminate:p.indeterminate,disabled:c||!p.availableCount,onChange:u}),t[26]=c,t[27]=u,t[28]=p,t[29]=r,t[30]=w):w=t[30];let T;t[31]!==C||t[32]!==w?(T=(0,B.jsxs)(`div`,{className:`flex min-h-16 items-center gap-3 px-3 py-2 sm:px-4`,children:[C,w]}),t[31]=C,t[32]=w,t[33]=T):T=t[33];let O;t[34]!==d||t[35]!==s?(O=s&&(0,B.jsx)(`div`,{className:`space-y-2 border-t border-edge bg-surface-overlay p-3 sm:p-4`,children:d}),t[34]=d,t[35]=s,t[36]=O):O=t[36];let k;return t[37]!==T||t[38]!==O?(k=(0,B.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge bg-surface-inset`,children:[T,O]}),t[37]=T,t[38]=O,t[39]=k):k=t[39],k}function me(e){let t=(0,F.c)(34),{icon:n,title:r,items:i,inventoryId:a,selected:s,disabled:l,onToggle:u,onToggleAll:d}=e,f=c(o(ge)).imports,[p,m]=(0,N.useState)(!1),[h,g]=(0,N.useState)(``),[_,y]=(0,N.useState)(60);if(!i.length)return null;let b;t[0]!==i||t[1]!==s?(b=L(i,s),t[0]=i,t[1]=s,t[2]=b):b=t[2];let x=b,S=Y(i,h),C=S.slice(0,_),w;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>m(he),t[3]=w):w=t[3];let T;t[4]===n?T=t[5]:(T=(0,B.jsx)(n,{"aria-hidden":`true`,className:`h-5 w-5 shrink-0 text-fg-muted`}),t[4]=n,t[5]=T);let O;t[6]!==i.length||t[7]!==r?(O=(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-fg`,children:[r,` (`,i.length,`)`]}),t[6]=i.length,t[7]=r,t[8]=O):O=t[8];let k;t[9]!==x.availableCount||t[10]!==x.selectedCount?(k=(0,B.jsxs)(`span`,{className:`text-xs font-normal text-fg-muted`,children:[x.selectedCount,`/`,x.availableCount]}),t[9]=x.availableCount,t[10]=x.selectedCount,t[11]=k):k=t[11];let A=p&&`rotate-180`,j;t[12]===A?j=t[13]:(j=E(`h-4 w-4 shrink-0 text-fg-muted transition-transform duration-200 motion-reduce:transition-none`,A),t[12]=A,t[13]=j);let M;t[14]===j?M=t[15]:(M=(0,B.jsx)(v,{"aria-hidden":`true`,className:j}),t[14]=j,t[15]=M);let P;t[16]!==p||t[17]!==T||t[18]!==O||t[19]!==k||t[20]!==M?(P=(0,B.jsxs)(D,{variant:`ghost`,className:`min-w-0 flex-1 justify-start px-1 text-left`,"aria-expanded":p,onClick:w,children:[T,O,k,M]}),t[16]=p,t[17]=T,t[18]=O,t[19]=k,t[20]=M,t[21]=P):P=t[21];let I=l||!x.availableCount,R;t[22]!==d||t[23]!==x.checked||t[24]!==x.indeterminate||t[25]!==I||t[26]!==r?(R=(0,B.jsx)(X,{label:r,checked:x.checked,indeterminate:x.indeterminate,disabled:I,onChange:d}),t[22]=d,t[23]=x.checked,t[24]=x.indeterminate,t[25]=I,t[26]=r,t[27]=R):R=t[27];let z;t[28]!==P||t[29]!==R?(z=(0,B.jsxs)(`div`,{className:`flex min-h-14 items-center gap-2 px-3 py-2`,children:[P,R]}),t[28]=P,t[29]=R,t[30]=z):z=t[30];let V=p&&(0,B.jsxs)(`div`,{className:`space-y-2 border-t border-edge p-2`,children:[i.length>8&&(0,B.jsx)(we,{value:h,label:f.searchWithin.replace(`{group}`,r),onChange:e=>{g(e),y(60)}}),(0,B.jsx)(`div`,{className:`space-y-1`,children:C.map(e=>(0,B.jsx)(Z,{inventoryId:a,item:e,checked:s.has(e.id),disabled:l,onChange:t=>u(e,t)},e.id))}),!S.length&&(0,B.jsx)(`p`,{className:`p-3 text-sm text-fg-muted`,children:f.noMatches}),C.length<S.length&&(0,B.jsx)(D,{variant:`ghost`,className:`w-full`,onClick:()=>y(q),children:f.showMore.replace(`{count}`,String(S.length-C.length))})]}),H;return t[31]!==z||t[32]!==V?(H=(0,B.jsxs)(`div`,{className:`rounded-xl border border-edge`,children:[z,V]}),t[31]=z,t[32]=V,t[33]=H):H=t[33],H}function q(e){return e+60}function he(e){return!e}function ge(e){return e.language}function _e(e){let t=(0,F.c)(15),{inventoryId:n,projects:r,projectChildren:i,selected:a,disabled:s,onToggle:l}=e,u=c(o(ve)).imports,[d,f]=(0,N.useState)(``),[p,m]=(0,N.useState)(60),h;t[0]===i?h=t[1]:(h=e=>i.get(e.id)??[],t[0]=i,t[1]=h);let g=Y(r,d,h),_=g.slice(0,p),v=r.length>8&&(0,B.jsx)(we,{value:d,label:u.searchWithin.replace(`{group}`,u.kinds.project),onChange:e=>{f(e),m(60)}}),y;t[2]!==s||t[3]!==n||t[4]!==l||t[5]!==i||t[6]!==a?(y=e=>(0,B.jsx)(ye,{inventoryId:n,project:e,children:i.get(e.id)??[],selected:a,disabled:s,onToggle:l},e.id),t[2]=s,t[3]=n,t[4]=l,t[5]=i,t[6]=a,t[7]=y):y=t[7];let b=_.map(y),x;t[8]===b?x=t[9]:(x=(0,B.jsx)(`div`,{className:`space-y-2`,children:b}),t[8]=b,t[9]=x);let S=!g.length&&(0,B.jsx)(`p`,{className:`p-3 text-sm text-fg-muted`,children:u.noMatches}),C=_.length<g.length&&(0,B.jsx)(D,{variant:`ghost`,className:`w-full`,onClick:()=>m(J),children:u.showMore.replace(`{count}`,String(g.length-_.length))}),w;return t[10]!==v||t[11]!==x||t[12]!==S||t[13]!==C?(w=(0,B.jsxs)(`div`,{className:`space-y-2`,children:[v,x,S,C]}),t[10]=v,t[11]=x,t[12]=S,t[13]=C,t[14]=w):w=t[14],w}function J(e){return e+60}function ve(e){return e.language}function ye(e){let t=(0,F.c)(39),{inventoryId:n,project:r,children:i,selected:a,disabled:s,onToggle:l}=e,u=c(o(Ce)).imports,[d,f]=(0,N.useState)(!1),p;if(t[0]!==i||t[1]!==a){let e;t[3]===a?e=t[4]:(e=e=>a.has(e.id),t[3]=a,t[4]=e),p=i.filter(e),t[0]=i,t[1]=a,t[2]=p}else p=t[2];let m=p.length,h;t[5]===r.name?h=t[6]:(h=(0,B.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:r.name}),t[5]=r.name,t[6]=h);let g;t[7]===r.displayPath?g=t[8]:(g=(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-xs font-normal text-fg-muted`,title:r.displayPath,children:r.displayPath}),t[7]=r.displayPath,t[8]=g);let _;t[9]!==h||t[10]!==g?(_=(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[h,g]}),t[9]=h,t[10]=g,t[11]=_):_=t[11];let y=_,b=i.length>0?(0,B.jsxs)(D,{variant:`ghost`,className:`min-w-0 flex-1 justify-start px-2 text-left`,"aria-expanded":d,onClick:()=>f(Se),children:[y,(0,B.jsxs)(`span`,{className:`text-xs font-normal text-fg-muted`,children:[u.projectContents.replace(`{skills}`,String(i.filter(xe).length)).replace(`{context}`,String(i.filter(be).length)),` · `,u.chosenCount.replace(`{count}`,String(m))]}),(0,B.jsx)(v,{"aria-hidden":`true`,className:E(`h-4 w-4 shrink-0 text-fg-muted transition-transform duration-200 motion-reduce:transition-none`,d&&`rotate-180`)})]}):(0,B.jsx)(`div`,{className:`min-w-0 flex-1 px-2`,children:y}),x=r.name,S;t[12]!==r.id||t[13]!==a?(S=a.has(r.id),t[12]=r.id,t[13]=a,t[14]=S):S=t[14];let C;t[15]!==s||t[16]!==r?(C=s||!I(r),t[15]=s,t[16]=r,t[17]=C):C=t[17];let w;t[18]!==l||t[19]!==r?(w=e=>l(r,e.target.checked),t[18]=l,t[19]=r,t[20]=w):w=t[20];let T;t[21]!==r.name||t[22]!==C||t[23]!==w||t[24]!==S?(T=(0,B.jsx)(`input`,{type:`checkbox`,"aria-label":x,checked:S,disabled:C,onChange:w}),t[21]=r.name,t[22]=C,t[23]=w,t[24]=S,t[25]=T):T=t[25];let O;t[26]!==T||t[27]!==b?(O=(0,B.jsxs)(`div`,{className:`flex items-center gap-2 p-2`,children:[b,T]}),t[26]=T,t[27]=b,t[28]=O):O=t[28];let k;t[29]!==i||t[30]!==s||t[31]!==n||t[32]!==l||t[33]!==d||t[34]!==a?(k=d&&(0,B.jsx)(`div`,{className:`border-t border-edge p-2`,children:(0,B.jsx)(`div`,{className:`space-y-1`,children:i.map(e=>(0,B.jsx)(Z,{inventoryId:n,item:e,checked:a.has(e.id),disabled:s,onChange:t=>l(e,t)},e.id))})}),t[29]=i,t[30]=s,t[31]=n,t[32]=l,t[33]=d,t[34]=a,t[35]=k):k=t[35];let A;return t[36]!==O||t[37]!==k?(A=(0,B.jsxs)(`div`,{className:`rounded-xl border border-edge`,children:[O,k]}),t[36]=O,t[37]=k,t[38]=A):A=t[38],A}function be(e){return e.kind===`context`}function xe(e){return e.kind===`skill`}function Se(e){return!e}function Ce(e){return e.language}function we(e){let t=(0,F.c)(13),{value:n,label:r,onChange:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,B.jsx)(C,{"aria-hidden":`true`,className:`h-4 w-4 shrink-0 text-fg-muted`}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=(0,B.jsx)(`span`,{className:`sr-only`,children:r}),t[1]=r,t[2]=o);let s=`${r}…`,c;t[3]===i?c=t[4]:(c=e=>i(e.target.value),t[3]=i,t[4]=c);let l;t[5]!==r||t[6]!==s||t[7]!==c||t[8]!==n?(l=(0,B.jsx)(`input`,{type:`search`,autoComplete:`off`,value:n,placeholder:s,"aria-label":r,onChange:c,className:`min-w-0 flex-1 border-0 bg-transparent px-0 py-2 text-sm text-fg placeholder:text-fg-subtle`}),t[5]=r,t[6]=s,t[7]=c,t[8]=n,t[9]=l):l=t[9];let u;return t[10]!==o||t[11]!==l?(u=(0,B.jsxs)(`label`,{className:`flex items-center gap-2 rounded-lg border border-edge bg-surface-panel px-3 focus-within:border-accent focus-within:ring-1 focus-within:ring-accent`,children:[a,o,l]}),t[10]=o,t[11]=l,t[12]=u):u=t[12],u}function Y(e,t,n=()=>[]){let r=t.trim().toLocaleLowerCase();if(!r)return e;let i=e=>`${e.name} ${e.description} ${e.displayPath}`.toLocaleLowerCase().includes(r);return e.filter(e=>i(e)||n(e).some(i))}function X(e){let t=(0,F.c)(10),{label:n,checked:r,indeterminate:i,disabled:a,onChange:o}=e,s=(0,N.useRef)(null),c,l;t[0]===i?(c=t[1],l=t[2]):(c=()=>{s.current&&(s.current.indeterminate=i)},l=[i],t[0]=i,t[1]=c,t[2]=l),(0,N.useEffect)(c,l);let u;t[3]===o?u=t[4]:(u=e=>o(e.target.checked),t[3]=o,t[4]=u);let d;return t[5]!==r||t[6]!==a||t[7]!==n||t[8]!==u?(d=(0,B.jsx)(`input`,{ref:s,type:`checkbox`,"aria-label":n,checked:r,disabled:a,onChange:u}),t[5]=r,t[6]=a,t[7]=n,t[8]=u,t[9]=d):d=t[9],d}function Z(e){let t=(0,F.c)(52),{inventoryId:n,item:r,checked:i,disabled:a,onChange:s}=e,l=o(Te),u;t[0]===l?u=t[1]:(u=c(l),t[0]=l,t[1]=u);let d=u.imports,[f,p]=(0,N.useState)(),[m,h]=(0,N.useState)(``),[g,_]=(0,N.useState)(!1),v;t[2]!==n||t[3]!==r.id||t[4]!==f?(v=async function(){if(_(Q),!f)try{p(await P(`/inventories/${n}/items/${r.id}/preview`))}catch(e){let t=e;h(t instanceof Error?t.message:String(t))}},t[2]=n,t[3]=r.id,t[4]=f,t[5]=v):v=t[5];let y=v,b;t[6]!==a||t[7]!==r?(b=a||!I(r),t[6]=a,t[7]=r,t[8]=b):b=t[8];let x;t[9]===s?x=t[10]:(x=e=>s(e.target.checked),t[9]=s,t[10]=x);let S;t[11]!==i||t[12]!==b||t[13]!==x?(S=(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-0.5`,checked:i,disabled:b,onChange:x}),t[11]=i,t[12]=b,t[13]=x,t[14]=S):S=t[14];let C;t[15]===r.name?C=t[16]:(C=(0,B.jsx)(`span`,{className:`block break-words text-sm font-medium text-fg`,children:r.name}),t[15]=r.name,t[16]=C);let w;t[17]===r.displayPath?w=t[18]:(w=(0,B.jsx)(`span`,{className:`block truncate text-xs text-fg-muted`,title:r.displayPath,children:r.displayPath}),t[17]=r.displayPath,t[18]=w);let T;t[19]!==C||t[20]!==w?(T=(0,B.jsxs)(`span`,{className:`min-w-0`,children:[C,w]}),t[19]=C,t[20]=w,t[21]=T):T=t[21];let E;t[22]!==S||t[23]!==T?(E=(0,B.jsxs)(`label`,{className:`flex min-w-0 flex-1 cursor-pointer items-start gap-3 py-1`,children:[S,T]}),t[22]=S,t[23]=T,t[24]=E):E=t[24];let O;t[25]!==r.name||t[26]!==r.status||t[27]!==d||t[28]!==y?(O=r.status!==`blocked`&&(0,B.jsx)(D,{variant:`ghost`,"aria-label":`${d.preview}: ${r.name}`,className:`h-9 shrink-0 px-2`,onClick:()=>void y(),children:d.preview}),t[25]=r.name,t[26]=r.status,t[27]=d,t[28]=y,t[29]=O):O=t[29];let k;t[30]!==E||t[31]!==O?(k=(0,B.jsxs)(`div`,{className:`flex items-start gap-2`,children:[E,O]}),t[30]=E,t[31]=O,t[32]=k):k=t[32];let j;t[33]===r.description?j=t[34]:(j=r.description&&(0,B.jsx)(`p`,{className:`pl-7 text-xs text-fg-muted`,children:r.description}),t[33]=r.description,t[34]=j);let M;t[35]!==r.status||t[36]!==r.targetName||t[37]!==d?(M=r.status!==`ready`&&(0,B.jsxs)(`p`,{className:`pl-7 text-xs text-fg-muted`,children:[d.statuses[r.status],r.status===`conflict`?` → ${r.targetName}`:``]}),t[35]=r.status,t[36]=r.targetName,t[37]=d,t[38]=M):M=t[38];let L;t[39]===r.reason?L=t[40]:(L=r.reason&&(0,B.jsx)(`p`,{className:`break-words pl-7 text-xs text-fg-muted`,children:r.reason}),t[39]=r.reason,t[40]=L);let R;t[41]!==f||t[42]!==m||t[43]!==g||t[44]!==d?(R=g&&(0,B.jsx)(`div`,{className:`ml-7 mt-2 rounded-lg border border-edge bg-surface-inset p-3`,children:m?(0,B.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:m}):f?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`pre`,{className:`max-h-60 overflow-auto whitespace-pre-wrap break-words text-xs text-fg`,children:f.text}),f.truncated&&(0,B.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:d.previewTruncated})]}):(0,B.jsx)(A,{sections:1})}),t[41]=f,t[42]=m,t[43]=g,t[44]=d,t[45]=R):R=t[45];let z;return t[46]!==k||t[47]!==j||t[48]!==M||t[49]!==L||t[50]!==R?(z=(0,B.jsxs)(`div`,{className:`min-w-0 rounded-lg px-2 py-1.5 hover:bg-surface-hover/60`,children:[k,j,M,L,R]}),t[46]=k,t[47]=j,t[48]=M,t[49]=L,t[50]=R,t[51]=z):z=t[51],z}function Q(e){return!e}function Te(e){return e.language}function $(){let e=c(o(e=>e.language)).imports,[t,n]=(0,N.useState)(),[r,i]=(0,N.useState)(),[a,s]=(0,N.useState)(!1),[l,u]=(0,N.useState)(),[d,f]=(0,N.useState)(new Set),[p,m]=(0,N.useState)(!1),[h,g]=(0,N.useState)(),[v,b]=(0,N.useState)(),[x,S]=(0,N.useState)(``),[C,w]=(0,N.useState)(``),[T,E]=(0,N.useState)(0),O=(0,N.useRef)(null),k=(0,N.useRef)(!1);(0,N.useEffect)(()=>{let e=new AbortController;return S(``),P(`/sources`,void 0,e.signal).then(e=>n(e.sources)).catch(t=>{e.signal.aborted||S(t instanceof Error?t.message:String(t))}),()=>{e.abort(),O.current?.abort()}},[T]);let F=(t?.flatMap(e=>e.lastImport?.status===`running`?[e.lastImport.id]:[])??[]).join(`,`);(0,N.useEffect)(()=>{if(!F)return;let e=new AbortController,t,n=async()=>{for(let t of F.split(`,`))try{let n=await P(`/runs/${t}`,void 0,e.signal);e.signal.aborted||I(n)}catch{}e.signal.aborted||(t=setTimeout(()=>void n(),3e3))};return t=setTimeout(()=>void n(),1500),()=>{e.abort(),clearTimeout(t)}},[F]);function I(e){n(t=>t?.map(t=>t.id===e.source?{...t,lastImport:e}:t)),e.status!==`running`&&g(t=>t?.requestId===e.id?void 0:t)}async function L(e){O.current?.abort();let t=new AbortController;O.current=t,i(e),s(!0),u(void 0),f(new Set),w(``),b(void 0),g(void 0);try{let n=await P(`/sources/${e}/scan`,{},t.signal);t.signal.aborted||(u(n),f(new Set(n.candidates.filter(e=>!e.parentId&&e.suggested).map(e=>e.id))))}catch(e){t.signal.aborted||w(e instanceof Error?e.message:String(e))}}async function R(){if(!l||!d.size||k.current)return;k.current=!0,m(!0),w(``),S(``);let e=h??{inventoryId:l.id,candidateIds:[...d],requestId:crypto.randomUUID(),retryOf:v};g(e);try{I(await P(`/runs`,e)),s(!1)}catch(e){let t=e instanceof Error?e.message:String(e);w(t),S(t);let n=e.body?.code;n&&[`invalid_input`,`inventory_stale`,`invalid_selection`,`missing_parent`,`not_found`,`conflict`].includes(n)&&g(void 0)}finally{k.current=!1,m(!1)}}async function z(e){i(e.source),s(!0),u(void 0),f(new Set),w(``),g(void 0),b(e.id),O.current?.abort();let t=new AbortController;O.current=t;try{let n=await P(`/inventories/${e.inventoryId}`,void 0,t.signal);if(t.signal.aborted)return;let r=new Set(e.items.filter(e=>e.status===`failed`).map(e=>e.candidateId));n.candidates.forEach(e=>{r.has(e.id)&&e.parentId&&r.add(e.parentId)}),u({...n,candidates:n.candidates.filter(e=>r.has(e.id))}),f(r)}catch(e){t.signal.aborted||w(e instanceof Error?e.message:String(e))}}let H=t?.filter(e=>e.detected||e.lastImport);return(0,B.jsxs)(j,{children:[(0,B.jsx)(M,{title:e.title,subtitle:e.subtitle}),x&&(0,B.jsxs)(`div`,{role:`alert`,className:`rounded-xl bg-danger-soft p-4 text-sm text-danger`,children:[(0,B.jsx)(`p`,{children:x}),!t&&(0,B.jsx)(D,{variant:`ghost`,onClick:()=>E(e=>e+1),children:e.retry})]}),!t&&!x&&(0,B.jsx)(A,{sections:1}),t&&(0,B.jsxs)(`section`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-base font-medium text-fg`,children:e.apps}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.detectedHint})]}),H?.length?(0,B.jsx)(`div`,{className:`flex flex-col gap-1 overflow-hidden rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:H.map(t=>(0,B.jsxs)(`article`,{className:`space-y-3 p-5 sm:p-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-surface-hover text-fg`,children:(0,B.jsx)(y,{className:`h-5 w-5`})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`h3`,{className:`font-medium text-fg`,children:t.name}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.includes})]}),(0,B.jsx)(D,{variant:`secondary`,disabled:p||!t.detected||!!h&&r!==t.id||t.lastImport?.status===`running`,onClick:()=>{S(``),h&&r===t.id?s(!0):L(t.id)},children:p&&r===t.id?e.importing:h&&r===t.id?e.retry:t.lastImport?e.importAgain:e.import})]}),t.lastImport&&(0,B.jsxs)(`div`,{role:`status`,className:`space-y-2 text-sm text-fg-muted`,children:[(0,B.jsxs)(`p`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(_,{className:`h-4 w-4 shrink-0`}),t.lastImport.status===`running`?e.importing:t.lastImport.issues.length?e.finishedWithIssues:e.finished]}),(0,B.jsxs)(`p`,{children:[e.summary.replace(`{skills}`,String(t.lastImport.skills)).replace(`{context}`,String(t.lastImport.context)).replace(`{projects}`,String(t.lastImport.projects)),t.lastImport.skipped>0&&` · ${e.skipped.replace(`{count}`,String(t.lastImport.skipped))}`]}),!!t.lastImport.issues.length&&(0,B.jsxs)(`details`,{children:[(0,B.jsxs)(`summary`,{className:`cursor-pointer text-fg`,children:[e.details,` (`,t.lastImport.issues.length,`)`]}),(0,B.jsx)(`ul`,{className:`mt-2 space-y-2`,children:t.lastImport.issues.map((e,t)=>(0,B.jsxs)(`li`,{className:`break-words`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:e.name}),` — `,e.reason]},t))})]}),t.lastImport.status===`partial`&&(0,B.jsx)(D,{variant:`ghost`,disabled:p||!!h,onClick:()=>void z(t.lastImport),children:e.retryFailed})]})]},t.id))}):(0,B.jsxs)(`div`,{className:`rounded-xl bg-surface-hover/20 p-6 text-sm text-fg-muted`,children:[(0,B.jsx)(`p`,{children:e.empty}),(0,B.jsx)(D,{variant:`ghost`,className:`mt-3`,onClick:()=>E(e=>e+1),children:e.refresh})]}),(0,B.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:e.footnote})]}),(0,B.jsx)(V,{open:a,sourceName:t?.find(e=>e.id===r)?.name??``,inventory:l,selected:d,onSelected:f,busy:p,locked:p||!!h,error:C,onClose:()=>{O.current?.abort(),s(!1)},onRefresh:()=>{r&&L(r)},onSubmit:()=>void R()})]})}export{$ as ImportsPage};
|