@bryanhu/codexly 0.37.0 → 0.38.0
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/CHANGELOG.md +46 -16
- package/README.md +8 -47
- package/README.zh-CN.md +8 -47
- package/dist/chunk-4RQ7HLCK.js +3 -0
- package/dist/chunk-GMNBWGMQ.js +5 -0
- package/dist/{chunk-PQPYP3AR.js → chunk-LGFUYNXR.js} +1 -1
- package/dist/{chunk-JHBSDMIM.js → chunk-RWMSDM4X.js} +1 -1
- package/dist/{chunk-ZK5H37U3.js → chunk-SNN2J7BU.js} +187 -170
- package/dist/chunk-YCHIPWV2.js +40 -0
- package/dist/cli.js +5 -5
- package/dist/client/index.js +2 -2
- package/dist/{command-RGXPFWPR.js → command-2D66UEBJ.js} +1 -1
- package/dist/core/index.js +1 -1
- package/dist/protocol/index.js +1 -1
- package/dist/providers/codex/index.js +1 -1
- package/dist/server/index.js +1 -1
- package/dist/sqlite-state-worker.js +22 -18
- package/dist/web/.vite/manifest.json +128 -135
- package/dist/web/.vite/manifest.json.br +0 -0
- package/dist/web/.vite/manifest.json.gz +0 -0
- package/dist/web/assets/{agent-settings-panel-K1YqqkJL.js → agent-settings-panel-C9S0LXqi.js} +1 -1
- package/dist/web/assets/agent-settings-panel-C9S0LXqi.js.br +0 -0
- package/dist/web/assets/agent-settings-panel-C9S0LXqi.js.gz +0 -0
- package/dist/web/assets/app-update-dialog-BsIh1VPg.js +1 -0
- package/dist/web/assets/app-update-dialog-BsIh1VPg.js.br +0 -0
- package/dist/web/assets/app-update-dialog-BsIh1VPg.js.gz +0 -0
- package/dist/web/assets/{background-image-picker-BHqZ3SX1.js → background-image-picker-B1xDUft3.js} +1 -1
- package/dist/web/assets/background-image-picker-B1xDUft3.js.br +0 -0
- package/dist/web/assets/background-image-picker-B1xDUft3.js.gz +0 -0
- package/dist/web/assets/{code-highlighter-DIfBIRTg.js → code-highlighter-kiC_chgH.js} +1 -1
- package/dist/web/assets/code-highlighter-kiC_chgH.js.br +0 -0
- package/dist/web/assets/code-highlighter-kiC_chgH.js.gz +0 -0
- package/dist/web/assets/{commit-settings-panel-B0i2Bqmu.js → commit-settings-panel-Cdtyux2J.js} +1 -1
- package/dist/web/assets/commit-settings-panel-Cdtyux2J.js.br +0 -0
- package/dist/web/assets/commit-settings-panel-Cdtyux2J.js.gz +0 -0
- package/dist/web/assets/file-review-dialog-DaGgZASG.js +2 -0
- package/dist/web/assets/file-review-dialog-DaGgZASG.js.br +0 -0
- package/dist/web/assets/file-review-dialog-DaGgZASG.js.gz +0 -0
- package/dist/web/assets/git-commit-review-Bz8YDy59.js +2 -0
- package/dist/web/assets/git-commit-review-Bz8YDy59.js.br +0 -0
- package/dist/web/assets/git-commit-review-Bz8YDy59.js.gz +0 -0
- package/dist/web/assets/{git-history-panel-Bk5XtV-h.js → git-history-panel-QBsXgUT7.js} +1 -1
- package/dist/web/assets/git-history-panel-QBsXgUT7.js.br +0 -0
- package/dist/web/assets/git-history-panel-QBsXgUT7.js.gz +0 -0
- package/dist/web/assets/{global-search-dialog-nP5Zoo16.js → global-search-dialog-DDaHRgce.js} +1 -1
- package/dist/web/assets/global-search-dialog-DDaHRgce.js.br +0 -0
- package/dist/web/assets/global-search-dialog-DDaHRgce.js.gz +0 -0
- package/dist/web/assets/global-settings-about-DpKyx3RM.js +1 -0
- package/dist/web/assets/global-settings-about-DpKyx3RM.js.br +0 -0
- package/dist/web/assets/global-settings-about-DpKyx3RM.js.gz +0 -0
- package/dist/web/assets/{global-settings-page-Bm6WTYej.js → global-settings-page-BEUBn7B5.js} +2 -2
- package/dist/web/assets/global-settings-page-BEUBn7B5.js.br +0 -0
- package/dist/web/assets/global-settings-page-BEUBn7B5.js.gz +0 -0
- package/dist/web/assets/{global-settings-pets-ChV29f_6.js → global-settings-pets-DBYFpNQk.js} +1 -1
- package/dist/web/assets/global-settings-pets-DBYFpNQk.js.br +0 -0
- package/dist/web/assets/global-settings-pets-DBYFpNQk.js.gz +0 -0
- package/dist/web/assets/{highlighted-body-OFNGDK62-D1VJUKau.js → highlighted-body-OFNGDK62-CeVKUhHG.js} +1 -1
- package/dist/web/assets/highlighted-body-OFNGDK62-CeVKUhHG.js.br +0 -0
- package/dist/web/assets/highlighted-body-OFNGDK62-CeVKUhHG.js.gz +0 -0
- package/dist/web/assets/{history-task-timeline-CphChwX0.js → history-task-timeline-Dl6to6Cp.js} +1 -1
- package/dist/web/assets/history-task-timeline-Dl6to6Cp.js.br +0 -0
- package/dist/web/assets/history-task-timeline-Dl6to6Cp.js.gz +0 -0
- package/dist/web/assets/{image-preview-CZiY9KQs.js → image-preview-Bez628xh.js} +2 -2
- package/dist/web/assets/image-preview-Bez628xh.js.br +0 -0
- package/dist/web/assets/image-preview-Bez628xh.js.gz +0 -0
- package/dist/web/assets/{image-preview-content-D54Quns6.js → image-preview-content-TkopF2n1.js} +1 -1
- package/dist/web/assets/image-preview-content-TkopF2n1.js.br +0 -0
- package/dist/web/assets/image-preview-content-TkopF2n1.js.gz +0 -0
- package/dist/web/assets/index-CHJSDTYw.css +2 -0
- package/dist/web/assets/index-CHJSDTYw.css.br +0 -0
- package/dist/web/assets/index-CHJSDTYw.css.gz +0 -0
- package/dist/web/assets/index-DobF11m_.js +4 -0
- package/dist/web/assets/index-DobF11m_.js.br +0 -0
- package/dist/web/assets/index-DobF11m_.js.gz +0 -0
- package/dist/web/assets/initial-deps-C-3sxJvc.js +2 -0
- package/dist/web/assets/initial-deps-C-3sxJvc.js.br +0 -0
- package/dist/web/assets/initial-deps-C-3sxJvc.js.gz +0 -0
- package/dist/web/assets/{installed-skills-pane-DnKCXx4r.js → installed-skills-pane-yCfl2E4Z.js} +1 -1
- package/dist/web/assets/installed-skills-pane-yCfl2E4Z.js.br +0 -0
- package/dist/web/assets/installed-skills-pane-yCfl2E4Z.js.gz +0 -0
- package/dist/web/assets/markdown-DVABVVc2.js +1 -0
- package/dist/web/assets/markdown-DVABVVc2.js.br +0 -0
- package/dist/web/assets/markdown-DVABVVc2.js.gz +0 -0
- package/dist/web/assets/{mcp-management-pane-CAcqH6Ft.js → mcp-management-pane-D4fhknd1.js} +1 -1
- package/dist/web/assets/mcp-management-pane-D4fhknd1.js.br +0 -0
- package/dist/web/assets/mcp-management-pane-D4fhknd1.js.gz +0 -0
- package/dist/web/assets/mdx-BLuqtYwj.js +1 -0
- package/dist/web/assets/mdx-BLuqtYwj.js.br +0 -0
- package/dist/web/assets/mdx-BLuqtYwj.js.gz +0 -0
- package/dist/web/assets/mermaid-GHXKKRXX-BL0SiEsb.js +1 -0
- package/dist/web/assets/mermaid-GHXKKRXX-BL0SiEsb.js.br +1 -0
- package/dist/web/assets/mermaid-GHXKKRXX-BL0SiEsb.js.gz +0 -0
- package/dist/web/assets/message-assistant-directive-r0UOX93m.js +3 -0
- package/dist/web/assets/message-assistant-directive-r0UOX93m.js.br +0 -0
- package/dist/web/assets/message-assistant-directive-r0UOX93m.js.gz +0 -0
- package/dist/web/assets/message-response-DTlvlBMa.js +151 -0
- package/dist/web/assets/message-response-DTlvlBMa.js.br +0 -0
- package/dist/web/assets/message-response-DTlvlBMa.js.gz +0 -0
- package/dist/web/assets/{official-plugins-pane-CBk4rbLt.js → official-plugins-pane-CRnpq0MJ.js} +1 -1
- package/dist/web/assets/official-plugins-pane-CRnpq0MJ.js.br +0 -0
- package/dist/web/assets/official-plugins-pane-CRnpq0MJ.js.gz +0 -0
- package/dist/web/assets/{patch-diff-viewer-nIzfWkKE.js → patch-diff-viewer-fv2hVYyb.js} +3 -3
- package/dist/web/assets/patch-diff-viewer-fv2hVYyb.js.br +0 -0
- package/dist/web/assets/patch-diff-viewer-fv2hVYyb.js.gz +0 -0
- package/dist/web/assets/{pdf-preview-Zrj4u-KR.js → pdf-preview-CEvfJiZa.js} +3 -3
- package/dist/web/assets/pdf-preview-CEvfJiZa.js.br +0 -0
- package/dist/web/assets/pdf-preview-CEvfJiZa.js.gz +0 -0
- package/dist/web/assets/{personalization-settings-panel-D3OqsNUV.js → personalization-settings-panel-CmNqDQg6.js} +1 -1
- package/dist/web/assets/personalization-settings-panel-CmNqDQg6.js.br +0 -0
- package/dist/web/assets/personalization-settings-panel-CmNqDQg6.js.gz +0 -0
- package/dist/web/assets/{project-file-popup-page-7yzFqPZq.js → project-file-popup-page-rkdge4He.js} +1 -1
- package/dist/web/assets/project-file-popup-page-rkdge4He.js.br +0 -0
- package/dist/web/assets/project-file-popup-page-rkdge4He.js.gz +0 -0
- package/dist/web/assets/project-source-panel-Dfdd7hXf.js +2 -0
- package/dist/web/assets/project-source-panel-Dfdd7hXf.js.br +0 -0
- package/dist/web/assets/project-source-panel-Dfdd7hXf.js.gz +0 -0
- package/dist/web/assets/{prompt-input--2KQl6SR.js → prompt-input-rTS8jFNM.js} +1 -1
- package/dist/web/assets/prompt-input-rTS8jFNM.js.br +0 -0
- package/dist/web/assets/prompt-input-rTS8jFNM.js.gz +0 -0
- package/dist/web/assets/resources-en-DiMZyInt.js +1 -0
- package/dist/web/assets/resources-en-DiMZyInt.js.br +0 -0
- package/dist/web/assets/resources-en-DiMZyInt.js.gz +0 -0
- package/dist/web/assets/{scheduled-task-date-time-picker-BVYVGT78.js → scheduled-task-date-time-picker-8cWX1p1O.js} +1 -1
- package/dist/web/assets/scheduled-task-date-time-picker-8cWX1p1O.js.br +0 -0
- package/dist/web/assets/scheduled-task-date-time-picker-8cWX1p1O.js.gz +0 -0
- package/dist/web/assets/{scheduled-tasks-container-CQkfAgKW.js → scheduled-tasks-container-BA7pSsmC.js} +2 -2
- package/dist/web/assets/scheduled-tasks-container-BA7pSsmC.js.br +0 -0
- package/dist/web/assets/scheduled-tasks-container-BA7pSsmC.js.gz +0 -0
- package/dist/web/assets/scheduled-tasks-container-DrOJ_UbG.css +1 -0
- package/dist/web/assets/scheduled-tasks-container-DrOJ_UbG.css.br +0 -0
- package/dist/web/assets/scheduled-tasks-container-DrOJ_UbG.css.gz +0 -0
- package/dist/web/assets/{shiki-bundle-COC_j-nR.js → shiki-bundle-CHd-S0Yk.js} +1 -1
- package/dist/web/assets/shiki-bundle-CHd-S0Yk.js.br +2 -0
- package/dist/web/assets/shiki-bundle-CHd-S0Yk.js.gz +0 -0
- package/dist/web/assets/{skills-market-container-_ME3wZFP.js → skills-market-container-BdTREXZb.js} +2 -2
- package/dist/web/assets/skills-market-container-BdTREXZb.js.br +0 -0
- package/dist/web/assets/skills-market-container-BdTREXZb.js.gz +0 -0
- package/dist/web/assets/{split-workspace-menu-content-CkpZv1Nz.js → split-workspace-menu-content-DgbECHxu.js} +1 -1
- package/dist/web/assets/split-workspace-menu-content-DgbECHxu.js.br +0 -0
- package/dist/web/assets/split-workspace-menu-content-DgbECHxu.js.gz +0 -0
- package/dist/web/assets/{third-party-marketplace-pane-D3AJNSoF.js → third-party-marketplace-pane-BPN-3gk1.js} +1 -1
- package/dist/web/assets/third-party-marketplace-pane-BPN-3gk1.js.br +0 -0
- package/dist/web/assets/third-party-marketplace-pane-BPN-3gk1.js.gz +0 -0
- package/dist/web/assets/workbench-inspector-changes-D1rDsafv.js +1 -0
- package/dist/web/assets/workbench-inspector-changes-D1rDsafv.js.br +0 -0
- package/dist/web/assets/workbench-inspector-changes-D1rDsafv.js.gz +0 -0
- package/dist/web/assets/{workbench-pet-canvas-Ct1J6Adp.js → workbench-pet-canvas-B5jypDil.js} +1 -1
- package/dist/web/assets/workbench-pet-canvas-B5jypDil.js.br +0 -0
- package/dist/web/assets/workbench-pet-canvas-B5jypDil.js.gz +0 -0
- package/dist/web/assets/workbench-shell-B139izuR.js +16 -0
- package/dist/web/assets/workbench-shell-B139izuR.js.br +0 -0
- package/dist/web/assets/workbench-shell-B139izuR.js.gz +0 -0
- package/dist/web/index.html +3 -3
- package/dist/web/index.html.br +0 -0
- package/dist/web/index.html.gz +0 -0
- package/docs/local-catalog.md +51 -0
- package/docs/model-discovery.md +26 -0
- package/package.json +5 -4
- package/dist/chunk-3WW7LK46.js +0 -5
- package/dist/chunk-43QCECCY.js +0 -40
- package/dist/chunk-YAHXVRU3.js +0 -3
- package/dist/web/assets/agent-settings-panel-K1YqqkJL.js.br +0 -0
- package/dist/web/assets/agent-settings-panel-K1YqqkJL.js.gz +0 -0
- package/dist/web/assets/background-image-picker-BHqZ3SX1.js.br +0 -0
- package/dist/web/assets/background-image-picker-BHqZ3SX1.js.gz +0 -0
- package/dist/web/assets/code-highlighter-DIfBIRTg.js.br +0 -0
- package/dist/web/assets/code-highlighter-DIfBIRTg.js.gz +0 -0
- package/dist/web/assets/commit-settings-panel-B0i2Bqmu.js.br +0 -0
- package/dist/web/assets/commit-settings-panel-B0i2Bqmu.js.gz +0 -0
- package/dist/web/assets/dockerfile-IyjqRm3v.js +0 -1
- package/dist/web/assets/dockerfile-IyjqRm3v.js.br +0 -0
- package/dist/web/assets/dockerfile-IyjqRm3v.js.gz +0 -0
- package/dist/web/assets/file-review-dialog-B3jUcADI.js +0 -2
- package/dist/web/assets/file-review-dialog-B3jUcADI.js.br +0 -0
- package/dist/web/assets/file-review-dialog-B3jUcADI.js.gz +0 -0
- package/dist/web/assets/git-commit-review-Bz_j3wJo.js +0 -2
- package/dist/web/assets/git-commit-review-Bz_j3wJo.js.br +0 -0
- package/dist/web/assets/git-commit-review-Bz_j3wJo.js.gz +0 -0
- package/dist/web/assets/git-history-panel-Bk5XtV-h.js.br +0 -0
- package/dist/web/assets/git-history-panel-Bk5XtV-h.js.gz +0 -0
- package/dist/web/assets/global-search-dialog-nP5Zoo16.js.br +0 -0
- package/dist/web/assets/global-search-dialog-nP5Zoo16.js.gz +0 -0
- package/dist/web/assets/global-settings-about-Bdzkr5Fi.js +0 -1
- package/dist/web/assets/global-settings-about-Bdzkr5Fi.js.br +0 -0
- package/dist/web/assets/global-settings-about-Bdzkr5Fi.js.gz +0 -0
- package/dist/web/assets/global-settings-page-Bm6WTYej.js.br +0 -0
- package/dist/web/assets/global-settings-page-Bm6WTYej.js.gz +0 -0
- package/dist/web/assets/global-settings-pets-ChV29f_6.js.br +0 -0
- package/dist/web/assets/global-settings-pets-ChV29f_6.js.gz +0 -0
- package/dist/web/assets/highlighted-body-OFNGDK62-D1VJUKau.js.br +0 -0
- package/dist/web/assets/highlighted-body-OFNGDK62-D1VJUKau.js.gz +0 -0
- package/dist/web/assets/history-task-timeline-CphChwX0.js.br +0 -0
- package/dist/web/assets/history-task-timeline-CphChwX0.js.gz +0 -0
- package/dist/web/assets/image-preview-CZiY9KQs.js.br +0 -4
- package/dist/web/assets/image-preview-CZiY9KQs.js.gz +0 -0
- package/dist/web/assets/image-preview-content-D54Quns6.js.br +0 -0
- package/dist/web/assets/image-preview-content-D54Quns6.js.gz +0 -0
- package/dist/web/assets/index-BJqxQCE6.css +0 -2
- package/dist/web/assets/index-BJqxQCE6.css.br +0 -0
- package/dist/web/assets/index-BJqxQCE6.css.gz +0 -0
- package/dist/web/assets/index-CV7PO8FJ.js +0 -4
- package/dist/web/assets/index-CV7PO8FJ.js.br +0 -0
- package/dist/web/assets/index-CV7PO8FJ.js.gz +0 -0
- package/dist/web/assets/initial-deps-DElr8S4a.js +0 -2
- package/dist/web/assets/initial-deps-DElr8S4a.js.br +0 -0
- package/dist/web/assets/initial-deps-DElr8S4a.js.gz +0 -0
- package/dist/web/assets/installed-skills-pane-DnKCXx4r.js.br +0 -0
- package/dist/web/assets/installed-skills-pane-DnKCXx4r.js.gz +0 -0
- package/dist/web/assets/lazy-message-response-S2-ZO_oT.js +0 -2
- package/dist/web/assets/lazy-message-response-S2-ZO_oT.js.br +0 -0
- package/dist/web/assets/lazy-message-response-S2-ZO_oT.js.gz +0 -0
- package/dist/web/assets/markdown-BYOwaDjH.js +0 -1
- package/dist/web/assets/markdown-BYOwaDjH.js.br +0 -0
- package/dist/web/assets/markdown-BYOwaDjH.js.gz +0 -0
- package/dist/web/assets/mcp-management-pane-CAcqH6Ft.js.br +0 -0
- package/dist/web/assets/mcp-management-pane-CAcqH6Ft.js.gz +0 -0
- package/dist/web/assets/mdx-DQZ5AkYe.js +0 -1
- package/dist/web/assets/mdx-DQZ5AkYe.js.br +0 -0
- package/dist/web/assets/mdx-DQZ5AkYe.js.gz +0 -0
- package/dist/web/assets/mermaid-GHXKKRXX-CRcc_eOq.js +0 -1
- package/dist/web/assets/mermaid-GHXKKRXX-CRcc_eOq.js.br +0 -1
- package/dist/web/assets/mermaid-GHXKKRXX-CRcc_eOq.js.gz +0 -0
- package/dist/web/assets/message-assistant-directive-7AH4Pn2V.js +0 -3
- package/dist/web/assets/message-assistant-directive-7AH4Pn2V.js.br +0 -0
- package/dist/web/assets/message-assistant-directive-7AH4Pn2V.js.gz +0 -0
- package/dist/web/assets/message-response-D6AZoXZR.js +0 -151
- package/dist/web/assets/message-response-D6AZoXZR.js.br +0 -0
- package/dist/web/assets/message-response-D6AZoXZR.js.gz +0 -0
- package/dist/web/assets/official-plugins-pane-CBk4rbLt.js.br +0 -0
- package/dist/web/assets/official-plugins-pane-CBk4rbLt.js.gz +0 -0
- package/dist/web/assets/patch-diff-viewer-nIzfWkKE.js.br +0 -0
- package/dist/web/assets/patch-diff-viewer-nIzfWkKE.js.gz +0 -0
- package/dist/web/assets/pdf-preview-Zrj4u-KR.js.br +0 -0
- package/dist/web/assets/pdf-preview-Zrj4u-KR.js.gz +0 -0
- package/dist/web/assets/personalization-settings-panel-D3OqsNUV.js.br +0 -0
- package/dist/web/assets/personalization-settings-panel-D3OqsNUV.js.gz +0 -0
- package/dist/web/assets/project-file-popup-page-7yzFqPZq.js.br +0 -0
- package/dist/web/assets/project-file-popup-page-7yzFqPZq.js.gz +0 -0
- package/dist/web/assets/project-source-panel-C1tTwC1j.js +0 -2
- package/dist/web/assets/project-source-panel-C1tTwC1j.js.br +0 -0
- package/dist/web/assets/project-source-panel-C1tTwC1j.js.gz +0 -0
- package/dist/web/assets/prompt-input--2KQl6SR.js.br +0 -0
- package/dist/web/assets/prompt-input--2KQl6SR.js.gz +0 -0
- package/dist/web/assets/resources-en-CNO1wrxl.js +0 -1
- package/dist/web/assets/resources-en-CNO1wrxl.js.br +0 -0
- package/dist/web/assets/resources-en-CNO1wrxl.js.gz +0 -0
- package/dist/web/assets/scheduled-task-date-time-picker-BVYVGT78.js.br +0 -0
- package/dist/web/assets/scheduled-task-date-time-picker-BVYVGT78.js.gz +0 -0
- package/dist/web/assets/scheduled-tasks-container-CQkfAgKW.js.br +0 -0
- package/dist/web/assets/scheduled-tasks-container-CQkfAgKW.js.gz +0 -0
- package/dist/web/assets/scheduled-tasks-container-CVGTy7-W.css +0 -1
- package/dist/web/assets/scheduled-tasks-container-CVGTy7-W.css.br +0 -0
- package/dist/web/assets/scheduled-tasks-container-CVGTy7-W.css.gz +0 -0
- package/dist/web/assets/shiki-bundle-COC_j-nR.js.br +0 -3
- package/dist/web/assets/shiki-bundle-COC_j-nR.js.gz +0 -0
- package/dist/web/assets/skills-market-container-_ME3wZFP.js.br +0 -0
- package/dist/web/assets/skills-market-container-_ME3wZFP.js.gz +0 -0
- package/dist/web/assets/split-workspace-menu-content-CkpZv1Nz.js.br +0 -0
- package/dist/web/assets/split-workspace-menu-content-CkpZv1Nz.js.gz +0 -0
- package/dist/web/assets/third-party-marketplace-pane-D3AJNSoF.js.br +0 -0
- package/dist/web/assets/third-party-marketplace-pane-D3AJNSoF.js.gz +0 -0
- package/dist/web/assets/workbench-inspector-changes-DSbBqbXe.js +0 -1
- package/dist/web/assets/workbench-inspector-changes-DSbBqbXe.js.br +0 -0
- package/dist/web/assets/workbench-inspector-changes-DSbBqbXe.js.gz +0 -0
- package/dist/web/assets/workbench-pet-canvas-Ct1J6Adp.js.br +0 -0
- package/dist/web/assets/workbench-pet-canvas-Ct1J6Adp.js.gz +0 -0
- package/dist/web/assets/workbench-shell-CP0njkD8.js +0 -16
- package/dist/web/assets/workbench-shell-CP0njkD8.js.br +0 -0
- package/dist/web/assets/workbench-shell-CP0njkD8.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/scheduled-task-date-time-picker-
|
|
2
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./initial-deps-CqwWvUnY.js";import{i as n,t as r}from"./react-runtime-CMZHB3u8.js";import{i,s as a,u as o}from"./initial-deps-CW5Jl6i2.js";import{B as s,Sn as c,Tt as l,bt as u,c as d,d as f,h as p,hn as m,l as h,y as g}from"./initial-deps-DElr8S4a.js";import{F as _,H as v,J as y,L as b,_ as x,at as S,ct as C,l as w,p as T}from"./initial-deps-B8FrcWWN.js";import{t as E}from"./external-link-DQSTtNhw.js";import{n as D}from"./history-location-C2XDYAuy.js";import{t as ee}from"./sliders-horizontal-C6QQuWdW.js";import{G as O,T as te,jt as ne,q as k}from"./index-CV7PO8FJ.js";import{t as re}from"./scheduled-tasks-BBUd86IL.js";import{a as ie,d as A,f as ae,i as oe,u as se}from"./workbench-shell-CP0njkD8.js";var j=``,M;function N(e,t){j!==t&&(M=new Intl.DateTimeFormat(`sv-SE`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}),j=t);let n=M.formatToParts(e),r=e=>{let t=n.find(t=>t.type===e)?.value;if(t===void 0)throw Error(`Missing date part: ${e}`);return t};return`${r(`year`)}-${r(`month`)}-${r(`day`)}T${r(`hour`)}:${r(`minute`)}:${r(`second`)}`}function P(e,t){if(!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/u.test(e))return;let n=e.length===16?`${e}:00`:e,r=Date.parse(`${n}Z`);if(Number.isFinite(r)&&new Date(r).toISOString().slice(0,19)===n){if(t===`UTC`)return r;try{let e=r;for(let i=0;i<3;i++){let i=N(e,t);if(i===n)return e;e+=r-Date.parse(`${i}Z`)}}catch{return}}}var F=e(n(),1),ce={every:`Every`,interval:`Repeat interval`,intervalUnit:`Interval unit`,units:{HOURLY:`hours`,DAILY:`days`,WEEKLY:`weeks`,MONTHLY:`months`,YEARLY:`years`},repeatDays:`Repeat on`,monthMode:`Monthly pattern`,byDate:`By date`,byWeekday:`By weekday`,lastDay:`Last day`,ordinal:`Occurrence`,ordinals:{1:`First`,2:`Second`,3:`Third`,4:`Fourth`,5:`Fifth`,"-1":`Last`},yearMonth:`Month`,yearDay:`Date`,startDate:`Start date`,rangeSettings:`Start and end conditions`,oncePast:`Choose a future execution time.`,end:`Ends`,never:`Never`,onDate:`On a date`,afterCount:`After a number of occurrences`,endDate:`End date`,count:`Planned occurrences`,countHint:`Counts scheduled occurrences, including skipped or missed times, not successful runs.`,monthSkipHint:`Months without the selected date are skipped. Choose Last day to run every month.`,ordinalSkipHint:`Months without the selected weekday occurrence are skipped.`,leapHint:`Runs on February 29 in leap years only.`,startHint:`Matches dates from this day; check the upcoming times. Weekly intervals start on Monday.`,preview:`Upcoming runs`,previewLoading:`Calculating upcoming times…`,previewFailed:`Could not calculate upcoming times. Check the settings and retry.`,retryPreview:`Recalculate`,showMore:`Show 5 runs`,showLess:`Show less`,ended:`Schedule ended`,noFutureRuns:`No future runs remain. Adjust the start date or ending condition.`,invalidDate:`Choose a valid date.`,invalidTime:`Enter a valid time.`,invalidInterval:`Enter a whole number from 1 to 999.`,selectWeekday:`Select at least one weekday.`,selectMonthDay:`Select at least one valid date.`,selectOrdinal:`Select at least one valid weekday occurrence.`,invalidYearDay:`Choose a valid month and date.`,invalidCount:`Enter a whole number from 1 to 10000.`,invalidEndDate:`The end date must not precede the start date.`,invalidWallTime:`This date or time does not exist. Choose another time.`,unsupportedRule:`This recurrence cannot be fully expressed in the form. Choose a new repeat pattern.`,summaryEvery:`Every {{interval}} {{unit}}`,summaryAt:`{{rule}} at {{time}}`,summaryFrom:`From {{date}}`,summaryUntil:`Until {{date}} (inclusive)`,summaryCount:`{{count}} planned occurrences`,summaryMonthDates:`Day {{days}}`,summaryYearDate:`{{month}}/{{day}}`},I={every:`每隔`,interval:`重复间隔`,intervalUnit:`间隔单位`,units:{HOURLY:`小时`,DAILY:`天`,WEEKLY:`周`,MONTHLY:`月`,YEARLY:`年`},repeatDays:`重复日期`,monthMode:`每月重复方式`,byDate:`按日期`,byWeekday:`按星期`,lastDay:`最后一天`,ordinal:`第几个`,ordinals:{1:`第一个`,2:`第二个`,3:`第三个`,4:`第四个`,5:`第五个`,"-1":`最后一个`},yearMonth:`月份`,yearDay:`日期`,startDate:`开始日期`,rangeSettings:`开始与结束条件`,oncePast:`请选择未来的执行时间。`,end:`结束`,never:`永不`,onDate:`到指定日期`,afterCount:`安排指定次数后`,endDate:`结束日期`,count:`计划次数`,countHint:`按计划触发次数计算,跳过或错过的时间也计入,不代表成功执行次数。`,monthSkipHint:`没有所选日期的月份将跳过;每月都要执行可选择“最后一天”。`,ordinalSkipHint:`没有所选星期的月份将跳过。`,leapHint:`仅在闰年的 2 月 29 日执行。`,startHint:`从该日期开始匹配规则,以接下来执行时间为准。隔周规则从该周周一计起。`,preview:`接下来执行`,previewLoading:`正在计算执行时间…`,previewFailed:`无法计算执行时间,请检查设置后重试。`,retryPreview:`重新计算`,showMore:`展开 5 次`,showLess:`收起`,ended:`计划已结束`,noFutureRuns:`此计划已无后续执行时间,可调整开始日期或结束条件。`,invalidDate:`请选择有效日期。`,invalidTime:`请输入有效时间。`,invalidInterval:`重复间隔需为 1~999 的整数。`,selectWeekday:`至少选择一个星期。`,selectMonthDay:`至少选择一个有效日期。`,selectOrdinal:`至少选择一个有效的星期序号。`,invalidYearDay:`请选择有效的月份和日期。`,invalidCount:`计划次数需为 1~10000 的整数。`,invalidEndDate:`结束日期不能早于开始日期。`,invalidWallTime:`该日期或时间不存在,请重新选择。`,unsupportedRule:`此任务的重复方式无法用表单完整表达,请重新选择重复方式。`,summaryEvery:`每 {{interval}} {{unit}}`,summaryAt:`{{rule}},{{time}} 执行`,summaryFrom:`从 {{date}} 开始`,summaryUntil:`至 {{date}}(含当天)`,summaryCount:`共安排 {{count}} 次`,summaryMonthDates:`{{days}} 日`,summaryYearDate:`{{month}} 月 {{day}} 日`};C.addResourceBundle(`en`,`workbench`,{scheduledTasks:{...re,...ce}},!0),C.addResourceBundle(`zh-CN`,`workbench`,{scheduledTasks:{...ne,...I}},!0);var L=[`MO`,`TU`,`WE`,`TH`,`FR`,`SA`,`SU`],R=[`HOURLY`,`DAILY`,`WEEKLY`,`MONTHLY`,`YEARLY`],le=new Set([`FREQ`,`INTERVAL`,`WKST`,`BYDAY`,`BYMONTHDAY`,`BYMONTH`,`BYHOUR`,`BYMINUTE`,`BYSECOND`,`COUNT`,`UNTIL`]);function ue(e,t){let n=e.rrule.trim().replace(/^RRULE:/u,``).split(`;`).map(e=>e.split(`=`)),r=new Map(n.map(([e=``,t=``])=>[e,t])),i=r.get(`FREQ`),a=()=>({...t,preset:`custom`,unsupported:!0});if(n.some(e=>e.length!==2||!le.has(e[0]??``)||!e[1])||r.size!==n.length||!R.includes(i)||r.has(`WKST`)&&r.get(`WKST`)!==`MO`||r.has(`BYSECOND`)&&r.get(`BYSECOND`)!==`0`||!r.has(`BYSECOND`)&&e.startAtUnixMs%6e4!=0)return a();let o=r.get(`BYHOUR`)??t.time.slice(0,2),s=r.get(`BYMINUTE`)??t.time.slice(3);if(!/^\d{1,2}$/u.test(o)||!/^\d{1,2}$/u.test(s)||i===`HOURLY`&&r.has(`BYHOUR`))return a();let c=`${o.padStart(2,`0`)}:${s.padStart(2,`0`)}`,l=Number(r.get(`INTERVAL`)??1),u={...t,preset:`custom`,frequency:i,interval:l,time:c,anchor:{unixMs:e.startAtUnixMs,startDate:t.startDate,time:c}},d=r.get(`BYDAY`);if(i===`WEEKLY`){let e=d?.split(`,`)??t.weekdays;if(e.some(e=>!L.includes(e)))return a();u={...u,weekdays:e}}else if(i===`MONTHLY`&&d){let e=d.split(`,`).map(e=>/^(-1|[1-5])(MO|TU|WE|TH|FR|SA|SU)$/u.exec(e));if(e.some(t=>t===null||t[2]!==e[0]?.[2])||r.has(`BYMONTHDAY`))return a();u={...u,monthMode:`weekday`,ordinals:e.map(e=>Number(e?.[1])),monthWeekday:e[0]?.[2]}}else if(d)return a();if(r.has(`BYMONTHDAY`)){let e=(r.get(`BYMONTHDAY`)??``).split(`,`).map(Number);if(i===`MONTHLY`)u={...u,monthDays:e};else if(i===`YEARLY`&&e.length===1)u={...u,yearDay:Number(e[0])};else return a()}if(r.has(`BYMONTH`)){if(i!==`YEARLY`||!/^\d{1,2}$/u.test(r.get(`BYMONTH`)??``))return a();u={...u,yearMonth:Number(r.get(`BYMONTH`))}}if(r.has(`COUNT`)&&r.has(`UNTIL`))return a();if(r.has(`COUNT`)&&(u={...u,endMode:`count`,count:Number(r.get(`COUNT`))}),r.has(`UNTIL`)){let t=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/u.exec(r.get(`UNTIL`)??``);if(!t)return a();let n=Date.parse(`${t.slice(1,4).join(`-`)}T${t.slice(4).join(`:`)}Z`);if(!Number.isFinite(n))return a();let i=N(n,e.timezone);if(!i.endsWith(`23:59:59`))return a();u={...u,endMode:`date`,endDate:i.slice(0,10)}}if(l===1){if(i===`DAILY`&&(u={...u,preset:`daily`}),i===`WEEKLY`){let e=L.filter(e=>u.weekdays.includes(e)).join(`,`);u={...u,preset:e===`MO,TU,WE,TH,FR`?`weekdays`:e===`SA,SU`?`weekends`:`weekly`}}i===`MONTHLY`&&(u={...u,preset:`monthly`})}return u}function z(e){return e===`en`?`en`:`zh-CN`}function B(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${String(t.getFullYear())}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function V(e=Date.now()){let t=B(e+36e5),n=new Date(t),r=L[(n.getDay()+6)%7]??`MO`;return{dateTime:t,preset:`once`,frequency:`WEEKLY`,interval:1,time:t.slice(11),startDate:t.slice(0,10),weekdays:[r],monthMode:`date`,monthDays:[n.getDate()],ordinals:[1],monthWeekday:r,yearMonth:n.getMonth()+1,yearDay:n.getDate(),endMode:`never`,endDate:t.slice(0,10),count:10}}function H(e){if(e.type===`once`)return V(e.atUnixMs-36e5);let t=N(e.startAtUnixMs,e.timezone),n=new Date(`${t.slice(0,10)}T12:00:00Z`),r=L[(n.getUTCDay()+6)%7]??`MO`;return ue(e,{...V(e.startAtUnixMs-36e5),dateTime:t.slice(0,16),startDate:t.slice(0,10),time:t.slice(11,16),weekdays:[r],monthWeekday:r,monthDays:[n.getUTCDate()],yearMonth:n.getUTCMonth()+1,yearDay:n.getUTCDate()})}function U(e){return e.preset===`daily`?`DAILY`:e.preset===`weekly`||e.preset===`weekdays`||e.preset===`weekends`?`WEEKLY`:e.preset===`monthly`?`MONTHLY`:e.frequency}function W(e,t,n){return Number.isInteger(e)&&e>=t&&e<=n}function G(e){if(e.unsupported)return`unsupportedRule`;if(e.preset===`once`){let t=new Date(e.dateTime).getTime();return Number.isFinite(t)&&B(t)===e.dateTime?void 0:`invalidDate`}if(!/^([01]\d|2[0-3]):[0-5]\d$/u.test(e.time))return`invalidTime`;if(e.preset===`custom`&&!W(e.interval,1,999))return`invalidInterval`;if(P(`${e.startDate}T00:00`,`UTC`)===void 0)return`invalidDate`;let t=U(e);if(t===`WEEKLY`&&e.preset!==`weekdays`&&e.preset!==`weekends`&&(!e.weekdays.length||e.weekdays.some(e=>!L.includes(e))))return`selectWeekday`;if(t===`MONTHLY`){if(e.monthMode===`date`&&(!e.monthDays.length||e.monthDays.some(e=>e!==-1&&!W(e,1,31))))return`selectMonthDay`;if(e.monthMode===`weekday`&&(!e.ordinals.length||e.ordinals.some(e=>e!==-1&&!W(e,1,5))||!L.includes(e.monthWeekday)))return`selectOrdinal`}if(t===`YEARLY`&&(!W(e.yearMonth,1,12)||!W(e.yearDay,1,new Date(2e3,e.yearMonth,0).getDate())))return`invalidYearDay`;if(e.endMode===`count`&&!W(e.count,1,1e4))return`invalidCount`;if(e.endMode===`date`&&(P(`${e.endDate}T23:59:59`,`UTC`)===void 0||e.endDate<e.startDate))return`invalidEndDate`}function K(e,t,n=Date.now()){if(G(e))return;if(e.preset===`once`){let t=new Date(e.dateTime).getTime();return t>n?{type:`once`,atUnixMs:t}:void 0}let r=e.anchor?.startDate===e.startDate&&e.anchor.time===e.time?e.anchor.unixMs:P(`${e.startDate}T${e.time}`,t);if(r===void 0)return;let i=U(e),a=[`FREQ=${i}`];if(e.preset===`custom`&&e.interval>1&&a.push(`INTERVAL=${String(e.interval)}`),i===`WEEKLY`){let t=e.preset===`weekdays`?L.slice(0,5):e.preset===`weekends`?L.slice(5):L.filter(t=>e.weekdays.includes(t));a.push(`WKST=MO`,`BYDAY=${t.join(`,`)}`)}i===`MONTHLY`&&a.push(e.monthMode===`date`?`BYMONTHDAY=${[...new Set(e.monthDays)].join(`,`)}`:`BYDAY=${[...new Set(e.ordinals)].map(t=>`${String(t)}${e.monthWeekday}`).join(`,`)}`),i===`YEARLY`&&a.push(`BYMONTH=${String(e.yearMonth)}`,`BYMONTHDAY=${String(e.yearDay)}`);let[o,s]=e.time.split(`:`).map(Number);if(i!==`HOURLY`&&a.push(`BYHOUR=${String(o)}`),a.push(`BYMINUTE=${String(s)}`,`BYSECOND=0`),e.endMode===`count`&&a.push(`COUNT=${String(e.count)}`),e.endMode===`date`){let n=P(`${e.endDate}T23:59:59`,t);if(n===void 0||n<r)return;a.push(`UNTIL=${new Date(n).toISOString().replace(/[-:]/gu,``).replace(`.000`,``)}`)}return{type:`rrule`,rrule:`RRULE:${a.join(`;`)}`,startAtUnixMs:r,timezone:t}}function q(e,t){return e===null?`-`:new Intl.DateTimeFormat(z(t),{dateStyle:`medium`,timeStyle:`short`}).format(e)}var J=r(),Y=Array.from({length:31},(e,t)=>t+1),de=Array.from({length:12},(e,t)=>t+1),fe=[1,2,3,4,5,-1];function X(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function pe({schedule:e,onChange:t,weekdayNames:n}){let{t:r}=S(`workbench`),i=n=>{t({...e,...n})};return U(e)===`YEARLY`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.yearMonth`)}),(0,J.jsx)(`select`,{value:e.yearMonth,onChange:e=>{i({yearMonth:Number(e.currentTarget.value)})},children:de.map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))})]}),(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.yearDay`)}),(0,J.jsx)(`select`,{value:e.yearDay,onChange:e=>{i({yearDay:Number(e.currentTarget.value)})},children:Y.map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))})]}),e.yearMonth===2&&e.yearDay===29?(0,J.jsx)(`p`,{className:`scheduled-task-hint`,children:r(`scheduledTasks.leapHint`)}):null]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.monthMode`)}),(0,J.jsxs)(`select`,{value:e.monthMode,onChange:e=>{i({monthMode:e.currentTarget.value})},children:[(0,J.jsx)(`option`,{value:`date`,children:r(`scheduledTasks.byDate`)}),(0,J.jsx)(`option`,{value:`weekday`,children:r(`scheduledTasks.byWeekday`)})]})]}),e.monthMode===`date`?(0,J.jsxs)(`div`,{className:`scheduled-task-field scheduled-task-field--choices`,children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.monthDay`)}),(0,J.jsxs)(`div`,{className:`scheduled-task-month-days`,role:`group`,"aria-label":r(`scheduledTasks.monthDay`),children:[Y.map(t=>(0,J.jsx)(`button`,{type:`button`,"aria-pressed":e.monthDays.includes(t),onClick:()=>{i({monthDays:X(e.monthDays,t)})},children:t},t)),(0,J.jsx)(`button`,{className:`scheduled-task-month-days__last`,type:`button`,"aria-pressed":e.monthDays.includes(-1),onClick:()=>{i({monthDays:X(e.monthDays,-1)})},children:r(`scheduledTasks.lastDay`)})]})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`scheduled-task-field scheduled-task-field--choices`,children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.ordinal`)}),(0,J.jsx)(`div`,{className:`scheduled-task-choices`,role:`group`,"aria-label":r(`scheduledTasks.ordinal`),children:fe.map(t=>(0,J.jsx)(`button`,{type:`button`,"aria-pressed":e.ordinals.includes(t),onClick:()=>{i({ordinals:X(e.ordinals,t)})},children:r(`scheduledTasks.ordinals.${String(t)}`)},t))})]}),(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.weekday`)}),(0,J.jsx)(`select`,{value:e.monthWeekday,onChange:e=>{i({monthWeekday:e.currentTarget.value})},children:L.map((e,t)=>(0,J.jsx)(`option`,{value:e,children:n[t]},e))})]})]}),e.monthMode===`date`&&e.monthDays.some(e=>e>=29)?(0,J.jsx)(`p`,{className:`scheduled-task-hint`,children:r(`scheduledTasks.monthSkipHint`)}):null,e.monthMode===`weekday`&&e.ordinals.includes(5)?(0,J.jsx)(`p`,{className:`scheduled-task-hint`,children:r(`scheduledTasks.ordinalSkipHint`)}):null]})}var me=(0,F.lazy)(async()=>({default:(await t(()=>import(`./scheduled-task-date-time-picker-BVYVGT78.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]))).ScheduledTaskDateTimePicker}));function Z({label:e,value:t,onChange:n,minimum:r=``,dateOnly:i=!0}){return(0,J.jsxs)(`div`,{className:`scheduled-task-field`,children:[(0,J.jsx)(`span`,{children:e}),(0,J.jsx)(F.Suspense,{fallback:(0,J.jsx)(s,{"aria-label":e,"aria-busy":`true`,disabled:!0,value:``}),children:(0,J.jsx)(me,{dateOnly:i,label:e,minimum:r,onChange:n,value:t})})]})}var he=(0,F.memo)(function({schedule:e,onChange:t}){let{i18n:n,t:r}=S(`workbench`),[i]=(0,F.useState)(()=>B(Date.now())),[a,o]=(0,F.useState)(e.endMode!==`never`),c=U(e),l=z(n.resolvedLanguage),u=(0,F.useMemo)(()=>{let e=new Intl.DateTimeFormat(l,{timeZone:`UTC`,weekday:`short`});return L.map((t,n)=>e.format(new Date(Date.UTC(2024,0,n+1))))},[l]),d=n=>{t({...e,...n})};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.repeat`)}),(0,J.jsx)(`select`,{onChange:e=>{d({preset:e.currentTarget.value,frequency:c,unsupported:!1})},value:e.preset,children:[`once`,`daily`,`weekdays`,`weekends`,`weekly`,`monthly`,`custom`].map(e=>(0,J.jsx)(`option`,{value:e,children:r(`scheduledTasks.${e}`)},e))})]}),e.preset===`once`?(0,J.jsx)(Z,{dateOnly:!1,label:r(`scheduledTasks.time`),minimum:i,value:e.dateTime,onChange:e=>{d({dateTime:e})}}):(0,J.jsxs)(J.Fragment,{children:[e.preset===`custom`?(0,J.jsxs)(`div`,{className:`scheduled-task-field`,children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.every`)}),(0,J.jsxs)(`div`,{className:`scheduled-task-inline-controls`,children:[(0,J.jsx)(s,{"aria-label":r(`scheduledTasks.interval`),type:`number`,min:1,max:999,step:1,value:Number.isNaN(e.interval)?``:e.interval,onChange:e=>{d({interval:e.currentTarget.valueAsNumber})}}),(0,J.jsx)(`select`,{"aria-label":r(`scheduledTasks.intervalUnit`),value:e.frequency,onChange:e=>{d({frequency:e.currentTarget.value})},children:R.map(e=>(0,J.jsx)(`option`,{value:e,children:r(`scheduledTasks.units.${e}`)},e))})]})]}):null,c===`WEEKLY`&&e.preset!==`weekdays`&&e.preset!==`weekends`?(0,J.jsxs)(`div`,{className:`scheduled-task-field scheduled-task-field--choices`,children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.repeatDays`)}),(0,J.jsx)(`div`,{className:`scheduled-task-choices`,role:`group`,"aria-label":r(`scheduledTasks.repeatDays`),children:L.map((t,n)=>(0,J.jsx)(`button`,{type:`button`,"aria-pressed":e.weekdays.includes(t),onClick:()=>{d({weekdays:e.weekdays.includes(t)?e.weekdays.filter(e=>e!==t):[...e.weekdays,t]})},children:u[n]},t))})]}):null,c===`MONTHLY`||c===`YEARLY`?(0,J.jsx)(pe,{schedule:e,onChange:t,weekdayNames:u}):null,(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.timeOfDay`)}),(0,J.jsx)(s,{step:60,type:`time`,value:e.time,onChange:e=>{d({time:e.currentTarget.value})}})]}),e.preset===`custom`?null:(0,J.jsx)(`button`,{className:`scheduled-task-range-toggle`,type:`button`,"aria-expanded":a,onClick:()=>{o(!a)},children:r(`scheduledTasks.rangeSettings`)}),e.preset===`custom`||a?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Z,{label:r(`scheduledTasks.startDate`),value:e.startDate,onChange:e=>{d({startDate:e})}}),(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.end`)}),(0,J.jsxs)(`select`,{value:e.endMode,onChange:e=>{d({endMode:e.currentTarget.value})},children:[(0,J.jsx)(`option`,{value:`never`,children:r(`scheduledTasks.never`)}),(0,J.jsx)(`option`,{value:`date`,children:r(`scheduledTasks.onDate`)}),(0,J.jsx)(`option`,{value:`count`,children:r(`scheduledTasks.afterCount`)})]})]}),e.endMode===`date`?(0,J.jsx)(Z,{label:r(`scheduledTasks.endDate`),minimum:e.startDate,value:e.endDate,onChange:e=>{d({endDate:e})}}):null,e.endMode===`count`?(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.count`)}),(0,J.jsx)(s,{type:`number`,min:1,max:1e4,step:1,value:Number.isNaN(e.count)?``:e.count,onChange:e=>{d({count:e.currentTarget.valueAsNumber})}})]}):null,e.endMode===`count`?(0,J.jsx)(`p`,{className:`scheduled-task-hint`,children:r(`scheduledTasks.countHint`)}):null]}):null]})]})});function ge({schedule:e,timezone:t,dates:n,pending:r,failed:i,retry:a,error:o}){let{i18n:s,t:c}=S(`workbench`),[l,u]=(0,F.useState)(!1),d=z(s.resolvedLanguage),f=(0,F.useMemo)(()=>new Intl.DateTimeFormat(d,{timeZone:t,year:`numeric`,month:`short`,day:`numeric`,weekday:`short`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}),[d,t]),p=(0,F.useMemo)(()=>{let e=new Intl.DateTimeFormat(d,{timeZone:`UTC`,weekday:`short`});return L.map((t,n)=>e.format(Date.UTC(2024,0,n+1)))},[d]),m=(0,F.useMemo)(()=>new Intl.DateTimeFormat(d,{timeZone:t,timeZoneName:`longGeneric`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value,[d,t]),h=U(e),g=c(`scheduledTasks.summaryEvery`,{interval:e.preset===`custom`?e.interval:1,unit:c(`scheduledTasks.units.${h}`)});if(e.preset===`weekdays`||e.preset===`weekends`?g=c(`scheduledTasks.${e.preset}`):h===`WEEKLY`&&(g+=` · ${L.filter(t=>e.weekdays.includes(t)).map(e=>p[L.indexOf(e)]).join(`、`)}`),h===`MONTHLY`){if(e.monthMode===`date`){let t=e.monthDays.filter(e=>e!==-1).join(`、`);g+=` · ${[t?c(`scheduledTasks.summaryMonthDates`,{days:t}):``,e.monthDays.includes(-1)?c(`scheduledTasks.lastDay`):``].filter(Boolean).join(`、`)}`}else g+=` · ${e.ordinals.map(e=>c(`scheduledTasks.ordinals.${String(e)}`)).join(`、`)} ${p[L.indexOf(e.monthWeekday)]??``}`}h===`YEARLY`&&(g+=` · ${c(`scheduledTasks.summaryYearDate`,{month:e.yearMonth,day:e.yearDay})}`);let _=e.preset===`once`?c(`scheduledTasks.once`):h===`HOURLY`?g:c(`scheduledTasks.summaryAt`,{rule:g,time:e.time});return(0,J.jsxs)(`div`,{className:`scheduled-task-preview`,"aria-live":`polite`,"aria-busy":r,children:[(0,J.jsx)(`p`,{className:`scheduled-task-preview__summary`,children:_}),(0,J.jsxs)(`p`,{className:`scheduled-task-preview__meta`,children:[m,e.preset===`once`?``:` · ${c(`scheduledTasks.summaryFrom`,{date:e.startDate})}${h===`HOURLY`?` ${e.time}`:``}`]}),e.preset!==`once`&&e.endMode!==`never`?(0,J.jsx)(`p`,{className:`scheduled-task-preview__meta`,children:e.endMode===`date`?c(`scheduledTasks.summaryUntil`,{date:e.endDate}):c(`scheduledTasks.summaryCount`,{count:e.count})}):null,e.preset===`custom`?(0,J.jsx)(`p`,{className:`scheduled-task-preview__meta`,children:c(`scheduledTasks.startHint`)}):null,(0,J.jsx)(`h4`,{children:c(`scheduledTasks.preview`)}),(0,J.jsx)(`div`,{className:`scheduled-task-preview__results`,"data-expanded":l,children:o?(0,J.jsx)(`p`,{className:`scheduled-task-error`,role:`alert`,children:c(`scheduledTasks.${o}`)}):r?(0,J.jsx)(`p`,{children:c(`scheduledTasks.previewLoading`)}):i?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{children:c(`scheduledTasks.previewFailed`)}),(0,J.jsx)(`button`,{type:`button`,onClick:a,children:c(`scheduledTasks.retryPreview`)})]}):n?.length===0?(0,J.jsx)(`p`,{children:c(`scheduledTasks.noFutureRuns`)}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`ol`,{children:n?.slice(0,l?5:3).map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(`time`,{dateTime:new Date(e).toISOString(),children:f.format(e)})},e))}),(n?.length??0)>3?(0,J.jsx)(`button`,{type:`button`,"aria-expanded":l,onClick:()=>{u(!l)},children:c(l?`scheduledTasks.showLess`:`scheduledTasks.showMore`)}):null]})})]})}function Q(e,t){let[n,r]=(0,F.useState)(),[i,a]=(0,F.useState)(0),o=(0,F.useRef)(void 0),s=e===void 0?void 0:JSON.stringify(e);if((0,F.useEffect)(()=>{if(s===void 0)return;let e=JSON.parse(s);if(e.type===`once`)return;let n=!1,i=setTimeout(()=>{(async()=>{if(await o.current,n)return;let i=Promise.resolve().then(()=>t(e)).then(e=>{n||r({key:s,dates:e.dates})},()=>{n||r({key:s,failed:!0})});o.current=i,await i})()},200);return()=>{n=!0,clearTimeout(i)}},[s,t,i]),e?.type===`once`)return{dates:[e.atUnixMs],pending:!1,failed:!1,retry:()=>{a(e=>e+1)}};let c=n?.key===s?n:void 0;return{dates:c?.dates,pending:e!==void 0&&c===void 0,failed:c?.failed===!0,retry:()=>{r(void 0),a(e=>e+1)}}}function _e(e){return e===void 0?[]:e.messageAttachments.map(t=>({attachment:t,...t,previewUrl:t.kind===`image`?m(``,e.projectId,t.id):``,source:`host`}))}function ve(e,t){if(e===void 0)return{attachments:[],content:[]};let n=new Map(t.map(e=>[e.id,e])),r=e.prompt.skills.flatMap(e=>{let t=n.get(e.id);return t===void 0?[]:[t]});return{attachments:_e(e),content:ie(e.prompt.text,r)}}function ye(e){let{i18n:t,t:n}=S(`workbench`),[r]=(0,F.useState)(()=>e.task?.schedule.type===`rrule`?e.task.schedule.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`),i=(0,F.useRef)(null),[a,o]=(0,F.useState)(e.task?.name??``),[u,d]=(0,F.useState)(()=>e.task===void 0?V():H(e.task.schedule)),[f,p]=(0,F.useState)(e.task?.turnOptions??e.composerProps.settings),[m,h]=(0,F.useState)(!1),[g,_]=(0,F.useState)(e.task!==void 0&&(e.task.prompt.text.trim()!==``||e.task.prompt.attachments.length>0||e.task.prompt.skills.length>0)),v=(0,F.useMemo)(()=>ve(e.task,e.skills),[e.skills,e.task]),b=e.projectId===`temporary`?n(`shell.temporaryTask`):e.projects.find(t=>t.id===e.projectId)?.name??e.projectId,x=(0,F.useMemo)(()=>K(u,r),[u,r]),C=Q(x,e.onPreview),w=G(u)??(x===void 0?u.preset===`once`?`oncePast`:`invalidWallTime`:void 0),T=a.trim()!==``&&x!==void 0&&g&&!C.pending&&!C.failed&&(C.dates?.length??0)>0,O=async(t,i,o)=>{if(a.trim()===``)throw Error(n(`scheduledTasks.name`));let s=K(u,r);if(s===void 0||C.pending||C.failed||!C.dates?.length)throw Error(n(`scheduledTasks.scheduleInvalid`));await e.onSave(e.task?.id,{enabled:e.task?.enabled??!0,messageAttachments:[...o],name:a.trim(),projectId:e.projectId,projectName:b,prompt:t,schedule:s,turnOptions:i})};return(0,J.jsxs)(`section`,{className:`scheduled-task-editor`,children:[(0,J.jsxs)(`div`,{className:`scheduled-task-editor__toolbar`,children:[(0,J.jsxs)(`span`,{className:`scheduled-task-status`,"data-enabled":e.task?.enabled??!0,children:[(0,J.jsx)(`span`,{}),n(e.task===void 0?`scheduledTasks.create`:e.task.enabled?`scheduledTasks.enabled`:`scheduledTasks.disabled`)]}),(0,J.jsxs)(`div`,{className:`scheduled-task-editor__actions`,children:[e.task===void 0?(0,J.jsx)(`span`,{}):(0,J.jsxs)(l,{"aria-label":n(`scheduledTasks.runNow`),disabled:e.task.lastRunStatus===`running`||e.task.runs.some(e=>e.status===`running`||e.status===`unknown`||e.status===`cleanup_pending`),onClick:()=>{e.task!==void 0&&e.onRunNow(e.task.id)},size:`sm`,variant:`outline`,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),n(`scheduledTasks.runNow`)]}),(0,J.jsxs)(l,{"aria-label":n(`scheduledTasks.save`),className:`disabled:bg-control-active disabled:text-muted-foreground disabled:opacity-100`,disabled:m||!T||e.task?.runs.some(e=>e.status===`running`||e.status===`unknown`||e.status===`cleanup_pending`),onClick:()=>void i.current?.submitCurrent(),size:`sm`,children:[(0,J.jsx)(se,{"aria-hidden":`true`}),n(`scheduledTasks.save`)]})]})]}),(0,J.jsxs)(`div`,{className:`scheduled-task-editor__body`,children:[(0,J.jsxs)(`label`,{className:`scheduled-task-title`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:n(`scheduledTasks.name`)}),(0,J.jsx)(s,{maxLength:120,onChange:e=>{o(e.currentTarget.value)},placeholder:n(`scheduledTasks.namePlaceholder`),value:a})]}),(0,J.jsxs)(`div`,{className:`scheduled-task-prompt`,children:[(0,J.jsx)(`h3`,{children:n(`scheduledTasks.prompt`)}),(0,J.jsx)(oe,{...e.composerProps,captureSubmitVisible:!1,composerRef:i,composerDraftId:`scheduled:${e.task?.id??`new`}`,footerVisible:!1,initialDraft:v,onCaptureSubmission:O,onFastModeChange:e.composerProps.onFastModeChange,onInputStateChange:_,onSettingsChange:(t,n,r)=>(p(t),e.composerProps.onSettingsChange(t,n,r)),onSubmissionStateChange:h,settings:f})]}),(0,J.jsxs)(`section`,{className:`scheduled-task-section`,children:[(0,J.jsxs)(`h3`,{children:[(0,J.jsx)(ee,{"aria-hidden":`true`}),n(`scheduledTasks.details`)]}),(0,J.jsxs)(`div`,{className:`scheduled-task-fields`,children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:n(`scheduledTasks.project`)}),(0,J.jsxs)(`select`,{onChange:t=>{e.onProjectChange(t.currentTarget.value)},value:e.projectId,children:[(0,J.jsx)(`option`,{value:c,children:n(`shell.temporaryTask`)}),e.projects.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,J.jsxs)(`div`,{className:`scheduled-task-info`,children:[(0,J.jsx)(`span`,{children:n(`scheduledTasks.runIn`)}),(0,J.jsx)(`span`,{children:n(`scheduledTasks.newChat`)})]})]})]}),(0,J.jsxs)(`section`,{className:`scheduled-task-section`,children:[(0,J.jsxs)(`h3`,{children:[(0,J.jsx)(y,{"aria-hidden":`true`}),n(`scheduledTasks.frequency`)]}),(0,J.jsx)(`div`,{className:`scheduled-task-fields`,children:(0,J.jsx)(he,{onChange:d,schedule:u})}),(0,J.jsx)(ge,{schedule:u,timezone:r,...C,error:w})]}),e.task===void 0?null:(0,J.jsx)(J.Fragment,{children:(0,J.jsxs)(`div`,{className:`scheduled-task-runs`,children:[(0,J.jsxs)(`h3`,{children:[(0,J.jsx)(D,{"aria-hidden":`true`}),n(`scheduledTasks.lastRun`),(0,J.jsx)(`span`,{children:e.task.runs.length})]}),e.task.runs.length===0?(0,J.jsx)(`p`,{children:n(`scheduledTasks.noRuns`)}):e.task.runs.toReversed().map(r=>(0,J.jsxs)(`div`,{className:`scheduled-task-run`,"data-status":r.status,children:[(0,J.jsx)(`span`,{children:n(`scheduledTasks.${r.status}`)}),(0,J.jsx)(`time`,{children:q(r.startedAtUnixMs,t.resolvedLanguage)}),r.status===`unknown`||r.status===`cleanup_pending`?(0,J.jsx)(`span`,{className:`scheduled-task-run__error`,children:n(r.status===`unknown`?`scheduledTasks.unknownHint`:`scheduledTasks.cleanupHint`)}):null,r.taskId===null?(0,J.jsx)(`span`,{className:`scheduled-task-run__error`,children:r.error}):(0,J.jsx)(l,{"aria-label":r.taskId,disabled:e.openingRun,onClick:()=>{e.task!==void 0&&r.taskId!==null&&e.onOpenRun(e.task.projectId,r.taskId)},size:`icon-sm`,variant:`ghost`,children:(0,J.jsx)(E,{"aria-hidden":`true`})})]},r.id))]})})]})]})}function be({task:e,onDelete:t,onEnabledChange:n}){let{t:r}=S(`workbench`),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(!1),c=async()=>{s(!0);try{await t(e.id),a(!1)}catch{}finally{s(!1)}};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(d,{modal:!1,children:[(0,J.jsx)(g,{asChild:!0,children:(0,J.jsx)(l,{"aria-label":r(`scheduledTasks.taskActions`,{name:e.name}),className:`scheduled-task-row__menu`,size:`icon-toolbar`,variant:`ghost`,children:(0,J.jsx)(_,{"aria-hidden":`true`})})}),(0,J.jsxs)(h,{align:`end`,sideOffset:4,className:`scheduled-task-menu`,children:[(0,J.jsxs)(f,{disabled:!e.enabled&&e.runs.some(e=>e.status===`running`||e.status===`unknown`||e.status===`cleanup_pending`),"aria-label":r(e.enabled?`scheduledTasks.disableTask`:`scheduledTasks.enableTask`,{name:e.name}),onSelect:()=>{n(e.id,!e.enabled)},children:[e.enabled?(0,J.jsx)(ae,{"aria-hidden":`true`}):(0,J.jsx)(A,{"aria-hidden":`true`}),r(e.enabled?`scheduledTasks.disable`:`scheduledTasks.enable`)]}),(0,J.jsx)(p,{}),(0,J.jsxs)(f,{className:`text-danger`,disabled:e.lastRunStatus===`running`||e.runs.some(e=>e.status===`cleanup_pending`),onSelect:()=>{a(!0)},children:[(0,J.jsx)(w,{"aria-hidden":`true`}),r(`scheduledTasks.delete`)]})]})]}),i?(0,J.jsx)(te,{title:r(`sidebar.deleteTaskTitle`),description:r(`sidebar.deleteTaskDescription`,{task:e.name}),confirmLabel:r(`scheduledTasks.deleteConfirm`),isPending:o,onClose:()=>{a(!1)},onConfirm:()=>{c()}}):null]})}function xe(e){return e.lastRunStatus===`unknown`?`failed`:e.lastRunStatus===`cleanup_pending`?`running`:e.enabled?e.lastRunStatus===`failed`?`failed`:e.lastRunStatus===`running`?`running`:`scheduled`:`paused`}function Se({activeId:e,loading:t,onCreate:n,onDelete:r,onEnabledChange:i,onSelect:a,query:o,setQuery:c,tasks:u}){let{i18n:d,t:f}=S(`workbench`),[p,m]=(0,F.useState)(`all`),h=u.filter(e=>p===`all`||e.enabled===(p===`enabled`));return(0,J.jsxs)(`aside`,{className:`scheduled-task-list`,children:[(0,J.jsxs)(`div`,{className:`scheduled-task-list__header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:f(`scheduledTasks.title`)}),(0,J.jsx)(`span`,{children:u.length})]}),(0,J.jsx)(l,{"aria-label":f(`scheduledTasks.create`),onClick:n,size:`icon-toolbar`,type:`button`,children:(0,J.jsx)(x,{"aria-hidden":`true`})})]}),(0,J.jsx)(`div`,{className:`scheduled-task-filters`,role:`group`,"aria-label":f(`scheduledTasks.filter`),children:[`all`,`enabled`,`disabled`].map(e=>(0,J.jsx)(`button`,{"aria-pressed":p===e,onClick:()=>{m(e)},type:`button`,children:f(`scheduledTasks.${e}`)},e))}),(0,J.jsxs)(`div`,{className:`scheduled-task-search`,children:[(0,J.jsx)(T,{"aria-hidden":`true`}),(0,J.jsx)(s,{"aria-label":f(`scheduledTasks.search`),onChange:e=>{c(e.currentTarget.value)},placeholder:f(`scheduledTasks.search`),type:`search`,value:o})]}),(0,J.jsx)(`div`,{className:`scheduled-task-list__items`,children:t?(0,J.jsx)(`div`,{className:`scheduled-task-list__empty`,role:`status`,children:(0,J.jsx)(b,{"aria-hidden":`true`})}):h.length===0?(0,J.jsxs)(`div`,{className:`scheduled-task-list__empty`,children:[(0,J.jsx)(y,{"aria-hidden":`true`}),(0,J.jsx)(`span`,{children:f(u.length===0&&o===``?`scheduledTasks.empty`:`scheduledTasks.noMatches`)})]}):h.map(t=>{let n=xe(t);return(0,J.jsxs)(`div`,{className:`scheduled-task-row`,"data-active":e===t.id?`true`:void 0,"data-tone":n,children:[(0,J.jsx)(`span`,{className:`scheduled-task-row__rail`}),(0,J.jsxs)(`button`,{"aria-current":e===t.id?`page`:void 0,"aria-label":t.name,className:`scheduled-task-row__content`,onClick:()=>{a(t)},type:`button`,children:[(0,J.jsx)(`strong`,{children:t.name}),(0,J.jsxs)(`span`,{children:[f(`scheduledTasks.${H(t.schedule).preset}`),` ·`,` `,t.projectName]}),(0,J.jsxs)(`span`,{className:`scheduled-task-row__time`,children:[n===`failed`?(0,J.jsx)(v,{"aria-hidden":`true`}):(0,J.jsx)(b,{"aria-hidden":`true`}),t.lastRunStatus===`unknown`||t.lastRunStatus===`cleanup_pending`?f(`scheduledTasks.${t.lastRunStatus}`):t.enabled?q(t.nextRunAtUnixMs,d.resolvedLanguage):f(`scheduledTasks.disabled`)]})]}),(0,J.jsx)(be,{task:t,onDelete:r,onEnabledChange:i})]},t.id)})})]})}var Ce=[`scheduled-tasks`],we=[],$=()=>void 0;function Te({context:e,projectId:t,temporary:n}){let r=o(),s=(0,F.useCallback)(t=>e.client.previewScheduledTask(t),[e.client]),[c,l]=(0,F.useState)(),[d,f]=(0,F.useState)(!1),[p,m]=(0,F.useState)(``),h=a(O(e.client,r)),g=h.data?.data??we,_=d?void 0:g.find(e=>e.id===c),v=(0,F.useMemo)(()=>{let e=p.trim().toLocaleLowerCase();return e===``?g:g.filter(t=>`${t.name}\n${t.projectName}`.toLocaleLowerCase().includes(e))},[p,g]),b=e=>r.setQueryData(Ce,e),x=i({meta:{actionNotification:!1},mutationFn:({taskId:t,...n})=>t===void 0?e.client.createScheduledTask(n):e.client.updateScheduledTask(t,n),onSuccess:e=>{l(e.task.id),f(!1),b(e.tasks)}}),S=i({mutationFn:t=>e.client.deleteScheduledTask(t),onSuccess:(e,t)=>{l(e=>e===t?void 0:e),b(e.tasks)}}),C=i({mutationFn:({enabled:t,taskId:n})=>e.client.setScheduledTaskEnabled(n,t),onSuccess:e=>{b(e.tasks)}}),w=i({mutationFn:t=>e.client.runScheduledTaskNow(t),onSuccess:e=>b(e.tasks)}),T=i({meta:{actionNotification:!1},mutationFn:({runProjectId:t,taskId:n})=>e.client.readNavigableTask(t,n),onError:k,onSuccess:(t,{runProjectId:n,taskId:i})=>{if(t.task===null){k(e.t(`scheduledTasks.runUnavailable`));return}r.setQueryData([`projects`,n,`tasks`,i],t.task),!u({projectId:n,taskId:i})&&e.navigate(n===`temporary`?{params:{taskId:i},to:`/temporary/t/$taskId`}:{params:{projectId:n,taskId:i},to:`/p/$projectId/t/$taskId`})}}),E=t=>void e.navigate(t===`temporary`?{to:`/temporary/scheduled`}:{params:{projectId:t},to:`/p/$projectId/scheduled`}),D={capabilities:e.capabilities,client:e.client,fastModeAvailable:e.fastModeAvailable,fastModeDefault:e.fastModeDefault,followUpBehavior:e.globalSettings?.followUpBehavior??`queue`,models:e.models,modelsError:e.modelsQuery.error,modelsPending:e.modelsQuery.isPending,onFastModeChange:$,onOpenProjectPath:e.openProjectFolder,onProjectRootChange:e.setSelectedRootId,onRequestNotificationPermission:$,onSettingsChange:$,onTaskStarted:$,projectId:t,projectName:e.projectName,projectPath:e.projectPath,projectPathOpenDisabled:e.projectFolderOpenDisabled,projectRoots:e.projectRoots,projectToolsEnabled:!n,selectedProjectRootId:e.selectedRootId??``,settings:e.draftSettings,skills:e.skillsQuery.data?.data??[]};return(0,J.jsxs)(`div`,{className:`scheduled-tasks`,children:[(0,J.jsx)(Se,{..._===void 0?{}:{activeId:_.id},loading:h.isPending,onDelete:S.mutateAsync,onCreate:()=>{f(!0),l(void 0)},onEnabledChange:(e,t)=>{C.mutate({enabled:t,taskId:e})},onSelect:e=>{f(!1),l(e.id),e.projectId!==t&&E(e.projectId)},query:p,setQuery:m,tasks:v}),d||_!==void 0?(0,J.jsx)(ye,{composerProps:D,openingRun:T.isPending,onOpenRun:(e,t)=>{T.isPending||T.mutate({runProjectId:e,taskId:t})},onProjectChange:E,onPreview:s,onRunNow:e=>w.mutateAsync(e).then($),onSave:(e,t)=>x.mutateAsync({...t,...e===void 0?{}:{taskId:e}}).then($),projectId:t,projects:e.projects,skills:e.skillsQuery.data?.data??[],..._===void 0?{}:{task:_}},_?.id??`new:${t}`):(0,J.jsxs)(`div`,{className:`scheduled-task-welcome`,children:[(0,J.jsx)(y,{"aria-hidden":`true`}),(0,J.jsx)(`h2`,{children:e.t(`scheduledTasks.welcome`)}),(0,J.jsx)(`p`,{children:e.t(`scheduledTasks.welcomeHint`)}),(0,J.jsx)(`span`,{children:e.t(`scheduledTasks.selectTask`)})]})]})}export{Te as ScheduledTasksContainer,B as n,z as t};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/scheduled-task-date-time-picker-8cWX1p1O.js","assets/rolldown-runtime-B0Z9INg1.js","assets/react-runtime-CMZHB3u8.js","assets/initial-deps-C-3sxJvc.js","assets/initial-deps-CqwWvUnY.js","assets/initial-deps-CW5Jl6i2.js","assets/initial-deps-CG4ykI_P.js","assets/initial-deps-D0opk7c-.js","assets/initial-deps-C0_XYRrC.js","assets/initial-deps-DZ-sH4cr.js","assets/initial-deps-B8FrcWWN.js","assets/initial-deps-Cppvl2Gz.js","assets/scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-source~c6tt9j64-ClgveiMa.js","assets/initial-deps-DFOart6r.js","assets/index-DobF11m_.js","assets/index-CHJSDTYw.css","assets/scheduled-task-floating-ui~scheduled-task-date-time-picker-wwPq7k9m.js","assets/scheduled-task-date-time-picker-Wk3Ob2xl.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./initial-deps-CqwWvUnY.js";import{i as n,t as r}from"./react-runtime-CMZHB3u8.js";import{i,s as a,u as o}from"./initial-deps-CW5Jl6i2.js";import{B as s,Tt as c,_n as l,bt as u,c as d,d as f,h as p,l as m,wn as h,y as g}from"./initial-deps-C-3sxJvc.js";import{F as _,H as v,J as y,L as b,_ as x,at as S,ct as C,l as w,p as T}from"./initial-deps-B8FrcWWN.js";import{t as E}from"./external-link-DQSTtNhw.js";import{n as D}from"./history-location-C2XDYAuy.js";import{t as ee}from"./sliders-horizontal-C6QQuWdW.js";import{E as O,J as k,K as te,Mt as ne}from"./index-DobF11m_.js";import{t as re}from"./scheduled-tasks-BBUd86IL.js";import{a as ie,d as A,f as ae,i as oe,u as se}from"./workbench-shell-B139izuR.js";var j=``,M;function N(e,t){j!==t&&(M=new Intl.DateTimeFormat(`sv-SE`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}),j=t);let n=M.formatToParts(e),r=e=>{let t=n.find(t=>t.type===e)?.value;if(t===void 0)throw Error(`Missing date part: ${e}`);return t};return`${r(`year`)}-${r(`month`)}-${r(`day`)}T${r(`hour`)}:${r(`minute`)}:${r(`second`)}`}function P(e,t){if(!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/u.test(e))return;let n=e.length===16?`${e}:00`:e,r=Date.parse(`${n}Z`);if(Number.isFinite(r)&&new Date(r).toISOString().slice(0,19)===n){if(t===`UTC`)return r;try{let e=r;for(let i=0;i<3;i++){let i=N(e,t);if(i===n)return e;e+=r-Date.parse(`${i}Z`)}}catch{return}}}var F=e(n(),1),ce={every:`Every`,interval:`Repeat interval`,intervalUnit:`Interval unit`,units:{HOURLY:`hours`,DAILY:`days`,WEEKLY:`weeks`,MONTHLY:`months`,YEARLY:`years`},repeatDays:`Repeat on`,monthMode:`Monthly pattern`,byDate:`By date`,byWeekday:`By weekday`,lastDay:`Last day`,ordinal:`Occurrence`,ordinals:{1:`First`,2:`Second`,3:`Third`,4:`Fourth`,5:`Fifth`,"-1":`Last`},yearMonth:`Month`,yearDay:`Date`,startDate:`Start date`,rangeSettings:`Start and end conditions`,oncePast:`Choose a future execution time.`,end:`Ends`,never:`Never`,onDate:`On a date`,afterCount:`After a number of occurrences`,endDate:`End date`,count:`Planned occurrences`,countHint:`Counts scheduled occurrences, including skipped or missed times, not successful runs.`,monthSkipHint:`Months without the selected date are skipped. Choose Last day to run every month.`,ordinalSkipHint:`Months without the selected weekday occurrence are skipped.`,leapHint:`Runs on February 29 in leap years only.`,startHint:`Matches dates from this day; check the upcoming times. Weekly intervals start on Monday.`,preview:`Upcoming runs`,previewLoading:`Calculating upcoming times…`,previewFailed:`Could not calculate upcoming times. Check the settings and retry.`,retryPreview:`Recalculate`,showMore:`Show 5 runs`,showLess:`Show less`,ended:`Schedule ended`,noFutureRuns:`No future runs remain. Adjust the start date or ending condition.`,invalidDate:`Choose a valid date.`,invalidTime:`Enter a valid time.`,invalidInterval:`Enter a whole number from 1 to 999.`,selectWeekday:`Select at least one weekday.`,selectMonthDay:`Select at least one valid date.`,selectOrdinal:`Select at least one valid weekday occurrence.`,invalidYearDay:`Choose a valid month and date.`,invalidCount:`Enter a whole number from 1 to 10000.`,invalidEndDate:`The end date must not precede the start date.`,invalidWallTime:`This date or time does not exist. Choose another time.`,unsupportedRule:`This recurrence cannot be fully expressed in the form. Choose a new repeat pattern.`,summaryEvery:`Every {{interval}} {{unit}}`,summaryAt:`{{rule}} at {{time}}`,summaryFrom:`From {{date}}`,summaryUntil:`Until {{date}} (inclusive)`,summaryCount:`{{count}} planned occurrences`,summaryMonthDates:`Day {{days}}`,summaryYearDate:`{{month}}/{{day}}`},I={every:`每隔`,interval:`重复间隔`,intervalUnit:`间隔单位`,units:{HOURLY:`小时`,DAILY:`天`,WEEKLY:`周`,MONTHLY:`月`,YEARLY:`年`},repeatDays:`重复日期`,monthMode:`每月重复方式`,byDate:`按日期`,byWeekday:`按星期`,lastDay:`最后一天`,ordinal:`第几个`,ordinals:{1:`第一个`,2:`第二个`,3:`第三个`,4:`第四个`,5:`第五个`,"-1":`最后一个`},yearMonth:`月份`,yearDay:`日期`,startDate:`开始日期`,rangeSettings:`开始与结束条件`,oncePast:`请选择未来的执行时间。`,end:`结束`,never:`永不`,onDate:`到指定日期`,afterCount:`安排指定次数后`,endDate:`结束日期`,count:`计划次数`,countHint:`按计划触发次数计算,跳过或错过的时间也计入,不代表成功执行次数。`,monthSkipHint:`没有所选日期的月份将跳过;每月都要执行可选择“最后一天”。`,ordinalSkipHint:`没有所选星期的月份将跳过。`,leapHint:`仅在闰年的 2 月 29 日执行。`,startHint:`从该日期开始匹配规则,以接下来执行时间为准。隔周规则从该周周一计起。`,preview:`接下来执行`,previewLoading:`正在计算执行时间…`,previewFailed:`无法计算执行时间,请检查设置后重试。`,retryPreview:`重新计算`,showMore:`展开 5 次`,showLess:`收起`,ended:`计划已结束`,noFutureRuns:`此计划已无后续执行时间,可调整开始日期或结束条件。`,invalidDate:`请选择有效日期。`,invalidTime:`请输入有效时间。`,invalidInterval:`重复间隔需为 1~999 的整数。`,selectWeekday:`至少选择一个星期。`,selectMonthDay:`至少选择一个有效日期。`,selectOrdinal:`至少选择一个有效的星期序号。`,invalidYearDay:`请选择有效的月份和日期。`,invalidCount:`计划次数需为 1~10000 的整数。`,invalidEndDate:`结束日期不能早于开始日期。`,invalidWallTime:`该日期或时间不存在,请重新选择。`,unsupportedRule:`此任务的重复方式无法用表单完整表达,请重新选择重复方式。`,summaryEvery:`每 {{interval}} {{unit}}`,summaryAt:`{{rule}},{{time}} 执行`,summaryFrom:`从 {{date}} 开始`,summaryUntil:`至 {{date}}(含当天)`,summaryCount:`共安排 {{count}} 次`,summaryMonthDates:`{{days}} 日`,summaryYearDate:`{{month}} 月 {{day}} 日`};C.addResourceBundle(`en`,`workbench`,{scheduledTasks:{...re,...ce}},!0),C.addResourceBundle(`zh-CN`,`workbench`,{scheduledTasks:{...ne,...I}},!0);var L=[`MO`,`TU`,`WE`,`TH`,`FR`,`SA`,`SU`],R=[`HOURLY`,`DAILY`,`WEEKLY`,`MONTHLY`,`YEARLY`],le=new Set([`FREQ`,`INTERVAL`,`WKST`,`BYDAY`,`BYMONTHDAY`,`BYMONTH`,`BYHOUR`,`BYMINUTE`,`BYSECOND`,`COUNT`,`UNTIL`]);function ue(e,t){let n=e.rrule.trim().replace(/^RRULE:/u,``).split(`;`).map(e=>e.split(`=`)),r=new Map(n.map(([e=``,t=``])=>[e,t])),i=r.get(`FREQ`),a=()=>({...t,preset:`custom`,unsupported:!0});if(n.some(e=>e.length!==2||!le.has(e[0]??``)||!e[1])||r.size!==n.length||!R.includes(i)||r.has(`WKST`)&&r.get(`WKST`)!==`MO`||r.has(`BYSECOND`)&&r.get(`BYSECOND`)!==`0`||!r.has(`BYSECOND`)&&e.startAtUnixMs%6e4!=0)return a();let o=r.get(`BYHOUR`)??t.time.slice(0,2),s=r.get(`BYMINUTE`)??t.time.slice(3);if(!/^\d{1,2}$/u.test(o)||!/^\d{1,2}$/u.test(s)||i===`HOURLY`&&r.has(`BYHOUR`))return a();let c=`${o.padStart(2,`0`)}:${s.padStart(2,`0`)}`,l=Number(r.get(`INTERVAL`)??1),u={...t,preset:`custom`,frequency:i,interval:l,time:c,anchor:{unixMs:e.startAtUnixMs,startDate:t.startDate,time:c}},d=r.get(`BYDAY`);if(i===`WEEKLY`){let e=d?.split(`,`)??t.weekdays;if(e.some(e=>!L.includes(e)))return a();u={...u,weekdays:e}}else if(i===`MONTHLY`&&d){let e=d.split(`,`).map(e=>/^(-1|[1-5])(MO|TU|WE|TH|FR|SA|SU)$/u.exec(e));if(e.some(t=>t===null||t[2]!==e[0]?.[2])||r.has(`BYMONTHDAY`))return a();u={...u,monthMode:`weekday`,ordinals:e.map(e=>Number(e?.[1])),monthWeekday:e[0]?.[2]}}else if(d)return a();if(r.has(`BYMONTHDAY`)){let e=(r.get(`BYMONTHDAY`)??``).split(`,`).map(Number);if(i===`MONTHLY`)u={...u,monthDays:e};else if(i===`YEARLY`&&e.length===1)u={...u,yearDay:Number(e[0])};else return a()}if(r.has(`BYMONTH`)){if(i!==`YEARLY`||!/^\d{1,2}$/u.test(r.get(`BYMONTH`)??``))return a();u={...u,yearMonth:Number(r.get(`BYMONTH`))}}if(r.has(`COUNT`)&&r.has(`UNTIL`))return a();if(r.has(`COUNT`)&&(u={...u,endMode:`count`,count:Number(r.get(`COUNT`))}),r.has(`UNTIL`)){let t=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/u.exec(r.get(`UNTIL`)??``);if(!t)return a();let n=Date.parse(`${t.slice(1,4).join(`-`)}T${t.slice(4).join(`:`)}Z`);if(!Number.isFinite(n))return a();let i=N(n,e.timezone);if(!i.endsWith(`23:59:59`))return a();u={...u,endMode:`date`,endDate:i.slice(0,10)}}if(l===1){if(i===`DAILY`&&(u={...u,preset:`daily`}),i===`WEEKLY`){let e=L.filter(e=>u.weekdays.includes(e)).join(`,`);u={...u,preset:e===`MO,TU,WE,TH,FR`?`weekdays`:e===`SA,SU`?`weekends`:`weekly`}}i===`MONTHLY`&&(u={...u,preset:`monthly`})}return u}function z(e){return e===`en`?`en`:`zh-CN`}function B(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${String(t.getFullYear())}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function V(e=Date.now()){let t=B(e+36e5),n=new Date(t),r=L[(n.getDay()+6)%7]??`MO`;return{dateTime:t,preset:`once`,frequency:`WEEKLY`,interval:1,time:t.slice(11),startDate:t.slice(0,10),weekdays:[r],monthMode:`date`,monthDays:[n.getDate()],ordinals:[1],monthWeekday:r,yearMonth:n.getMonth()+1,yearDay:n.getDate(),endMode:`never`,endDate:t.slice(0,10),count:10}}function H(e){if(e.type===`once`)return V(e.atUnixMs-36e5);let t=N(e.startAtUnixMs,e.timezone),n=new Date(`${t.slice(0,10)}T12:00:00Z`),r=L[(n.getUTCDay()+6)%7]??`MO`;return ue(e,{...V(e.startAtUnixMs-36e5),dateTime:t.slice(0,16),startDate:t.slice(0,10),time:t.slice(11,16),weekdays:[r],monthWeekday:r,monthDays:[n.getUTCDate()],yearMonth:n.getUTCMonth()+1,yearDay:n.getUTCDate()})}function U(e){return e.preset===`daily`?`DAILY`:e.preset===`weekly`||e.preset===`weekdays`||e.preset===`weekends`?`WEEKLY`:e.preset===`monthly`?`MONTHLY`:e.frequency}function W(e,t,n){return Number.isInteger(e)&&e>=t&&e<=n}function G(e){if(e.unsupported)return`unsupportedRule`;if(e.preset===`once`){let t=new Date(e.dateTime).getTime();return Number.isFinite(t)&&B(t)===e.dateTime?void 0:`invalidDate`}if(!/^([01]\d|2[0-3]):[0-5]\d$/u.test(e.time))return`invalidTime`;if(e.preset===`custom`&&!W(e.interval,1,999))return`invalidInterval`;if(P(`${e.startDate}T00:00`,`UTC`)===void 0)return`invalidDate`;let t=U(e);if(t===`WEEKLY`&&e.preset!==`weekdays`&&e.preset!==`weekends`&&(!e.weekdays.length||e.weekdays.some(e=>!L.includes(e))))return`selectWeekday`;if(t===`MONTHLY`){if(e.monthMode===`date`&&(!e.monthDays.length||e.monthDays.some(e=>e!==-1&&!W(e,1,31))))return`selectMonthDay`;if(e.monthMode===`weekday`&&(!e.ordinals.length||e.ordinals.some(e=>e!==-1&&!W(e,1,5))||!L.includes(e.monthWeekday)))return`selectOrdinal`}if(t===`YEARLY`&&(!W(e.yearMonth,1,12)||!W(e.yearDay,1,new Date(2e3,e.yearMonth,0).getDate())))return`invalidYearDay`;if(e.endMode===`count`&&!W(e.count,1,1e4))return`invalidCount`;if(e.endMode===`date`&&(P(`${e.endDate}T23:59:59`,`UTC`)===void 0||e.endDate<e.startDate))return`invalidEndDate`}function K(e,t,n=Date.now()){if(G(e))return;if(e.preset===`once`){let t=new Date(e.dateTime).getTime();return t>n?{type:`once`,atUnixMs:t}:void 0}let r=e.anchor?.startDate===e.startDate&&e.anchor.time===e.time?e.anchor.unixMs:P(`${e.startDate}T${e.time}`,t);if(r===void 0)return;let i=U(e),a=[`FREQ=${i}`];if(e.preset===`custom`&&e.interval>1&&a.push(`INTERVAL=${String(e.interval)}`),i===`WEEKLY`){let t=e.preset===`weekdays`?L.slice(0,5):e.preset===`weekends`?L.slice(5):L.filter(t=>e.weekdays.includes(t));a.push(`WKST=MO`,`BYDAY=${t.join(`,`)}`)}i===`MONTHLY`&&a.push(e.monthMode===`date`?`BYMONTHDAY=${[...new Set(e.monthDays)].join(`,`)}`:`BYDAY=${[...new Set(e.ordinals)].map(t=>`${String(t)}${e.monthWeekday}`).join(`,`)}`),i===`YEARLY`&&a.push(`BYMONTH=${String(e.yearMonth)}`,`BYMONTHDAY=${String(e.yearDay)}`);let[o,s]=e.time.split(`:`).map(Number);if(i!==`HOURLY`&&a.push(`BYHOUR=${String(o)}`),a.push(`BYMINUTE=${String(s)}`,`BYSECOND=0`),e.endMode===`count`&&a.push(`COUNT=${String(e.count)}`),e.endMode===`date`){let n=P(`${e.endDate}T23:59:59`,t);if(n===void 0||n<r)return;a.push(`UNTIL=${new Date(n).toISOString().replace(/[-:]/gu,``).replace(`.000`,``)}`)}return{type:`rrule`,rrule:`RRULE:${a.join(`;`)}`,startAtUnixMs:r,timezone:t}}function q(e,t){return e===null?`-`:new Intl.DateTimeFormat(z(t),{dateStyle:`medium`,timeStyle:`short`}).format(e)}var J=r(),Y=Array.from({length:31},(e,t)=>t+1),de=Array.from({length:12},(e,t)=>t+1),fe=[1,2,3,4,5,-1];function X(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function pe({schedule:e,onChange:t,weekdayNames:n}){let{t:r}=S(`workbench`),i=n=>{t({...e,...n})};return U(e)===`YEARLY`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.yearMonth`)}),(0,J.jsx)(`select`,{value:e.yearMonth,onChange:e=>{i({yearMonth:Number(e.currentTarget.value)})},children:de.map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))})]}),(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.yearDay`)}),(0,J.jsx)(`select`,{value:e.yearDay,onChange:e=>{i({yearDay:Number(e.currentTarget.value)})},children:Y.map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))})]}),e.yearMonth===2&&e.yearDay===29?(0,J.jsx)(`p`,{className:`scheduled-task-hint`,children:r(`scheduledTasks.leapHint`)}):null]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.monthMode`)}),(0,J.jsxs)(`select`,{value:e.monthMode,onChange:e=>{i({monthMode:e.currentTarget.value})},children:[(0,J.jsx)(`option`,{value:`date`,children:r(`scheduledTasks.byDate`)}),(0,J.jsx)(`option`,{value:`weekday`,children:r(`scheduledTasks.byWeekday`)})]})]}),e.monthMode===`date`?(0,J.jsxs)(`div`,{className:`scheduled-task-field scheduled-task-field--choices`,children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.monthDay`)}),(0,J.jsxs)(`div`,{className:`scheduled-task-month-days`,role:`group`,"aria-label":r(`scheduledTasks.monthDay`),children:[Y.map(t=>(0,J.jsx)(`button`,{type:`button`,"aria-pressed":e.monthDays.includes(t),onClick:()=>{i({monthDays:X(e.monthDays,t)})},children:t},t)),(0,J.jsx)(`button`,{className:`scheduled-task-month-days__last`,type:`button`,"aria-pressed":e.monthDays.includes(-1),onClick:()=>{i({monthDays:X(e.monthDays,-1)})},children:r(`scheduledTasks.lastDay`)})]})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`scheduled-task-field scheduled-task-field--choices`,children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.ordinal`)}),(0,J.jsx)(`div`,{className:`scheduled-task-choices`,role:`group`,"aria-label":r(`scheduledTasks.ordinal`),children:fe.map(t=>(0,J.jsx)(`button`,{type:`button`,"aria-pressed":e.ordinals.includes(t),onClick:()=>{i({ordinals:X(e.ordinals,t)})},children:r(`scheduledTasks.ordinals.${String(t)}`)},t))})]}),(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.weekday`)}),(0,J.jsx)(`select`,{value:e.monthWeekday,onChange:e=>{i({monthWeekday:e.currentTarget.value})},children:L.map((e,t)=>(0,J.jsx)(`option`,{value:e,children:n[t]},e))})]})]}),e.monthMode===`date`&&e.monthDays.some(e=>e>=29)?(0,J.jsx)(`p`,{className:`scheduled-task-hint`,children:r(`scheduledTasks.monthSkipHint`)}):null,e.monthMode===`weekday`&&e.ordinals.includes(5)?(0,J.jsx)(`p`,{className:`scheduled-task-hint`,children:r(`scheduledTasks.ordinalSkipHint`)}):null]})}var me=(0,F.lazy)(async()=>({default:(await t(()=>import(`./scheduled-task-date-time-picker-8cWX1p1O.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]))).ScheduledTaskDateTimePicker}));function Z({label:e,value:t,onChange:n,minimum:r=``,dateOnly:i=!0}){return(0,J.jsxs)(`div`,{className:`scheduled-task-field`,children:[(0,J.jsx)(`span`,{children:e}),(0,J.jsx)(F.Suspense,{fallback:(0,J.jsx)(s,{"aria-label":e,"aria-busy":`true`,disabled:!0,value:``}),children:(0,J.jsx)(me,{dateOnly:i,label:e,minimum:r,onChange:n,value:t})})]})}var he=(0,F.memo)(function({schedule:e,onChange:t}){let{i18n:n,t:r}=S(`workbench`),[i]=(0,F.useState)(()=>B(Date.now())),[a,o]=(0,F.useState)(e.endMode!==`never`),c=U(e),l=z(n.resolvedLanguage),u=(0,F.useMemo)(()=>{let e=new Intl.DateTimeFormat(l,{timeZone:`UTC`,weekday:`short`});return L.map((t,n)=>e.format(new Date(Date.UTC(2024,0,n+1))))},[l]),d=n=>{t({...e,...n})};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.repeat`)}),(0,J.jsx)(`select`,{onChange:e=>{d({preset:e.currentTarget.value,frequency:c,unsupported:!1})},value:e.preset,children:[`once`,`daily`,`weekdays`,`weekends`,`weekly`,`monthly`,`custom`].map(e=>(0,J.jsx)(`option`,{value:e,children:r(`scheduledTasks.${e}`)},e))})]}),e.preset===`once`?(0,J.jsx)(Z,{dateOnly:!1,label:r(`scheduledTasks.time`),minimum:i,value:e.dateTime,onChange:e=>{d({dateTime:e})}}):(0,J.jsxs)(J.Fragment,{children:[e.preset===`custom`?(0,J.jsxs)(`div`,{className:`scheduled-task-field`,children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.every`)}),(0,J.jsxs)(`div`,{className:`scheduled-task-inline-controls`,children:[(0,J.jsx)(s,{"aria-label":r(`scheduledTasks.interval`),type:`number`,min:1,max:999,step:1,value:Number.isNaN(e.interval)?``:e.interval,onChange:e=>{d({interval:e.currentTarget.valueAsNumber})}}),(0,J.jsx)(`select`,{"aria-label":r(`scheduledTasks.intervalUnit`),value:e.frequency,onChange:e=>{d({frequency:e.currentTarget.value})},children:R.map(e=>(0,J.jsx)(`option`,{value:e,children:r(`scheduledTasks.units.${e}`)},e))})]})]}):null,c===`WEEKLY`&&e.preset!==`weekdays`&&e.preset!==`weekends`?(0,J.jsxs)(`div`,{className:`scheduled-task-field scheduled-task-field--choices`,children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.repeatDays`)}),(0,J.jsx)(`div`,{className:`scheduled-task-choices`,role:`group`,"aria-label":r(`scheduledTasks.repeatDays`),children:L.map((t,n)=>(0,J.jsx)(`button`,{type:`button`,"aria-pressed":e.weekdays.includes(t),onClick:()=>{d({weekdays:e.weekdays.includes(t)?e.weekdays.filter(e=>e!==t):[...e.weekdays,t]})},children:u[n]},t))})]}):null,c===`MONTHLY`||c===`YEARLY`?(0,J.jsx)(pe,{schedule:e,onChange:t,weekdayNames:u}):null,(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.timeOfDay`)}),(0,J.jsx)(s,{step:60,type:`time`,value:e.time,onChange:e=>{d({time:e.currentTarget.value})}})]}),e.preset===`custom`?null:(0,J.jsx)(`button`,{className:`scheduled-task-range-toggle`,type:`button`,"aria-expanded":a,onClick:()=>{o(!a)},children:r(`scheduledTasks.rangeSettings`)}),e.preset===`custom`||a?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Z,{label:r(`scheduledTasks.startDate`),value:e.startDate,onChange:e=>{d({startDate:e})}}),(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.end`)}),(0,J.jsxs)(`select`,{value:e.endMode,onChange:e=>{d({endMode:e.currentTarget.value})},children:[(0,J.jsx)(`option`,{value:`never`,children:r(`scheduledTasks.never`)}),(0,J.jsx)(`option`,{value:`date`,children:r(`scheduledTasks.onDate`)}),(0,J.jsx)(`option`,{value:`count`,children:r(`scheduledTasks.afterCount`)})]})]}),e.endMode===`date`?(0,J.jsx)(Z,{label:r(`scheduledTasks.endDate`),minimum:e.startDate,value:e.endDate,onChange:e=>{d({endDate:e})}}):null,e.endMode===`count`?(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:r(`scheduledTasks.count`)}),(0,J.jsx)(s,{type:`number`,min:1,max:1e4,step:1,value:Number.isNaN(e.count)?``:e.count,onChange:e=>{d({count:e.currentTarget.valueAsNumber})}})]}):null,e.endMode===`count`?(0,J.jsx)(`p`,{className:`scheduled-task-hint`,children:r(`scheduledTasks.countHint`)}):null]}):null]})]})});function ge({schedule:e,timezone:t,dates:n,pending:r,failed:i,retry:a,error:o}){let{i18n:s,t:c}=S(`workbench`),[l,u]=(0,F.useState)(!1),d=z(s.resolvedLanguage),f=(0,F.useMemo)(()=>new Intl.DateTimeFormat(d,{timeZone:t,year:`numeric`,month:`short`,day:`numeric`,weekday:`short`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}),[d,t]),p=(0,F.useMemo)(()=>{let e=new Intl.DateTimeFormat(d,{timeZone:`UTC`,weekday:`short`});return L.map((t,n)=>e.format(Date.UTC(2024,0,n+1)))},[d]),m=(0,F.useMemo)(()=>new Intl.DateTimeFormat(d,{timeZone:t,timeZoneName:`longGeneric`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value,[d,t]),h=U(e),g=c(`scheduledTasks.summaryEvery`,{interval:e.preset===`custom`?e.interval:1,unit:c(`scheduledTasks.units.${h}`)});if(e.preset===`weekdays`||e.preset===`weekends`?g=c(`scheduledTasks.${e.preset}`):h===`WEEKLY`&&(g+=` · ${L.filter(t=>e.weekdays.includes(t)).map(e=>p[L.indexOf(e)]).join(`、`)}`),h===`MONTHLY`){if(e.monthMode===`date`){let t=e.monthDays.filter(e=>e!==-1).join(`、`);g+=` · ${[t?c(`scheduledTasks.summaryMonthDates`,{days:t}):``,e.monthDays.includes(-1)?c(`scheduledTasks.lastDay`):``].filter(Boolean).join(`、`)}`}else g+=` · ${e.ordinals.map(e=>c(`scheduledTasks.ordinals.${String(e)}`)).join(`、`)} ${p[L.indexOf(e.monthWeekday)]??``}`}h===`YEARLY`&&(g+=` · ${c(`scheduledTasks.summaryYearDate`,{month:e.yearMonth,day:e.yearDay})}`);let _=e.preset===`once`?c(`scheduledTasks.once`):h===`HOURLY`?g:c(`scheduledTasks.summaryAt`,{rule:g,time:e.time});return(0,J.jsxs)(`div`,{className:`scheduled-task-preview`,"aria-live":`polite`,"aria-busy":r,children:[(0,J.jsx)(`p`,{className:`scheduled-task-preview__summary`,children:_}),(0,J.jsxs)(`p`,{className:`scheduled-task-preview__meta`,children:[m,e.preset===`once`?``:` · ${c(`scheduledTasks.summaryFrom`,{date:e.startDate})}${h===`HOURLY`?` ${e.time}`:``}`]}),e.preset!==`once`&&e.endMode!==`never`?(0,J.jsx)(`p`,{className:`scheduled-task-preview__meta`,children:e.endMode===`date`?c(`scheduledTasks.summaryUntil`,{date:e.endDate}):c(`scheduledTasks.summaryCount`,{count:e.count})}):null,e.preset===`custom`?(0,J.jsx)(`p`,{className:`scheduled-task-preview__meta`,children:c(`scheduledTasks.startHint`)}):null,(0,J.jsx)(`h4`,{children:c(`scheduledTasks.preview`)}),(0,J.jsx)(`div`,{className:`scheduled-task-preview__results`,"data-expanded":l,children:o?(0,J.jsx)(`p`,{className:`scheduled-task-error`,role:`alert`,children:c(`scheduledTasks.${o}`)}):r?(0,J.jsx)(`p`,{children:c(`scheduledTasks.previewLoading`)}):i?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{children:c(`scheduledTasks.previewFailed`)}),(0,J.jsx)(`button`,{type:`button`,onClick:a,children:c(`scheduledTasks.retryPreview`)})]}):n?.length===0?(0,J.jsx)(`p`,{children:c(`scheduledTasks.noFutureRuns`)}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`ol`,{children:n?.slice(0,l?5:3).map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(`time`,{dateTime:new Date(e).toISOString(),children:f.format(e)})},e))}),(n?.length??0)>3?(0,J.jsx)(`button`,{type:`button`,"aria-expanded":l,onClick:()=>{u(!l)},children:c(l?`scheduledTasks.showLess`:`scheduledTasks.showMore`)}):null]})})]})}function Q(e,t){let[n,r]=(0,F.useState)(),[i,a]=(0,F.useState)(0),o=(0,F.useRef)(void 0),s=e===void 0?void 0:JSON.stringify(e);if((0,F.useEffect)(()=>{if(s===void 0)return;let e=JSON.parse(s);if(e.type===`once`)return;let n=!1,i=setTimeout(()=>{(async()=>{if(await o.current,n)return;let i=Promise.resolve().then(()=>t(e)).then(e=>{n||r({key:s,dates:e.dates})},()=>{n||r({key:s,failed:!0})});o.current=i,await i})()},200);return()=>{n=!0,clearTimeout(i)}},[s,t,i]),e?.type===`once`)return{dates:[e.atUnixMs],pending:!1,failed:!1,retry:()=>{a(e=>e+1)}};let c=n?.key===s?n:void 0;return{dates:c?.dates,pending:e!==void 0&&c===void 0,failed:c?.failed===!0,retry:()=>{r(void 0),a(e=>e+1)}}}function _e(e){return e===void 0?[]:e.messageAttachments.map(t=>({attachment:t,...t,previewUrl:t.kind===`image`?l(``,e.projectId,t.id):``,source:`host`}))}function ve(e,t){if(e===void 0)return{attachments:[],content:[]};let n=new Map(t.map(e=>[e.id,e])),r=e.prompt.skills.flatMap(e=>{let t=n.get(e.id);return t===void 0?[]:[t]});return{attachments:_e(e),content:ie(e.prompt.text,r)}}function ye(e){let{i18n:t,t:n}=S(`workbench`),[r]=(0,F.useState)(()=>e.task?.schedule.type===`rrule`?e.task.schedule.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`),i=(0,F.useRef)(null),[a,o]=(0,F.useState)(e.task?.name??``),[l,u]=(0,F.useState)(()=>e.task===void 0?V():H(e.task.schedule)),[d,f]=(0,F.useState)(e.task?.turnOptions??e.composerProps.settings),[p,m]=(0,F.useState)(!1),[g,_]=(0,F.useState)(e.task!==void 0&&(e.task.prompt.text.trim()!==``||e.task.prompt.attachments.length>0||e.task.prompt.skills.length>0)),v=(0,F.useMemo)(()=>ve(e.task,e.skills),[e.skills,e.task]),b=e.projectId===`temporary`?n(`shell.temporaryTask`):e.projects.find(t=>t.id===e.projectId)?.name??e.projectId,x=(0,F.useMemo)(()=>K(l,r),[l,r]),C=Q(x,e.onPreview),w=G(l)??(x===void 0?l.preset===`once`?`oncePast`:`invalidWallTime`:void 0),T=a.trim()!==``&&x!==void 0&&g&&!C.pending&&!C.failed&&(C.dates?.length??0)>0,O=async(t,i,o)=>{if(a.trim()===``)throw Error(n(`scheduledTasks.name`));let s=K(l,r);if(s===void 0||C.pending||C.failed||!C.dates?.length)throw Error(n(`scheduledTasks.scheduleInvalid`));await e.onSave(e.task?.id,{enabled:e.task?.enabled??!0,messageAttachments:[...o],name:a.trim(),projectId:e.projectId,projectName:b,prompt:t,schedule:s,turnOptions:i})};return(0,J.jsxs)(`section`,{className:`scheduled-task-editor`,children:[(0,J.jsxs)(`div`,{className:`scheduled-task-editor__toolbar`,children:[(0,J.jsxs)(`span`,{className:`scheduled-task-status`,"data-enabled":e.task?.enabled??!0,children:[(0,J.jsx)(`span`,{}),n(e.task===void 0?`scheduledTasks.create`:e.task.enabled?`scheduledTasks.enabled`:`scheduledTasks.disabled`)]}),(0,J.jsxs)(`div`,{className:`scheduled-task-editor__actions`,children:[e.task===void 0?(0,J.jsx)(`span`,{}):(0,J.jsxs)(c,{"aria-label":n(`scheduledTasks.runNow`),disabled:e.task.lastRunStatus===`running`||e.task.runs.some(e=>e.status===`running`||e.status===`unknown`||e.status===`cleanup_pending`),onClick:()=>{e.task!==void 0&&e.onRunNow(e.task.id)},size:`sm`,variant:`outline`,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),n(`scheduledTasks.runNow`)]}),(0,J.jsxs)(c,{"aria-label":n(`scheduledTasks.save`),className:`disabled:bg-control-active disabled:text-muted-foreground disabled:opacity-100`,disabled:p||!T||e.task?.runs.some(e=>e.status===`running`||e.status===`unknown`||e.status===`cleanup_pending`),onClick:()=>void i.current?.submitCurrent(),size:`sm`,children:[(0,J.jsx)(se,{"aria-hidden":`true`}),n(`scheduledTasks.save`)]})]})]}),(0,J.jsxs)(`div`,{className:`scheduled-task-editor__body`,children:[(0,J.jsxs)(`label`,{className:`scheduled-task-title`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:n(`scheduledTasks.name`)}),(0,J.jsx)(s,{maxLength:120,onChange:e=>{o(e.currentTarget.value)},placeholder:n(`scheduledTasks.namePlaceholder`),value:a})]}),(0,J.jsxs)(`div`,{className:`scheduled-task-prompt`,children:[(0,J.jsx)(`h3`,{children:n(`scheduledTasks.prompt`)}),(0,J.jsx)(oe,{...e.composerProps,captureSubmitVisible:!1,composerRef:i,composerDraftId:`scheduled:${e.task?.id??`new`}`,footerVisible:!1,initialDraft:v,onCaptureSubmission:O,onFastModeChange:e.composerProps.onFastModeChange,onInputStateChange:_,onSettingsChange:(t,n,r)=>(f(t),e.composerProps.onSettingsChange(t,n,r)),onSubmissionStateChange:m,settings:d})]}),(0,J.jsxs)(`section`,{className:`scheduled-task-section`,children:[(0,J.jsxs)(`h3`,{children:[(0,J.jsx)(ee,{"aria-hidden":`true`}),n(`scheduledTasks.details`)]}),(0,J.jsxs)(`div`,{className:`scheduled-task-fields`,children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:n(`scheduledTasks.project`)}),(0,J.jsxs)(`select`,{onChange:t=>{e.onProjectChange(t.currentTarget.value)},value:e.projectId,children:[(0,J.jsx)(`option`,{value:h,children:n(`shell.temporaryTask`)}),e.projects.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,J.jsxs)(`div`,{className:`scheduled-task-info`,children:[(0,J.jsx)(`span`,{children:n(`scheduledTasks.runIn`)}),(0,J.jsx)(`span`,{children:n(`scheduledTasks.newChat`)})]})]})]}),(0,J.jsxs)(`section`,{className:`scheduled-task-section`,children:[(0,J.jsxs)(`h3`,{children:[(0,J.jsx)(y,{"aria-hidden":`true`}),n(`scheduledTasks.frequency`)]}),(0,J.jsx)(`div`,{className:`scheduled-task-fields`,children:(0,J.jsx)(he,{onChange:u,schedule:l})}),(0,J.jsx)(ge,{schedule:l,timezone:r,...C,error:w})]}),e.task===void 0?null:(0,J.jsx)(J.Fragment,{children:(0,J.jsxs)(`div`,{className:`scheduled-task-runs`,children:[(0,J.jsxs)(`h3`,{children:[(0,J.jsx)(D,{"aria-hidden":`true`}),n(`scheduledTasks.lastRun`),(0,J.jsx)(`span`,{children:e.task.runs.length})]}),e.task.runs.length===0?(0,J.jsx)(`p`,{children:n(`scheduledTasks.noRuns`)}):e.task.runs.toReversed().map(r=>(0,J.jsxs)(`div`,{className:`scheduled-task-run`,"data-status":r.status,children:[(0,J.jsx)(`span`,{children:n(`scheduledTasks.${r.status}`)}),(0,J.jsx)(`time`,{children:q(r.startedAtUnixMs,t.resolvedLanguage)}),r.status===`unknown`||r.status===`cleanup_pending`?(0,J.jsx)(`span`,{className:`scheduled-task-run__error`,children:n(r.status===`unknown`?`scheduledTasks.unknownHint`:`scheduledTasks.cleanupHint`)}):null,r.taskId===null?(0,J.jsx)(`span`,{className:`scheduled-task-run__error`,children:r.error}):(0,J.jsx)(c,{"aria-label":r.taskId,disabled:e.openingRun,onClick:()=>{e.task!==void 0&&r.taskId!==null&&e.onOpenRun(e.task.projectId,r.taskId)},size:`icon-sm`,variant:`ghost`,children:(0,J.jsx)(E,{"aria-hidden":`true`})})]},r.id))]})})]})]})}function be({task:e,onDelete:t,onEnabledChange:n}){let{t:r}=S(`workbench`),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(!1),l=async()=>{s(!0);try{await t(e.id),a(!1)}catch{}finally{s(!1)}};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(d,{modal:!1,children:[(0,J.jsx)(g,{asChild:!0,children:(0,J.jsx)(c,{"aria-label":r(`scheduledTasks.taskActions`,{name:e.name}),className:`scheduled-task-row__menu`,size:`icon-toolbar`,variant:`ghost`,children:(0,J.jsx)(_,{"aria-hidden":`true`})})}),(0,J.jsxs)(m,{align:`end`,sideOffset:4,className:`scheduled-task-menu`,children:[(0,J.jsxs)(f,{disabled:!e.enabled&&e.runs.some(e=>e.status===`running`||e.status===`unknown`||e.status===`cleanup_pending`),"aria-label":r(e.enabled?`scheduledTasks.disableTask`:`scheduledTasks.enableTask`,{name:e.name}),onSelect:()=>{n(e.id,!e.enabled)},children:[e.enabled?(0,J.jsx)(ae,{"aria-hidden":`true`}):(0,J.jsx)(A,{"aria-hidden":`true`}),r(e.enabled?`scheduledTasks.disable`:`scheduledTasks.enable`)]}),(0,J.jsx)(p,{}),(0,J.jsxs)(f,{className:`text-danger`,disabled:e.lastRunStatus===`running`||e.runs.some(e=>e.status===`cleanup_pending`),onSelect:()=>{a(!0)},children:[(0,J.jsx)(w,{"aria-hidden":`true`}),r(`scheduledTasks.delete`)]})]})]}),i?(0,J.jsx)(O,{title:r(`sidebar.deleteTaskTitle`),description:r(`sidebar.deleteTaskDescription`,{task:e.name}),confirmLabel:r(`scheduledTasks.deleteConfirm`),isPending:o,onClose:()=>{a(!1)},onConfirm:()=>{l()}}):null]})}function xe(e){return e.lastRunStatus===`unknown`?`failed`:e.lastRunStatus===`cleanup_pending`?`running`:e.enabled?e.lastRunStatus===`failed`?`failed`:e.lastRunStatus===`running`?`running`:`scheduled`:`paused`}function Se({activeId:e,loading:t,onCreate:n,onDelete:r,onEnabledChange:i,onSelect:a,query:o,setQuery:l,tasks:u}){let{i18n:d,t:f}=S(`workbench`),[p,m]=(0,F.useState)(`all`),h=u.filter(e=>p===`all`||e.enabled===(p===`enabled`));return(0,J.jsxs)(`aside`,{className:`scheduled-task-list`,children:[(0,J.jsxs)(`div`,{className:`scheduled-task-list__header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:f(`scheduledTasks.title`)}),(0,J.jsx)(`span`,{children:u.length})]}),(0,J.jsx)(c,{"aria-label":f(`scheduledTasks.create`),onClick:n,size:`icon-toolbar`,type:`button`,children:(0,J.jsx)(x,{"aria-hidden":`true`})})]}),(0,J.jsx)(`div`,{className:`scheduled-task-filters`,role:`group`,"aria-label":f(`scheduledTasks.filter`),children:[`all`,`enabled`,`disabled`].map(e=>(0,J.jsx)(`button`,{"aria-pressed":p===e,onClick:()=>{m(e)},type:`button`,children:f(`scheduledTasks.${e}`)},e))}),(0,J.jsxs)(`div`,{className:`scheduled-task-search`,children:[(0,J.jsx)(T,{"aria-hidden":`true`}),(0,J.jsx)(s,{"aria-label":f(`scheduledTasks.search`),onChange:e=>{l(e.currentTarget.value)},placeholder:f(`scheduledTasks.search`),type:`search`,value:o})]}),(0,J.jsx)(`div`,{className:`scheduled-task-list__items`,children:t?(0,J.jsx)(`div`,{className:`scheduled-task-list__empty`,role:`status`,children:(0,J.jsx)(b,{"aria-hidden":`true`})}):h.length===0?(0,J.jsxs)(`div`,{className:`scheduled-task-list__empty`,children:[(0,J.jsx)(y,{"aria-hidden":`true`}),(0,J.jsx)(`span`,{children:f(u.length===0&&o===``?`scheduledTasks.empty`:`scheduledTasks.noMatches`)})]}):h.map(t=>{let n=xe(t);return(0,J.jsxs)(`div`,{className:`scheduled-task-row`,"data-active":e===t.id?`true`:void 0,"data-tone":n,children:[(0,J.jsx)(`span`,{className:`scheduled-task-row__rail`}),(0,J.jsxs)(`button`,{"aria-current":e===t.id?`page`:void 0,"aria-label":t.name,className:`scheduled-task-row__content`,onClick:()=>{a(t)},type:`button`,children:[(0,J.jsx)(`strong`,{children:t.name}),(0,J.jsxs)(`span`,{children:[f(`scheduledTasks.${H(t.schedule).preset}`),` ·`,` `,t.projectName]}),(0,J.jsxs)(`span`,{className:`scheduled-task-row__time`,children:[n===`failed`?(0,J.jsx)(v,{"aria-hidden":`true`}):(0,J.jsx)(b,{"aria-hidden":`true`}),t.lastRunStatus===`unknown`||t.lastRunStatus===`cleanup_pending`?f(`scheduledTasks.${t.lastRunStatus}`):t.enabled?q(t.nextRunAtUnixMs,d.resolvedLanguage):f(`scheduledTasks.disabled`)]})]}),(0,J.jsx)(be,{task:t,onDelete:r,onEnabledChange:i})]},t.id)})})]})}var Ce=[`scheduled-tasks`],we=[],$=()=>void 0;function Te({context:e,projectId:t,temporary:n}){let r=o(),s=(0,F.useCallback)(t=>e.client.previewScheduledTask(t),[e.client]),[c,l]=(0,F.useState)(),[d,f]=(0,F.useState)(!1),[p,m]=(0,F.useState)(``),h=a(te(e.client,r)),g=h.data?.data??we,_=d?void 0:g.find(e=>e.id===c),v=(0,F.useMemo)(()=>{let e=p.trim().toLocaleLowerCase();return e===``?g:g.filter(t=>`${t.name}\n${t.projectName}`.toLocaleLowerCase().includes(e))},[p,g]),b=e=>r.setQueryData(Ce,e),x=i({meta:{actionNotification:!1},mutationFn:({taskId:t,...n})=>t===void 0?e.client.createScheduledTask(n):e.client.updateScheduledTask(t,n),onSuccess:e=>{l(e.task.id),f(!1),b(e.tasks)}}),S=i({mutationFn:t=>e.client.deleteScheduledTask(t),onSuccess:(e,t)=>{l(e=>e===t?void 0:e),b(e.tasks)}}),C=i({mutationFn:({enabled:t,taskId:n})=>e.client.setScheduledTaskEnabled(n,t),onSuccess:e=>{b(e.tasks)}}),w=i({mutationFn:t=>e.client.runScheduledTaskNow(t),onSuccess:e=>b(e.tasks)}),T=i({meta:{actionNotification:!1},mutationFn:({runProjectId:t,taskId:n})=>e.client.readNavigableTask(t,n),onError:k,onSuccess:(t,{runProjectId:n,taskId:i})=>{if(t.task===null){k(e.t(`scheduledTasks.runUnavailable`));return}r.setQueryData([`projects`,n,`tasks`,i],t.task),!u({projectId:n,taskId:i})&&e.navigate(n===`temporary`?{params:{taskId:i},to:`/temporary/t/$taskId`}:{params:{projectId:n,taskId:i},to:`/p/$projectId/t/$taskId`})}}),E=t=>void e.navigate(t===`temporary`?{to:`/temporary/scheduled`}:{params:{projectId:t},to:`/p/$projectId/scheduled`}),D={capabilities:e.capabilities,client:e.client,fastModeAvailable:e.fastModeAvailable,fastModeDefault:e.fastModeDefault,followUpBehavior:e.globalSettings?.followUpBehavior??`queue`,models:e.models,modelsError:e.modelsQuery.error,modelsPending:e.modelsQuery.isPending,onFastModeChange:$,onOpenProjectPath:e.openProjectFolder,onProjectRootChange:e.setSelectedRootId,onRequestNotificationPermission:$,onSettingsChange:$,onTaskStarted:$,projectId:t,projectName:e.projectName,projectPath:e.projectPath,projectPathOpenDisabled:e.projectFolderOpenDisabled,projectRoots:e.projectRoots,projectToolsEnabled:!n,selectedProjectRootId:e.selectedRootId??``,settings:e.draftSettings,skills:e.skillsQuery.data?.data??[]};return(0,J.jsxs)(`div`,{className:`scheduled-tasks`,children:[(0,J.jsx)(Se,{..._===void 0?{}:{activeId:_.id},loading:h.isPending,onDelete:S.mutateAsync,onCreate:()=>{f(!0),l(void 0)},onEnabledChange:(e,t)=>{C.mutate({enabled:t,taskId:e})},onSelect:e=>{f(!1),l(e.id),e.projectId!==t&&E(e.projectId)},query:p,setQuery:m,tasks:v}),d||_!==void 0?(0,J.jsx)(ye,{composerProps:D,openingRun:T.isPending,onOpenRun:(e,t)=>{T.isPending||T.mutate({runProjectId:e,taskId:t})},onProjectChange:E,onPreview:s,onRunNow:e=>w.mutateAsync(e).then($),onSave:(e,t)=>x.mutateAsync({...t,...e===void 0?{}:{taskId:e}}).then($),projectId:t,projects:e.projects,skills:e.skillsQuery.data?.data??[],..._===void 0?{}:{task:_}},_?.id??`new:${t}`):(0,J.jsxs)(`div`,{className:`scheduled-task-welcome`,children:[(0,J.jsx)(y,{"aria-hidden":`true`}),(0,J.jsx)(`h2`,{children:e.t(`scheduledTasks.welcome`)}),(0,J.jsx)(`p`,{children:e.t(`scheduledTasks.welcomeHint`)}),(0,J.jsx)(`span`,{children:e.t(`scheduledTasks.selectTask`)})]})]})}export{Te as ScheduledTasksContainer,B as n,z as t};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.scheduled-task-filters{background:var(--ui-color-control);border-radius:10px;gap:4px;margin:0 20px;padding:4px;display:flex}.scheduled-task-filters button{min-height:32px;color:var(--ui-color-text-muted);font-size:var(--ui-font-size-label);white-space:nowrap;border-radius:7px;flex:1}.scheduled-task-filters button[aria-pressed=true]{color:var(--ui-color-text);background:var(--ui-color-content);font-weight:var(--ui-font-weight-semibold);box-shadow:0 1px 3px #0000000d}.scheduled-task-filters button:focus-visible,.scheduled-task-row__content:focus-visible{outline:2px solid var(--ui-color-accent);outline-offset:-2px}.scheduled-task-editor__actions{align-items:center;gap:8px;display:flex}.scheduled-task-status{color:var(--ui-color-text-muted);font-size:var(--ui-font-size-label);align-items:center;gap:7px;display:flex}.scheduled-task-status>span{background:var(--ui-color-text-subtle);border-radius:50%;width:6px;height:6px}.scheduled-task-status[data-enabled=true]>span{background:var(--ui-color-accent)}.scheduled-task-editor__body{max-width:860px;margin:0 auto;padding:26px 32px 0}.scheduled-task-title{display:block}.scheduled-task-title input{border:1px solid var(--ui-color-separator-strong);height:42px;box-shadow:none;font-size:18px;font-weight:var(--ui-font-weight-semibold);letter-spacing:normal;background:0 0;border-radius:10px;padding:0 12px}.scheduled-task-title input::placeholder{color:var(--ui-color-text-subtle);font-size:var(--ui-font-size-body-small);opacity:1;font-weight:400}.scheduled-task-title input:focus-visible{box-shadow:var(--ui-shadow-focus)}.scheduled-task-section{margin-top:28px}.scheduled-task-section h3,.scheduled-task-runs h3{color:var(--ui-color-text-muted);font-size:var(--ui-font-size-label);font-weight:var(--ui-font-weight-medium);align-items:center;gap:8px;margin-bottom:12px;display:flex}.scheduled-task-section h3>svg,.scheduled-task-runs h3>svg{width:15px;height:15px}.scheduled-task-section h3>span,.scheduled-task-runs h3>span{color:var(--ui-color-text-subtle);font-size:var(--ui-font-size-caption);margin-left:auto;font-weight:400}.scheduled-task-info{min-height:58px;color:var(--ui-color-text-muted);font-size:var(--ui-font-size-label);justify-content:space-between;align-items:center;gap:16px;display:flex}.scheduled-task-info>:last-child{color:var(--ui-color-text)}.scheduled-task-next-run{color:var(--ui-color-text-subtle);font-size:var(--ui-font-size-caption);flex-wrap:wrap;gap:8px;margin-top:10px;padding:0 4px;display:flex}.scheduled-task-next-run>span{color:var(--ui-color-text-muted);font-variant-numeric:tabular-nums}.scheduled-task-welcome{align-content:center;justify-items:center;padding:32px}.scheduled-task-welcome>svg{border:1px solid var(--ui-color-separator);width:48px;height:48px;color:var(--ui-color-accent);background:var(--ui-color-panel);border-radius:14px;margin-bottom:14px;padding:10px}.scheduled-task-welcome h2{color:var(--ui-color-text);font-size:22px;font-weight:var(--ui-font-weight-semibold)}.scheduled-task-welcome p{max-width:340px;margin:4px 0 20px;line-height:1.8}.scheduled-task-welcome>span{font-size:var(--ui-font-size-caption)}.scheduled-task-row__menu{opacity:0;align-self:center;margin-right:10px}.scheduled-task-row:hover .scheduled-task-row__menu,.scheduled-task-row:focus-within .scheduled-task-row__menu,.scheduled-task-row__menu[data-state=open]{opacity:1}.scheduled-task-menu{border:1px solid var(--ui-color-separator);width:max-content;min-width:112px}.scheduled-task-menu svg{width:15px;height:15px}.scheduled-task-fields input::-webkit-date-and-time-value{text-align:right}.scheduled-task-calendar input::-webkit-date-and-time-value{text-align:right}.scheduled-task-fields input::-webkit-datetime-edit{text-align:right;flex:1;display:block}.scheduled-task-calendar input::-webkit-datetime-edit{text-align:right;flex:1;display:block}.scheduled-task-fields input::-webkit-datetime-edit-fields-wrapper{text-align:right;padding:0}.scheduled-task-calendar input::-webkit-datetime-edit-fields-wrapper{text-align:right;padding:0}.scheduled-task-fields input[type=time]{justify-self:end;width:104px}.scheduled-task-date-time-field{justify-self:end;width:min(100%,240px);min-width:0;height:34px}.scheduled-task-date-picker,.scheduled-task-date-picker .react-datepicker__input-container{width:100%;height:34px;display:block}.scheduled-task-date-picker .react-datepicker__input-container .react-datepicker__calendar-icon{box-sizing:border-box;width:16px;height:16px;color:var(--ui-color-text-subtle);cursor:pointer;padding:0;top:50%;left:auto;right:10px;transform:translateY(-50%)}.scheduled-task-date-picker .react-datepicker__view-calendar-icon input{text-align:right;text-align-last:right;cursor:pointer;padding-left:10px;padding-right:38px}.scheduled-task-calendar-popper{z-index:30;padding-top:5px}.react-datepicker.scheduled-task-calendar{border:1px solid var(--ui-color-separator-strong);border-radius:var(--ui-radius-surface);width:292px;color:var(--ui-color-text);background:var(--ui-color-raised);box-shadow:var(--ui-shadow-floating);font-family:inherit;font-size:var(--ui-font-size-label);overflow:hidden}.scheduled-task-calendar .react-datepicker__header{border-color:var(--ui-color-separator);background:var(--ui-color-panel);border-radius:0;padding:12px 12px 8px}.scheduled-task-calendar .react-datepicker__current-month,.scheduled-task-calendar .react-datepicker__day-name,.scheduled-task-calendar .react-datepicker__day,.scheduled-task-calendar .react-datepicker__month-text{color:var(--ui-color-text)}.scheduled-task-calendar .react-datepicker__current-month{height:24px;font-size:var(--ui-font-size-body-small);font-weight:var(--ui-font-weight-semibold);line-height:24px}.scheduled-task-calendar .react-datepicker__header__dropdown{justify-content:center;gap:6px;margin-top:8px;display:flex}.scheduled-task-calendar .react-datepicker__month-dropdown-container--select,.scheduled-task-calendar .react-datepicker__year-dropdown-container--select{margin:0}.scheduled-task-calendar .react-datepicker__month-select,.scheduled-task-calendar .react-datepicker__year-select{border:1px solid var(--ui-color-separator-strong);border-radius:var(--ui-radius-control);height:28px;color:var(--ui-color-text);background:var(--ui-color-raised);font:inherit;outline:none;padding:0 7px}.scheduled-task-calendar .react-datepicker__month-select:focus,.scheduled-task-calendar .react-datepicker__year-select:focus{background-color:var(--ui-color-control-hover)}.scheduled-task-calendar .react-datepicker__month-container{float:none;width:100%}.scheduled-task-calendar .react-datepicker__month{margin:8px 12px 10px}.scheduled-task-calendar .react-datepicker__day-names{margin-top:8px}.scheduled-task-calendar .react-datepicker__day-name,.scheduled-task-calendar .react-datepicker__day{border-radius:var(--ui-radius-control);width:34px;height:32px;margin:1px;line-height:32px}.scheduled-task-calendar .react-datepicker__day-name{color:var(--ui-color-text-subtle);font-size:var(--ui-font-size-caption);font-weight:var(--ui-font-weight-medium)}.scheduled-task-calendar .react-datepicker__day:hover,.scheduled-task-calendar .react-datepicker__month-text:hover{background:var(--ui-color-control-hover)!important}.scheduled-task-calendar .react-datepicker__day--selected,.scheduled-task-calendar .react-datepicker__day--selected:hover,.scheduled-task-calendar .react-datepicker__day--keyboard-selected,.scheduled-task-calendar .react-datepicker__day--keyboard-selected:hover,.scheduled-task-calendar .react-datepicker__month-text--selected{color:#fff!important;background:var(--ui-color-accent)!important}.scheduled-task-calendar .react-datepicker__day--today{color:var(--ui-color-accent-strong);font-weight:var(--ui-font-weight-semibold)}.scheduled-task-calendar .react-datepicker__day--outside-month{color:var(--ui-color-text-subtle);opacity:.55}.scheduled-task-calendar .react-datepicker__day--disabled{color:var(--ui-color-text-subtle);opacity:.45}.scheduled-task-calendar .react-datepicker__day--disabled:hover{background:0 0!important}.scheduled-task-calendar .react-datepicker__navigation{border-radius:var(--ui-radius-control);width:32px;height:32px;top:8px}.scheduled-task-calendar .react-datepicker__navigation:hover{background:var(--ui-color-control-hover)}.scheduled-task-calendar .react-datepicker__navigation--previous{left:9px}.scheduled-task-calendar .react-datepicker__navigation--next{right:9px}.scheduled-task-calendar .react-datepicker__navigation-icon:before{border-color:var(--ui-color-text-muted)}.scheduled-task-calendar .react-datepicker__input-time-container{clear:both;border-top:1px solid var(--ui-color-separator);background:color-mix(in srgb, var(--ui-color-panel) 72%, var(--ui-color-raised));justify-content:space-between;align-items:center;margin:0;padding:11px 14px;display:flex}.scheduled-task-calendar .react-datepicker-time__caption,.scheduled-task-calendar .react-datepicker-time__input-container{float:none;margin:0}.scheduled-task-calendar .react-datepicker-time__caption{color:var(--ui-color-text-muted);font-weight:var(--ui-font-weight-medium)}.scheduled-task-calendar .react-datepicker-time__input-container,.scheduled-task-calendar .react-datepicker-time__input{display:block}.scheduled-task-calendar .react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input input{border:1px solid var(--ui-color-separator-strong);border-radius:var(--ui-radius-control);width:112px;height:30px;color:var(--ui-color-text);background:var(--ui-color-raised);font:inherit;text-align:right;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;outline:none;margin:0;padding:0 8px}@media (prefers-color-scheme:dark){.scheduled-task-calendar .react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input input{--lightningcss-light: ;--lightningcss-dark:initial}}.scheduled-task-calendar .react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input input:focus{border-color:var(--ui-color-accent);box-shadow:var(--ui-shadow-focus)}.scheduled-task-field--choices{padding-block:12px}.scheduled-task-choices{flex-wrap:wrap;justify-content:flex-end;gap:5px;display:flex}.scheduled-task-month-days{grid-template-columns:repeat(7,32px);justify-content:end;gap:4px;display:grid}.scheduled-task-choices button,.scheduled-task-month-days button{border:1px solid var(--ui-color-separator);border-radius:var(--ui-radius-control);min-width:32px;min-height:32px;font-size:var(--ui-font-size-label);color:var(--ui-color-text-muted);cursor:pointer;padding:3px 7px}.scheduled-task-choices button[aria-pressed=true],.scheduled-task-month-days button[aria-pressed=true]{background:var(--ui-color-accent);color:var(--ui-color-accent-foreground,white);border-color:var(--ui-color-accent)}.scheduled-task-choices button:focus-visible,.scheduled-task-month-days button:focus-visible{outline:2px solid var(--ui-color-accent);outline-offset:2px}.scheduled-task-month-days__last{grid-column:span 4}.scheduled-task-inline-controls{justify-content:flex-end;gap:6px;min-width:0;display:flex}.scheduled-task-inline-controls input,.scheduled-task-fields input[type=number]{justify-self:end;width:80px}.scheduled-task-hint{color:var(--ui-color-text-muted);font-size:var(--ui-font-size-caption);padding-block:10px;line-height:1.7}.scheduled-task-preview{border-left:2px solid var(--ui-color-accent);background:var(--ui-color-panel);border-radius:0 var(--ui-radius-control) var(--ui-radius-control) 0;font-size:var(--ui-font-size-label);margin-top:14px;padding:14px 16px}.scheduled-task-preview__summary{color:var(--ui-color-text);overflow-wrap:anywhere;line-height:1.7}.scheduled-task-preview__meta{color:var(--ui-color-text-muted);font-size:var(--ui-font-size-caption);line-height:1.7}.scheduled-task-preview ol{font-variant-numeric:tabular-nums;gap:5px;margin-top:8px;padding:0;list-style:none;display:grid}.scheduled-task-preview h4{color:var(--ui-color-text-muted);margin-top:12px}.scheduled-task-preview__results{scrollbar-gutter:stable;height:7rem;overflow:auto}.scheduled-task-preview__results[data-expanded=true]{height:10rem}.scheduled-task-preview button{color:var(--ui-color-accent);cursor:pointer;margin-top:8px}.scheduled-task-preview button:focus-visible{outline:2px solid var(--ui-color-accent);outline-offset:2px}.scheduled-task-error{color:var(--ui-color-danger,#dc2626);font-size:var(--ui-font-size-label);margin-top:10px}.scheduled-task-range-toggle{text-align:right;min-height:38px;color:var(--ui-color-text-muted);font-size:var(--ui-font-size-caption);cursor:pointer}.scheduled-task-range-toggle:focus-visible{outline:2px solid var(--ui-color-accent);outline-offset:-2px}@media (width<=600px){.scheduled-task-fields .scheduled-task-field--choices{grid-template-columns:minmax(0,1fr)}.scheduled-task-choices{justify-content:flex-start}.scheduled-task-month-days{grid-template-columns:repeat(7,minmax(24px,32px));justify-content:start}}.scheduled-tasks{background:var(--ui-color-content);flex:1;grid-template-columns:clamp(280px,29%,380px) minmax(0,1fr);min-width:0;min-height:0;display:grid;overflow:hidden}.scheduled-task-list{border-right:1px solid var(--ui-color-separator);background:color-mix(in srgb, var(--ui-color-text) 1.5%, var(--ui-color-content));grid-template-rows:auto auto auto minmax(0,1fr);min-height:0;display:grid}.scheduled-task-list__header{justify-content:space-between;align-items:center;gap:10px;height:76px;padding:0 20px;display:flex}.scheduled-task-list__header>div{align-items:baseline;gap:7px;min-width:0;display:flex}.scheduled-task-list__header h2,.scheduled-task-prompt h3,.scheduled-task-runs h3{color:var(--ui-color-text);font-size:var(--ui-font-size-body-small);font-weight:var(--ui-font-weight-semibold)}.scheduled-task-list__header span{color:var(--ui-color-text-subtle);font-size:var(--ui-font-size-caption)}.scheduled-task-search{margin:16px 20px;position:relative}.scheduled-task-search svg{z-index:1;width:14px;color:var(--ui-color-text-subtle);position:absolute;top:11px;left:9px}.scheduled-task-search input{background:var(--ui-color-control);border-radius:10px;height:38px;padding-left:30px}.scheduled-task-list__items{scrollbar-gutter:stable;min-height:0;padding:0 12px 16px;overflow-y:auto}.scheduled-task-list__empty,.scheduled-task-welcome{min-height:180px;color:var(--ui-color-text-subtle);font-size:var(--ui-font-size-body-small);text-align:center;place-content:center;gap:8px;display:grid}.scheduled-task-list__empty svg{width:20px;margin:auto}.scheduled-task-row{width:100%;min-height:96px;color:var(--ui-color-text);text-align:left;border:1px solid #0000;border-radius:12px;grid-template-columns:24px minmax(0,1fr) auto;margin-bottom:6px;display:grid;position:relative;overflow:hidden}.scheduled-task-row:hover{background:var(--ui-color-control-hover)}.scheduled-task-row[data-active=true]{border-color:color-mix(in srgb, var(--ui-color-accent) 22%, var(--ui-color-separator));background:color-mix(in srgb, var(--ui-color-accent) 7%, var(--ui-color-content))}.scheduled-task-row__rail{background:var(--ui-color-task-running);border-radius:50%;width:7px;height:7px;margin-top:22px;margin-left:15px}.scheduled-task-row[data-tone=failed] .scheduled-task-row__rail{background:var(--ui-color-task-failed)}.scheduled-task-row[data-tone=paused] .scheduled-task-row__rail{background:var(--ui-color-text-subtle)}.scheduled-task-row[data-tone=running] .scheduled-task-row__rail{background:var(--ui-color-warning)}.scheduled-task-row__content{min-width:0;color:inherit;text-align:left;align-content:center;gap:3px;padding:13px 10px;display:grid}.scheduled-task-row__content strong,.scheduled-task-row__content>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.scheduled-task-row__content strong{font-size:var(--ui-font-size-body-small);font-weight:var(--ui-font-weight-semibold)}.scheduled-task-row__content>span{color:var(--ui-color-text-subtle);font-size:var(--ui-font-size-label)}.scheduled-task-row__time{align-items:center;gap:5px;display:flex}.scheduled-task-row__time svg{width:12px}.scheduled-task-editor{scrollbar-gutter:stable;min-height:0;padding:0 0 28px;overflow-y:auto}.scheduled-task-editor__toolbar{z-index:5;border-bottom:1px solid var(--ui-color-separator);background:var(--ui-color-content);justify-content:space-between;align-items:center;height:64px;padding:0 28px;display:flex;position:sticky;top:0}.scheduled-task-fields{border:1px solid var(--ui-color-separator);background:color-mix(in srgb, var(--ui-color-panel) 45%, var(--ui-color-content));border-radius:14px;padding:0 18px;display:grid}.scheduled-task-fields>label,.scheduled-task-field{grid-template-columns:minmax(90px,1fr) minmax(160px,auto);align-items:center;gap:16px;min-width:0;min-height:58px;display:grid}.scheduled-task-fields>:not(:first-child){border-top:1px solid var(--ui-color-separator)}.scheduled-task-fields>label>span,.scheduled-task-field>span{color:var(--ui-color-text-muted);font-size:var(--ui-font-size-label);font-weight:var(--ui-font-weight-medium)}.scheduled-task-fields input,.scheduled-task-fields select{text-align:right;text-align-last:right;border-radius:var(--ui-radius-control);width:100%;height:34px;color:var(--ui-color-text);font-size:var(--ui-font-size-body-small);background:0 0;border:1px solid #0000;outline:none;padding:0 10px}.scheduled-task-fields input:focus{box-shadow:var(--ui-shadow-focus)}.scheduled-task-fields select{text-overflow:ellipsis;justify-self:end;width:auto;min-width:0;max-width:180px}.scheduled-task-fields select:not(:disabled),.scheduled-task-fields input[type=time]:not(:disabled){cursor:pointer}.scheduled-task-fields__wide{grid-column:1/-1}.scheduled-task-prompt{padding-top:20px}.scheduled-task-prompt>h3,.scheduled-task-runs>h3{padding:0 0 12px}.scheduled-task-prompt>section{padding-left:0;padding-right:0}.scheduled-task-runs{padding-top:30px}.scheduled-task-runs>p{border:1px dashed var(--ui-color-separator-strong);color:var(--ui-color-text-subtle);font-size:var(--ui-font-size-body-small);text-align:center;border-radius:12px;padding:24px}.scheduled-task-run{border-top:1px solid var(--ui-color-separator);min-height:52px;color:var(--ui-color-text-muted);font-size:var(--ui-font-size-label);grid-template-columns:80px minmax(120px,1fr) auto;align-items:center;gap:12px;margin:0;display:grid}.scheduled-task-run[data-status=failed]>:first-child,.scheduled-task-run__error{color:var(--ui-color-danger)}.scheduled-task-run[data-status=started]>:first-child{color:var(--ui-color-task-completed)}.scheduled-task-run[data-status=running]>:first-child{color:var(--ui-color-warning)}.scheduled-task-run__error{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.scheduled-task-editor,.scheduled-task-list{min-width:0}@media (width<=1000px){.scheduled-tasks{grid-template-rows:minmax(180px,30%) minmax(0,1fr);grid-template-columns:minmax(0,1fr)}.scheduled-task-list{border-right:0;border-bottom:1px solid var(--ui-color-separator);max-height:260px}.scheduled-task-list__header{height:56px}.scheduled-task-editor__body{padding:20px 16px 0}.scheduled-task-editor__toolbar{padding:0 16px}.scheduled-task-fields>label,.scheduled-task-field{grid-template-columns:minmax(70px,1fr) minmax(0,1.5fr);gap:8px}.scheduled-task-info{flex-wrap:wrap;gap:8px;padding:12px 0}.scheduled-task-run{grid-template-columns:64px minmax(0,1fr) auto;gap:8px}.scheduled-task-row__menu{opacity:1}}@media (hover:none){.scheduled-task-row__menu{opacity:1}}
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r,t as i}from"./engine-compile-C-bb4peU.js";import{n as a,r as o,t as s}from"./patch-diff-viewer-
|
|
1
|
+
import{a as e,n as t,o as n,r,t as i}from"./engine-compile-C-bb4peU.js";import{n as a,r as o,t as s}from"./patch-diff-viewer-fv2hVYyb.js";export{s as bundledLanguages,t as codeToHtml,r as createCssVariablesTheme,a as createHighlighter,i as createJavaScriptRegexEngine,o as createOnigurumaEngine,e as getTokenStyleObject,n as stringifyTokenStyle};
|
|
Binary file
|
package/dist/web/assets/{skills-market-container-_ME3wZFP.js → skills-market-container-BdTREXZb.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/installed-skills-pane-
|
|
2
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./initial-deps-CqwWvUnY.js";import{i as n,t as r}from"./react-runtime-CMZHB3u8.js";import{Y as i,at as a,d as o,tt as s}from"./initial-deps-B8FrcWWN.js";import"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/installed-skills-pane-yCfl2E4Z.js","assets/rolldown-runtime-B0Z9INg1.js","assets/react-runtime-CMZHB3u8.js","assets/initial-deps-CW5Jl6i2.js","assets/initial-deps-CG4ykI_P.js","assets/initial-deps-D0opk7c-.js","assets/initial-deps-C0_XYRrC.js","assets/initial-deps-DZ-sH4cr.js","assets/initial-deps-C-3sxJvc.js","assets/initial-deps-CqwWvUnY.js","assets/initial-deps-B8FrcWWN.js","assets/initial-deps-Cppvl2Gz.js","assets/scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-source~c6tt9j64-ClgveiMa.js","assets/initial-deps-DFOart6r.js","assets/dist-D2KGXHMS.js","assets/index-DobF11m_.js","assets/index-CHJSDTYw.css","assets/mcp-management-pane-D4fhknd1.js","assets/official-plugins-pane-CRnpq0MJ.js","assets/prompt-input-rTS8jFNM.js","assets/external-link-DQSTtNhw.js","assets/official-plugins-pane-BCxHJLaj.css","assets/third-party-marketplace-pane-BPN-3gk1.js","assets/download-05FmZQzE.js","assets/workbench-shell-B139izuR.js","assets/arrow-down-DoJlTckg.js","assets/pdf-preview-CEvfJiZa.js","assets/clipboard-BxrWcnRh.js","assets/message-assistant-directive-r0UOX93m.js","assets/image-preview-Bez628xh.js","assets/git-fork-CElzN7bT.js","assets/history-location-C2XDYAuy.js","assets/maximize-2-CawekEKe.js","assets/scan-DyLrpouW.js","assets/workbench-pet-canvas-B5jypDil.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./initial-deps-CqwWvUnY.js";import{i as n,t as r}from"./react-runtime-CMZHB3u8.js";import{Y as i,at as a,d as o,tt as s}from"./initial-deps-B8FrcWWN.js";import"./index-DobF11m_.js";var c=s(`badge-check`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),l=s(`store`,[[`path`,{d:`M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5`,key:`slp6dd`}],[`path`,{d:`M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244`,key:`o0xfot`}],[`path`,{d:`M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05`,key:`wn3emo`}]]),u=e(n(),1),d=r(),f=[{icon:i,value:`skills`},{icon:o,value:`mcp`},{icon:c,value:`plugins`},{icon:l,value:`marketplace`}];function p(e){return f.some(t=>t.value===e)?e:`skills`}function m({active:e,onSelect:t}){let{t:n}=a(`workbench`);return(0,d.jsx)(`div`,{"aria-label":n(`skillsMarket.sectionsLabel`),className:`skills-market-tabs`,role:`tablist`,children:f.map(({icon:r,value:i})=>(0,d.jsxs)(`button`,{"aria-selected":e===i,onClick:()=>{t(i)},role:`tab`,type:`button`,children:[(0,d.jsx)(r,{"aria-hidden":`true`}),n(`skillsMarket.tabs.${i}`)]},i))})}var h=(0,u.lazy)(()=>t(()=>import(`./installed-skills-pane-yCfl2E4Z.js`).then(e=>({default:e.InstalledSkillsPane})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),g=(0,u.lazy)(()=>t(()=>import(`./mcp-management-pane-D4fhknd1.js`).then(e=>({default:e.McpManagementPane})),__vite__mapDeps([17,2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),_=(0,u.lazy)(()=>t(()=>import(`./official-plugins-pane-CRnpq0MJ.js`).then(e=>({default:e.OfficialPluginsPane})),__vite__mapDeps([18,1,2,3,4,5,6,7,8,9,10,11,12,13,19,15,16,20,21]))),v=(0,u.lazy)(()=>t(()=>import(`./third-party-marketplace-pane-BPN-3gk1.js`).then(e=>({default:e.ThirdPartyMarketplacePane})),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,12,13,23,20,15,16,24,25,19,26,27,28,29,30,31,32,33,34])));function y({onSectionChange:e,projectId:t,rootPath:n,section:r}){let{t:i}=a(`workbench`),[o,s]=(0,u.useState)(()=>p(r));return(0,u.useEffect)(()=>{s(p(r))},[r]),(0,d.jsxs)(`section`,{"aria-label":i(`skillsMarket.title`),className:`skills-market extension-center`,children:[(0,d.jsxs)(`header`,{className:`extension-center__header`,children:[(0,d.jsx)(`div`,{className:`extension-center__identity`,children:(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`span`,{className:`skills-market-eyebrow`,children:`CODEX EXTENSIONS`}),(0,d.jsx)(`h2`,{children:i(`skillsMarket.title`)})]})}),(0,d.jsx)(m,{active:o,onSelect:t=>{s(t),e?.(t)}})]}),(0,d.jsxs)(u.Suspense,{fallback:(0,d.jsx)(`div`,{className:`skills-market-state`,role:`status`,children:i(`skillsMarket.loadingExtension`)}),children:[o===`skills`?(0,d.jsx)(h,{}):null,o===`mcp`?(0,d.jsx)(g,{}):null,o===`plugins`?(0,d.jsx)(_,{}):null,o===`marketplace`?(0,d.jsx)(v,{...t===void 0?{}:{projectId:t},...n===void 0?{}:{rootPath:n}}):null]})]})}export{y as SkillsMarketContainer};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CMZHB3u8.js";import{dt as t,ft as n,ut as r}from"./initial-deps-
|
|
1
|
+
import{t as e}from"./react-runtime-CMZHB3u8.js";import{dt as t,ft as n,ut as r}from"./initial-deps-C-3sxJvc.js";import{Q as i,X as a,Z as o}from"./initial-deps-B8FrcWWN.js";import{t as s}from"./arrow-down-DoJlTckg.js";var c=e(),l=[{direction:`up`,icon:a,key:`↑`},{direction:`down`,icon:s,key:`↓`},{direction:`left`,icon:i,key:`←`},{direction:`right`,icon:o,key:`→`}];function u({labels:e,limit:i,onSplit:a}){let o=typeof navigator<`u`&&/mac/i.test(navigator.platform);return(0,c.jsxs)(r,{onCloseAutoFocus:e=>{e.preventDefault()},children:[i?(0,c.jsx)(n,{children:e.limit}):null,l.map(({direction:n,icon:r,key:s})=>(0,c.jsxs)(t,{disabled:i,onSelect:()=>{a(n)},children:[(0,c.jsx)(r,{"aria-hidden":`true`,className:`size-3.5`}),e[n],(0,c.jsxs)(`span`,{"aria-hidden":`true`,className:`ml-auto pl-4 text-caption text-muted-foreground`,children:[o?`⌘ ⌥`:`Ctrl Alt`,` `,s]})]},n))]})}export{u as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{i as r,n as i,s as a,u as o}from"./initial-deps-CW5Jl6i2.js";import{B as s,C as c,D as l,E as u,F as d,I as f,L as p,O as m,R as h,T as g,Tt as _,w as v,z as y}from"./initial-deps-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{i as r,n as i,s as a,u as o}from"./initial-deps-CW5Jl6i2.js";import{B as s,C as c,D as l,E as u,F as d,I as f,L as p,O as m,R as h,T as g,Tt as _,w as v,z as y}from"./initial-deps-C-3sxJvc.js";import{E as b,Y as x,at as S,p as C,tt as w}from"./initial-deps-B8FrcWWN.js";import{t as T}from"./download-05FmZQzE.js";import{t as E}from"./external-link-DQSTtNhw.js";import{ot as D}from"./index-DobF11m_.js";import{l as O}from"./workbench-shell-B139izuR.js";var k=w(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),A=w(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),j=e(t(),1),M=n();function N(e){try{let t=new URL(e);t.protocol===`https:`&&window.open(t.href,`_blank`,`noopener,noreferrer`)}catch{}}function P({client:e,currentProjectId:t,currentRootPath:n,installedSkills:r,installingScope:i,onClose:o,onInstall:s,projects:x,skill:C}){let{t:w}=S(`workbench`),D=x.some(e=>e.id===t)?t:x[0]?.id,[A,P]=(0,j.useState)(D),F=x.find(e=>e.id===A),I=F!==void 0&&F.id===t&&n!==void 0&&F.roots.some(e=>e.path===n)?n:F?.roots[0]?.path,L=a({queryFn:()=>e.getClawhubSkill(C.owner,C.slug),queryKey:[`extensions`,`marketplace`,`detail`,C.owner,C.slug],staleTime:3e5}),R=L.data,z=e=>r.find(t=>t.marketplace?.owner===C.owner&&t.marketplace.slug===C.slug&&(e===`user`?t.scope===`user`:t.scope===`repo`&&t.projectId===A))?.marketplace?.installedVersion,B=e=>{let t=z(e);return t===C.latestVersion?w(`skillsMarket.current`):w(t===void 0?e===`user`?`skillsMarket.installGlobal`:`skillsMarket.installProject`:`skillsMarket.update`)},V=i!==null,H=R?.scanStatus!==`clean`;return(0,M.jsx)(c,{open:!0,onOpenChange:e=>{e||o()},children:(0,M.jsxs)(v,{className:`skills-market-detail third-party-skill-sheet`,closeLabel:w(`skillsMarket.closeSkillDetails`),children:[(0,M.jsxs)(l,{className:`skills-market-detail__header`,children:[(0,M.jsx)(`div`,{className:`skills-market-detail__mark`,"aria-hidden":`true`,children:(0,M.jsx)(O,{})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(m,{className:`truncate text-title`,children:C.displayName}),(0,M.jsxs)(g,{children:[`@`,C.owner,` / `,C.slug]})]}),R===void 0?null:(0,M.jsxs)(`span`,{className:`skills-market-scan`,children:[(0,M.jsx)(k,{"aria-hidden":`true`}),w(`skillsMarket.codexCompatible`)]})]}),(0,M.jsxs)(`div`,{className:`skills-market-detail__facts`,children:[(0,M.jsx)(`span`,{children:w(`skillsMarket.version`,{version:C.latestVersion})}),(0,M.jsx)(`span`,{children:w(`skillsMarket.downloads`,{count:C.downloads})}),(0,M.jsx)(`span`,{children:w(`skillsMarket.stars`,{count:C.stars})}),R===void 0?null:(0,M.jsx)(`span`,{children:w(`skillsMarket.scan`,{status:R.scanStatus})})]}),(0,M.jsx)(`div`,{className:`skills-market-detail__body third-party-skill-sheet__body`,children:L.isPending?(0,M.jsx)(`div`,{className:`skills-market-state`,role:`status`,children:w(`skillsMarket.loadingDetail`)}):L.error===null?(0,M.jsx)(`pre`,{className:`skills-market-readme`,children:R?.readme}):(0,M.jsx)(`div`,{className:`skills-market-state`,role:`alert`,children:w(`skillsMarket.loadError`)})}),(0,M.jsxs)(u,{className:`skills-market-detail__footer third-party-skill-sheet__footer`,children:[(0,M.jsxs)(_,{className:`third-party-skill-sheet__market-link`,onClick:()=>{N(C.canonicalUrl)},type:`button`,variant:`ghost`,children:[(0,M.jsx)(E,{"aria-hidden":`true`}),w(`skillsMarket.openMarketplace`)]}),(0,M.jsxs)(`div`,{className:`third-party-skill-sheet__actions`,children:[F===void 0||I===void 0?null:(0,M.jsxs)(`div`,{className:`skills-market-project-target`,children:[(0,M.jsxs)(d,{onValueChange:P,value:F.id,children:[(0,M.jsx)(h,{"aria-label":w(`skillsMarket.projectTarget`),size:`sm`,title:F.name,children:(0,M.jsx)(y,{})}),(0,M.jsx)(f,{align:`end`,position:`popper`,children:x.map(e=>(0,M.jsx)(p,{value:e.id,children:e.name},e.id))})]}),(0,M.jsxs)(_,{disabled:H||V||z(`project`)===C.latestVersion,onClick:()=>{s(C,`project`,{projectId:F.id,rootPath:I})},type:`button`,variant:`outline`,children:[i===`project`?(0,M.jsx)(b,{"aria-hidden":`true`,className:`animate-spin`,"data-icon":`loading`}):(0,M.jsx)(T,{"aria-hidden":`true`}),B(`project`)]})]}),(0,M.jsxs)(_,{disabled:H||V||z(`user`)===C.latestVersion,onClick:()=>{s(C,`user`,{})},type:`button`,children:[i===`user`?(0,M.jsx)(b,{"aria-hidden":`true`,className:`animate-spin`,"data-icon":`loading`}):(0,M.jsx)(T,{"aria-hidden":`true`}),B(`user`)]})]})]})]})})}function F(e){let[t,n]=(0,j.useState)(e);return(0,j.useEffect)(()=>{let t=window.setTimeout(()=>{n(e)},250);return()=>{window.clearTimeout(t)}},[e]),t}function I({skill:e,onOpen:t}){return(0,M.jsxs)(`button`,{className:`skills-market-card`,onClick:()=>{t(e)},type:`button`,children:[(0,M.jsxs)(`span`,{className:`skills-market-card__topline`,children:[(0,M.jsx)(`span`,{className:`skills-market-glyph`,"data-tone":`marketplace`,"aria-hidden":`true`,children:(0,M.jsx)(x,{})}),(0,M.jsxs)(`span`,{className:`min-w-0 flex-1 text-left`,children:[(0,M.jsx)(`strong`,{className:`block truncate text-body-small`,children:e.displayName}),(0,M.jsxs)(`span`,{className:`block truncate text-label text-muted-foreground`,children:[`@`,e.owner]})]}),(0,M.jsxs)(`span`,{className:`skills-version`,children:[`v`,e.latestVersion]})]}),(0,M.jsx)(`span`,{className:`skills-market-card__summary`,children:e.summary}),(0,M.jsxs)(`span`,{className:`skills-market-card__footer`,children:[(0,M.jsxs)(`span`,{children:[(0,M.jsx)(T,{"aria-hidden":`true`}),e.downloads.toLocaleString()]}),(0,M.jsxs)(`span`,{children:[(0,M.jsx)(A,{"aria-hidden":`true`}),e.stars.toLocaleString()]})]})]})}function L({projectId:e,rootPath:t}){let{t:n}=S(`workbench`),{client:c,projects:l}=D(),u=o(),[m,g]=(0,j.useState)(``),[v,b]=(0,j.useState)(`recommended`),[x,w]=(0,j.useState)(null),T=F(m.trim()),E=a({queryFn:()=>c.listInstalledSkills(),queryKey:[`extensions`,`skills`]}),O=i({getNextPageParam:e=>e.nextCursor??void 0,initialPageParam:null,queryFn:({pageParam:e})=>c.listClawhubSkills(T,e,v),queryKey:[`extensions`,`marketplace`,`clawhub`,T,v],staleTime:12e4}),k=r({meta:{actionNotification:{successMessage:n(`skillsMarket.installComplete`)}},mutationFn:({projectId:e,rootPath:t,scope:n,skill:r})=>c.installClawhubSkill(r.owner,r.slug,n,e,t),onSuccess:e=>{w(null),u.setQueryData([`extensions`,`skills`],e.installedSkills)}}),A=O.data?.pages.flatMap(e=>e.items)??[];return(0,M.jsxs)(`div`,{className:`skills-market-pane`,role:`tabpanel`,children:[(0,M.jsxs)(`div`,{className:`skills-market-toolbar`,children:[(0,M.jsxs)(`div`,{className:`skills-market-search`,children:[(0,M.jsx)(C,{"aria-hidden":`true`}),(0,M.jsx)(s,{"aria-label":n(`skillsMarket.search`),onChange:e=>{g(e.currentTarget.value)},placeholder:n(`skillsMarket.search`),value:m})]}),(0,M.jsxs)(d,{onValueChange:b,value:v,children:[(0,M.jsx)(h,{"aria-label":n(`skillsMarket.sort`),children:(0,M.jsx)(y,{})}),(0,M.jsxs)(f,{children:[(0,M.jsx)(p,{value:`recommended`,children:n(`skillsMarket.sortRecommended`)}),(0,M.jsx)(p,{value:`downloads`,children:n(`skillsMarket.sortDownloads`)}),(0,M.jsx)(p,{value:`updated`,children:n(`skillsMarket.sortUpdated`)})]})]})]}),O.isPending?(0,M.jsx)(`div`,{className:`skills-market-state`,role:`status`,children:n(`skillsMarket.loadingMarket`)}):O.error===null?A.length===0?(0,M.jsx)(`div`,{className:`skills-market-state`,children:n(`skillsMarket.emptyMarket`)}):(0,M.jsx)(`div`,{className:`skills-market-grid`,children:A.map(e=>(0,M.jsx)(I,{onOpen:w,skill:e},e.id))}):(0,M.jsx)(`div`,{className:`skills-market-state`,role:`alert`,children:n(`skillsMarket.marketError`)}),O.hasNextPage?(0,M.jsx)(_,{className:`mx-auto`,disabled:O.isFetchingNextPage,onClick:()=>void O.fetchNextPage(),type:`button`,variant:`outline`,children:n(O.isFetchingNextPage?`skillsMarket.loading`:`skillsMarket.loadMore`)}):null,x===null?null:(0,M.jsx)(P,{client:c,currentProjectId:e,currentRootPath:t,installedSkills:E.data?.data??[],installingScope:k.isPending?k.variables.scope:null,onClose:()=>{w(null)},onInstall:(e,t,n)=>{k.mutate({scope:t,skill:e,...n})},projects:l,skill:x})]})}export{L as ThirdPartyMarketplacePane};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{h as r,i,p as a,s as o,t as s,u as c}from"./initial-deps-CW5Jl6i2.js";import{Bt as l,Et as u,G as d,H as f,Ht as p,J as m,K as h,M as g,P as _,Tt as v,U as y,Ut as b,V as x,Vt as S,W as C,c as w,d as T,h as E,j as D,l as O,u as k,y as A,zt as j}from"./initial-deps-C-3sxJvc.js";import{E as M,F as N,H as P,K as F,W as I,X as ee,at as L,ct as R,g as z,k as B,q as V,tt as H}from"./initial-deps-B8FrcWWN.js";import{t as te}from"./arrow-down-DoJlTckg.js";import{C as U,T as W}from"./prompt-input-rTS8jFNM.js";import{j as G}from"./message-assistant-directive-r0UOX93m.js";import{n as K,r as ne,t as q}from"./file-navigation-view-preference-BYYgwRsz.js";import{t as J}from"./upload-BQhbr7lC.js";import{Y,ht as re,mt as ie}from"./index-DobF11m_.js";import{g as ae,l as oe,m as se,n as ce}from"./workbench-shell-B139izuR.js";var X=e(t(),1);function le(e,t){let n=c(t);return de({filters:{...e,status:`pending`}},n).length}function ue(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function de(e={},t){let n=c(t).getMutationCache(),i=X.useRef(e),o=X.useRef(null);return o.current===null&&(o.current=ue(n,e)),X.useEffect(()=>{i.current=e}),X.useSyncExternalStore(X.useCallback(e=>n.subscribe(()=>{let t=r(o.current,ue(n,i.current));o.current!==t&&(o.current=t,a.schedule(e))}),[n]),()=>o.current,()=>o.current)}var fe=H(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),pe=H(`file-minus-corner`,[[`path`,{d:`M20 14V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12`,key:`l9p8hp`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),me=H(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]);function Z(e){let t=e?.toLowerCase()??``;return/(?:git|workspace) (?:status|changes|snapshot|state).*changed|head or branch changed|snapshot.?mismatch/u.test(t)?`state_changed`:/commit or set aside working changes|local changes.*overwritten|would be overwritten by merge/u.test(t)?`working_changes`:/resolve and stage all merge conflicts|choose a current merge conflict|complete or cancel.*merge|conflict marker/u.test(t)?`merge_conflicts`:/invalid remote (?:url|name)|invalid remote url or name/u.test(t)?`invalid_remote`:/host key verification|remote host identification has changed/u.test(t)?`host_key`:/protected branch|gh006|changes must be made through a pull request/u.test(t)?`protected_branch`:/authentication failed|publickey|invalid.*(?:token|password)|could not read username/u.test(t)?`authentication`:/write access|permission.*denied|not permitted|403|access denied/u.test(t)?`permission`:/non-fast-forward|not possible to fast-forward|cannot fast-forward|fetch first|tip of your current branch is behind/u.test(t)?`remote_updates`:/gh013|repository rule violations|pre-receive hook declined|hook declined|push declined/u.test(t)?`rules`:/timed out|timeout|connection.*(?:reset|closed)|unexpected disconnect/u.test(t)?`unknown_result`:/could not resolve|couldn't connect|failed to connect|failed to fetch|networkerror|network request failed|econnrefused|network is unreachable|unable to access/u.test(t)?`network`:`unknown`}function Q(e,t,n){return{snapshot:e,message:n?.message??``,selectedPaths:new Set(t.map(e=>e.path)),knownPaths:new Set(t.map(e=>e.path)),previousMessage:n?.previousMessage??null}}function he(e,t,n,r=!0){let i=new Set(n.map(e=>e.path)),a=e.knownPaths.size===0?i:r?new Set([...e.selectedPaths].filter(e=>i.has(e))):e.selectedPaths;return{...e,snapshot:t,selectedPaths:a,knownPaths:new Set([...e.knownPaths,...i])}}function ge(e,t,n){return e.snapshot===t.snapshot&&e.selectedPaths.size===t.selectedPaths.size&&[...e.selectedPaths].every(e=>t.selectedPaths.has(e))?{...e,message:n,previousMessage:e.message}:e}function _e(e){return JSON.stringify({version:1,snapshot:e.snapshot,message:e.message,selectedPaths:[...e.selectedPaths],knownPaths:[...e.knownPaths],previousMessage:e.previousMessage})}function ve(e){if(e===null||e.length>2e6)return null;try{let t=JSON.parse(e),n=e=>Array.isArray(e)&&e.length<=1e5&&e.every(e=>typeof e==`string`);return t.version!==1||typeof t.snapshot!=`string`||typeof t.message!=`string`||t.message.length>1e4||!n(t.selectedPaths)||!n(t.knownPaths)||!(e=>e===null||typeof e==`string`&&e.length<=1e4)(t.previousMessage)?null:{snapshot:t.snapshot,message:t.message,selectedPaths:new Set(t.selectedPaths),knownPaths:new Set(t.knownPaths),previousMessage:t.previousMessage}}catch{return null}}function ye(e){let{remote:t}=e,n=e.pushStatus===`failed`||e.pushStatus===`not_configured`,r=[`commit`,`generate`,`status`].includes(e.failureOperation??``),i=e.failureOperation??`status`,a=e.actionError||e.pushError?Z(e.actionError??e.pushError):e.savedFailureKind??`unknown`,o=n||e.actionError?{kind:a,remote:!r,titleKey:r?`commit.${i}Failed`:`commit.failure_${a}`,helpKey:r&&a===`unknown`?`commit.${i}FailedHelp`:`commit.fix_${a}`}:null,s=(e,t,n)=>({action:e,labelKey:t,...n?{disabledReason:n}:{}}),c=(e,t,n,r)=>({primary:s(e,t,r),summaryKey:n,failure:o});if(t?.operation===`merge`||(t?.conflicts.length??0)>0)return{primary:s(`inspect`,`commit.refreshGitStatus`),summaryKey:`commit.mergePending`,hintKey:`commit.mergeExternalHelp`,failure:null};if(!e.branch)return c(null,`commit.push`,`commit.detachedHead`);if(t?.remotes.length===0)return c(`configure`,`commit.configureRemote`,`commit.noRemote`);if(t?.upstream===null||e.pushStatus===`not_configured`)return c(`publish`,`commit.publishBranch`,`commit.unpublished`);let l=(t?.ahead??0)>0?`commit.ahead`:(t?.behind??0)>0?`commit.behind`:t?.ahead===0&&t.behind===0?`commit.synced`:e.inspecting?`commit.awaitingCheck`:e.pushStatus===`pushed`?`commit.pushedToRemote`:e.commitSha?`commit.savedLocally`:`commit.remoteReady`;if((t?.ahead??0)>0&&(t?.behind??0)>0)return{...c(`inspect`,`commit.refreshGitStatus`,l),hintKey:`commit.divergedExternalHelp`};if(o?.remote&&e.hasActions){if(a===`state_changed`)return c(`inspect`,`commit.refreshGitStatus`,l);if(a===`invalid_remote`||a===`permission`)return c(`configure`,`commit.configureRemote`,l);if(a===`protected_branch`)return c(`branch`,`commit.createFeatureBranch`,l);if([`authentication`,`network`,`unknown_result`].includes(a))return c(`fetch`,`commit.checkConnection`,l);if(a===`remote_updates`&&!(t?.behind??0))return c(`fetch`,`commit.fetchRemote`,l)}return(t?.behind??0)>0?c(`integrate`,`commit.pullRemote`,l,e.hasWorkingChanges?`commit.pullNeedsCommit`:void 0):!t&&e.hasActions?c(`inspect`,`commit.inspectRemote`,e.inspecting?`commit.awaitingCheck`:`commit.remoteUnknown`):t?.ahead===0&&t.behind===0?c(e.hasActions?`fetch`:null,`commit.fetchRemote`,l):e.pushStatus===`pushed`&&!t?c(null,`commit.pushed`,l):c(`push`,o?.remote?`commit.pushAgain`:`commit.push`,l)}var be={push:`commit.pushing`,fetch:`commit.fetchingRemote`,inspect:`commit.inspectingRemote`,configure:`commit.configuringRemote`,publish:`commit.publishingBranch`,integrate:`commit.integratingRemote`,branch:`commit.creatingFeatureBranch`},$=n();function xe({initialName:e,initialUrl:t,busy:n,error:r,onSave:i,onClose:a,returnFocusElement:o,t:s}){let[c,l]=(0,X.useState)(e),[u,p]=(0,X.useState)(t),[m]=(0,X.useState)(()=>o??(typeof document>`u`?null:document.activeElement));return(0,$.jsx)(x,{open:!0,onOpenChange:e=>{!e&&!n&&a()},children:(0,$.jsxs)(f,{"aria-describedby":void 0,onCloseAutoFocus:e=>{e.preventDefault(),m instanceof HTMLElement&&m.isConnected&&m.focus()},children:[(0,$.jsx)(d,{children:(0,$.jsx)(h,{children:s(`commit.configureRemote`)})}),(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),!n&&i(c.trim(),u.trim()).then(e=>{e&&a()})},children:[(0,$.jsxs)(`label`,{className:`block text-label`,children:[s(`commit.remoteName`),(0,$.jsx)(`input`,{className:`mt-1 h-8 w-full rounded-control border border-separator-strong bg-panel px-2 outline-none focus-visible:shadow-focus`,required:!0,pattern:`[A-Za-z0-9_.-]+`,maxLength:128,value:c,disabled:n,autoComplete:`off`,onChange:e=>{l(e.currentTarget.value)}})]}),(0,$.jsxs)(`label`,{className:`block text-label`,children:[s(`commit.remoteUrl`),(0,$.jsx)(`input`,{className:`mt-1 h-8 w-full rounded-control border border-separator-strong bg-panel px-2 outline-none focus-visible:shadow-focus`,required:!0,value:u,disabled:n,autoComplete:`off`,autoCapitalize:`none`,spellCheck:!1,placeholder:`https://github.com/owner/repo.git`,onChange:e=>{p(e.currentTarget.value)}})]}),r?(0,$.jsx)(`p`,{className:`break-words text-caption text-danger`,role:`alert`,children:r}):null,(0,$.jsxs)(C,{children:[(0,$.jsx)(v,{variant:`ghost`,type:`button`,disabled:n,onClick:a,children:s(`commit.cancel`)}),(0,$.jsxs)(v,{type:`submit`,className:`text-[color:light-dark(#ffffff,#181818)]`,disabled:n||!c.trim()||!u.trim(),children:[n?(0,$.jsx)(M,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}):null,s(n?`commit.configuringRemote`:`commit.saveRemote`)]})]})]})]})})}function Se({kind:e,branch:t,remote:n,commitSha:r,defaultRemote:i,busy:a,error:o,failure:s,guidanceKey:c,returnFocus:l,onAction:u,onClose:p,t:m}){let g=(0,X.useId)(),[_,b]=(0,X.useState)(i),[S,w]=(0,X.useState)(`feature/recovery`),[T,E]=(0,X.useState)(!1),D={publish:`commit.publishBranch`,branch:`commit.createFeatureBranch`,info:`commit.remoteInfo`,error:`commit.operationDetails`,guidance:`commit.gitOperationHelp`},O=e===`publish`?`commit.publishHelp`:e===`branch`?`commit.featureBranchHelp`:e===`info`?`commit.remoteInfoHelp`:e===`guidance`?c:c??s?.helpKey,k=async e=>{if(!a){E(!1);try{await u(e)?p():E(!0)}catch{E(!0)}}},A=`${_}/${t??``}`;return(0,$.jsx)(x,{open:!0,onOpenChange:e=>{!e&&!a&&p()},children:(0,$.jsxs)(f,{onCloseAutoFocus:e=>{e.preventDefault(),l?.isConnected&&l.focus()},children:[(0,$.jsxs)(d,{children:[(0,$.jsx)(h,{children:m(e===`error`&&s?s.titleKey:D[e])}),O?(0,$.jsx)(y,{children:m(O)}):null]}),e===`error`&&r&&s?.remote?(0,$.jsx)(`p`,{className:`text-caption text-muted-foreground`,children:m(`commit.localCommitSafe`)}):null,e===`publish`||e===`branch`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:t=>{t.preventDefault(),k(e===`publish`?{action:`publish`,remote:_}:{action:`branch`,branchName:S.trim()})},children:[e===`publish`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`label`,{htmlFor:g,className:`block text-label`,children:m(`commit.remoteName`)}),(0,$.jsx)(`select`,{id:g,className:`h-9 w-full rounded-control border border-separator-strong bg-panel px-2 text-body-small outline-none focus-visible:shadow-focus`,value:_,disabled:a,onChange:e=>{b(e.currentTarget.value)},children:n?.remotes.map(e=>(0,$.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,$.jsxs)(`div`,{className:`rounded-control bg-control px-3 py-2 text-caption`,children:[(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:m(`commit.pushDestination`)}),(0,$.jsx)(`p`,{className:`break-all font-mono`,children:A}),(0,$.jsx)(`p`,{className:`mt-1 break-all text-muted-foreground`,children:n?.remotes.find(e=>e.name===_)?.url})]})]}):(0,$.jsxs)(`label`,{className:`block text-label`,children:[m(`commit.branchName`),(0,$.jsx)(`input`,{className:`mt-1 h-9 w-full rounded-control border border-separator-strong bg-panel px-2 outline-none focus-visible:shadow-focus`,required:!0,maxLength:1024,value:S,disabled:a,autoComplete:`off`,autoCapitalize:`none`,spellCheck:!1,onChange:e=>{w(e.currentTarget.value)}})]}),T?(0,$.jsx)(`p`,{role:`alert`,className:`text-caption text-warning`,children:m(e===`publish`?`commit.publishFailedHelp`:`commit.branchFailedHelp`)}):null,(0,$.jsxs)(C,{children:[(0,$.jsx)(v,{type:`button`,variant:`ghost`,disabled:a,onClick:p,children:m(`commit.cancel`)}),(0,$.jsxs)(v,{type:`submit`,className:`text-[color:light-dark(#ffffff,#181818)]`,disabled:a||(e===`branch`?!S.trim():!_),children:[a?(0,$.jsx)(M,{className:`size-3.5 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}):null,m(a?e===`publish`?`commit.publishingBranch`:`commit.creatingFeatureBranch`:D[e])]})]})]}):null,e===`info`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`dl`,{className:`space-y-3 text-caption`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-muted-foreground`,children:m(`commit.currentBranch`)}),(0,$.jsx)(`dd`,{className:`break-all font-mono`,children:t??m(`commit.detachedHead`)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-muted-foreground`,children:m(`commit.pushDestination`)}),(0,$.jsx)(`dd`,{className:`break-all font-mono`,children:n?.remote&&n.targetBranch?`${n.remote}/${n.targetBranch}`:m(`commit.unpublished`)})]}),n?.remotes.map(e=>(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-muted-foreground`,children:e.name}),(0,$.jsx)(`dd`,{className:`break-all font-mono`,children:e.url})]},e.name)),r?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-muted-foreground`,children:m(`commit.lastCommit`)}),(0,$.jsx)(`dd`,{className:`break-all font-mono`,children:r})]}):null]}),n?(0,$.jsx)(`p`,{className:`text-caption text-muted-foreground`,children:m(`commit.lastChecked`,{time:new Date(n.checkedAt).toLocaleTimeString()})}):null]}):null,e===`error`&&o?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`p`,{className:`text-caption text-muted-foreground`,children:m(`commit.technicalDetails`)}),(0,$.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-all rounded-control bg-control p-3 font-mono text-caption`,children:o})]}):null,e===`info`||e===`error`||e===`guidance`?(0,$.jsx)(C,{children:(0,$.jsx)(v,{type:`button`,variant:`outline`,onClick:p,children:m(`commit.close`)})}):null]})})}function Ce({busy:e,canPublish:t,dialogOpen:n,onInspect:r,onOpen:i,t:a}){let o=(0,X.useRef)(null);return(0,$.jsxs)(w,{children:[(0,$.jsx)(A,{asChild:!0,children:(0,$.jsx)(v,{ref:o,size:`icon-toolbar`,variant:`ghost`,type:`button`,"data-slot":`git-remote-more`,"aria-label":a(`commit.moreRemoteActions`),title:a(`commit.moreRemoteActions`),children:(0,$.jsx)(N,{className:`size-4`,"aria-hidden":`true`})})}),(0,$.jsxs)(O,{align:`end`,onCloseAutoFocus:e=>{n&&e.preventDefault()},children:[(0,$.jsxs)(T,{disabled:e,onSelect:r,children:[(0,$.jsx)(z,{className:`size-3.5`}),a(`commit.inspectRemote`)]}),(0,$.jsxs)(T,{disabled:e,onSelect:()=>{i(`configure`,o.current)},children:[(0,$.jsx)(me,{className:`size-3.5`}),a(`commit.configureRemote`)]}),t?(0,$.jsxs)(T,{disabled:e,onSelect:()=>{i(`publish`,o.current)},children:[(0,$.jsx)(J,{className:`size-3.5`}),a(`commit.publishBranch`)]}):null,(0,$.jsx)(E,{}),(0,$.jsxs)(T,{onSelect:()=>{i(`info`,o.current)},children:[(0,$.jsx)(U,{className:`size-3.5`}),a(`commit.remoteInfo`)]})]})]})}function we({branch:e,remote:t,pushStatus:n,pushError:r,commitSha:i,busy:a,activeAction:o,actionError:s,failureOperation:c,inspecting:l,onPush:u,onAction:d,onOpenHistory:f,savedFailureKind:p,hasWorkingChanges:m=!1,t:h}){let y=(0,X.useRef)(null),[b,x]=(0,X.useState)(null),S=ye({branch:e,remote:t,pushStatus:n,pushError:r,commitSha:i,actionError:s,failureOperation:c,inspecting:l,savedFailureKind:p,hasWorkingChanges:m,hasActions:!!d}),{primary:C}=S,w=t?.remote??t?.remotes[0]?.name??`origin`,T=s??r,E=(e,t=y.current)=>{x({kind:e,returnFocus:t})},O=()=>{x(null)},k=e=>d?.(e)??Promise.resolve(!1),A=l&&!t,j=a&&o===C.action,N=h(A?`commit.inspectingRemote`:j&&o?be[o]:C.labelKey),F=!!d&&!!t?.remotes.length&&C.action!==`fetch`,L=h(o===`fetch`&&a?`commit.fetchingRemote`:`commit.fetchRemote`),R=b&&![`info`,`error`,`guidance`].includes(b.kind)?null:S.failure,z=t?.ahead??0,B=t?.behind??0,H=!!R||!!C.disabledReason||!!S.hintKey,U=H||z>0&&B>0,W=[`push`,`publish`,`integrate`].includes(C.action??``),K={"commit.fetchRemote":`commit.fetchShort`,"commit.refreshGitStatus":`commit.refreshShort`,"commit.checkConnection":`commit.checkConnectionShort`,"commit.createFeatureBranch":`commit.branchShort`},ne=!j&&!A&&K[C.labelKey]?h(K[C.labelKey]??C.labelKey):N,q=S.summaryKey!==`commit.mergePending`&&(z>0||B>0),Y=t?.remote&&t.targetBranch?`${t.remote}/${t.targetBranch}`:null;return(0,$.jsxs)(`section`,{className:`h-[72px] shrink-0 overflow-hidden border-b border-separator px-3 py-1.5`,"data-slot":`git-remote-status`,"aria-label":h(`commit.remoteStatus`),children:[(0,$.jsxs)(`div`,{className:`flex h-7 min-w-0 items-center gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,$.jsx)(G,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate text-caption font-medium`,title:e??h(`commit.detachedHead`),children:e??h(`commit.detachedHead`)}),Y?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(I,{className:`size-3 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`min-w-0 max-w-[45%] truncate text-caption text-muted-foreground`,title:Y,children:Y})]}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[F?(0,$.jsxs)(D,{children:[(0,$.jsx)(_,{asChild:!0,children:(0,$.jsx)(v,{size:`icon-toolbar`,variant:`ghost`,type:`button`,"aria-label":L,disabled:a||!e,onClick:()=>{k({action:`fetch`})},children:o===`fetch`&&a?(0,$.jsx)(M,{className:`size-3.5 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}):(0,$.jsx)(fe,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,$.jsx)(g,{children:h(`commit.fetchRemoteHint`)})]}):null,d?(0,$.jsx)(Ce,{busy:a,canPublish:!!t?.remotes.length&&t.upstream===null,dialogOpen:b!==null,onInspect:()=>{k({action:`inspect`})},onOpen:E,t:h}):null]})]}),(0,$.jsxs)(`div`,{className:`mt-1.5 flex h-6 min-w-0 items-center gap-2`,"data-slot":`git-remote-summary`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,$.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-caption ${H?`max-w-[50%]`:`flex-1`}`,role:`status`,children:q?(0,$.jsxs)($.Fragment,{children:[z>0?f?(0,$.jsxs)(`button`,{className:`inline-flex h-6 min-w-0 max-w-full touch-manipulation items-center gap-1.5 rounded-control bg-brand/10 px-1.5 text-brand-strong outline-none hover:bg-brand/15 focus-visible:shadow-focus`,type:`button`,"data-slot":`git-open-unpushed-history`,"aria-label":h(`commit.ahead`,{count:z}),title:h(`commit.ahead`,{count:z}),onClick:f,children:[(0,$.jsx)(ee,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:h(U?`commit.aheadShort`:`commit.ahead`,{count:z})})]}):(0,$.jsxs)(`span`,{className:`inline-flex h-6 min-w-0 items-center gap-1.5 rounded-control bg-brand/10 px-1.5 text-brand-strong`,title:h(`commit.ahead`,{count:z}),children:[(0,$.jsx)(ee,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`truncate`,children:h(U?`commit.aheadShort`:`commit.ahead`,{count:z})})]}):null,B>0?(0,$.jsxs)(`span`,{className:`inline-flex h-6 min-w-0 items-center gap-1.5 rounded-control bg-control px-1.5 text-muted-foreground`,title:h(`commit.behind`,{count:B}),children:[(0,$.jsx)(te,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`truncate`,children:h(U?`commit.behindShort`:`commit.behind`,{count:B})})]}):null]}):H?null:(0,$.jsxs)(`span`,{className:`inline-flex h-6 min-w-0 items-center gap-1.5 rounded-control bg-control px-1.5 text-muted-foreground`,children:[S.summaryKey===`commit.synced`||S.summaryKey===`commit.pushedToRemote`?(0,$.jsx)(V,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}):null,(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:h(S.summaryKey)})]})}),H?(0,$.jsx)(`div`,{className:`flex h-6 min-w-0 flex-1 items-center text-caption`,children:R?(0,$.jsxs)(`div`,{role:`alert`,className:`flex h-full min-w-0 flex-1 items-center gap-1.5`,"data-slot":`git-remote-notice`,children:[(0,$.jsx)(P,{className:`size-3.5 shrink-0 text-warning`,"aria-hidden":`true`}),(0,$.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,title:h(R.titleKey),children:h(R.titleKey)}),(0,$.jsx)(`button`,{className:`min-h-6 shrink-0 touch-manipulation rounded-sm text-muted-foreground underline underline-offset-2 outline-none hover:text-foreground focus-visible:shadow-focus`,type:`button`,"aria-label":h(`commit.viewDetails`),onClick:e=>{E(`error`,e.currentTarget)},children:h(`commit.detailsShort`)})]}):C.disabledReason?(0,$.jsx)(`p`,{className:`min-w-0 truncate text-muted-foreground`,title:h(C.disabledReason),children:h(C.disabledReason)}):S.hintKey?(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-muted-foreground`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 truncate`,children:h(`commit.externalGitRequired`)}),(0,$.jsx)(`button`,{className:`min-h-6 shrink-0 touch-manipulation rounded-sm underline underline-offset-2 outline-none hover:text-foreground focus-visible:shadow-focus`,type:`button`,"aria-label":h(`commit.viewDetails`),onClick:e=>{E(`guidance`,e.currentTarget)},children:h(`commit.detailsShort`)})]}):null}):null]}),C.action?(0,$.jsxs)(v,{ref:y,size:`toolbar`,variant:W?`default`:`outline`,className:W?`text-[color:light-dark(#ffffff,#181818)]`:void 0,type:`button`,"data-slot":`git-remote-primary`,"aria-label":N,title:N,disabled:a||A||!!C.disabledReason||C.action!==`push`&&!d,onClick:()=>{let e=C.action;e===`push`?u():e===`configure`||e===`publish`||e===`branch`?E(e):e&&k({action:e})},children:[j||A?(0,$.jsx)(M,{className:`size-3.5 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}):C.action===`push`||C.action===`publish`?(0,$.jsx)(J,{className:`size-3.5`,"aria-hidden":`true`}):null,ne]}):null]}),b?.kind===`configure`?(0,$.jsx)(xe,{initialName:w,initialUrl:t?.remotes.find(e=>e.name===w)?.url??``,busy:a,returnFocusElement:b.returnFocus,error:c===`configure`&&s?h(S.failure?.kind===`invalid_remote`?`commit.fix_invalid_remote`:`commit.remoteSaveFailed`):null,onSave:(e,t)=>k({action:`configure`,remote:e,url:t}),onClose:O,t:h}):null,b&&b.kind!==`configure`?(0,$.jsx)(Se,{kind:b.kind,branch:e,remote:t,commitSha:i,defaultRemote:w,busy:a,error:T,failure:S.failure,guidanceKey:S.hintKey,returnFocus:b.returnFocus,onAction:k,onClose:O,t:h}):null]})}var Te=e=>JSON.stringify({version:1,...e});function Ee(e,t){if(!e||e.length>2048)return null;try{let n=JSON.parse(e),r=e=>e===null||typeof e==`string`;return n.version!==1||!r(n.head)||!r(n.commitSha)||typeof n.pushStatus!=`string`||![`failed`,`not_configured`,`not_requested`,`pushed`,`checked`,`updated`].includes(n.pushStatus)||![`state_changed`,`working_changes`,`merge_conflicts`,`invalid_remote`,`authentication`,`permission`,`remote_updates`,`protected_branch`,`network`,`host_key`,`rules`,`unknown_result`,`unknown`].includes(String(n.failureKind))||t!==void 0&&n.head!==null&&n.head!==t?null:{head:n.head,commitSha:n.commitSha,pushStatus:n.pushStatus,failureKind:n.failureKind}}catch{return null}}function De(e,t,n){let r=`codexly:git-receipt:v1:${e}`,[i,a]=(0,X.useState)(()=>{try{return typeof window>`u`?null:Ee(window.localStorage.getItem(r),n)}catch{return null}}),o=t?Te(t):null;return(0,X.useEffect)(()=>{if(!o)return;let e=Ee(o);a(e);try{window.localStorage.setItem(r,o)}catch{}},[r,o]),t??(i&&(n===void 0||i.head===null||i.head===n)?i:null)}function Oe({busyAction:e,canCommit:t,disabled:n,isPending:r,labels:i,onCommit:a}){let o=r?e===`commit_and_push`?i.committingAndPushing:i.committing:i.commit;return(0,$.jsx)(`div`,{className:`mt-2`,"data-slot":`git-changes-actions`,children:(0,$.jsxs)(ce,{className:`w-full`,children:[(0,$.jsxs)(v,{"aria-label":o,className:`min-w-0 flex-1 rounded-r-none disabled:pointer-events-auto disabled:cursor-not-allowed disabled:opacity-100 disabled:hover:bg-brand disabled:active:brightness-100`,disabled:!t,onClick:()=>{a(`commit`)},type:`button`,children:[r?(0,$.jsx)(M,{"aria-hidden":`true`,className:`animate-spin`}):(0,$.jsx)(se,{"aria-hidden":`true`}),o]}),(0,$.jsxs)(w,{children:[(0,$.jsx)(A,{asChild:!0,children:(0,$.jsx)(v,{"aria-label":i.moreGitActions,className:`w-9 shrink-0 rounded-l-none border-l border-brand-contrast/30 px-0 disabled:opacity-100`,disabled:n,type:`button`,children:(0,$.jsx)(F,{"aria-hidden":`true`})})}),(0,$.jsx)(O,{align:`end`,className:`max-w-[calc(100vw-1rem)]`,children:(0,$.jsx)(k,{children:(0,$.jsxs)(T,{className:`focus-visible:!outline-none focus-visible:shadow-none`,disabled:!t,onSelect:()=>{a(`commit_and_push`)},children:[(0,$.jsx)(se,{"aria-hidden":`true`,className:`size-4`}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{children:i.commitAndPush}),(0,$.jsx)(`p`,{className:`mt-0.5 text-caption text-muted-foreground`,children:i.commitAndPushDescription})]})]})})})]})]})})}function ke({draft:e,generating:t,disabled:n,canGenerate:r,onGenerate:i,update:a,t:o}){return(0,$.jsxs)(`div`,{className:`space-y-2`,"data-slot":`git-commit-editor`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`label`,{className:`text-label font-semibold`,htmlFor:`commit-message`,children:o(`commit.commitMessage`)}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[e.previousMessage===null?null:(0,$.jsx)(v,{size:`sm`,variant:`link`,type:`button`,onClick:()=>{a(e=>({...e,message:e.previousMessage??``,previousMessage:null}))},children:o(`commit.undoGeneration`)}),(0,$.jsxs)(v,{variant:`ghost`,size:`sm`,disabled:!r||t,onClick:i,type:`button`,"aria-label":o(`commit.generateMessage`),children:[t?(0,$.jsx)(M,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}):(0,$.jsx)(oe,{className:`size-3.5`,"aria-hidden":`true`}),o(t?`commit.generatingMessage`:`commit.generateMessage`)]})]})]}),(0,$.jsx)(`textarea`,{id:`commit-message`,"aria-label":o(`commit.commitMessage`),className:`block min-h-12 w-full resize-none rounded-control border border-separator-strong bg-panel px-2 py-1.5 text-label leading-5 outline-none focus-visible:shadow-focus`,rows:2,maxLength:1e4,disabled:n,placeholder:o(`commit.messagePlaceholder`),value:e.message,onChange:e=>{let t=e.currentTarget.value;a(e=>({...e,message:t,previousMessage:null}))}})]})}function Ae(e,t,n){try{return Q(t,n,typeof window>`u`?null:ve(window.localStorage.getItem(e)))}catch{return Q(t,n)}}function je(e,t,n,r){let i=`codexly:git-draft:v1:${e}`,a=(0,X.useMemo)(()=>`${t}:${n.map(e=>`${e.path}:${String(Number(e.staged))}`).join(`\0`)}:${String(r)}`,[t,n,r]),[o,s]=(0,X.useState)(()=>({range:a,draft:Ae(i,t,n)}));o.range!==a&&s({range:a,draft:he(o.draft,t,n,r)});let c=(0,X.useRef)(o.draft);c.current=o.draft;let l=()=>{try{window.localStorage.setItem(i,_e(c.current))}catch{}};return(0,X.useEffect)(()=>{let e=setTimeout(l,250);return()=>{clearTimeout(e)}},[i,o.draft]),(0,X.useEffect)(()=>{let e=()=>{l()};return window.addEventListener(`pagehide`,e),()=>{window.removeEventListener(`pagehide`,e),e()}},[i]),[o.draft,e=>{s(t=>({...t,draft:e(t.draft)}))}]}function Me(e){let t=new Map;for(let n of e.staged)t.set(n.path,{path:n.path,staged:!0,unstaged:!1});for(let n of e.unstaged)t.set(n.path,{path:n.path,staged:t.has(n.path),unstaged:!0});return[...t.values()].sort((e,t)=>e.path.localeCompare(t.path,`en`))}function Ne({gitStatus:e,draftScope:t=`repository`,error:n=null,isCommitting:r=!1,isPushing:i=!1,activeRemoteAction:a,isGenerating:o=!1,totalChanges:s,complete:c=!0,onLoadMore:l,isLoadingMore:u=!1,onCommit:d,onPush:f,onGenerateMessage:p,result:m=null,pushResult:h=null,remoteResult:g,isInspectingRemote:_=!1,onRemoteAction:y,onOpenHistory:x,t:S,viewMode:C,onViewModeChange:w,renderChanges:T}){let E=(0,X.useMemo)(()=>Me(e),[e]),[D,O]=je(t,e.snapshot,E,c),[k,A]=(0,X.useState)(``),[j,N]=(0,X.useState)(null),[P,F]=(0,X.useState)(!1),[I,ee]=(0,X.useState)(`commit`),L=(0,X.useRef)(!1),R=(0,X.useRef)(0);(0,X.useEffect)(()=>()=>{R.current++},[]);let z=r||i,B=(s??E.length)>0,V=h?.pushError??m?.pushError??null,H=De(t,h||m?{head:h?.remoteState?.head??m?.commitSha??g?.remoteState?.head??null,commitSha:m?.commitSha??null,pushStatus:h?.pushStatus??m?.pushStatus??`not_requested`,failureKind:Z(V)}:null,g?.remoteState?.head),te=h?.pushStatus??m?.pushStatus??H?.pushStatus??null,U=b(e=>S(e)),W=g?.remoteState?.operation!==`merge`&&(g?.remoteState?.conflicts.length??0)===0&&!z&&D.selectedPaths.size>0&&D.message.trim()!==``,G=async(e,t=`push`)=>{if(L.current)return!1;L.current=!0,N(null);try{return await e(),!0}catch(e){return N({message:e instanceof Error?e.message:String(e),operation:t}),!1}finally{L.current=!1}},q=async()=>{if(P||o)return;let e=D,t=++R.current;F(!0),N(null);try{let n=await p({expectedSnapshot:e.snapshot,paths:[...e.selectedPaths]});R.current===t&&O(t=>ge(t,e,n))}catch(e){R.current===t&&N({message:e instanceof Error?e.message:String(e),operation:`generate`})}finally{R.current===t&&F(!1)}},J=t=>G(async()=>{ee(t),await d({action:t,expectedSnapshot:e.snapshot,paths:[...D.selectedPaths],message:D.message}),R.current++,F(!1),O(e=>({...Q(e.snapshot,[]),knownPaths:e.knownPaths}))},`commit`);return e.repositoryMode===`root`?(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,"data-slot":`commit-changes-panel`,children:[(0,$.jsx)(we,{onOpenHistory:x,branch:e.branch,remote:g?.remoteState,pushStatus:te,pushError:V,commitSha:m?.commitSha??H?.commitSha??void 0,savedFailureKind:H?.failureKind,busy:z,hasWorkingChanges:B,activeAction:i?a??`push`:null,actionError:j?.message??(V?null:n?.message??null),failureOperation:j?.operation??(!V&&n?`status`:void 0),inspecting:_,t:S,onPush:()=>{G(f)},...y?{onAction:e=>G(()=>y(e,H?.failureKind),e.action??`push`)}:{}}),B?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`max-h-[25%] shrink-0 space-y-2 overflow-y-auto px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-caption font-semibold`,children:S(`commit.selectedFiles`,{selected:D.selectedPaths.size,total:s??E.length})}),(0,$.jsx)(v,{size:`icon-sm`,variant:`ghost`,type:`button`,"aria-label":S(C===`tree`?`diff.showFileList`:`diff.showFileTree`),onClick:()=>{w(C===`tree`?`list`:`tree`)},children:C===`tree`?(0,$.jsx)(K,{className:`size-3.5`}):(0,$.jsx)(ne,{className:`size-3.5`})})]}),(0,$.jsx)(`input`,{"aria-label":S(`commit.searchFiles`),placeholder:S(`commit.searchFiles`),className:`h-8 w-full rounded-control border border-separator bg-panel px-2 text-label outline-none focus-visible:shadow-focus`,value:k,onChange:e=>{A(e.currentTarget.value)}}),E.some(e=>e.staged&&e.unstaged)?(0,$.jsx)(`p`,{className:`text-caption text-muted-foreground`,children:S(`commit.partialStaged`)}):null]}),(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:T(D.selectedPaths,e=>{O(t=>({...t,selectedPaths:e}))},z,k)}),c?null:(0,$.jsx)(`div`,{className:`shrink-0 border-t border-separator px-3 py-1`,children:(0,$.jsxs)(v,{size:`sm`,variant:`ghost`,className:`w-full`,disabled:u,onClick:l,type:`button`,children:[u?(0,$.jsx)(M,{className:`size-3.5 animate-spin`}):null,S(`commit.loadMore`),` · `,E.length,` / `,s??E.length]})}),(0,$.jsxs)(`section`,{className:`max-h-[60%] min-h-0 shrink space-y-2 overflow-y-auto border-t border-separator px-3 py-2`,"data-slot":`git-commit-footer`,children:[(0,$.jsx)(ke,{draft:D,update:O,generating:P||o,disabled:r,canGenerate:D.selectedPaths.size>0&&!z,onGenerate:()=>{q()},t:S}),(0,$.jsx)(Oe,{busyAction:r?I:null,canCommit:W,isPending:r,disabled:z,labels:U,onCommit:e=>{J(e)}})]})]}):null]}):null}function Pe(e){return[...e].sort((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name,`en`):e.kind===`file`?-1:1)}function Fe(e){let t=[e.name],n=e;for(;n.children.size===1;){let e=n.children.values().next().value;if(e?.kind!==`folder`)break;t.push(e.name),n=e}return{children:Pe([...n.children.values()].map(e=>e.kind===`folder`?Fe(e):e)),kind:`folder`,name:t.join(`/`),path:n.path}}function Ie(e){let t={children:new Map,kind:`folder`,name:``,path:``};for(let n of e){let e=n.path.split(`/`),r=e.pop();if(r===void 0)continue;let i=t;for(let t of e){let e=i.path===``?t:`${i.path}/${t}`,n=i.children.get(t);if(n?.kind===`folder`){i=n;continue}let r={children:new Map,kind:`folder`,name:t,path:e};i.children.set(t,r),i=r}i.children.set(r,{kind:`file`,name:r,path:n.path,status:n.kind})}return Pe([...t.children.values()].map(e=>e.kind===`folder`?Fe(e):e))}var Le=[];function Re(e,t,n,r,i,a=0){for(let o of t){let t=`${r}:${o.path}`;if(o.kind===`folder`)e.push({key:t,label:r,depth:a,kind:`folder`,path:o.path,name:o.name}),i.has(t)||Re(e,o.children,n,r,i,a+1);else{let i=n.get(o.path);i&&e.push({key:t,label:r,depth:a,kind:`file`,name:o.name,change:i})}}}function ze({changes:e,disabled:t=!1,label:n,onOpenFileDiff:r,onSelectedPathsChange:i,selectedPaths:a,viewMode:o=`tree`,secondaryChanges:c=Le,secondaryLabel:l=``,statsAvailable:d=!1}){let f=(0,X.useRef)(null),p=(0,X.useRef)(null),[h,g]=(0,X.useState)(new Set),_=(0,X.useMemo)(()=>[{changes:e,label:n},{changes:c,label:l}].filter(e=>e.changes.length>0).map(e=>({...e,paths:e.changes.map(e=>e.path),byPath:new Map(e.changes.map(e=>[e.path,e])),nodes:o===`tree`?Ie(e.changes):[],sorted:o===`list`?e.changes.toSorted((e,t)=>e.path.localeCompare(t.path,`en`)):[]})),[e,n,c,l,o]),v=(0,X.useMemo)(()=>{let e=[];for(let t of _)if(e.push({key:t.label,label:t.label,depth:0,kind:`section`,paths:t.paths}),o===`tree`)Re(e,t.nodes,t.byPath,t.label,h);else for(let n of t.sorted)e.push({key:`${t.label}:${n.path}`,kind:`file`,label:t.label,depth:0,name:n.path,change:n});return e},[_,h,o]),y=s({count:v.length,getScrollElement:()=>f.current,getItemKey:e=>v[e]?.key??e,estimateSize:()=>32,overscan:8,initialRect:{width:400,height:400}}),b=y.getVirtualItems();(0,X.useLayoutEffect)(()=>{if(p.current===null)return;let e=f.current?.querySelector(`[data-row-index="${String(p.current)}"]`);e&&(e.focus(),p.current=null)},[b]);let x=e=>{let t=new Set(a);t.has(e)?t.delete(e):t.add(e),i(t)},S=e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},C=(e,t)=>{let n=e.key===`ArrowDown`?t+1:e.key===`ArrowUp`?t-1:e.key===`Home`?0:e.key===`End`?v.length-1:null;n!==null&&(e.preventDefault(),p.current=Math.max(0,Math.min(v.length-1,n)),y.scrollToIndex(p.current,{align:`auto`}),f.current?.querySelector(`[data-row-index="${String(p.current)}"]`)?.focus())};return(0,$.jsx)(`div`,{ref:f,className:`h-full min-h-0 flex-1 overflow-y-auto overscroll-contain`,"data-slot":`commit-changes-scroll`,children:(0,$.jsx)(`div`,{role:`tree`,"aria-label":n,"data-slot":o===`list`?`commit-changes-list`:`commit-changes-tree`,style:{height:y.getTotalSize(),position:`relative`},children:b.map(e=>{let n=v[e.index];if(!n)return null;let s={height:32,left:0,top:0,width:`100%`,position:`absolute`,transform:`translateY(${String(e.start)}px)`,paddingLeft:12+n.depth*14};if(n.kind===`section`){let r=n.paths.reduce((e,t)=>e+Number(a.has(t)),0);return(0,$.jsxs)(`div`,{role:`treeitem`,style:s,className:`flex items-center gap-1.5 pr-3`,"data-row-index":e.index,tabIndex:-1,onKeyDown:t=>{C(t,e.index)},children:[(0,$.jsx)(m,{"aria-label":n.label,checked:r===0?!1:r===n.paths.length||`indeterminate`,disabled:t,onCheckedChange:e=>{let t=new Set(a);for(let r of n.paths)e?t.add(r):t.delete(r);i(t)}}),(0,$.jsx)(`h3`,{className:`text-label font-semibold`,children:n.label}),(0,$.jsx)(`span`,{className:`ml-auto text-caption text-muted-foreground`,children:n.paths.length})]},n.key)}let c=n.kind===`folder`,l=c&&!h.has(n.key),f=c?n.path:n.change.path,p=c?`update`:n.change.kind,g=c?B:p===`create`?W:p===`delete`?pe:ae,_=()=>{c?S(n.key):r(n.change)};return(0,$.jsxs)(`div`,{role:`treeitem`,"aria-label":f,"aria-level":o===`tree`?n.depth+1:void 0,"aria-expanded":c?l:void 0,tabIndex:0,"data-row-index":e.index,style:s,className:`flex cursor-pointer items-center gap-1.5 pr-3 font-mono text-label hover:bg-control-hover focus-visible:shadow-focus`,onClick:_,onKeyDown:t=>{t.target===t.currentTarget&&(C(t,e.index),(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),_()),c&&(t.key===`ArrowLeft`&&l||t.key===`ArrowRight`&&!l)&&(t.preventDefault(),S(n.key)))},children:[c?(0,$.jsx)(I,{"aria-hidden":`true`,className:u(`size-3.5 shrink-0`,l&&`rotate-90`)}):(0,$.jsx)(m,{"aria-label":`${n.label}: ${f}`,checked:a.has(f),disabled:t,onClick:e=>{e.stopPropagation()},onCheckedChange:()=>{x(f)}}),(0,$.jsx)(g,{"aria-hidden":`true`,className:u(`size-3.5 shrink-0`,!c&&(p===`create`?`text-diff-added`:p===`delete`?`text-danger`:`text-warning`))}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:f,children:n.name}),!c&&d&&n.change.stats!==void 0&&(0,$.jsxs)(`span`,{className:`flex shrink-0 gap-1 text-meta`,"aria-label":`+${String(n.change.stats.additions)} -${String(n.change.stats.removals)}`,children:[(0,$.jsxs)(`span`,{className:`text-diff-added`,children:[`+`,n.change.stats.additions]}),(0,$.jsxs)(`span`,{className:`text-diff-removed`,children:[`-`,n.change.stats.removals]})]}),!c&&(0,$.jsx)(`span`,{className:`text-meta text-muted-foreground`,children:p===`create`?`A`:p===`delete`?`D`:`M`})]},n.key)})})})}function Be(e){let{gitStatus:t,onOpenFileDiff:n}=e,{t:r}=L(`workbench`),[i,a]=q(`changes`),o=(0,X.useMemo)(()=>{let e=new Map(t.staged.map(e=>[e.path,e]));for(let n of t.unstaged)e.has(n.path)||e.set(n.path,n);return[...e.values()]},[t]),s=JSON.stringify([e.draftScope??`repository`,t.branch]);return(0,$.jsx)(Ne,{...e,draftScope:s,t:(e,t)=>r(e,t??{}),viewMode:i,onViewModeChange:a,renderChanges:(e,t,a,s)=>{let c=s?o.filter(e=>e.path.toLowerCase().includes(s.toLowerCase())):o;return s&&c.length===0?(0,$.jsx)(`p`,{className:`p-3 text-caption text-muted-foreground`,children:r(`commit.noMatchingFiles`)}):(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,"data-slot":`commit-changes-scroll`,children:(0,$.jsx)(ze,{changes:c,label:r(`commit.changes`),disabled:a,onOpenFileDiff:n,onSelectedPathsChange:t,selectedPaths:e,viewMode:i})})}},s)}function Ve(e){return e.pushStatus===`pushed`?`commit.commitAndPushSucceeded`:e.pushStatus===`not_requested`?`commit.commitSucceeded`:null}function He(e,t,n,r,i,a){let o=r===void 0?[`projects`,t,n,`git-status`]:[`projects`,t,n,`git-status`,r];e.setQueryData(o,i),e.setQueryData([`projects`,t,n,`git-history`,r??null],{pageParams:[void 0],pages:[a]})}function Ue({client:e,detailsError:t=null,gitStatus:n,onOpenFileDiff:r,onOpenHistory:a,projectId:s,rootPath:u}){let{t:d}=L(`workbench`),f=c(),m=i({...re(s,u,e),meta:{actionNotification:!1}}),h=i({...ie(s,u,e),...j(s,u,f),meta:{actionNotification:!1}}),g=i(S(s,u,e)),[_,v]=(0,X.useState)(),[y,b]=(0,X.useState)(),x=n,C=JSON.stringify([s,u,x.branch]),w=y?.scope===C?y.result:null,T=le({predicate:e=>e.options.scope?.id===`project-git-mutation:${s}:${u}`})>0,E=l(s,u,x.branch,x.snapshot,e,T),D=o({...E,enabled:x.repositoryMode===`root`&&E.enabled}),O=async(e,t)=>{let n=x.snapshot,r;try{r=await g.mutateAsync({...e,expectedSnapshot:n,...[`push`,`publish`,`fetch`].includes(e.action??``)&&x.branch?{expectedBranch:x.branch}:{}})}catch(e){throw v({result:{branch:x.branch,pushStatus:`failed`,pushError:e instanceof Error?e.message:String(e)},snapshot:n,scope:C}),f.invalidateQueries({queryKey:E.queryKey}),e}if(r.remoteState&&f.setQueryData(E.queryKey,r),(e.action!==`inspect`||p(t??Z(_?.scope===C?_.result.pushError:null),r))&&v({result:r,snapshot:n,scope:C}),r.pushStatus===`pushed`&&Y(d(`commit.pushSucceeded`)),[`inspect`,`integrate`,`branch`].includes(e.action??``)&&await f.invalidateQueries({queryKey:[`projects`,s,u,`git-status`]}),f.invalidateQueries({queryKey:[`projects`,s,u,`git-history`]}),r.pushStatus===`failed`||r.pushStatus===`not_configured`)throw Error(r.pushError??d(`commit.pushFailed`))};return(0,$.jsx)(Be,{onOpenHistory:a,draftScope:JSON.stringify([s,u]),error:t??D.error,gitStatus:x,pushResult:_?.scope===C?_.result:null,isPushing:g.isPending,activeRemoteAction:g.isPending?g.variables.action??`push`:null,onPush:()=>O({action:`push`}),onRemoteAction:O,remoteResult:D.data,isInspectingRemote:D.isPending,isCommitting:h.isPending,isGenerating:m.isPending,onCommit:async e=>{v(void 0);let t=await h.mutateAsync(e);b({result:t,snapshot:t.status.snapshot,scope:C}),He(f,s,u,e.repository,t.status,t.history);let n=Ve(t);if(n!==null){Y(d(n));return}},onGenerateMessage:async e=>(await m.mutateAsync(e)).message,onOpenFileDiff:r,result:w})}function We({client:e,detailsError:t,detailsPending:n,detailsStatus:r,gitStatus:i,gitStatusError:a,onOpenFileDiff:o,onOpenHistory:s,projectId:c,rootPath:l}){return c!==void 0&&e!==void 0&&i!==void 0?(0,$.jsx)(Ue,{client:e,detailsError:t,detailsPending:n,gitStatus:r??i,onOpenFileDiff:o,onOpenHistory:s,projectId:c,rootPath:l}):a===null?(0,$.jsx)(`p`,{className:`p-3 text-caption text-muted-foreground`,role:`status`,children:R.t(`inspector.gitLoading`,{ns:`conversation`})}):(0,$.jsx)(`p`,{className:`p-3 text-caption text-danger`,role:`alert`,children:a.message})}export{We as WorkbenchInspectorChanges};
|
|
Binary file
|
|
Binary file
|
package/dist/web/assets/{workbench-pet-canvas-Ct1J6Adp.js → workbench-pet-canvas-B5jypDil.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{o as r,r as i}from"./initial-deps-CW5Jl6i2.js";import{
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{o as r,r as i}from"./initial-deps-CW5Jl6i2.js";import{xn as a}from"./initial-deps-C-3sxJvc.js";import{Lt as o}from"./index-DobF11m_.js";var s=[`workbench-pets`];function c(e=o){return r({queryFn:({signal:t})=>e.listWorkbenchPets({signal:t}),queryKey:s,staleTime:3e4})}function l(e,t=o){return i({meta:{actionNotification:{successMessage:!1}},mutationFn:async e=>{let n=`workbench-pet-${e}-${globalThis.crypto.randomUUID()}`;return t.downloadWorkbenchPet(e,{idempotencyKey:n})},mutationKey:[`workbench-pets`,`download`],onSuccess:({pets:t})=>{e.setQueryData(s,t)},scope:{id:`workbench-pet-download`}})}var u=e(t(),1);function d(e){return e!==void 0&&e.frames.length>0}function f(e,t){let n=new Set,r=t;for(;!n.has(r);){n.add(r);let t=e[r];if(t!==void 0&&d(t))return t;if(t!==void 0)r=t.fallback;else if(r!==`idle`)r=`idle`;else return}}var p=class{#e;#t;#n=`idle`;#r=!1;#i=0;#a=!1;#o;#s=!0;constructor(e){this.#e=e.animations,this.#t=e.onFrame}play(e){this.#n=e,this.#l()}setReducedMotion(e){this.#a!==e&&(this.#a=e,this.#l())}setVisible(e){this.#s!==e&&(this.#s=e,this.#l())}dispose(){this.#r=!0,this.#i+=1,this.#c()}#c(){this.#o!==void 0&&clearTimeout(this.#o),this.#o=void 0}#l(){if(this.#i+=1,this.#c(),this.#r||!this.#s)return;let e=f(this.#e,this.#n);e!==void 0&&this.#u(e,0,this.#i)}#u(e,t,n){if(n!==this.#i||this.#r||!this.#s)return;let r=e.frames[t];if(r===void 0||(this.#t(r.spriteIndex),this.#a))return;let i=t+1,a=e.loopStart??-1;i>=e.frames.length&&a<0||(this.#o=setTimeout(()=>{this.#o=void 0,this.#u(e,i<e.frames.length?i:a,n)},r.durationMs))}};async function m(e,t){let n=await fetch(e,{credentials:`same-origin`,signal:t});if(!n.ok)throw Error(`Unable to load pet asset: ${String(n.status)}`);return createImageBitmap(await n.blob())}function h(e,t,n,r){let i=e.getContext(`2d`);if(i===null)throw Error(`Canvas 2D context is unavailable`);let a=Math.max(1,e.clientWidth||n.width),o=Math.max(1,e.clientHeight||n.height),s=Math.min(3,Math.max(1,globalThis.devicePixelRatio||1)),c=Math.round(a*s),l=Math.round(o*s);e.width!==c&&(e.width=c),e.height!==l&&(e.height=l);let u=r%n.columns,d=Math.floor(r/n.columns);i.clearRect(0,0,c,l),i.imageSmoothingEnabled=!1,i.drawImage(t,u*n.width,d*n.height,n.width,n.height,0,0,c,l)}var g=n();function _(){let[e,t]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{let e=matchMedia(`(prefers-reduced-motion: reduce)`),n=()=>{t(e.matches)};return n(),e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}},[]),e}function v({animationName:e,pet:t}){let n=(0,u.useRef)(null),[r,i]=(0,u.useState)(null),[o,s]=(0,u.useState)(!1),c=_(),l=a(t.assetId);return(0,u.useEffect)(()=>{let e=new AbortController,t=!0;return i(null),s(!1),typeof createImageBitmap==`function`?(m(l,e.signal).then(e=>{t?i(e):e.close()}).catch(()=>{t&&!e.signal.aborted&&s(!0)}),()=>{t=!1,e.abort()}):(s(!0),()=>{e.abort()})},[l]),(0,u.useEffect)(()=>()=>{r?.close()},[r]),(0,u.useEffect)(()=>{let i=n.current;if(i===null||r===null)return;let a=0,o=e=>{a=e;try{h(i,r,t.frame,e)}catch{s(!0)}},l=new p({animations:t.animations,onFrame:o});l.setReducedMotion(c),l.setVisible(document.visibilityState===`visible`),l.play(e);let u=new ResizeObserver(()=>{o(a)});u.observe(i);let d=()=>{l.setVisible(document.visibilityState===`visible`)};return document.addEventListener(`visibilitychange`,d),()=>{u.disconnect(),document.removeEventListener(`visibilitychange`,d),l.dispose()}},[e,r,t.animations,t.frame,c]),o?(0,g.jsx)(`span`,{"aria-hidden":`true`,className:`workbench-pet-static-fallback`,style:{backgroundImage:`url(${l})`,backgroundSize:`${String(t.frame.columns*100)}% ${String(t.frame.rows*100)}%`}}):(0,g.jsx)(`canvas`,{"aria-hidden":`true`,className:`workbench-pet-canvas`,ref:n})}export{l as n,c as r,v as t};
|
|
Binary file
|
|
Binary file
|