@open-mercato/cezar 0.17.0-pr976.3708 → 0.17.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/README.md +4 -0
- package/dist/agent-config/validate.d.ts +2 -1
- package/dist/agent-config/validate.js.map +1 -1
- package/dist/api-origin.d.ts +0 -4
- package/dist/api-origin.js +0 -22
- package/dist/api-origin.js.map +1 -1
- package/dist/cockpit-address.d.ts +5 -0
- package/dist/cockpit-address.js +7 -0
- package/dist/cockpit-address.js.map +1 -1
- package/dist/contract/health.d.ts +30 -0
- package/dist/contract/index.d.ts +1 -0
- package/dist/contract/index.js +2370 -2054
- package/dist/contract/projects.d.ts +1 -0
- package/dist/contract/runs.d.ts +178 -2
- package/dist/contract/skills.d.ts +23 -0
- package/dist/contract/webhooks.d.ts +1136 -0
- package/dist/contract/workspace.d.ts +2 -0
- package/dist/core/agent-errors.d.ts +6 -0
- package/dist/core/agent-errors.js +13 -0
- package/dist/core/agent-errors.js.map +1 -1
- package/dist/core/agent-failure-class.d.ts +24 -0
- package/dist/core/agent-failure-class.js +99 -0
- package/dist/core/agent-failure-class.js.map +1 -0
- package/dist/core/agent-runner.d.ts +1 -1
- package/dist/core/claude-cli-runner.d.ts +2 -2
- package/dist/core/claude-cli-runner.js +17 -21
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/codex-app-server-runner.d.ts +1 -1
- package/dist/core/codex-app-server-runner.js +20 -23
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/copilot-acp-runner.d.ts +1 -1
- package/dist/core/copilot-acp-runner.js +10 -10
- package/dist/core/copilot-acp-runner.js.map +1 -1
- package/dist/core/cursor-agent-runner.js +18 -22
- package/dist/core/cursor-agent-runner.js.map +1 -1
- package/dist/core/inactivity-deadline.d.ts +21 -0
- package/dist/core/inactivity-deadline.js +49 -0
- package/dist/core/inactivity-deadline.js.map +1 -0
- package/dist/core/junie-runner.d.ts +1 -1
- package/dist/core/junie-runner.js +16 -20
- package/dist/core/junie-runner.js.map +1 -1
- package/dist/core/opencode-server-runner.d.ts +2 -2
- package/dist/core/opencode-server-runner.js +23 -15
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/pi-runner.d.ts +1 -1
- package/dist/core/pi-runner.js +8 -10
- package/dist/core/pi-runner.js.map +1 -1
- package/dist/core/provider-auth.js +18 -6
- package/dist/core/provider-auth.js.map +1 -1
- package/dist/core/runner-factory.d.ts +2 -0
- package/dist/core/runner-factory.js +39 -0
- package/dist/core/runner-factory.js.map +1 -1
- package/dist/core/secret-redaction.js +38 -6
- package/dist/core/secret-redaction.js.map +1 -1
- package/dist/data-gitignore.d.ts +1 -1
- package/dist/data-gitignore.js +1 -0
- package/dist/data-gitignore.js.map +1 -1
- package/dist/disk-space.d.ts +38 -0
- package/dist/disk-space.js +113 -0
- package/dist/disk-space.js.map +1 -0
- package/dist/dispatch/prompts.js +1 -1
- package/dist/git-worktree.d.ts +2 -0
- package/dist/git-worktree.js +16 -0
- package/dist/git-worktree.js.map +1 -1
- package/dist/handoff.d.ts +2 -2
- package/dist/handoff.js +1 -1
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/pack-check.d.ts +10 -0
- package/dist/pack-check.js +7 -0
- package/dist/pack-check.js.map +1 -1
- package/dist/release/backport.d.ts +34 -0
- package/dist/release/backport.js +33 -0
- package/dist/release/backport.js.map +1 -0
- package/dist/runs/agent-error-telemetry.d.ts +5 -1
- package/dist/runs/agent-error-telemetry.js +17 -10
- package/dist/runs/agent-error-telemetry.js.map +1 -1
- package/dist/runs/failure-kind.d.ts +1 -1
- package/dist/runs/failure-kind.js +5 -8
- package/dist/runs/failure-kind.js.map +1 -1
- package/dist/runs/lifecycle.d.ts +55 -0
- package/dist/runs/lifecycle.js +24 -0
- package/dist/runs/lifecycle.js.map +1 -0
- package/dist/runs/retention.js +36 -4
- package/dist/runs/retention.js.map +1 -1
- package/dist/runs/store.d.ts +31 -0
- package/dist/runs/store.js +59 -5
- package/dist/runs/store.js.map +1 -1
- package/dist/server/capabilities.js +3 -0
- package/dist/server/capabilities.js.map +1 -1
- package/dist/server/disk-health.d.ts +11 -0
- package/dist/server/disk-health.js +26 -0
- package/dist/server/disk-health.js.map +1 -0
- package/dist/server/forge/github.d.ts +9 -1
- package/dist/server/forge/github.js +42 -3
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/message-receipts.d.ts +27 -0
- package/dist/server/message-receipts.js +54 -0
- package/dist/server/message-receipts.js.map +1 -0
- package/dist/server/project-context.d.ts +5 -0
- package/dist/server/project-context.js +35 -1
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/server.d.ts +2744 -866
- package/dist/server/server.js +191 -148
- package/dist/server/server.js.map +1 -1
- package/dist/server/webhooks.d.ts +817 -0
- package/dist/server/webhooks.js +91 -0
- package/dist/server/webhooks.js.map +1 -0
- package/dist/server/worktree-lifecycle.d.ts +88 -88
- package/dist/startup-port.d.ts +12 -0
- package/dist/startup-port.js +33 -0
- package/dist/startup-port.js.map +1 -0
- package/dist/telemetry-service.json +1 -0
- package/dist/webhooks/admission.d.ts +360 -0
- package/dist/webhooks/admission.js +294 -0
- package/dist/webhooks/admission.js.map +1 -0
- package/dist/webhooks/coordinator.d.ts +39 -0
- package/dist/webhooks/coordinator.js +215 -0
- package/dist/webhooks/coordinator.js.map +1 -0
- package/dist/webhooks/destination.d.ts +24 -0
- package/dist/webhooks/destination.js +111 -0
- package/dist/webhooks/destination.js.map +1 -0
- package/dist/webhooks/discord.d.ts +4 -0
- package/dist/webhooks/discord.js +102 -0
- package/dist/webhooks/discord.js.map +1 -0
- package/dist/webhooks/endpoints.d.ts +201 -0
- package/dist/webhooks/endpoints.js +345 -0
- package/dist/webhooks/endpoints.js.map +1 -0
- package/dist/webhooks/history.d.ts +42 -0
- package/dist/webhooks/history.js +222 -0
- package/dist/webhooks/history.js.map +1 -0
- package/dist/webhooks/lifecycle.d.ts +34 -0
- package/dist/webhooks/lifecycle.js +60 -0
- package/dist/webhooks/lifecycle.js.map +1 -0
- package/dist/webhooks/limits.d.ts +19 -0
- package/dist/webhooks/limits.js +101 -0
- package/dist/webhooks/limits.js.map +1 -0
- package/dist/webhooks/links.d.ts +12 -0
- package/dist/webhooks/links.js +40 -0
- package/dist/webhooks/links.js.map +1 -0
- package/dist/webhooks/operations.d.ts +24 -0
- package/dist/webhooks/operations.js +128 -0
- package/dist/webhooks/operations.js.map +1 -0
- package/dist/webhooks/outbox.d.ts +37 -0
- package/dist/webhooks/outbox.js +221 -0
- package/dist/webhooks/outbox.js.map +1 -0
- package/dist/webhooks/ownership.d.ts +17 -0
- package/dist/webhooks/ownership.js +254 -0
- package/dist/webhooks/ownership.js.map +1 -0
- package/dist/webhooks/payload.d.ts +6 -0
- package/dist/webhooks/payload.js +112 -0
- package/dist/webhooks/payload.js.map +1 -0
- package/dist/webhooks/platform.d.ts +9 -0
- package/dist/webhooks/platform.js +12 -0
- package/dist/webhooks/platform.js.map +1 -0
- package/dist/webhooks/privacy.d.ts +4 -0
- package/dist/webhooks/privacy.js +43 -0
- package/dist/webhooks/privacy.js.map +1 -0
- package/dist/webhooks/process-identity.d.ts +36 -0
- package/dist/webhooks/process-identity.js +240 -0
- package/dist/webhooks/process-identity.js.map +1 -0
- package/dist/webhooks/scheduler.d.ts +10 -0
- package/dist/webhooks/scheduler.js +43 -0
- package/dist/webhooks/scheduler.js.map +1 -0
- package/dist/webhooks/service.d.ts +313 -0
- package/dist/webhooks/service.js +1005 -0
- package/dist/webhooks/service.js.map +1 -0
- package/dist/webhooks/signing.d.ts +3 -0
- package/dist/webhooks/signing.js +36 -0
- package/dist/webhooks/signing.js.map +1 -0
- package/dist/webhooks/slack.d.ts +4 -0
- package/dist/webhooks/slack.js +56 -0
- package/dist/webhooks/slack.js.map +1 -0
- package/dist/webhooks/source.d.ts +178 -0
- package/dist/webhooks/source.js +23 -0
- package/dist/webhooks/source.js.map +1 -0
- package/dist/webhooks/storage.d.ts +21 -0
- package/dist/webhooks/storage.js +202 -0
- package/dist/webhooks/storage.js.map +1 -0
- package/dist/webhooks/transport.d.ts +30 -0
- package/dist/webhooks/transport.js +235 -0
- package/dist/webhooks/transport.js.map +1 -0
- package/dist/workflows/completion-reason.d.ts +4 -0
- package/dist/workflows/completion-reason.js +39 -0
- package/dist/workflows/completion-reason.js.map +1 -0
- package/dist/workflows/queued-bounds.d.ts +31 -0
- package/dist/workflows/queued-bounds.js +81 -0
- package/dist/workflows/queued-bounds.js.map +1 -0
- package/dist/workflows/run.d.ts +113 -20
- package/dist/workflows/run.js +726 -191
- package/dist/workflows/run.js.map +1 -1
- package/dist/workspace/config.d.ts +8 -0
- package/dist/workspace/config.js +62 -19
- package/dist/workspace/config.js.map +1 -1
- package/dist/workspace/ui-state.d.ts +4 -2
- package/dist/workspace/ui-state.js +13 -9
- package/dist/workspace/ui-state.js.map +1 -1
- package/package.json +4 -3
- package/scripts/check-pack.mjs +2 -4
- package/scripts/mock-claude.mjs +30 -5
- package/scripts/webhooks-schema.mjs +5 -0
- package/web/dist/assets/23I4SOAX-B4MCXPfc.js +2 -0
- package/web/dist/assets/26H2HVXD-DnN7AaEY.js +2 -0
- package/web/dist/assets/2IZ5MNOH-CgfSuFFL.js +1 -0
- package/web/dist/assets/2P3CZEXH-kInGrvHu.js +2 -0
- package/web/dist/assets/3E5HRNYT-DLbBxF6y.js +5 -0
- package/web/dist/assets/3JIRLDUO-B9tVJ8E_.js +1 -0
- package/web/dist/assets/5MJ3UKSG-nDfsJSF7.js +2 -0
- package/web/dist/assets/5THPTBWS-Ce_hS451.js +1 -0
- package/web/dist/assets/7OAKGN26-t-mlpHkx.js +25 -0
- package/web/dist/assets/7WLXJQOR-D6QVYUu9.js +1 -0
- package/web/dist/assets/A255FCTW-Bx0Z-P1v.js +1 -0
- package/web/dist/assets/AM43MQ64-C_UmP8Ka.js +2 -0
- package/web/dist/assets/AOZTNTMC-Di2iVwCo.js +5 -0
- package/web/dist/assets/AQNLM6KG-CcWg0kGq.js +4 -0
- package/web/dist/assets/BNU2RHQB-M1l5nkNs.js +2 -0
- package/web/dist/assets/C5HTQT3I-B50g1XeK.js +4 -0
- package/web/dist/assets/CPKRWH5G-DHdVktma.js +12 -0
- package/web/dist/assets/CUVCMPQX-75g4RQep.js +1 -0
- package/web/dist/assets/D4V2MWCI-Bm34L6wL.js +1 -0
- package/web/dist/assets/DHKBVIA3-Db-JqVOb.js +1 -0
- package/web/dist/assets/DKTLEL5E-DciMwFJ1.js +1 -0
- package/web/dist/assets/DUZNPW7S-4AKJemkg.js +2 -0
- package/web/dist/assets/E3FWOBN4-AT8jzYgb.js +4 -0
- package/web/dist/assets/E65FQMJL-eiWd8F8c.js +1 -0
- package/web/dist/assets/FTXIJQGB-CggtIYAM.js +1 -0
- package/web/dist/assets/G3MDBVQH-BZmnMkFw.js +1 -0
- package/web/dist/assets/G3OATVW2-D5zJu3ib.js +8 -0
- package/web/dist/assets/GUJTEFZK-DPEFMf5Q.js +1 -0
- package/web/dist/assets/IHVFDU4A-pP0Mb5Iu.js +10 -0
- package/web/dist/assets/IV52FOAS-jWHN2JLM.js +5 -0
- package/web/dist/assets/JTJEEBDN-DZeTEWqk.js +2 -0
- package/web/dist/assets/K7FUICZ3-C9JebvoP.js +2 -0
- package/web/dist/assets/LHH2HHRB-DZSZGD4x.js +2 -0
- package/web/dist/assets/MSPQPZZY-DOCBMJ70.js +4 -0
- package/web/dist/assets/OB6ZFVKF-D6V5f56z.js +2 -0
- package/web/dist/assets/PLTZDMI2-DltbYIQQ.js +1 -0
- package/web/dist/assets/R7EPXMMD-Dk_RDmvY.js +5 -0
- package/web/dist/assets/RVARI57O-CgA1WoRv.js +1 -0
- package/web/dist/assets/SPBWZ4VS-8FnOEPzw.js +1 -0
- package/web/dist/assets/SR7OOV3Q-3uZPNU1G.js +4 -0
- package/web/dist/assets/STAXBNH4-C4N6ZLTR.js +2 -0
- package/web/dist/assets/SXFARSFO-DHdVQB4G.js +1 -0
- package/web/dist/assets/TC77ISAL-BgUbI3Of.js +2 -0
- package/web/dist/assets/TYIQQHVC-S2gy0AUp.js +13 -0
- package/web/dist/assets/TZUXETIT-C6qyTEYa.js +2 -0
- package/web/dist/assets/U7N72BGE-8vTdAst9.js +6 -0
- package/web/dist/assets/UFPIB6EZ-BVjLTP07.js +3 -0
- package/web/dist/assets/UO52YEYL-EHYBNpY5.js +3 -0
- package/web/dist/assets/VIK3ONSK-Cton0Rgg.js +2 -0
- package/web/dist/assets/VVVO4ZVP-CdFWI9EE.js +2 -0
- package/web/dist/assets/WRGXZO53-DYQ4OW92.js +3 -0
- package/web/dist/assets/X5SG7MGC-DtC_vaXe.js +2 -0
- package/web/dist/assets/XLHPVVFU-MQkW7HpM.js +2 -0
- package/web/dist/assets/XXYPNCD5-Ib-xj97c.js +5 -0
- package/web/dist/assets/Z6WRYFJC-C6TE3q4J.js +7 -0
- package/web/dist/assets/ZI2QNEGF-DwOKsV8B.js +8 -0
- package/web/dist/assets/{agent-task-pickers-CJAx53eR.js → agent-task-pickers-C_2o0KYX.js} +1 -1
- package/web/dist/assets/{alert-dialog-BugYooRk.js → alert-dialog-fzSWCIyG.js} +1 -1
- package/web/dist/assets/arrow-left-CpV00riO.js +1 -0
- package/web/dist/assets/{automation-format-Bxe-TVRX.js → automation-format-BgAhuFNq.js} +1 -1
- package/web/dist/assets/automations-route-Ca648Wyc.js +1 -0
- package/web/dist/assets/bundle-mjs-rHxsej31.js +1 -0
- package/web/dist/assets/button-vdGgKu1b.js +100 -0
- package/web/dist/assets/{centered-state-Cm8_dS47.js → centered-state-C1nDqaTs.js} +1 -1
- package/web/dist/assets/check-DA3yaTey.js +1 -0
- package/web/dist/assets/chevron-left-D1eW2pzs.js +1 -0
- package/web/dist/assets/chevron-right-DwqBinJp.js +1 -0
- package/web/dist/assets/{chunk-BO2N2NFS-CFvlB0rH.js → chunk-BO2N2NFS-Bde6epwZ.js} +4 -4
- package/web/dist/assets/circle-check-G0BDdNX3.js +1 -0
- package/web/dist/assets/clipboard-B9AGRj3s.js +1 -0
- package/web/dist/assets/{collapsible-BoDLSmkP.js → collapsible-Ci-k9Y0m.js} +1 -1
- package/web/dist/assets/{commit-list-C_l41PzR.js → commit-list-B8qutNJ9.js} +1 -1
- package/web/dist/assets/{compare-variants-Du6vJ7FF.js → compare-variants-CD-H9QV0.js} +1 -1
- package/web/dist/assets/dashboard-BuNIEyIc.js +44 -0
- package/web/dist/assets/diff-DdDwJ41q.js +3 -0
- package/web/dist/assets/{diff-view-D7b6T1ik.js → diff-view-D4eUaNtD.js} +4 -4
- package/web/dist/assets/{download-CHsOA7RH.js → download-C9cyRK4D.js} +1 -1
- package/web/dist/assets/facet-filter-BpaMiUU2.js +5 -0
- package/web/dist/assets/{file-Bu00nVUj.js → file-CcDDcqzK.js} +1 -1
- package/web/dist/assets/file-preview-DyqTWb0f.js +2 -0
- package/web/dist/assets/{file-text-CISqp5LY.js → file-text-C5N0APxx.js} +1 -1
- package/web/dist/assets/{git-pull-request-draft-D2Lm-pPz.js → git-pull-request-draft-Bqwhflhv.js} +1 -1
- package/web/dist/assets/git-tab-loading-BXSixY5p.js +1 -0
- package/web/dist/assets/git-toolbar-CB3F5Ztu.js +1 -0
- package/web/dist/assets/github-CjHl4MMe.js +1 -0
- package/web/dist/assets/{highlighted-body-OFNGDK62-CDHv8VkT.js → highlighted-body-OFNGDK62-k8gmH63p.js} +1 -1
- package/web/dist/assets/{host-usage-CRNpjHr0.js → host-usage-EIcPz8s9.js} +1 -1
- package/web/dist/assets/{icon-tooltip-BrV8FoZY.js → icon-tooltip-CCXhXgac.js} +1 -1
- package/web/dist/assets/index-C_k6g6fh.js +29 -0
- package/web/dist/assets/index-DvagaaKL.css +2 -0
- package/web/dist/assets/{input-6sILF4ZL.js → input-DXFchFdf.js} +1 -1
- package/web/dist/assets/layout-cards-DrC84hQa.js +1 -0
- package/web/dist/assets/lazy-DaFjwB-q.js +11 -0
- package/web/dist/assets/lib-xgA2N1t8.js +1 -0
- package/web/dist/assets/loader-circle-B2Lhi0xN.js +1 -0
- package/web/dist/assets/{markdown-DDUUmNxl.js → markdown-3VbTQcD0.js} +1 -1
- package/web/dist/assets/markdown-DxPHdOwB.js +4 -0
- package/web/dist/assets/mermaid-GHXKKRXX-CQo8vsdt.js +1 -0
- package/web/dist/assets/{message-square-CUcOsOeK.js → message-square-9JNzSy42.js} +1 -1
- package/web/dist/assets/plus-BHSN5Uog.js +1 -0
- package/web/dist/assets/preload-helper-Czpn1I53.js +1 -0
- package/web/dist/assets/{project-router-Uv5K_t7U.js → project-router-BzcW5R3O.js} +2 -2
- package/web/dist/assets/queries-XYjXpa8s.js +1 -0
- package/web/dist/assets/reference-chip-JX3G6Wkk.js +1 -0
- package/web/dist/assets/repo-git-CZTtXETi.js +1 -0
- package/web/dist/assets/{run-diff-CaQSFkcv.js → run-diff-C_s9tHfS.js} +2 -2
- package/web/dist/assets/{save-D8UGIAXq.js → save-B4O7rFCS.js} +1 -1
- package/web/dist/assets/{scroll-within-CEDDAUiO.js → scroll-within-DTBX-TR6.js} +1 -1
- package/web/dist/assets/{search-x-CG0S6SUu.js → search-x-CQPbQgV6.js} +1 -1
- package/web/dist/assets/{settings-2-ogt1zu3P.js → settings-2-CrmZbb_8.js} +1 -1
- package/web/dist/assets/skills-DXkSdyb8.js +1 -0
- package/web/dist/assets/{square-VAdlYQJn.js → square-DCg6avOT.js} +1 -1
- package/web/dist/assets/{tabs-BP29AtfS.js → tabs-Cb8MmIEQ.js} +1 -1
- package/web/dist/assets/{tag-4juVmU06.js → tag-CEWhwfVf.js} +1 -1
- package/web/dist/assets/task-commits-BruCWCkF.js +1 -0
- package/web/dist/assets/{task-graph-4GzVwwdu.js → task-graph-D_OLXJSk.js} +1 -1
- package/web/dist/assets/{task-notes-CCT7q8Fr.js → task-notes-DzOdZjqZ.js} +1 -1
- package/web/dist/assets/task-workspace-C5Conyc1.js +29 -0
- package/web/dist/assets/{terminal-DEjD4n5K.js → terminal-BVAfyHZI.js} +1 -1
- package/web/dist/assets/terminal-drawer-Dcg67RS8.js +3 -0
- package/web/dist/assets/{textarea-DJjpA11v.js → textarea-DywMDkfl.js} +1 -1
- package/web/dist/assets/{token-metrics-BJ1naBNS.js → token-metrics-BiFl2ovY.js} +1 -1
- package/web/dist/assets/{tooltip-BieGyrAz.js → tooltip-7suUQClM.js} +1 -1
- package/web/dist/assets/{tracker-DitRxloO.js → tracker-BFYcbTEV.js} +2 -2
- package/web/dist/assets/{triangle-alert-lwmk_SnN.js → triangle-alert-hMpQrXJS.js} +1 -1
- package/web/dist/assets/{upload-Dx8IzFX_.js → upload-Ddh5Fb-A.js} +1 -1
- package/web/dist/assets/use-now-BlhSvP80.js +1 -0
- package/web/dist/assets/{use-submit-shortcut-B-uDwQhP.js → use-submit-shortcut-BC7gmgDS.js} +1 -1
- package/web/dist/assets/workflow-graph-BljUjNdF.js +13 -0
- package/web/dist/assets/worktree-lifecycle-operation-psNUwGwT.js +18 -0
- package/web/dist/index.html +41 -41
- package/web/dist/assets/arrow-left-FG-BtI91.js +0 -1
- package/web/dist/assets/automations-route-BRN9qRg1.js +0 -1
- package/web/dist/assets/bundle-mjs-BT31bpU6.js +0 -1
- package/web/dist/assets/button-DFlig-3W.js +0 -100
- package/web/dist/assets/check-Bg7-Ecuy.js +0 -1
- package/web/dist/assets/chevron-left-Cd_qkrfl.js +0 -1
- package/web/dist/assets/chevron-right-7BUoNLSN.js +0 -1
- package/web/dist/assets/circle-check-D3dWBsEI.js +0 -1
- package/web/dist/assets/dashboard-BDtFQg4f.js +0 -44
- package/web/dist/assets/diff-DZjcij_W.js +0 -3
- package/web/dist/assets/diff-stat-BIAV32IP.js +0 -1
- package/web/dist/assets/facet-filter-BCQvQXmA.js +0 -5
- package/web/dist/assets/file-preview-B0UXYkxB.js +0 -2
- package/web/dist/assets/git-tab-loading-Dcf8fCoC.js +0 -1
- package/web/dist/assets/git-toolbar-aXyXLu2P.js +0 -1
- package/web/dist/assets/github-PjL79xgT.js +0 -1
- package/web/dist/assets/index-DvwYGTi3.css +0 -2
- package/web/dist/assets/index-DxwI2MZD.js +0 -25
- package/web/dist/assets/layout-cards-Det2whh-.js +0 -1
- package/web/dist/assets/lib-BQXq3kEf.js +0 -1
- package/web/dist/assets/loader-circle-DDkRpp8X.js +0 -1
- package/web/dist/assets/markdown-lc7gwiQQ.js +0 -4
- package/web/dist/assets/mermaid-GHXKKRXX-CbLTa2tM.js +0 -1
- package/web/dist/assets/plus-BqHBcC4w.js +0 -1
- package/web/dist/assets/queries-C09jaXiS.js +0 -1
- package/web/dist/assets/reference-chip-CHF-Sbml.js +0 -1
- package/web/dist/assets/repo-git-DT0rQqvz.js +0 -1
- package/web/dist/assets/skills-Cf8xEPei.js +0 -1
- package/web/dist/assets/task-commits-CyO2Q8jS.js +0 -1
- package/web/dist/assets/task-workspace-C6o0DzgB.js +0 -29
- package/web/dist/assets/terminal-drawer-TV4K7S4u.js +0 -3
- package/web/dist/assets/use-now-Cr9QvR5I.js +0 -1
- package/web/dist/assets/workflow-graph-g3f0xPwZ.js +0 -13
- package/web/dist/assets/worktree-lifecycle-operation-COUqhS7A.js +0 -18
- package/web/dist/assets/x-BrRT8S7Q.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ca as r}from"./queries-C09jaXiS.js";import{r as i}from"./button-DFlig-3W.js";import{i as a}from"./bundle-mjs-BT31bpU6.js";var o=e(t(),1),s=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,c=/^[\\/]{2}/;function l(e,t){return t+e.replace(/\\/g,`/`)}var u=`popstate`;function d(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function f(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return _(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:v(t)}return b(t,n,null,e)}function p(e,t){if(e===!1||e==null)throw Error(t)}function m(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function h(){return Math.random().toString(36).substring(2,10)}function g(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function _(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?y(t):t,state:n,key:t&&t.key||r||h(),mask:i}}function v({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function y(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function b(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=f();l??(l=0,o.replaceState({...o.state,idx:l},``));function f(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=f(),t=e==null?null:e-l;l=e,c&&c({action:s,location:y.location,delta:t})}function m(e,t){s=`PUSH`;let r=d(e)?e:_(y.location,e,t);n&&n(r,e),l=f()+1;let u=g(r,l),p=y.createHref(r.mask||r);try{o.pushState(u,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&c&&c({action:s,location:y.location,delta:1})}function h(e,t){s=`REPLACE`;let r=d(e)?e:_(y.location,e,t);n&&n(r,e),l=f();let i=g(r,l),u=y.createHref(r.mask||r);o.replaceState(i,``,u),a&&c&&c({action:s,location:y.location,delta:0})}function v(e){return x(i,e)}let y={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(u,p),c=e,()=>{i.removeEventListener(u,p),c=null}},createHref(e){return t(i,e)},createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return y}function x(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),p(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:v(t);return i=i.replace(/ $/,`%20`),!n&&c.test(i)&&(i=r+i),new URL(i,r)}function S(e,t,n=`/`){return C(e,t,n,!1)}function C(e,t,n,r,i){let a=O((typeof t==`string`?y(t):t).pathname||`/`,n);if(a==null)return null;let o=i??T(e),s=null,c=me(a);for(let e=0;s==null&&e<o.length;++e)s=de(o[e],c,r);return s}function w(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function T(e){let t=E(e);return te(t),t}function E(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;p(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=A([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(p(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),E(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:le(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=pe(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ee(e.path))a(e,t,!0,n)}),t}function ee(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ee(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function te(e){e.sort((e,t)=>e.score===t.score?ue(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ne=/^:[\w-]+$/,re=3,ie=2,ae=1,oe=10,se=-2,ce=e=>e===`*`;function le(e,t){let n=e.split(`/`),r=n.length;return n.some(ce)&&(r+=se),t&&(r+=ie),n.filter(e=>!ce(e)).reduce((e,t)=>e+(ne.test(t)?re:t===``?ae:oe),r)}function ue(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function de(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?fe(u,l,s.matcher,s.compiledParams):D(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=D({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:A([a,d.pathname]),pathnameBase:xe(A([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=A([a,d.pathnameBase]))}return o}function D(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=pe(e.path,e.caseSensitive,e.end);return fe(e,t,n,r)}function fe(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function pe(e,t=!1,n=!0){m(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function me(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return m(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function O(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function he(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?y(e):e,a;return n?(n=be(n),a=n.startsWith(`/`)?ge(n.substring(1),`/`):ge(n,t)):a=t,{pathname:a,search:Se(r),hash:Ce(i)}}function ge(e,t){let n=j(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function _e(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ve(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ye(e){let t=ve(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function k(e,t,n,r=!1){let i;typeof e==`string`?i=y(e):(i={...e},p(!i.pathname||!i.pathname.includes(`?`),_e(`?`,`pathname`,`search`,i)),p(!i.pathname||!i.pathname.includes(`#`),_e(`#`,`pathname`,`hash`,i)),p(!i.search||!i.search.includes(`#`),_e(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=he(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var be=e=>e.replace(/[\\/]{2,}/g,`/`),A=e=>be(e.join(`/`)),j=e=>e.replace(/\/+$/,``),xe=e=>j(e).replace(/^\/*/,`/`),Se=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ce=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,we=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Te(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ee(e){return A(e.map(e=>e.route.path).filter(Boolean))||`/`}var De=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Oe(e,t){let n=e;if(typeof n!=`string`||!s.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(De)try{let e=new URL(window.location.href),r=c.test(n)?new URL(l(n,e.protocol)):new URL(n),a=O(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{m(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ke=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(ke);var Ae=[`GET`,...ke];new Set(Ae);var je=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Me(e){try{return je.includes(new URL(e).protocol)}catch{return!1}}var M=o.createContext(null);M.displayName=`DataRouter`;var N=o.createContext(null);N.displayName=`DataRouterState`;var Ne=o.createContext(!1);function Pe(){return o.useContext(Ne)}var Fe=o.createContext({isTransitioning:!1});Fe.displayName=`ViewTransition`;var Ie=o.createContext(new Map);Ie.displayName=`Fetchers`;var Le=o.createContext(null);Le.displayName=`Await`;var P=o.createContext(null);P.displayName=`Navigation`;var F=o.createContext(null);F.displayName=`Location`;var I=o.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName=`Route`;var Re=o.createContext(null);Re.displayName=`RouteError`;var ze=`REACT_ROUTER_ERROR`,Be=`REDIRECT`,Ve=`ROUTE_ERROR_RESPONSE`;function He(e){if(e.startsWith(`${ze}:${Be}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ue(e){if(e.startsWith(`${ze}:${Ve}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new we(t.status,t.statusText,t.data)}catch{}}function We(e,{relative:t}={}){p(L(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=o.useContext(P),{hash:i,pathname:a,search:s}=B(e,{relative:t}),c=a;return n!==`/`&&(c=a===`/`?n:A([n,a])),r.createHref({pathname:c,search:s,hash:i})}function L(){return o.useContext(F)!=null}function R(){return p(L(),`useLocation() may be used only in the context of a <Router> component.`),o.useContext(F).location}function Ge(){return o.useContext(F).navigationType}var Ke=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function qe(e){o.useContext(P).static||o.useLayoutEffect(e)}function z(){let{isDataRoute:e}=o.useContext(I);return e?gt():Je()}function Je(){p(L(),`useNavigate() may be used only in the context of a <Router> component.`);let e=o.useContext(M),{basename:t,navigator:n}=o.useContext(P),{matches:r}=o.useContext(I),{pathname:i}=R(),a=JSON.stringify(ye(r)),s=o.useRef(!1);return qe(()=>{s.current=!0}),o.useCallback((r,o={})=>{if(m(s.current,Ke),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=k(r,JSON.parse(a),i,o.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:A([t,c.pathname])),(o.replace?n.replace:n.push)(c,o.state,o)},[t,n,a,i,e])}var Ye=o.createContext(null);function Xe(e){let t=o.useContext(I).outlet;return o.useMemo(()=>t&&o.createElement(Ye.Provider,{value:e},t),[t,e])}function Ze(){let{matches:e}=o.useContext(I);return e[e.length-1]?.params??{}}function B(e,{relative:t}={}){let{matches:n}=o.useContext(I),{pathname:r}=R(),i=JSON.stringify(ye(n));return o.useMemo(()=>k(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Qe(e,t){return $e(e,t)}function $e(e,t,n){p(L(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=o.useContext(P),{matches:i}=o.useContext(I),a=i[i.length-1],s=a?a.params:{},c=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;vt(c,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ea as r}from"./queries-XYjXpa8s.js";import{r as i}from"./button-vdGgKu1b.js";import{t as a}from"./preload-helper-Czpn1I53.js";var o=e(t(),1),s=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,c=/^[\\/]{2}/;function l(e,t){return t+e.replace(/\\/g,`/`)}var u=`popstate`;function d(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function f(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return _(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:v(t)}return b(t,n,null,e)}function p(e,t){if(e===!1||e==null)throw Error(t)}function m(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function h(){return Math.random().toString(36).substring(2,10)}function g(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function _(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?y(t):t,state:n,key:t&&t.key||r||h(),mask:i}}function v({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function y(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function b(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=f();l??(l=0,o.replaceState({...o.state,idx:l},``));function f(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=f(),t=e==null?null:e-l;l=e,c&&c({action:s,location:y.location,delta:t})}function m(e,t){s=`PUSH`;let r=d(e)?e:_(y.location,e,t);n&&n(r,e),l=f()+1;let u=g(r,l),p=y.createHref(r.mask||r);try{o.pushState(u,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&c&&c({action:s,location:y.location,delta:1})}function h(e,t){s=`REPLACE`;let r=d(e)?e:_(y.location,e,t);n&&n(r,e),l=f();let i=g(r,l),u=y.createHref(r.mask||r);o.replaceState(i,``,u),a&&c&&c({action:s,location:y.location,delta:0})}function v(e){return x(i,e)}let y={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(u,p),c=e,()=>{i.removeEventListener(u,p),c=null}},createHref(e){return t(i,e)},createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return y}function x(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),p(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:v(t);return i=i.replace(/ $/,`%20`),!n&&c.test(i)&&(i=r+i),new URL(i,r)}function S(e,t,n=`/`){return C(e,t,n,!1)}function C(e,t,n,r,i){let a=O((typeof t==`string`?y(t):t).pathname||`/`,n);if(a==null)return null;let o=i??T(e),s=null,c=me(a);for(let e=0;s==null&&e<o.length;++e)s=de(o[e],c,r);return s}function w(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function T(e){let t=E(e);return te(t),t}function E(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;p(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=A([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(p(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),E(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:le(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=pe(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ee(e.path))a(e,t,!0,n)}),t}function ee(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ee(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function te(e){e.sort((e,t)=>e.score===t.score?ue(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ne=/^:[\w-]+$/,re=3,ie=2,ae=1,oe=10,se=-2,ce=e=>e===`*`;function le(e,t){let n=e.split(`/`),r=n.length;return n.some(ce)&&(r+=se),t&&(r+=ie),n.filter(e=>!ce(e)).reduce((e,t)=>e+(ne.test(t)?re:t===``?ae:oe),r)}function ue(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function de(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?fe(u,l,s.matcher,s.compiledParams):D(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=D({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:A([a,d.pathname]),pathnameBase:xe(A([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=A([a,d.pathnameBase]))}return o}function D(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=pe(e.path,e.caseSensitive,e.end);return fe(e,t,n,r)}function fe(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function pe(e,t=!1,n=!0){m(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function me(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return m(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function O(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function he(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?y(e):e,a;return n?(n=be(n),a=n.startsWith(`/`)?ge(n.substring(1),`/`):ge(n,t)):a=t,{pathname:a,search:Se(r),hash:Ce(i)}}function ge(e,t){let n=j(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function _e(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ve(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ye(e){let t=ve(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function k(e,t,n,r=!1){let i;typeof e==`string`?i=y(e):(i={...e},p(!i.pathname||!i.pathname.includes(`?`),_e(`?`,`pathname`,`search`,i)),p(!i.pathname||!i.pathname.includes(`#`),_e(`#`,`pathname`,`hash`,i)),p(!i.search||!i.search.includes(`#`),_e(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=he(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var be=e=>e.replace(/[\\/]{2,}/g,`/`),A=e=>be(e.join(`/`)),j=e=>e.replace(/\/+$/,``),xe=e=>j(e).replace(/^\/*/,`/`),Se=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ce=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,we=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Te(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ee(e){return A(e.map(e=>e.route.path).filter(Boolean))||`/`}var De=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Oe(e,t){let n=e;if(typeof n!=`string`||!s.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(De)try{let e=new URL(window.location.href),r=c.test(n)?new URL(l(n,e.protocol)):new URL(n),a=O(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{m(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ke=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(ke);var Ae=[`GET`,...ke];new Set(Ae);var je=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Me(e){try{return je.includes(new URL(e).protocol)}catch{return!1}}var M=o.createContext(null);M.displayName=`DataRouter`;var N=o.createContext(null);N.displayName=`DataRouterState`;var Ne=o.createContext(!1);function Pe(){return o.useContext(Ne)}var Fe=o.createContext({isTransitioning:!1});Fe.displayName=`ViewTransition`;var Ie=o.createContext(new Map);Ie.displayName=`Fetchers`;var Le=o.createContext(null);Le.displayName=`Await`;var P=o.createContext(null);P.displayName=`Navigation`;var F=o.createContext(null);F.displayName=`Location`;var I=o.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName=`Route`;var Re=o.createContext(null);Re.displayName=`RouteError`;var ze=`REACT_ROUTER_ERROR`,Be=`REDIRECT`,Ve=`ROUTE_ERROR_RESPONSE`;function He(e){if(e.startsWith(`${ze}:${Be}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ue(e){if(e.startsWith(`${ze}:${Ve}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new we(t.status,t.statusText,t.data)}catch{}}function We(e,{relative:t}={}){p(L(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=o.useContext(P),{hash:i,pathname:a,search:s}=B(e,{relative:t}),c=a;return n!==`/`&&(c=a===`/`?n:A([n,a])),r.createHref({pathname:c,search:s,hash:i})}function L(){return o.useContext(F)!=null}function R(){return p(L(),`useLocation() may be used only in the context of a <Router> component.`),o.useContext(F).location}function Ge(){return o.useContext(F).navigationType}var Ke=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function qe(e){o.useContext(P).static||o.useLayoutEffect(e)}function z(){let{isDataRoute:e}=o.useContext(I);return e?gt():Je()}function Je(){p(L(),`useNavigate() may be used only in the context of a <Router> component.`);let e=o.useContext(M),{basename:t,navigator:n}=o.useContext(P),{matches:r}=o.useContext(I),{pathname:i}=R(),a=JSON.stringify(ye(r)),s=o.useRef(!1);return qe(()=>{s.current=!0}),o.useCallback((r,o={})=>{if(m(s.current,Ke),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=k(r,JSON.parse(a),i,o.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:A([t,c.pathname])),(o.replace?n.replace:n.push)(c,o.state,o)},[t,n,a,i,e])}var Ye=o.createContext(null);function Xe(e){let t=o.useContext(I).outlet;return o.useMemo(()=>t&&o.createElement(Ye.Provider,{value:e},t),[t,e])}function Ze(){let{matches:e}=o.useContext(I);return e[e.length-1]?.params??{}}function B(e,{relative:t}={}){let{matches:n}=o.useContext(I),{pathname:r}=R(),i=JSON.stringify(ye(n));return o.useMemo(()=>k(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Qe(e,t){return $e(e,t)}function $e(e,t,n){p(L(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=o.useContext(P),{matches:i}=o.useContext(I),a=i[i.length-1],s=a?a.params:{},c=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;vt(c,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
2
|
|
|
3
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=R(),f;if(t){let e=typeof t==`string`?y(t):t;p(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let h=f.pathname||`/`,g=h;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);g=`/`+h.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):S(e,{pathname:g});m(u||_!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),m(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let v=ot(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:A([l,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:A([l,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&v?o.createElement(F.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},v):v}function et(){let e=ht(),t=Te(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=o.createElement(o.Fragment,null,o.createElement(`p`,null,`💿 Hey developer 👋`),o.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,o.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,o.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),o.createElement(o.Fragment,null,o.createElement(`h2`,null,`Unexpected Application Error!`),o.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?o.createElement(`pre`,{style:i},n):null,s)}var tt=o.createElement(et,null),nt=class extends o.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ue(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:o.createElement(I.Provider,{value:this.props.routeContext},o.createElement(Re.Provider,{value:e,children:this.props.component}));return this.context?o.createElement(it,{error:e},t):t}};nt.contextType=Ne;var rt=new WeakMap;function it({children:e,error:t}){let{basename:n}=o.useContext(P);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=He(t.digest);if(e){let r=rt.get(t);if(r)throw r;let i=Oe(e.location,n),a=i.absoluteURL||i.to;if(Me(a))throw Error(`Invalid redirect location`);if(De&&!rt.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw rt.set(t,n),n}return o.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function at({routeContext:e,match:t,children:n}){let r=o.useContext(M);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),o.createElement(I.Provider,{value:e},n)}function ot(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);p(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,c=-1;if(n&&r){s=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:a}=r,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||o){n.isStatic&&(s=!0),i=c>=0?i.slice(0,c+1):[i[0]];break}}}}let l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ee(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;r&&(d=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||tt,s&&(c<0&&l===0?(vt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?o.createElement(n.route.Component,null):n.route.element?n.route.element:e,o.createElement(at,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?o.createElement(nt,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function st(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ct(e){let t=o.useContext(M);return p(t,st(e)),t}function lt(e){let t=o.useContext(N);return p(t,st(e)),t}function ut(e){let t=o.useContext(I);return p(t,st(e)),t}function dt(e){let t=ut(e),n=t.matches[t.matches.length-1];return p(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ft(){return dt(`useRouteId`)}function pt(){let e=lt(`useNavigation`);return o.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function mt(){let{matches:e,loaderData:t}=lt(`useMatches`);return o.useMemo(()=>e.map(e=>w(e,t)),[e,t])}function ht(){let e=o.useContext(Re),t=lt(`useRouteError`),n=dt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function gt(){let{router:e}=ct(`useNavigate`),t=dt(`useNavigate`),n=o.useRef(!1);return qe(()=>{n.current=!0}),o.useCallback(async(r,i={})=>{m(n.current,Ke),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var _t={};function vt(e,t,n){!t&&!_t[e]&&(_t[e]=!0,m(!1,n))}o.memo(yt);function yt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return $e(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function bt({to:e,replace:t,state:n,relative:r}){p(L(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=o.useContext(P);m(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=o.useContext(I),{pathname:s}=R(),c=z(),l=k(e,ye(a),s,r===`path`),u=JSON.stringify(l);return o.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function xt(e){return Xe(e.context)}function St(e){p(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ct({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:s}){p(!L(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=o.useMemo(()=>({basename:c,navigator:i,static:a,useTransitions:s,future:{}}),[c,i,a,s]);typeof n==`string`&&(n=y(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:h=null,key:g=`default`,mask:_}=n,v=o.useMemo(()=>{let e=O(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:h,key:g,mask:_},navigationType:r}},[c,u,d,f,h,g,r,_]);return m(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:o.createElement(P.Provider,{value:l},o.createElement(F.Provider,{children:t,value:v}))}function wt({children:e,location:t}){return Qe(Tt(e),t)}o.Component;function Tt(e,t=[]){let n=[];return o.Children.forEach(e,(e,r)=>{if(!o.isValidElement(e))return;let i=[...t,r];if(e.type===o.Fragment){n.push.apply(n,Tt(e.props.children,i));return}p(e.type===St,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),p(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Tt(e.props.children,i)),n.push(a)}),n}var V=`get`,H=`application/x-www-form-urlencoded`;function U(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Et(e){return U(e)&&e.tagName.toLowerCase()===`button`}function Dt(e){return U(e)&&e.tagName.toLowerCase()===`form`}function Ot(e){return U(e)&&e.tagName.toLowerCase()===`input`}function kt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function At(e,t){return e.button===0&&(!t||t===`_self`)&&!kt(e)}function jt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Mt(e,t){let n=jt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var W=null;function Nt(){if(W===null)try{new FormData(document.createElement(`form`),0),W=!1}catch{W=!0}return W}var Pt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ft(e){return e!=null&&!Pt.has(e)?(m(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${H}"`),null):e}function It(e,t){let n,r,i,a,o;if(Dt(e)){let o=e.getAttribute(`action`);r=o?O(o,t):null,n=e.getAttribute(`method`)||V,i=Ft(e.getAttribute(`enctype`))||H,a=new FormData(e)}else if(Et(e)||Ot(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?O(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||V,i=Ft(e.getAttribute(`formenctype`))||Ft(o.getAttribute(`enctype`))||H,a=new FormData(o,e),!Nt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(U(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=V,r=null,i=H,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Lt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Rt=/[&><\u2028\u2029]/g;function zt(e){return e.replace(Rt,e=>Lt[e])}function Bt(e,t){if(e===!1||e==null)throw Error(t)}function Vt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&O(i.pathname,t)===`/`?i.pathname=`${j(t)}/_root.${r}`:i.pathname=`${j(i.pathname)}.${r}`,i}async function Ht(e,t){if(e.id in t)return t[e.id];try{let n=await a(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ut(e){return e!=null&&typeof e.page==`string`}function Wt(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Gt(e,t,n){return Xt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Ht(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Wt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Kt(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function qt(e,t,{includeHydrateFallback:n}={}){return Jt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Jt(e){return[...new Set(e)]}function Yt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Xt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ut(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Yt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Zt(){let e=o.useContext(M);return Bt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Qt(){let e=o.useContext(N);return Bt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var G=o.createContext(void 0);G.displayName=`FrameworkContext`;function K(){let e=o.useContext(G);return Bt(e,`You must render this element inside a <HydratedRouter> element`),e}function $t(e,t){let n=o.useContext(G),[r,i]=o.useState(!1),[a,s]=o.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=o.useRef(null);o.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),o.useEffect(()=>{if(r){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),s(!1)};return n?e===`intent`?[a,p,{onFocus:q(c,m),onBlur:q(l,h),onMouseEnter:q(u,m),onMouseLeave:q(d,h),onTouchStart:q(f,m)}]:[a,p,{}]:[!1,p,{}]}function q(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function en({page:e,...t}){let n=Pe(),{nonce:r}=K(),{router:i}=Zt(),a=o.useMemo(()=>S(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?o.createElement(nn,{page:e,matches:a,...t}):o.createElement(rn,{page:e,matches:a,...t})):null}function tn(e){let{manifest:t,routeModules:n}=K(),[r,i]=o.useState([]);return o.useEffect(()=>{let r=!1;return Gt(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function nn({page:e,matches:t,...n}){let r=R(),{future:i}=K(),{basename:a}=Zt(),s=o.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Vt(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return o.createElement(o.Fragment,null,s.map(e=>o.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function rn({page:e,matches:t,...n}){let r=R(),{future:i,manifest:a,routeModules:s}=K(),{basename:c}=Zt(),{loaderData:l,matches:u}=Qt(),d=o.useMemo(()=>Kt(e,t,u,a,r,`data`),[e,t,u,a,r]),f=o.useMemo(()=>Kt(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=o.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,o=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:n.add(e.route.id))}),n.size===0)return[];let u=Vt(e,c,i.v8_trailingSlashAwareDataRequests,`data`);return o&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,i.v8_trailingSlashAwareDataRequests,l,r,a,d,t,e,s]),m=o.useMemo(()=>qt(f,a),[f,a]),h=tn(f);return o.createElement(o.Fragment,null,p.map(e=>o.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>o.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>o.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function an(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}o.Component;var on=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{on&&(window.__reactRouterVersion=`7.18.1`)}catch{}function sn({basename:e,children:t,useTransitions:n,window:r}){let i=o.useRef();i.current??=f({window:r,v5Compat:!0});let a=i.current,[s,c]=o.useState({action:a.action,location:a.location}),l=o.useCallback(e=>{n===!1?c(e):o.startTransition(()=>c(e))},[n]);return o.useLayoutEffect(()=>a.listen(l),[a,l]),o.createElement(Ct,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:a,useTransitions:n})}function cn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=o.useState({action:n.action,location:n.location}),s=o.useCallback(e=>{r===!1?a(e):o.startTransition(()=>a(e))},[r]);return o.useLayoutEffect(()=>n.listen(s),[n,s]),o.createElement(Ct,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}cn.displayName=`unstable_HistoryRouter`;var J=o.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:c,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=o.useContext(P),b=typeof d==`string`&&s.test(d),x=Oe(d,_);d=x.to;let S=We(d,{relative:r}),C=R(),w=null;if(c){let e=k(c,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:A([_,e.pathname])),w=v.createHref(e)}let[T,E,ee]=$t(n,h),te=mn(d,{replace:a,mask:c,state:l,target:u,preventScrollReset:f,relative:r,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function ne(t){e&&e(t),t.defaultPrevented||te(t)}let re=!(x.isExternal||i),ie=o.createElement(`a`,{...h,...ee,href:(re?w:void 0)||x.absoluteURL||S,onClick:re?ne:e,ref:an(g,E),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?o.createElement(o.Fragment,null,ie,o.createElement(en,{page:S})):ie});J.displayName=`Link`;var ln=o.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:s,children:c,...l},u){let d=B(a,{relative:l.relative}),f=R(),p=o.useContext(N),{navigator:m,basename:h}=o.useContext(P),g=p!=null&&wn(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=O(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return o.createElement(J,{...l,"aria-current":w,className:T,ref:u,style:E,to:a,viewTransition:s},typeof c==`function`?c(C):c)});ln.displayName=`NavLink`;var un=o.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:c=V,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=o.useContext(P),v=vn(),y=yn(l,{relative:d}),b=c.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&s.test(l);return o.createElement(`form`,{ref:g,method:b,action:y,onSubmit:r?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||c,l=()=>v(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&n!==!1?o.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});un.displayName=`Form`;function dn({getKey:e,storageKey:t,...n}){let r=o.useContext(G),{basename:i}=o.useContext(P),a=R(),s=mt();Sn({getKey:e,storageKey:t});let c=o.useMemo(()=>{if(!r||!e)return null;let t=xn(a,s,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),o.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${zt(JSON.stringify(t||bn))}, ${zt(JSON.stringify(c))})`}})}dn.displayName=`ScrollRestoration`;function fn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Y(e){let t=o.useContext(M);return p(t,fn(e)),t}function pn(e){let t=o.useContext(N);return p(t,fn(e)),t}function mn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=z(),f=R(),p=B(e,{relative:s});return o.useCallback(m=>{if(At(m,t)){m.preventDefault();let t=n===void 0?v(f)===v(p):n,h=()=>d(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?o.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,s,c,l,u])}function hn(e){m(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=o.useRef(jt(e)),n=o.useRef(!1),r=R(),i=o.useMemo(()=>Mt(r.search,n.current?null:t.current),[r.search]),a=z();return[i,o.useCallback((e,t)=>{let r=jt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var gn=0,_n=()=>`__${String(++gn)}__`;function vn(){let{router:e}=Y(`useSubmit`),{basename:t}=o.useContext(P),n=ft(),r=e.fetch,i=e.navigate;return o.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=It(e,t);if(a.navigate===!1){let e=a.fetcherKey||_n();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function yn(e,{relative:t}={}){let{basename:n}=o.useContext(P),r=o.useContext(I);p(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...B(e||`.`,{relative:t})},s=R();if(e==null){a.search=s.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:A([n,a.pathname])),v(a)}var bn=`react-router-scroll-positions`,X={};function xn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:O(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Sn({getKey:e,storageKey:t}={}){let{router:n}=Y(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=pn(`useScrollRestoration`),{basename:a}=o.useContext(P),s=R(),c=mt(),l=pt();o.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Cn(o.useCallback(()=>{if(l.state===`idle`){let t=xn(s,c,a,e);X[t]=window.scrollY}try{sessionStorage.setItem(t||bn,JSON.stringify(X))}catch(e){m(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,s,c,t])),typeof document<`u`&&(o.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||bn);e&&(X=JSON.parse(e))}catch{}},[t]),o.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(X,()=>window.scrollY,e?(t,n)=>xn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),o.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{m(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[s,r,i]))}function Cn(e,t){let{capture:n}=t||{};o.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function wn(e,{relative:t}={}){let n=o.useContext(Fe);p(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Y(`useViewTransitionState`),i=B(e,{relative:t});if(!n.isTransitioning)return!1;let a=O(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=O(n.nextLocation.pathname,r)||n.nextLocation.pathname;return D(i.pathname,s)!=null||D(i.pathname,a)!=null}var Z=n(),Tn=5e3,En=200,Q=[],Dn=1,On=new Set,kn=new Set;function An(e){Q=e;for(let e of On)e()}function jn(e){return On.add(e),()=>On.delete(e)}var Mn=new Set;function Nn(e){return Mn.add(e),()=>Mn.delete(e)}function Pn(e,t){let n=setTimeout(()=>{kn.delete(n),e()},t);kn.add(n)}function Fn(e,t={}){let n={id:Dn++,message:e,tone:t.tone??`default`,...t.action?{action:t.action}:{},exiting:!1},r=t.durationMs??Tn;if(An([...Q,n]),n.tone===`danger`&&!t.reported&&!t.expected)for(let t of Mn)try{t(e)}catch{}Pn(()=>{An(Q.map(e=>e.id===n.id?{...e,exiting:!0}:e)),Pn(()=>An(Q.filter(e=>e.id!==n.id)),En)},r)}function In(){let e=(0,o.useSyncExternalStore)(jn,()=>Q);return e.length===0?null:(0,Z.jsx)(`div`,{"data-slot":`toaster`,className:`pointer-events-none fixed top-[calc(61px+env(safe-area-inset-top))] right-[calc(16px+env(safe-area-inset-right))] z-[60] flex flex-col items-end gap-2 md:top-[calc(16px+env(safe-area-inset-top))]`,children:e.map(e=>(0,Z.jsxs)(`div`,{role:`status`,"data-slot":`toast`,"data-tone":e.tone,"data-state":e.exiting?`closed`:`open`,className:i(`pointer-events-auto max-w-[min(360px,calc(100vw-32px))] rounded-md px-3.5 py-2.5 text-[13px] font-medium shadow-modal`,`motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-right-4 motion-safe:duration-200`,`motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:slide-out-to-right-4`,e.tone===`danger`?`bg-danger text-danger-foreground`:`bg-contrast text-contrast-foreground`),children:[e.message,e.action?(0,Z.jsxs)(Z.Fragment,{children:[` `,(0,Z.jsx)(`a`,{"data-slot":`toast-action`,href:e.action.href,target:`_blank`,rel:`noopener noreferrer`,className:`font-semibold underline underline-offset-2 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:e.action.label})]}):null]},e.id))})}var Ln=/^\/p\/([^/]+)(?=\/|$)/;function Rn(e){let t=Ln.exec(e)?.[1];return t===void 0?null:decodeURIComponent(t)}function zn(e){let t=Ln.exec(e);if(!t)return e;let n=e.slice(t[0].length);return n===``?`/`:n}function Bn(e,t){return!t.startsWith(`/`)||t===`/p`||t.startsWith(`/p/`)?t:`/p/${encodeURIComponent(e)}${t}`}function Vn(e,t){return e===null?t:typeof t==`string`?Bn(e,t):t.pathname===void 0?t:{...t,pathname:Bn(e,t.pathname)}}function Hn(){let{projectId:e}=r(),{pathname:t}=R();return e??Rn(t)}function $(){let e=Hn();return(0,o.useCallback)(t=>Vn(e,t),[e])}function Un(e){let{pathname:t}=R();return(0,o.useMemo)(()=>D(e,zn(t)),[e,t])}function Wn({to:e,...t}){let n=$();return(0,Z.jsx)(J,{...t,to:n(e)})}function Gn({to:e,...t}){let n=$();return(0,Z.jsx)(ln,{...t,to:n(e)})}function Kn({to:e,...t}){let n=$();return(0,Z.jsx)(bt,{...t,to:n(e)})}function qn(){let e=z(),t=$();return(0,o.useMemo)(()=>((n,r)=>typeof n==`number`?e(n):e(t(n),r)),[e,t])}export{Ge as C,z as S,hn as T,xt as _,Vn as a,D as b,qn as c,Nn as d,Fn as f,bt as g,ln as h,Rn as i,Un as l,J as m,Gn as n,zn as o,sn as p,Kn as r,Hn as s,Wn as t,In as u,St as v,Ze as w,R as x,wt as y};
|
|
3
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=R(),f;if(t){let e=typeof t==`string`?y(t):t;p(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let h=f.pathname||`/`,g=h;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);g=`/`+h.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):S(e,{pathname:g});m(u||_!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),m(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let v=ot(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:A([l,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:A([l,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&v?o.createElement(F.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},v):v}function et(){let e=ht(),t=Te(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=o.createElement(o.Fragment,null,o.createElement(`p`,null,`💿 Hey developer 👋`),o.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,o.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,o.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),o.createElement(o.Fragment,null,o.createElement(`h2`,null,`Unexpected Application Error!`),o.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?o.createElement(`pre`,{style:i},n):null,s)}var tt=o.createElement(et,null),nt=class extends o.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ue(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:o.createElement(I.Provider,{value:this.props.routeContext},o.createElement(Re.Provider,{value:e,children:this.props.component}));return this.context?o.createElement(it,{error:e},t):t}};nt.contextType=Ne;var rt=new WeakMap;function it({children:e,error:t}){let{basename:n}=o.useContext(P);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=He(t.digest);if(e){let r=rt.get(t);if(r)throw r;let i=Oe(e.location,n),a=i.absoluteURL||i.to;if(Me(a))throw Error(`Invalid redirect location`);if(De&&!rt.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw rt.set(t,n),n}return o.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function at({routeContext:e,match:t,children:n}){let r=o.useContext(M);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),o.createElement(I.Provider,{value:e},n)}function ot(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);p(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,c=-1;if(n&&r){s=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:a}=r,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||o){n.isStatic&&(s=!0),i=c>=0?i.slice(0,c+1):[i[0]];break}}}}let l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ee(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;r&&(d=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||tt,s&&(c<0&&l===0?(vt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?o.createElement(n.route.Component,null):n.route.element?n.route.element:e,o.createElement(at,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?o.createElement(nt,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function st(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ct(e){let t=o.useContext(M);return p(t,st(e)),t}function lt(e){let t=o.useContext(N);return p(t,st(e)),t}function ut(e){let t=o.useContext(I);return p(t,st(e)),t}function dt(e){let t=ut(e),n=t.matches[t.matches.length-1];return p(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ft(){return dt(`useRouteId`)}function pt(){let e=lt(`useNavigation`);return o.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function mt(){let{matches:e,loaderData:t}=lt(`useMatches`);return o.useMemo(()=>e.map(e=>w(e,t)),[e,t])}function ht(){let e=o.useContext(Re),t=lt(`useRouteError`),n=dt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function gt(){let{router:e}=ct(`useNavigate`),t=dt(`useNavigate`),n=o.useRef(!1);return qe(()=>{n.current=!0}),o.useCallback(async(r,i={})=>{m(n.current,Ke),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var _t={};function vt(e,t,n){!t&&!_t[e]&&(_t[e]=!0,m(!1,n))}o.memo(yt);function yt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return $e(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function bt({to:e,replace:t,state:n,relative:r}){p(L(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=o.useContext(P);m(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=o.useContext(I),{pathname:s}=R(),c=z(),l=k(e,ye(a),s,r===`path`),u=JSON.stringify(l);return o.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function xt(e){return Xe(e.context)}function St(e){p(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ct({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:s}){p(!L(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=o.useMemo(()=>({basename:c,navigator:i,static:a,useTransitions:s,future:{}}),[c,i,a,s]);typeof n==`string`&&(n=y(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:h=null,key:g=`default`,mask:_}=n,v=o.useMemo(()=>{let e=O(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:h,key:g,mask:_},navigationType:r}},[c,u,d,f,h,g,r,_]);return m(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:o.createElement(P.Provider,{value:l},o.createElement(F.Provider,{children:t,value:v}))}function wt({children:e,location:t}){return Qe(Tt(e),t)}o.Component;function Tt(e,t=[]){let n=[];return o.Children.forEach(e,(e,r)=>{if(!o.isValidElement(e))return;let i=[...t,r];if(e.type===o.Fragment){n.push.apply(n,Tt(e.props.children,i));return}p(e.type===St,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),p(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Tt(e.props.children,i)),n.push(a)}),n}var V=`get`,H=`application/x-www-form-urlencoded`;function U(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Et(e){return U(e)&&e.tagName.toLowerCase()===`button`}function Dt(e){return U(e)&&e.tagName.toLowerCase()===`form`}function Ot(e){return U(e)&&e.tagName.toLowerCase()===`input`}function kt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function At(e,t){return e.button===0&&(!t||t===`_self`)&&!kt(e)}function jt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Mt(e,t){let n=jt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var W=null;function Nt(){if(W===null)try{new FormData(document.createElement(`form`),0),W=!1}catch{W=!0}return W}var Pt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ft(e){return e!=null&&!Pt.has(e)?(m(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${H}"`),null):e}function It(e,t){let n,r,i,a,o;if(Dt(e)){let o=e.getAttribute(`action`);r=o?O(o,t):null,n=e.getAttribute(`method`)||V,i=Ft(e.getAttribute(`enctype`))||H,a=new FormData(e)}else if(Et(e)||Ot(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?O(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||V,i=Ft(e.getAttribute(`formenctype`))||Ft(o.getAttribute(`enctype`))||H,a=new FormData(o,e),!Nt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(U(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=V,r=null,i=H,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Lt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Rt=/[&><\u2028\u2029]/g;function zt(e){return e.replace(Rt,e=>Lt[e])}function Bt(e,t){if(e===!1||e==null)throw Error(t)}function Vt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&O(i.pathname,t)===`/`?i.pathname=`${j(t)}/_root.${r}`:i.pathname=`${j(i.pathname)}.${r}`,i}async function Ht(e,t){if(e.id in t)return t[e.id];try{let n=await a(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ut(e){return e!=null&&typeof e.page==`string`}function Wt(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Gt(e,t,n){return Xt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Ht(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Wt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Kt(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function qt(e,t,{includeHydrateFallback:n}={}){return Jt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Jt(e){return[...new Set(e)]}function Yt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Xt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ut(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Yt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Zt(){let e=o.useContext(M);return Bt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Qt(){let e=o.useContext(N);return Bt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var G=o.createContext(void 0);G.displayName=`FrameworkContext`;function K(){let e=o.useContext(G);return Bt(e,`You must render this element inside a <HydratedRouter> element`),e}function $t(e,t){let n=o.useContext(G),[r,i]=o.useState(!1),[a,s]=o.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=o.useRef(null);o.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),o.useEffect(()=>{if(r){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),s(!1)};return n?e===`intent`?[a,p,{onFocus:q(c,m),onBlur:q(l,h),onMouseEnter:q(u,m),onMouseLeave:q(d,h),onTouchStart:q(f,m)}]:[a,p,{}]:[!1,p,{}]}function q(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function en({page:e,...t}){let n=Pe(),{nonce:r}=K(),{router:i}=Zt(),a=o.useMemo(()=>S(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?o.createElement(nn,{page:e,matches:a,...t}):o.createElement(rn,{page:e,matches:a,...t})):null}function tn(e){let{manifest:t,routeModules:n}=K(),[r,i]=o.useState([]);return o.useEffect(()=>{let r=!1;return Gt(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function nn({page:e,matches:t,...n}){let r=R(),{future:i}=K(),{basename:a}=Zt(),s=o.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Vt(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return o.createElement(o.Fragment,null,s.map(e=>o.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function rn({page:e,matches:t,...n}){let r=R(),{future:i,manifest:a,routeModules:s}=K(),{basename:c}=Zt(),{loaderData:l,matches:u}=Qt(),d=o.useMemo(()=>Kt(e,t,u,a,r,`data`),[e,t,u,a,r]),f=o.useMemo(()=>Kt(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=o.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,o=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:n.add(e.route.id))}),n.size===0)return[];let u=Vt(e,c,i.v8_trailingSlashAwareDataRequests,`data`);return o&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,i.v8_trailingSlashAwareDataRequests,l,r,a,d,t,e,s]),m=o.useMemo(()=>qt(f,a),[f,a]),h=tn(f);return o.createElement(o.Fragment,null,p.map(e=>o.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>o.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>o.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function an(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}o.Component;var on=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{on&&(window.__reactRouterVersion=`7.18.1`)}catch{}function sn({basename:e,children:t,useTransitions:n,window:r}){let i=o.useRef();i.current??=f({window:r,v5Compat:!0});let a=i.current,[s,c]=o.useState({action:a.action,location:a.location}),l=o.useCallback(e=>{n===!1?c(e):o.startTransition(()=>c(e))},[n]);return o.useLayoutEffect(()=>a.listen(l),[a,l]),o.createElement(Ct,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:a,useTransitions:n})}function cn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=o.useState({action:n.action,location:n.location}),s=o.useCallback(e=>{r===!1?a(e):o.startTransition(()=>a(e))},[r]);return o.useLayoutEffect(()=>n.listen(s),[n,s]),o.createElement(Ct,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}cn.displayName=`unstable_HistoryRouter`;var J=o.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:c,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=o.useContext(P),b=typeof d==`string`&&s.test(d),x=Oe(d,_);d=x.to;let S=We(d,{relative:r}),C=R(),w=null;if(c){let e=k(c,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:A([_,e.pathname])),w=v.createHref(e)}let[T,E,ee]=$t(n,h),te=mn(d,{replace:a,mask:c,state:l,target:u,preventScrollReset:f,relative:r,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function ne(t){e&&e(t),t.defaultPrevented||te(t)}let re=!(x.isExternal||i),ie=o.createElement(`a`,{...h,...ee,href:(re?w:void 0)||x.absoluteURL||S,onClick:re?ne:e,ref:an(g,E),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?o.createElement(o.Fragment,null,ie,o.createElement(en,{page:S})):ie});J.displayName=`Link`;var ln=o.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:s,children:c,...l},u){let d=B(a,{relative:l.relative}),f=R(),p=o.useContext(N),{navigator:m,basename:h}=o.useContext(P),g=p!=null&&wn(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=O(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return o.createElement(J,{...l,"aria-current":w,className:T,ref:u,style:E,to:a,viewTransition:s},typeof c==`function`?c(C):c)});ln.displayName=`NavLink`;var un=o.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:c=V,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=o.useContext(P),v=vn(),y=yn(l,{relative:d}),b=c.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&s.test(l);return o.createElement(`form`,{ref:g,method:b,action:y,onSubmit:r?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||c,l=()=>v(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&n!==!1?o.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});un.displayName=`Form`;function dn({getKey:e,storageKey:t,...n}){let r=o.useContext(G),{basename:i}=o.useContext(P),a=R(),s=mt();Sn({getKey:e,storageKey:t});let c=o.useMemo(()=>{if(!r||!e)return null;let t=xn(a,s,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),o.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${zt(JSON.stringify(t||bn))}, ${zt(JSON.stringify(c))})`}})}dn.displayName=`ScrollRestoration`;function fn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Y(e){let t=o.useContext(M);return p(t,fn(e)),t}function pn(e){let t=o.useContext(N);return p(t,fn(e)),t}function mn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=z(),f=R(),p=B(e,{relative:s});return o.useCallback(m=>{if(At(m,t)){m.preventDefault();let t=n===void 0?v(f)===v(p):n,h=()=>d(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?o.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,s,c,l,u])}function hn(e){m(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=o.useRef(jt(e)),n=o.useRef(!1),r=R(),i=o.useMemo(()=>Mt(r.search,n.current?null:t.current),[r.search]),a=z();return[i,o.useCallback((e,t)=>{let r=jt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var gn=0,_n=()=>`__${String(++gn)}__`;function vn(){let{router:e}=Y(`useSubmit`),{basename:t}=o.useContext(P),n=ft(),r=e.fetch,i=e.navigate;return o.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=It(e,t);if(a.navigate===!1){let e=a.fetcherKey||_n();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function yn(e,{relative:t}={}){let{basename:n}=o.useContext(P),r=o.useContext(I);p(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...B(e||`.`,{relative:t})},s=R();if(e==null){a.search=s.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:A([n,a.pathname])),v(a)}var bn=`react-router-scroll-positions`,X={};function xn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:O(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Sn({getKey:e,storageKey:t}={}){let{router:n}=Y(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=pn(`useScrollRestoration`),{basename:a}=o.useContext(P),s=R(),c=mt(),l=pt();o.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Cn(o.useCallback(()=>{if(l.state===`idle`){let t=xn(s,c,a,e);X[t]=window.scrollY}try{sessionStorage.setItem(t||bn,JSON.stringify(X))}catch(e){m(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,s,c,t])),typeof document<`u`&&(o.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||bn);e&&(X=JSON.parse(e))}catch{}},[t]),o.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(X,()=>window.scrollY,e?(t,n)=>xn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),o.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{m(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[s,r,i]))}function Cn(e,t){let{capture:n}=t||{};o.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function wn(e,{relative:t}={}){let n=o.useContext(Fe);p(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Y(`useViewTransitionState`),i=B(e,{relative:t});if(!n.isTransitioning)return!1;let a=O(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=O(n.nextLocation.pathname,r)||n.nextLocation.pathname;return D(i.pathname,s)!=null||D(i.pathname,a)!=null}var Z=n(),Tn=5e3,En=200,Q=[],Dn=1,On=new Set,kn=new Set;function An(e){Q=e;for(let e of On)e()}function jn(e){return On.add(e),()=>On.delete(e)}var Mn=new Set;function Nn(e){return Mn.add(e),()=>Mn.delete(e)}function Pn(e,t){let n=setTimeout(()=>{kn.delete(n),e()},t);kn.add(n)}var Fn=new Set([`Failed to fetch`,`network error`,`Load failed`,`The network connection was lost.`,`NetworkError when attempting to fetch resource.`]),In=`cannot reach the cezar server — check the connection and try again`;function Ln(e){return Fn.has(e.trim())?In:e}function Rn(e,t={}){let n=Ln(e),r={id:Dn++,message:n,tone:t.tone??`default`,...t.action?{action:t.action}:{},exiting:!1},i=t.durationMs??Tn;if(An([...Q,r]),r.tone===`danger`&&!t.reported&&!t.expected)for(let e of Mn)try{e(n)}catch{}Pn(()=>{An(Q.map(e=>e.id===r.id?{...e,exiting:!0}:e)),Pn(()=>An(Q.filter(e=>e.id!==r.id)),En)},i)}function zn(){let e=(0,o.useSyncExternalStore)(jn,()=>Q);return e.length===0?null:(0,Z.jsx)(`div`,{"data-slot":`toaster`,className:`pointer-events-none fixed top-[calc(61px+env(safe-area-inset-top))] right-[calc(16px+env(safe-area-inset-right))] z-[60] flex flex-col items-end gap-2 md:top-[calc(16px+env(safe-area-inset-top))]`,children:e.map(e=>(0,Z.jsxs)(`div`,{role:`status`,"data-slot":`toast`,"data-tone":e.tone,"data-state":e.exiting?`closed`:`open`,className:i(`pointer-events-auto max-w-[min(360px,calc(100vw-32px))] rounded-md px-3.5 py-2.5 text-[13px] font-medium shadow-modal`,`motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-right-4 motion-safe:duration-200`,`motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:slide-out-to-right-4`,e.tone===`danger`?`bg-danger text-danger-foreground`:`bg-contrast text-contrast-foreground`),children:[e.message,e.action?(0,Z.jsxs)(Z.Fragment,{children:[` `,(0,Z.jsx)(`a`,{"data-slot":`toast-action`,href:e.action.href,target:`_blank`,rel:`noopener noreferrer`,className:`font-semibold underline underline-offset-2 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:e.action.label})]}):null]},e.id))})}var Bn=/^\/p\/([^/]+)(?=\/|$)/;function Vn(e){let t=Bn.exec(e)?.[1];return t===void 0?null:decodeURIComponent(t)}function Hn(e){let t=Bn.exec(e);if(!t)return e;let n=e.slice(t[0].length);return n===``?`/`:n}function Un(e,t){return!t.startsWith(`/`)||t===`/p`||t.startsWith(`/p/`)?t:`/p/${encodeURIComponent(e)}${t}`}function Wn(e,t){return e===null?t:typeof t==`string`?Un(e,t):t.pathname===void 0?t:{...t,pathname:Un(e,t.pathname)}}function Gn(){let{projectId:e}=r(),{pathname:t}=R();return e??Vn(t)}function $(){let e=Gn();return(0,o.useCallback)(t=>Wn(e,t),[e])}function Kn(e){let{pathname:t}=R();return(0,o.useMemo)(()=>D(e,Hn(t)),[e,t])}function qn({to:e,...t}){let n=$();return(0,Z.jsx)(J,{...t,to:n(e)})}function Jn({to:e,...t}){let n=$();return(0,Z.jsx)(ln,{...t,to:n(e)})}function Yn({to:e,...t}){let n=$();return(0,Z.jsx)(bt,{...t,to:n(e)})}function Xn(){let e=z(),t=$();return(0,o.useMemo)(()=>((n,r)=>typeof n==`number`?e(n):e(t(n),r)),[e,t])}export{Ge as C,z as S,hn as T,xt as _,Wn as a,D as b,Xn as c,Nn as d,Rn as f,bt as g,ln as h,Vn as i,Kn as l,J as m,Jn as n,Hn as o,sn as p,Yn as r,Gn as s,qn as t,zn as u,St as v,Ze as w,R as x,wt as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{B as r,Bt as i,Ct as a,G as o,H as s,Ht as c,L as l,Mt as u,Ot as d,R as f,St as p,V as m,W as h,Xt as g,Zt as ee,wt as _,z as te,zt as ne}from"./button-vdGgKu1b.js";var v=/^[\w!#$%&'*.^`|~+-]+$/,re=(e,t,n={})=>{if(!v.test(e))throw Error(`Invalid cookie name`);let r=`${e}=${t}`;if(e.startsWith(`__Secure-`)&&!n.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!n.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(n.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(n.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`,`sameSite`,`priority`])if(n[e]&&/[;\r\n]/.test(n[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw Error(`Partitioned Cookie must have Secure attributes`);r+=`; Partitioned`}return r},ie=(e,t,n)=>(t=encodeURIComponent(t),re(e,t,n)),ae=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),oe=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},se=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.set(n,r);return t},ce=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},le=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function y(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ue(e,t){if(!y(e)&&!y(t))return t;let n={...e};for(let e in t){let r=t[e];y(n[e])&&y(r)?n[e]=ue(n[e],r):n[e]=r}return n}var de=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return de(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),fe=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),r={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,r]of Object.entries(e.cookie))t.push(ie(n,r,{path:`/`}));r.Cookie=t.join(`,`)}this.cType&&(r[`Content-Type`]=this.cType);let i=new Headers(r??void 0),a=this.url;a=le(a),a=oe(a,this.pathParams),this.queryParams&&(a=a+`?`+this.queryParams.toString()),n=this.method.toUpperCase();let o=!(n===`GET`||n===`HEAD`);return(t?.fetch||fetch)(a,{body:o?this.rBody:void 0,method:n,headers:i,...t?.init})}},pe=(e,t)=>de(function n(r){let i=t?.buildSearchParams??se,a=[...r.path],o=a.slice(-3).reverse();if(o[0]===`toString`)return o[1]===`name`?o[2]||``:n.toString();if(o[0]===`valueOf`)return o[1]===`name`?o[2]||``:n;let s=``;if(/^\$/.test(o[0])){let e=a.pop();e&&(s=e.replace(/^\$/,``))}let c=ae(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=oe(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=le(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=ce(r.args[0]&&r.args[0].param?oe(c,r.args[0].param):c,`ws`),n=new URL(e),i=r.args[0]?.query;return i&&Object.entries(i).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(n.toString())}let l=new fe(c,s,{buildSearchParams:i});if(s){t??={};let e={...r.args[1]},n=t.headers,i=e.headers;n&&i&&(e.headers=async()=>({...typeof n==`function`?await n():n,...typeof i==`function`?await i():i}));let a=ue(t,e);return l.fetch(r.args[0],a)}return l},[]);function me(e={}){let{baseUrl:t=``,token:n,headers:r,fetch:i}=e;return pe(t,{headers:{...n?{Authorization:`Bearer ${n}`}:{},...r},...i?{fetch:i}:{}})}var b=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},he=new class extends b{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ge={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},x=new class{#e=ge;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function _e(e){setTimeout(e,0)}var ve=typeof window>`u`||`Deno`in globalThis;function S(){}function ye(e,t){return typeof e==`function`?e(t):e}function be(e){return typeof e==`number`&&e>=0&&e!==1/0}function xe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function C(e,t){return typeof e==`function`?e(t):e}function w(e,t){return typeof e==`function`?e(t):e}function Se(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==we(o,t.options))return!1}else if(!Te(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ce(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(T(t.options.mutationKey)!==T(a))return!1}else if(!Te(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function we(e,t){return(t?.queryKeyHashFn||T)(e)}function T(e){return JSON.stringify(e,(e,t)=>ke(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Te(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Te(e[n],t[n])):!1}var Ee=Object.prototype.hasOwnProperty;function De(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Oe(e)&&Oe(t);if(!r&&!(ke(e)&&ke(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=De(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function E(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Oe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ke(e){if(!Ae(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ae(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Ae(e){return Object.prototype.toString.call(e)===`[object Object]`}function je(e){return new Promise(t=>{x.setTimeout(t,e)})}function Me(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:De(e,t)}function Ne(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Pe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Fe=Symbol();function Ie(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Fe?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Le(e,t){return typeof e==`function`?e(...t):!!e}function Re(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var D=(()=>{let e=()=>ve;return{isServer(){return e()},setIsServer(t){e=t}}})();function ze(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Be=_e;function Ve(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Be,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var O=Ve(),He=new class extends b{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Ue(e){return Math.min(1e3*2**e,3e4)}function We(e){return(e??`online`)!==`online`||He.isOnline()}var Ge=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ke(e){let t=!1,n=0,r,i=ze(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Ge(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>he.isFocused()&&(e.networkMode===`always`||He.isOnline())&&e.canRun(),u=()=>We(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(D.isServer()?0:3),o=e.retryDelay??Ue,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),je(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var qe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),be(this.gcTime)&&(this.#e=x.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(D.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(x.clearTimeout(this.#e),this.#e=void 0)}};function Je(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Re(e,()=>t.signal,()=>n=!0)},u=Ie(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Pe:Ne;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Xe:Ye,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ye(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Ye(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Xe(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ze(e,t){return t?Ye(e,t)!=null:!1}function Qe(e,t){return!t||!e.getPreviousPageParam?!1:Xe(e,t)!=null}var $e=class extends qe{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=nt(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=nt(this.options);e.data!==void 0&&(this.setState(tt(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Me(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(S).catch(S):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>w(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Fe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>C(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!xe(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ie(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Je(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Ke({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ge&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ge){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...et(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...tt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),O.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function et(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:We(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function tt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function nt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var k=class extends b{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=ze(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),it(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return at(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return at(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof w(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!E(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ot(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||w(this.options.enabled,this.#t)!==w(t.enabled,this.#t)||C(this.options.staleTime,this.#t)!==C(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||w(this.options.enabled,this.#t)!==w(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ct(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(S)),t}#g(){this.#b();let e=C(this.options.staleTime,this.#t);if(D.isServer()||this.#r.isStale||!be(e))return;let t=xe(this.#r.dataUpdatedAt,e)+1;this.#d=x.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(D.isServer()||w(this.options.enabled,this.#t)===!1||!be(this.#p)||this.#p===0)&&(this.#f=x.setInterval(()=>{(this.options.refetchIntervalInBackground||he.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(x.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(x.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&it(e,t),o=i&&ot(e,n,t,r);(a||o)&&(l={...l,...et(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Me(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Me(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,ee=m===`pending`,_=m===`error`,te=ee&&g,ne=d!==void 0,v={status:m,fetchStatus:l.fetchStatus,isPending:ee,isSuccess:m===`success`,isError:_,isInitialLoading:te,isLoading:te,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!ee,isLoadingError:_&&!ne,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:_&&ne,isStale:st(e,t),refetch:this.refetch,promise:this.#o,isEnabled:w(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=v.data!==void 0,r=v.status===`error`&&!t,i=e=>{r?e.reject(v.error):t&&e.resolve(v.data)},a=()=>{let e=this.#o=v.promise=ze();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||v.data!==o.value)&&a();break;case`rejected`:(!r||v.error!==o.reason)&&a();break}}return v}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!E(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){O.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function rt(e,t){return w(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&w(t.retryOnMount,e)===!1)}function it(e,t){return rt(e,t)||e.state.data!==void 0&&at(e,t,t.refetchOnMount)}function at(e,t,n){if(w(t.enabled,e)!==!1&&C(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&st(e,t)}return!1}function ot(e,t,n,r){return(e!==t||w(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&st(e,n)}function st(e,t){return w(t.enabled,e)!==!1&&e.isStaleByTime(C(t.staleTime,e))}function ct(e,t){return!E(e.getCurrentResult(),t)}var lt=class extends k{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Ze(t,n.data),hasPreviousPage:Qe(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},ut=class extends qe{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||dt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Ke({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),O.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function dt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ft=class extends b{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),E(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&T(t.mutationKey)!==T(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??dt();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){O.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function pt(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function mt(e,t,n){let r=e.slice(0);return r[t]=n,r}var ht=class extends b{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,O.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!E(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(pt(e,n).forEach(e=>{e.destroy()}),pt(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=De(this.#a,t(e))),this.#a}return e}#f(){return this.#r?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new k(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=mt(this.#t,n,t),this.#h())}#h(){if(this.hasListeners()){let e=this.#u(this.#t,this.#l),t=this.#f(),n=this.#a,r=t?n:this.#d(e,this.#r?.combine);(t||n!==r)&&O.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},A=e(t(),1),gt=n(),_t=A.createContext(void 0),j=e=>{let t=A.useContext(_t);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},vt=({client:e,children:t})=>(A.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,gt.jsx)(_t.Provider,{value:e,children:t})),yt=A.createContext(!1),bt=()=>A.useContext(yt);yt.Provider;function xt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var St=A.createContext(xt()),Ct=()=>A.useContext(St),wt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Le(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Tt=e=>{A.useEffect(()=>{e.clearReset()},[e])},Et=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Le(n,[e.error,r])),Dt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Ot=(e,t)=>e.isLoading&&e.isFetching&&!t,kt=(e,t)=>e?.suspense&&t.isPending,At=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function jt({queries:e,...t},n){let r=j(n),i=bt(),a=Ct(),o=A.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{Dt(e);let t=r.getQueryCache().get(e.queryHash);wt(e,a,t)}),Tt(a);let[s]=A.useState(()=>new ht(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;A.useSyncExternalStore(A.useCallback(e=>d?s.subscribe(O.batchCalls(e)):S,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),A.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>kt(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&kt(n,e)?At(n,new k(r,n),a):[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&Et({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(p?.error)throw p.error;return l(u())}function Mt(e,t,n){let r=bt(),i=Ct(),a=j(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Dt(o),wt(o,i,s),Tt(i);let l=!a.getQueryCache().get(o.queryHash),[u]=A.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(A.useSyncExternalStore(A.useCallback(e=>{let t=f?u.subscribe(O.batchCalls(e)):S;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),A.useEffect(()=>{u.setOptions(o)},[o,u]),kt(o,d))throw At(o,u,i);if(Et({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!D.isServer()&&Ot(d,r)&&(l?At(o,u,i):s?.promise)?.catch(S).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function M(e,t){return Mt(e,k,t)}function N(e,t){let n=j(t),[r]=A.useState(()=>new ft(n,e));A.useEffect(()=>{r.setOptions(e)},[r,e]);let i=A.useSyncExternalStore(A.useCallback(e=>r.subscribe(O.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=A.useCallback((e,t)=>{r.mutate(e,t).catch(S)},[r]);if(i.error&&Le(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function P(e,t){return Mt(e,lt,t)}var Nt={projectId:null,apiBase:l},Pt=(0,A.createContext)(Nt);function Ft(){return(0,A.useContext)(Pt)}function It({projectId:e,children:t}){r()!==e&&h(e),(0,A.useLayoutEffect)(()=>{h(e)},[e]),(0,A.useLayoutEffect)(()=>()=>h(null),[]);let n=(0,A.useMemo)(()=>e===null?Nt:{projectId:e,apiBase:`${l}/p/${encodeURIComponent(e)}`},[e]);return(0,gt.jsx)(Pt.Provider,{value:n,children:t})}var F=[`claude`,`codex`,`junie`,`opencode`,`cursor`,`pi`,`copilot`],Lt=new Set([`connected`,`disconnected`,`not-installed`,`unknown`]);function Rt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function zt(e,t){if(!Rt(e))return null;let{provider:n,status:r,enabled:i,hint:a,authFailureId:o}=e;return typeof n!=`string`||!F.includes(n)||typeof r!=`string`||!Lt.has(r)||t&&typeof i!=`boolean`||!t&&i!==void 0&&typeof i!=`boolean`||a!==void 0&&typeof a!=`string`||o!==void 0&&(typeof o!=`string`||o.length<1||o.length>128||r!==`disconnected`)?null:{provider:n,status:r,...typeof i==`boolean`?{enabled:i}:{},...a===void 0?{}:{hint:a},...o===void 0?{}:{authFailureId:o}}}function Bt(e){return zt(e,!1)}function Vt(e,t){if(!Rt(e)||!Array.isArray(e.providers))return null;let n=[],r=new Set;for(let i of e.providers){let e=zt(i,t);if(e===null||r.has(e.provider))return null;r.add(e.provider),n.push(e)}return n}function I(e){let t=Vt(e,!0);if(t===null||t.length===0)return null;let n=new Map(t.map(e=>[e.provider,e]));return F.flatMap(e=>{let t=n.get(e);return t?[t]:[]})}function L(e){let t=I(e);if(t===null)throw Error(`Invalid provider status response`);return{providers:t}}function Ht(e,t){let n=I(e);if(n!==null)return{providers:n.map(e=>e.provider===t.provider?{provider:t.provider,status:t.status,enabled:t.enabled??e.enabled,...t.hint===void 0?{}:{hint:t.hint},...t.authFailureId===void 0?{}:{authFailureId:t.authFailureId}}:e)}}function Ut(e,t,n,r){let i=I(e),a=I(t),o=I(n);if(o===null||a===null)return n;if(i===null)return{providers:a};let s=new Map(i.map(e=>[e.provider,e])),c=new Map(a.map(e=>[e.provider,e]));return{providers:o.map(e=>{let t=s.get(e.provider),n=c.get(e.provider);if(t===void 0||n===void 0)return n??e;let i=r!==void 0&&n.authFailureId===r&&e.authFailureId===void 0;return r!==void 0&&n.authFailureId!==void 0&&n.authFailureId!==r&&e.authFailureId===void 0?n:Wt(t,n)?e:i?{...e,enabled:n.enabled}:n})}}function Wt(e,t){return e.provider===t.provider&&e.status===t.status&&e.enabled===t.enabled&&e.hint===t.hint&&e.authFailureId===t.authFailureId}function Gt(e){let t=I(e);if(t===null)return[];let n=new Set(t.filter(e=>e.enabled&&(e.status===`connected`||e.provider===`junie`&&e.status===`unknown`)).map(e=>e.provider));return F.filter(e=>n.has(e))}function Kt(e,t){return I(e)?.find(e=>e.provider===t)}var qt=`cezar:sid`,Jt;function Yt(e=Date.now()){let t=crypto.getRandomValues(new Uint8Array(16));for(let n=0;n<6;n++)t[n]=Math.floor(e/2**(8*(5-n)))&255;t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=[...t].map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function Xt(){try{let e=localStorage.getItem(qt);if(e)return e;let t=Yt();return localStorage.setItem(qt,t),t}catch{return Jt??=Yt()}}var Zt=`x-cezar-sid`;function Qt(){Jt=void 0;try{localStorage.removeItem(qt)}catch{}}function $t(e){if(typeof e!=`object`||!e)return;let{name:t,message:n}=e;return{name:typeof t==`string`?t:`unknown`,message:typeof n==`string`?n:``}}var en=/\/(?:providers|agent-profiles)(?:\/|$)/;function tn(e,t){if(!en.test(e))return;let n=e.split(`/`),r=n[n.indexOf(`providers`)+1];if(n.includes(`providers`)&&p.safeParse(r).success)return r;if(typeof t==`string`)try{let e=JSON.parse(t).provider;return p.safeParse(e).success?e:void 0}catch{return}}var nn=null;function rn(e,t,n,r,i){try{let a=new URL(e,window.location.origin).pathname,o=tn(a,r),s=$t(i);nn={method:(t??`GET`).toUpperCase(),path:a,status:n,at:Date.now(),...o?{provider:o}:{},...s?{cause:s}:{}}}catch{}}function an(e=3e3,t=Date.now()){return nn&&t-nn.at<=e?nn:null}var R=class extends Error{status;manual;command;runIds;exists;constructor(e,t,n={}){super(t,n.cause===void 0?void 0:{cause:n.cause}),this.name=`ApiError`,this.status=e,this.manual=n.manual,this.command=n.command,this.exists=n.exists,this.runIds=n.runIds}};function z(e){try{return JSON.parse(e)}catch{return}}function on(e){return typeof e==`string`?e:void 0}function B(e,t,n){let r=z(n),i=r&&typeof r==`object`?r:{},a=on(i.error)??`${e} ${t||`request failed`}`.trim(),s=e===409?o.safeParse(r):void 0;return new R(e,a,{...s?.success?{runIds:s.data.runIds}:{},manual:on(i.manual),command:on(i.command),exists:typeof i.exists==`boolean`?i.exists:void 0})}var V=me({fetch:(e,t)=>dn(sn(String(e)),t)});function sn(e){let t=ln(e.endsWith(`?`)?e.slice(0,-1):e);return t.startsWith(`/`)?`${te()}${t}`:t}var cn=`${l}/p/default`;function ln(e){if(r()!==null||!e.startsWith(cn))return e;let t=e.slice(cn.length);return t===``||t.startsWith(`/`)||t.startsWith(`?`)?`${l}${t}`:e}var H=e=>({init:{signal:e?.signal}});async function U(e){try{return await e.text()}catch(t){throw t instanceof DOMException&&t.name===`AbortError`?t:(rn(e.url,void 0,0,void 0,t),new R(0,`cannot reach the cezar server (${e.url})`,{cause:t}))}}async function W(e,t){let n=await U(e);if(!e.ok)throw B(e.status,e.statusText,n);let r=z(n);if(r===void 0)throw new R(e.status,`the cezar server answered ${t} with a non-JSON body`);return r}async function un(e,t,n){let r=e.status,i=await W(e,t),a=n.safeParse(i);if(!a.success)throw new R(r,`the cezar server answered ${t} with an unexpected body`);return a.data}async function dn(e,t){try{let n=new Headers(t?.headers);n.set(Zt,Xt());let r=await fetch(e,{...t,headers:n,credentials:`include`});return r.ok||rn(e,t?.method,r.status,t?.body),r}catch(n){throw n instanceof DOMException&&n.name===`AbortError`?n:(rn(e,t?.method,0,t?.body,n),new R(0,`cannot reach the cezar server (${e})`,{cause:n}))}}async function fn(e,t){return dn(f(e),t)}async function pn(e,t={}){let n=new Headers(t.headers);n.set(`accept`,`text/plain`);let r=await fn(e,{...t,headers:n}),i=await U(r);if(!r.ok)throw B(r.status,r.statusText,i);return i}var G=(e,t=``)=>`/runs/${encodeURIComponent(e)}${t}`;async function mn(e){return W(await V.api.v1.health.$get({},H(e)),`/health`)}async function hn(e){return W(await V.api.v1[`star-count`].$get({},H(e)),`/star-count`)}async function gn(e){return W(await V.api.v1.preview[`design-proxy`].$post({json:e}),`/preview/design-proxy`)}async function _n(e){return W(await V.api.v1.telemetry.consent.$get({},H(e)),`/telemetry/consent`)}async function vn(e){return W(await V.api.v1.telemetry.consent.$put({json:e}),`/telemetry/consent`)}async function yn(e,t){return W(await V.api.v1.models.$get({query:{runner:e}},H(t)),`/models`)}async function bn(e=!1,t){return L(await W(await V.api.v1.providers.status.$get({query:e?{refresh:`1`}:{}},H(t)),`/providers/status`))}async function xn(e){return W(await V.api.v1.p[`:projectId`][`launch-key`].$get({param:{projectId:m()}},H(e)),`/launch-key`)}async function Sn(e){return W(await V.api.v1.projects.$get({},H(e)),`/projects`)}async function Cn(e,t){return W(await V.api.v1.fs.browse.$get({query:{path:e===``?void 0:e,...t?.showHidden?{showHidden:`1`}:{}}},H(t)),`/fs/browse`)}async function wn(e){return W(await V.api.v1.p[`:projectId`].runs.$get({param:{projectId:m()},query:{}},H(e)),`/runs`)}async function Tn(e,t){return W(await V.api.v1.p[`:projectId`].runs.$get({param:{projectId:e},query:{}},H(t)),`/runs`)}async function En(e){return W(await V.api.v1.workspace[`runs-index`].$get({},H(e)),`/workspace/runs-index`)}async function Dn(e,t){return W(await V.api.v1.p[`:projectId`].runs[`:id`].$get({param:{projectId:m(),id:encodeURIComponent(e)}},H(t)),G(e))}async function On(e,t,n){return W(await V.api.v1.p[`:projectId`].runs[`:id`].$get({param:{projectId:e,id:encodeURIComponent(t)}},H(n)),G(t))}async function kn(e,t,n){return un(await V.api.v1.p[`:projectId`].runs[`:id`].history.$get({param:{projectId:m(),id:encodeURIComponent(e)},query:{...t===void 0?{}:{cursor:t}}},H(n)),`${G(e)}/history`,ee)}async function An(e,t){return un(await V.api.v1.p[`:projectId`].runs[`:id`][`history-context`].$get({param:{projectId:m(),id:encodeURIComponent(e)}},H(t)),`${G(e)}/history-context`,g)}async function jn(e){return W(await V.api.v1.p[`:projectId`][`ui-state`].$get({param:{projectId:m()}},H(e)),`/ui-state`)}async function Mn(e){return W(await V.api.v1.p[`:projectId`].workflows.$get({param:{projectId:m()}},H(e)),`/workflows`)}async function Nn(e){return W(await V.api.v1.p[`:projectId`].skills.$get({param:{projectId:m()},query:{}},H(e)),`/skills`)}async function Pn(e){return W(await V.api.v1.p[`:projectId`].skills.$get({param:{projectId:m()},query:{wait:`1`}},H(e)),`/skills`)}async function Fn(){return W(await V.api.v1.p[`:projectId`].skills.refresh.$post({param:{projectId:m()}}),`/skills/refresh`)}async function In(e){return W(await V.api.v1.p[`:projectId`].skills.importable.$get({param:{projectId:m()},query:{}},H(e)),`/skills/importable`)}async function Ln(e){return W(await V.api.v1.p[`:projectId`].skills.importable.$get({param:{projectId:m()},query:{wait:`1`}},H(e)),`/skills/importable`)}async function Rn(e){return W(await V.api.v1.p[`:projectId`].todos.$get({param:{projectId:m()}},H(e)),`/todos`)}async function zn(e){return W(await V.api.v1.p[`:projectId`].repo.$get({param:{projectId:m()}},H(e)),`/repo`)}async function Bn(e){return W(await V.api.v1.p[`:projectId`].config.$get({param:{projectId:m()}},H(e)),`/config`)}async function Vn(e={}){return W(await V.api.v1.p[`:projectId`][`agent-config`].$get({param:{projectId:m()}},H(e)),`/agent-config`)}async function Hn(e,t={}){return W(await V.api.v1.p[`:projectId`][`agent-config`][`:id`].$get({param:{projectId:m(),id:encodeURIComponent(e)}},H(t)),`/agent-config/${encodeURIComponent(e)}`)}async function Un(e,t){return W(await V.api.v1.p[`:projectId`][`agent-config`][`:id`].$put({param:{projectId:m(),id:encodeURIComponent(e)},json:t}),`/agent-config/${encodeURIComponent(e)}`)}async function Wn(e){return W(await V.api.v1.p[`:projectId`].repo.changes.$get({param:{projectId:m()}},H(e)),`/repo/changes`)}async function Gn(e){return W(await V.api.v1.p[`:projectId`].repo.tree.$get({param:{projectId:m()}},H(e)),`/repo/tree`)}async function Kn(e,t){return W(await V.api.v1.p[`:projectId`].repo.files.$get({param:{projectId:m()},query:{path:e}},H(t)),`/repo/files`)}function qn(e){return f(`/repo/files?path=${encodeURIComponent(e)}&raw=1`)}async function Jn(e,t){return W(await V.api.v1.p[`:projectId`].repo.commit[`:sha`].$get({param:{projectId:m(),sha:encodeURIComponent(e)},query:{structured:`1`}},H(t)),`/repo/commit/:sha`)}async function Yn(e,t){return W(await V.api.v1.p[`:projectId`].runs[`:id`].tree.$get({param:{projectId:m(),id:encodeURIComponent(e)}},H(t)),G(e,`/tree`))}async function Xn(e,t){return W(await V.api.v1.p[`:projectId`].runs[`:id`].commits.$get({param:{projectId:m(),id:encodeURIComponent(e)}},H(t)),G(e,`/commits`))}async function Zn(e,t,n){return W(await V.api.v1.p[`:projectId`].runs[`:id`].commit[`:sha`].$get({param:{projectId:m(),id:encodeURIComponent(e),sha:encodeURIComponent(t)}},H(n)),G(e,`/commit/${encodeURIComponent(t)}`))}async function Qn(e={},t){return W(await V.api.v1.p[`:projectId`].github.$get({param:{projectId:m()},query:{limit:e.limit===void 0?void 0:String(e.limit),refresh:e.refresh?`1`:void 0,issuesCursor:e.issuesCursor,prsCursor:e.prsCursor}},H(t)),`/github`)}async function $n(e={},t){return W(await V.api.v1.p[`:projectId`].tracker[`automation-options`].$get({param:{projectId:m()},query:e},H(t)),`/tracker/automation-options`)}async function er(e){return W(await V.api.v1.p[`:projectId`].tracker.connection.$get({param:{projectId:m()}},H(e)),`/tracker/connection`)}async function tr(e){return W(await V.api.v1.p[`:projectId`].tracker.connection.$put({param:{projectId:m()},json:e}),`/tracker/connection`)}async function nr(){return W(await V.api.v1.p[`:projectId`].tracker.connection.$delete({param:{projectId:m()}}),`/tracker/connection`)}async function rr(e){return W(await V.api.v1.p[`:projectId`].secrets.$get({param:{projectId:m()}},H(e)),`/secrets`)}async function ir(e){return W(await V.api.v1.workspace.secrets.$get({},H(e)),`/workspace/secrets`)}async function ar(e){if(!e.ok)throw B(e.status,e.statusText,await U(e))}async function or(e,t){await ar(await V.api.v1.p[`:projectId`].secrets[`:name`].$put({param:{projectId:m(),name:e},json:t}))}async function sr(e){await ar(await V.api.v1.p[`:projectId`].secrets[`:name`].$delete({param:{projectId:m(),name:e}}))}async function cr(e,t){await ar(await V.api.v1.workspace.secrets[`:name`].$put({param:{name:e},json:t}))}async function lr(e){await ar(await V.api.v1.workspace.secrets[`:name`].$delete({param:{name:e}}))}async function ur(e){return W(await V.api.v1.p[`:projectId`].e2e.$get({param:{projectId:m()}},H(e)),`/e2e`)}async function dr(e){return W(await V.api.v1.p[`:projectId`].e2e.setup.$post({param:{projectId:m()},json:e}),`/e2e/setup`)}async function fr(e){return W(await V.api.v1.p[`:projectId`].tracker.association.$get({param:{projectId:m()}},H(e)),`/tracker/association`)}async function pr(e,t={},n){return W(await V.api.v1.p[`:projectId`].tracker.candidates.$get({param:{projectId:m()},query:{kind:e,q:t.q,cursor:t.cursor,limit:t.limit===void 0?void 0:String(t.limit)}},H(n)),`/tracker/candidates`)}async function mr(e){return W(await V.api.v1.p[`:projectId`].tracker.association.$put({param:{projectId:m()},json:e}),`/tracker/association`)}async function hr(){return W(await V.api.v1.p[`:projectId`].tracker.association.$delete({param:{projectId:m()}}),`/tracker/association`)}function gr(e){return{expectedScope:e.association?ne(e.association):void 0,cursor:e.cursor,limit:e.limit===void 0?void 0:String(e.limit),refresh:e.refresh?`1`:void 0,state:e.state,labels:e.labels?.length?JSON.stringify(e.labels):void 0}}async function _r(e={},t){return W(await V.api.v1.p[`:projectId`].tracker.$get({param:{projectId:m()},query:gr(e)},H(t)),`/tracker`)}async function vr(e,t={},n){return W(await V.api.v1.p[`:projectId`].tracker.search.$get({param:{projectId:m()},query:{...gr(t),q:e}},H(n)),`/tracker/search`)}async function yr(e,t){return W(await V.api.v1.p[`:projectId`].tracker[`:id`].$get({param:{projectId:m(),id:encodeURIComponent(e)},query:{expectedScope:t?.association?ne(t.association):void 0}},H(t)),`/tracker/${encodeURIComponent(e)}`)}async function br(e,t){return W(await V.api.v1.p[`:projectId`].github.checks.$get({param:{projectId:m()},query:{prs:e.join(`,`)}},H(t)),`/github/checks`)}async function xr(e,t,n={},r){return W(await V.api.v1.p[`:projectId`].github.search.$get({param:{projectId:m()},query:{kind:e,q:t,limit:n.limit}},H(r)),`/github/search`)}async function Sr(e,t,n){return W(await V.api.v1.p[`:projectId`].github[`ref-status`].$get({param:{projectId:e},query:{...t.prs?.length?{prs:t.prs.join(`,`)}:{},...t.issues?.length?{issues:t.issues.join(`,`)}:{}}},H(n)),`/github/ref-status`)}async function Cr(e,t,n={},r){return W(await V.api.v1.p[`:projectId`].github.comments[`:kind`][`:number`].$get({param:{projectId:m(),kind:e,number:String(t)},query:{refresh:n.refresh?`1`:void 0}},H(r)),`/github/comments/${e}/${t}`)}async function wr(e,t={},n){return W(await V.api.v1.p[`:projectId`].github.prs[`:number`][`merge-state`].$get({param:{projectId:m(),number:String(e)},query:{refresh:t.refresh?`1`:void 0}},H(n)),`/github/prs/${e}/merge-state`)}async function Tr(e,t){return W(await V.api.v1.p[`:projectId`].github.prs[`:number`].merge.$post({param:{projectId:m(),number:String(e)},json:t}),`/github/prs/:number/merge`)}async function Er(e,t={},n){return W(await V.api.v1.p[`:projectId`].github.prs[`:number`].changes.$get({param:{projectId:m(),number:String(e)},query:{refresh:t.refresh?`1`:void 0}},H(n)),`/github/prs/${e}/changes`)}function Dr(e,t){return pn(G(e,`/diff`),{method:`GET`,signal:t?.signal})}function Or(e,t){return pn(G(e,`/handoff`),{method:`GET`,signal:t?.signal})}async function kr(e,t){return W(await V.api.v1.p[`:projectId`].runs[`:id`].changes.$get({param:{projectId:m(),id:encodeURIComponent(e)}},H(t)),G(e,`/changes`))}async function Ar(e,t,n){return W(await V.api.v1.p[`:projectId`].runs[`:id`].files.$get({param:{projectId:m(),id:encodeURIComponent(e)},query:{path:t}},H(n)),`/runs/:id/files`)}function jr(e,t,n){let r=n?`&rev=${encodeURIComponent(n)}`:``;return f(G(e,`/files?path=${encodeURIComponent(t)}&raw=1${r}`))}async function Mr(e,t){return W(await V.api.v1.p[`:projectId`].groups[`:groupId`].$get({param:{projectId:m(),groupId:encodeURIComponent(e)}},H(t)),`/groups/${encodeURIComponent(e)}`)}async function Nr(e,t){return W(await V.api.v1.providers.connect.$post({json:{provider:e,...t?{profileId:t}:{}}}),`/providers/connect`)}async function Pr(e){return W(await V.api.v1.providers[`:provider`].update.$post({param:{provider:e}}),`/providers/${encodeURIComponent(e)}/update`)}async function Fr(e,t){return L(await W(await V.api.v1.providers[`:provider`].enabled.$put({param:{provider:e},json:{enabled:t}}),`/providers/${encodeURIComponent(e)}/enabled`))}async function Ir(e,t){return L(await W(await V.api.v1.providers[`:provider`].retry.$post({param:{provider:e},json:{authFailureId:t}}),`/providers/${encodeURIComponent(e)}/retry`))}async function Lr(e){let t=`/projects`,n=await fn(t,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({root:e})}),r=await U(n),i=z(r),a=i?.project;if((n.ok||n.status===409)&&a!=null)return i;throw n.ok?new R(n.status,`the cezar server answered ${t} without a project`):B(n.status,n.statusText,r)}async function Rr(e){return W(await V.api.v1.projects.checkout.$post({json:e}),`/projects/checkout`)}async function zr(e){return W(await V.api.v1.projects.create.$post({json:e}),`/projects/create`)}async function Br(e){return un(await V.api.v1.projects[`github-owners`].$get({},H(e)),`/projects/github-owners`,d)}async function Vr(e){return W(await V.api.v1.projects[`:projectId`].$delete({param:{projectId:encodeURIComponent(e)}}),`/projects/${encodeURIComponent(e)}`)}async function Hr(e,t){return W(await V.api.v1.projects[`:projectId`].$patch({param:{projectId:encodeURIComponent(e)},json:t}),`/projects/${encodeURIComponent(e)}`)}async function Ur(e){return W(await V.api.v1.p[`:projectId`].runs.$post({param:{projectId:m()},json:e}),`/runs`)}async function Wr(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`].cancel.$post({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/cancel`))}async function Gr(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`][`start-now`].$post({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/start-now`))}async function Kr(e,t=!0,n){return W(await V.api.v1.p[`:projectId`].runs[`:id`].archive.$post({param:{projectId:m(),id:encodeURIComponent(e)},json:{archived:t,...n?{surface:n}:{}}}),G(e,`/archive`))}async function qr(e,t=!0,n){return W(await V.api.v1.p[`:projectId`].runs[`:id`].pin.$post({param:{projectId:m(),id:encodeURIComponent(e)},json:{pinned:t,...n?{surface:n}:{}}}),G(e,`/pin`))}async function Jr(e,t,n=!0,r){return W(await V.api.v1.p[`:projectId`].runs[`:id`].pin.$post({param:{projectId:e,id:encodeURIComponent(t)},json:{pinned:n,...r?{surface:r}:{}}}),G(t,`/pin`))}async function Yr(e,t,n=!0,r){return W(await V.api.v1.p[`:projectId`].runs[`:id`].archive.$post({param:{projectId:e,id:encodeURIComponent(t)},json:{archived:n,...r?{surface:r}:{}}}),G(t,`/archive`))}async function Xr(e,t,n){let r=n?`read`:`unread`;return W(await(n?V.api.v1.p[`:projectId`].runs[`:id`].read.$post({param:{projectId:e,id:encodeURIComponent(t)}}):V.api.v1.p[`:projectId`].runs[`:id`].unread.$post({param:{projectId:e,id:encodeURIComponent(t)}})),G(t,`/${r}`))}async function Zr(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`][`auto-resume`].$delete({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/auto-resume`))}async function Qr(){return W(await V.api.v1.p[`:projectId`].runs[`archive-finished`].$post({param:{projectId:m()}}),`/runs/archive-finished`)}async function $r(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`].read.$post({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/read`))}async function ei(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`].unread.$post({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/unread`))}async function ti(){return W(await V.api.v1.p[`:projectId`].runs[`read-all`].$post({param:{projectId:m()}}),`/runs/read-all`)}async function ni(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`].land.$post({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/land`))}async function ri(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`].finish.$post({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/finish`))}async function ii(e,t={}){let n={...t.text===void 0?{}:{text:t.text},...t.images===void 0?{}:{images:t.images},...t.runner===void 0?{}:{runner:t.runner},...t.model===void 0?{}:{model:t.model},...t.agentProfile===void 0?{}:{agentProfile:t.agentProfile},...t.idempotencyKey===void 0?{}:{idempotencyKey:t.idempotencyKey}};return W(await V.api.v1.p[`:projectId`].runs[`:id`].continue.$post({param:{projectId:m(),id:encodeURIComponent(e)},json:n}),G(e,`/continue`))}async function ai(e,t,n={}){return W(await V.api.v1.p[`:projectId`].runs[`:id`].continue.$post({param:{projectId:e,id:encodeURIComponent(t)},json:{...n.text===void 0?{}:{text:n.text},...n.images===void 0?{}:{images:n.images},...n.runner===void 0?{}:{runner:n.runner},...n.model===void 0?{}:{model:n.model},...n.agentProfile===void 0?{}:{agentProfile:n.agentProfile},...n.idempotencyKey===void 0?{}:{idempotencyKey:n.idempotencyKey}}}),G(t,`/continue`))}var oi=1e3;async function si(e,t={}){let n=m(),r=async()=>W(await V.api.v1.p[`:projectId`].runs[`:id`].pr.$post({param:{projectId:n,id:encodeURIComponent(e)},json:t}),G(e,`/pr`));try{return await r()}catch(e){if(!(e instanceof R)||e.status!==0)throw e;await new Promise(e=>setTimeout(e,oi));try{return await r()}catch(t){throw t instanceof R&&t.status===0?e:t}}}async function ci(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`].pr.adopt.$post({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/pr/adopt`))}async function li(e,t){return W(await V.api.v1.p[`:projectId`].runs[`:id`].$patch({param:{projectId:m(),id:encodeURIComponent(e)},json:t}),G(e))}async function ui(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`].$delete({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e))}async function di(e){return W(await V.api.v1.p[`:projectId`].todos[`:id`].$delete({param:{projectId:m(),id:encodeURIComponent(e)}}),`/todos/${encodeURIComponent(e)}`)}async function fi(e,t={}){let n={...t.runner===void 0?{}:{runner:t.runner},...t.model===void 0?{}:{model:t.model},...t.prompt===void 0?{}:{prompt:t.prompt}};return W(await V.api.v1.p[`:projectId`].todos[`:id`].start.$post({param:{projectId:m(),id:encodeURIComponent(e)},json:Object.keys(n).length>0?n:void 0}),`/todos/${encodeURIComponent(e)}/start`)}async function pi(e,t){return W(await V.api.v1.p[`:projectId`].groups[`:groupId`].pick.$post({param:{projectId:m(),groupId:encodeURIComponent(e)},json:{runId:t}}),`/groups/${encodeURIComponent(e)}/pick`)}async function mi(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`][`open-in-cli`].$post({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/open-in-cli`))}async function hi(e){return W(await V.api.v1.p[`:projectId`][`open-targets`].$get({param:{projectId:m()}},H(e)),`/open-targets`)}async function gi(e){return W(await V.api.v1.p[`:projectId`][`open-in`].$post({param:{projectId:m()},json:{target:e}}),`/open-in`)}async function _i(e,t){return W(await V.api.v1.p[`:projectId`].runs[`:id`][`open-in`].$post({param:{projectId:m(),id:encodeURIComponent(e)},json:{target:t}}),G(e,`/open-in`))}async function vi(e,t){return W(await V.api.v1.p[`:projectId`].runs[`:id`][`open-in`].$post({param:{projectId:m(),id:encodeURIComponent(e)},json:{target:`default`,path:t}}),G(e,`/open-in`))}async function yi(e,t){return W(await V.api.v1.p[`:projectId`].runs[`:id`].git.commit.$post({param:{projectId:m(),id:encodeURIComponent(e)},json:{message:t}}),G(e,`/git/commit`))}async function bi(e,t){return W(await V.api.v1.p[`:projectId`].runs[`:id`].git.status.$get({param:{projectId:m(),id:encodeURIComponent(e)}},H(t)),G(e,`/git/status`))}async function xi(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`].git.push.$post({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/git/push`))}var Si=[250,750,1500],Ci=e=>new Promise(t=>setTimeout(t,e));async function wi(e,t,n=Ci){let r={text:t.text??``,images:t.images??[],idempotencyKey:t.idempotencyKey??Yt()};for(let t=0;;t+=1)try{return await e(r)}catch(e){let r=Si[t];if(!(e instanceof R)||e.status!==0||r===void 0)throw e;await n(r)}}async function Ti(e,t){return wi(async t=>W(await V.api.v1.p[`:projectId`].runs[`:id`].messages.$post({param:{projectId:m(),id:encodeURIComponent(e)},json:t}),G(e,`/messages`)),t)}async function Ei(e,t,n){return wi(async n=>W(await V.api.v1.p[`:projectId`].runs[`:id`].messages.$post({param:{projectId:e,id:encodeURIComponent(t)},json:n}),G(t,`/messages`)),n)}async function Di(e,t,n){return W(await V.api.v1.p[`:projectId`].runs[`:id`][`queued-messages`][`:msgId`].$patch({param:{projectId:m(),id:encodeURIComponent(e),msgId:encodeURIComponent(t)},json:n}),G(e,`/queued-messages/${encodeURIComponent(t)}`))}async function Oi(e,t){return W(await V.api.v1.p[`:projectId`].runs[`:id`][`queued-messages`][`:msgId`].$delete({param:{projectId:m(),id:encodeURIComponent(e),msgId:encodeURIComponent(t)}}),G(e,`/queued-messages/${encodeURIComponent(t)}`))}async function ki(e,t){return W(await V.api.v1.p[`:projectId`].runs[`:id`].drafts.$get({param:{projectId:m(),id:encodeURIComponent(e)}},H(t)),G(e,`/drafts`))}var Ai=56*1024;async function ji(e,t,n,r){let i=r?.keepalive===!0&&new TextEncoder().encode(JSON.stringify(n)).length<=Ai;return W(await V.api.v1.p[`:projectId`].runs[`:id`].drafts[`:surface`].$put({param:{projectId:m(),id:encodeURIComponent(e),surface:t},json:n},{init:{keepalive:i}}),G(e,`/drafts/${t}`))}async function Mi(e,t,n){return W(await V.api.v1.p[`:projectId`].runs[`:id`].drafts[`:surface`].images.$post({param:{projectId:m(),id:encodeURIComponent(e),surface:t},json:n}),G(e,`/drafts/${t}/images`))}async function Ni(e){return W(await V.api.v1.workspace.uploads.$post({json:e}),`/workspace/uploads`)}async function Pi(e){return W(await V.api.v1.workspace.uploads[`:uploadId`].$delete({param:{uploadId:e}}),`/workspace/uploads/${e}`)}async function Fi(e,t,n,r){return W(await V.api.v1.p[`:projectId`].runs[`:id`].drafts[`:surface`].images[`:imageId`].$get({param:{projectId:m(),id:encodeURIComponent(e),surface:t,imageId:n}},H(r)),G(e,`/drafts/${t}/images/${n}`))}async function Ii(e,t,n){return W(await V.api.v1.p[`:projectId`].runs[`:id`].drafts[`:surface`].images[`:imageId`].$delete({param:{projectId:m(),id:encodeURIComponent(e),surface:t,imageId:n}}),G(e,`/drafts/${t}/images/${n}`))}async function Li(e){return W(await V.api.v1.p[`:projectId`].repo.branch.$post({param:{projectId:m()},json:e}),`/repo/branch`)}async function Ri(e){return W(await V.api.v1.p[`:projectId`].repo.sync.$get({param:{projectId:m()}},H(e)),`/repo/sync`)}async function zi(e){let t={param:{projectId:m()}},n=V.api.v1.p[`:projectId`].repo;return W(e===`fetch`?await n.fetch.$post(t):e===`pull`?await n.pull.$post(t):e===`push`?await n.push.$post(t):await n.sync.$post(t),`/repo/${e}`)}async function Bi(e){return W(await V.api.v1.p[`:projectId`].plan.$post({param:{projectId:m()},json:{task:e}}),`/plan`)}async function Vi(e){return W(await V.api.v1.p[`:projectId`].automations.$get({param:{projectId:m()}},H(e)),`/automations`)}async function Hi(e){return W(await V.api.v1.p[`:projectId`].automations.$post({param:{projectId:m()},json:e}),`/automations`)}async function Ui(e,t){return W(await V.api.v1.p[`:projectId`].automations[`:id`].$put({param:{projectId:m(),id:encodeURIComponent(e)},json:t}),`/automations/${encodeURIComponent(e)}`)}async function Wi(e,t){let n={projectId:m(),id:encodeURIComponent(e)},r=`/automations/${encodeURIComponent(e)}/${t?`enable`:`pause`}`;return W(t?await V.api.v1.p[`:projectId`].automations[`:id`].enable.$post({param:n}):await V.api.v1.p[`:projectId`].automations[`:id`].pause.$post({param:n}),r)}async function Gi(e,t){return W(await V.api.v1.p[`:projectId`].automations[`:id`].check.$post({param:{projectId:m(),id:encodeURIComponent(e)},json:{mode:t}}),`/automations/${encodeURIComponent(e)}/check`)}async function Ki(e,t){return W(await V.api.v1.p[`:projectId`][`automation-log`].$get({param:{projectId:m()},query:{automationId:e}},H(t)),`/automation-log?automationId=${encodeURIComponent(e)}`)}async function qi(e){return W(await V.api.v1.p[`:projectId`][`automation-log`][`:receiptId`].retry.$post({param:{projectId:m(),receiptId:encodeURIComponent(e)}}),`/automation-log/${encodeURIComponent(e)}/retry`)}async function Ji(e,t){return W(await V.api.v1.p[`:projectId`].automations[`:id`].run.$post({param:{projectId:m(),id:encodeURIComponent(e)},query:t?{expectedRevision:String(t)}:{}}),`/automations/${encodeURIComponent(e)}/run`)}async function Yi(e,t){let n=await V.api.v1.p[`:projectId`].automations[`:id`].$delete({param:{projectId:m(),id:encodeURIComponent(e)},query:t?{expectedRevision:String(t)}:{}});if(!n.ok)throw B(n.status,n.statusText,await U(n))}async function Xi(e,t){return W(await V.api.v1.workspace[`automation-templates`].$get({query:e?{exclude:e}:{}},H(t)),`/workspace/automation-templates`)}async function Zi(e){return W(await V.api.v1.p[`:projectId`].workflows.$post({param:{projectId:m()},json:e}),`/workflows`)}async function Qi(e){return W(await V.api.v1.p[`:projectId`].workflows.nodes.$get({param:{projectId:m()}},H(e)),`/workflows/nodes`)}async function $i(e){return W(await V.api.v1.p[`:projectId`].workflows.validate.$post({param:{projectId:m()},json:{graph:e}}),`/workflows/validate`)}async function ea(e){return W(await V.api.v1.p[`:projectId`].workflows.graph.$post({param:{projectId:m()},json:e}),`/workflows/graph`)}async function ta(e){return W(await V.api.v1.p[`:projectId`].workflows.parse.$post({param:{projectId:m()},json:{yaml:e}}),`/workflows/parse`)}async function na(e){return W(await V.api.v1.p[`:projectId`].workflows[`:name`].$delete({param:{projectId:m(),name:encodeURIComponent(e)}}),`/workflows/${encodeURIComponent(e)}`)}async function ra(e,t=m()){return W(await V.api.v1.p[`:projectId`][`ui-state`].$put({param:{projectId:t},json:e}),`/ui-state`)}async function ia(e){return W(await V.api.v1.workspace[`ui-state`].$get({},H(e)),`/workspace/ui-state`)}async function aa(e,t={}){return W(await V.api.v1.workspace[`ui-state`].$put({json:e},{init:{keepalive:t.keepalive}}),`/workspace/ui-state`)}async function oa(e){let t=await W(await V.api.v1.workspace.config.$get({},H(e)),`/workspace/config`);return{...t,branding:t.branding?{...t.branding,logoUrl:t.branding.logoUrl?s(t.branding.logoUrl):null}:{name:`cezar`,logoUrl:null},agentDefaults:t.agentDefaults??{},orgSkillsRepos:t.orgSkillsRepos??[],resources:{...t.resources,idleTimeoutMinutes:t.resources.idleTimeoutMinutes===void 0?15:t.resources.idleTimeoutMinutes}}}async function sa(e){let t=new FormData;t.set(`file`,e);let n=await fn(`/workspace/branding-logo`,{method:`POST`,body:t}),r=await U(n);if(!n.ok)throw B(n.status,n.statusText,r);let i=z(r),a=_.safeParse(i);if(!a.success)throw new R(n.status,`the cezar server answered /workspace/branding-logo with an unexpected body`);return a.data.logoUrl?s(a.data.logoUrl):null}async function ca(){let e=await fn(`/workspace/branding-logo`,{method:`DELETE`}),t=await U(e);if(!e.ok)throw B(e.status,e.statusText,t);let n=_.safeParse(z(t));if(!n.success)throw new R(e.status,`the cezar server answered /workspace/branding-logo with an unexpected body`);return n.data.logoUrl?s(n.data.logoUrl):null}async function la(e){return W(await V.api.v1.workspace[`host-usage`].$get({},H(e)),`/workspace/host-usage`)}async function ua(e){let t=await W(await V.api.v1.workspace[`agent-profiles`].$get({},H(e)),`/workspace/agent-profiles`);return{...t,profileCapableProviders:t.profileCapableProviders??[],selections:t.selections??{},defaults:t.defaults??{},profiles:(t.profiles??[]).map(e=>({...e,files:e.files??[]}))}}async function da(e){return W(await V.api.v1.workspace[`agent-profiles`].$post({json:e}),`/workspace/agent-profiles`)}async function fa(e,t){return W(await V.api.v1.workspace[`agent-profiles`][`:id`].status.$get({param:{id:encodeURIComponent(e)},query:{...t?.refresh||t?.recheck?{refresh:`1`}:{},...t?.recheck?{recheck:`1`}:{}}},H(t)),`/workspace/agent-profiles/${encodeURIComponent(e)}/status`)}async function pa(e,t){return W(await V.api.v1.workspace[`agent-profiles`][`:id`].details.$get({param:{id:encodeURIComponent(e)}},H(t)),`/workspace/agent-profiles/${encodeURIComponent(e)}/details`)}async function ma(e,t){return W(await V.api.v1.workspace[`agent-profiles`][`:id`].open.$post({param:{id:encodeURIComponent(e)},json:t}),`/workspace/agent-profiles/${encodeURIComponent(e)}/open`)}async function ha(e){return W(await V.api.v1.workspace[`agent-profiles`].selection.$put({json:e}),`/workspace/agent-profiles/selection`)}async function ga(e,t){return W(await V.api.v1.workspace[`agent-profiles`][`:id`].$patch({param:{id:encodeURIComponent(e)},json:t}),`/workspace/agent-profiles/${encodeURIComponent(e)}`)}async function _a(e){return W(await V.api.v1.workspace[`agent-profiles`][`:id`].$delete({param:{id:encodeURIComponent(e)}}),`/workspace/agent-profiles/${encodeURIComponent(e)}`)}async function va(e,t){return W(await V.api.v1.workspace[`skills-update`].$get({query:{projectId:e}},H(t)),`/workspace/skills-update?projectId=${encodeURIComponent(e)}`)}async function ya(e){return W(await V.api.v1.workspace[`skills-update`].check.$post({json:{projectId:e}}),`/workspace/skills-update/check`)}async function ba(e){return W(await V.api.v1.workspace[`skills-update`].apply.$post({json:{projectId:e}}),`/workspace/skills-update/apply`)}async function xa(e){return W(await V.api.v1.workspace[`self-update`].$get({},H(e)),`/workspace/self-update`)}async function Sa(){return W(await V.api.v1.workspace[`self-update`].refresh.$post({}),`/workspace/self-update/refresh`)}async function Ca(e){return W(await V.api.v1.workspace[`self-update`].development.$get({query:e?.refresh?{refresh:`1`}:{}},H(e)),`/workspace/self-update/development`)}async function wa(e){return W(await V.api.v1.workspace[`self-update`].channel.$put({json:{channel:e}}),`/workspace/self-update/channel`)}async function Ta(e){return W(await V.api.v1.workspace[`self-update`].apply.$post({json:{version:e}}),`/workspace/self-update/apply`)}async function Ea(e){return W(await V.api.v1.workspace[`self-update`].apply.$post({json:{version:e,whenIdle:!0}}),`/workspace/self-update/apply`)}async function Da(){return W(await V.api.v1.workspace[`self-update`].scheduled.$delete({}),`/workspace/self-update/scheduled`)}async function Oa(e){let t=await W(await V.api.v1.workspace.config.$put({json:e}),`/workspace/config`);return{...t,orgSkillsRepos:t.orgSkillsRepos??[]}}async function ka(e){return W(await V.api.v1.p[`:projectId`].config.$put({param:{projectId:m()},json:e}),`/config`)}async function Aa(e){return W(await V.api.v1.p[`:projectId`].worktrees.$get({param:{projectId:m()}},H(e)),`/worktrees`)}async function ja(){return W(await V.api.v1.p[`:projectId`].worktrees.reclaim.$post({param:{projectId:m()},json:{}}),`/worktrees/reclaim`)}async function Ma(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`][`remove-worktree`].$post({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/remove-worktree`))}async function Na(e,t,n){return i.parse(await W(await V.api.v1.p[`:projectId`].tracker.watch.$post({param:{projectId:e},json:t},{init:{signal:n}}),`/tracker/watch`))}async function Pa(e,t,n,r){return c.parse(await W(await V.api.v1.p[`:projectId`].tracker.watch[`:watchId`].$get({param:{projectId:e,watchId:t},query:{after:r===void 0?void 0:String(r)}},{init:{signal:n}}),`/tracker/watch`))}async function Fa(e,t,n){return c.parse(await W(await V.api.v1.p[`:projectId`].tracker.watch[`:watchId`].$post({param:{projectId:e,watchId:t}},{init:{signal:n}}),`/tracker/watch`))}var Ia={list:async(e,t)=>W(await V.api.v1.p[`:projectId`].webhooks.$get({param:{projectId:e}},{init:{signal:t}}),`/webhooks`),create:async(e,t)=>W(await V.api.v1.p[`:projectId`].webhooks.$post({param:{projectId:e},json:t}),`/webhooks`),update:async(e,t,n)=>W(await V.api.v1.p[`:projectId`].webhooks[`:id`].$patch({param:{projectId:e,id:t},json:n}),`/webhooks`),remove:async(e,t,n)=>W(await V.api.v1.p[`:projectId`].webhooks[`:id`].$delete({param:{projectId:e,id:t},json:{expectedRevision:n}}),`/webhooks`),activate:async(e,t,n)=>W(await V.api.v1.p[`:projectId`].webhooks[`:id`].activate.$post({param:{projectId:e,id:t},json:{expectedRevision:n,confirmed:!0}}),`/webhooks`),pause:async(e,t,n)=>W(await V.api.v1.p[`:projectId`].webhooks[`:id`].pause.$post({param:{projectId:e,id:t},json:{expectedRevision:n}}),`/webhooks`),resume:async(e,t,n)=>W(await V.api.v1.p[`:projectId`].webhooks[`:id`].resume.$post({param:{projectId:e,id:t},json:{expectedRevision:n,confirmed:!0}}),`/webhooks`),rotate:async(e,t,n,r)=>W(await V.api.v1.p[`:projectId`].webhooks[`:id`][`rotate-secret`].$post({param:{projectId:e,id:t},json:{expectedRevision:n,mode:r}}),`/webhooks`),test:async(e,t,n)=>W(await V.api.v1.p[`:projectId`].webhooks[`:id`].test.$post({param:{projectId:e,id:t},json:n}),`/webhooks`),retry:async(e,t,n)=>W(await V.api.v1.p[`:projectId`].webhooks.deliveries[`:deliveryId`].retry.$post({param:{projectId:e,deliveryId:t},json:n}),`/webhooks`),replay:async(e,t,n)=>W(await V.api.v1.p[`:projectId`].webhooks.deliveries[`:deliveryId`].replay.$post({param:{projectId:e,deliveryId:t},json:{...n,confirmed:!0}}),`/webhooks`),acknowledge:async(e,t)=>W(await V.api.v1.p[`:projectId`].webhooks.notice.acknowledge.$post({param:{projectId:e},json:{expectedChangeSequence:t}}),`/webhooks`),history:async(e,t)=>W(await V.api.v1.p[`:projectId`].webhooks.history.$get({param:{projectId:e},query:{limit:`100`,...t?{cursor:t}:{}}}),`/webhooks/history`),deliveries:async(e,t,n,r)=>W(await V.api.v1.p[`:projectId`].webhooks[`:id`].deliveries.$get({param:{projectId:e,id:t},query:{limit:`100`,...n?{cursor:n}:{},...r?{taskId:r}:{}}}),`/webhooks/deliveries`),activity:async(e,t)=>W(await V.api.v1.p[`:projectId`].webhooks[`:id`].activity.$get({param:{projectId:e,id:t}}),`/webhooks/activity`)};async function La(e={limit:50},t){return W(await V.api.v1.p[`:projectId`][`worktree-lifecycle`].$get({param:{projectId:m()},query:{cursor:e.cursor,limit:e.limit,attentionOnly:e.attentionOnly===void 0?void 0:e.attentionOnly?`true`:`false`}},H(t)),`/worktree-lifecycle`)}async function Ra(e,t){return W(await V.api.v1.p[`:projectId`][`worktree-lifecycle`][`:worktreeId`].$get({param:{projectId:m(),worktreeId:e}},H(t)),`/worktree-lifecycle`)}async function za(e,t){return W(await V.api.v1.p[`:projectId`][`worktree-lifecycle`].operations[`:operationId`].$get({param:{projectId:m(),operationId:e}},H(t)),`/worktree-lifecycle/operations`)}async function Ba(e,t=0,n){return W(await V.api.v1.p[`:projectId`][`worktree-lifecycle`].operations[`:operationId`].output.$get({param:{projectId:m(),operationId:e},query:{afterSeq:t,limit:100}},H(n)),`/worktree-lifecycle/operations/output`)}async function Va(e){return W(await V.api.v1.p[`:projectId`][`worktree-lifecycle`].operations.$post({param:{projectId:m()},json:e}),`/worktree-lifecycle/operations`)}async function Ha(e,t){return W(await V.api.v1.p[`:projectId`][`worktree-lifecycle`].operations[`:operationId`].actions.$post({param:{projectId:m(),operationId:e},json:t}),`/worktree-lifecycle/operations/actions`)}async function Ua(e){return W(await V.api.v1.p[`:projectId`][`worktree-lifecycle`].preview.$post({param:{projectId:m()},json:e}),`/worktree-lifecycle/preview`)}async function Wa(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`].terminal.$get({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/terminal`))}async function Ga(e,t){return W(await V.api.v1.p[`:projectId`].runs[`:id`].terminal.$post({param:{projectId:m(),id:encodeURIComponent(e)},json:t}),G(e,`/terminal`))}async function Ka(e,t,n){return W(await V.api.v1.p[`:projectId`].runs[`:id`].terminal[`:sessionId`].output.$get({param:{projectId:m(),id:encodeURIComponent(e),sessionId:t},query:{cursor:String(n)}}),G(e,`/terminal/${t}/output`))}async function qa(e,t,n){await W(await V.api.v1.p[`:projectId`].runs[`:id`].terminal[`:sessionId`].input.$post({param:{projectId:m(),id:encodeURIComponent(e),sessionId:t},json:{data:n}}),G(e,`/terminal/${t}/input`))}async function Ja(e,t,n,r){await W(await V.api.v1.p[`:projectId`].runs[`:id`].terminal[`:sessionId`].resize.$post({param:{projectId:m(),id:encodeURIComponent(e),sessionId:t},json:{cols:n,rows:r}}),G(e,`/terminal/${t}/resize`))}async function Ya(e,t){await W(await V.api.v1.p[`:projectId`].runs[`:id`].terminal[`:sessionId`].$delete({param:{projectId:m(),id:encodeURIComponent(e),sessionId:t}}),G(e,`/terminal/${t}`))}async function Xa(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`].terminal.urls.$get({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/terminal/urls`))}async function Za(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`].terminal.commands.$get({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/terminal/commands`))}async function Qa(){return W(await V.api.v1.p[`:projectId`][`start-app`].$get({param:{projectId:m()}}),`/start-app`)}async function $a(e){return W(await V.api.v1.p[`:projectId`][`start-app`].$put({param:{projectId:m()},json:e}),`/start-app`)}async function eo(e){return W(await V.api.v1.p[`:projectId`].runs[`:id`].layouts.$get({param:{projectId:m(),id:encodeURIComponent(e)}}),G(e,`/layouts`))}async function to(e,t,n){let r=n?.keepalive===!0&&new TextEncoder().encode(JSON.stringify(t)).length<=Ai;return W(await V.api.v1.p[`:projectId`].runs[`:id`].layouts.$put({param:{projectId:m(),id:encodeURIComponent(e)},json:t},{init:{keepalive:r}}),G(e,`/layouts`))}async function no(e){return W(await V.api.v1.p[`:projectId`][`deferred-start`].preview.$post({param:{projectId:m()},json:e}),`/deferred-start/preview`)}async function ro(e){return W(await V.api.v1.p[`:projectId`][`deferred-start`].$post({param:{projectId:m()},json:e}),`/deferred-start`)}async function io(e){return W(await V.api.v1.p[`:projectId`][`deferred-start`].options.$post({param:{projectId:m()},json:e}),`/deferred-start/options`)}function ao(e,t){if(e===`ping`)return{project:null,event:{type:`ping`}};let n;try{n=JSON.parse(t)}catch{return null}if(!oo(n))return null;let r=n.project;if(typeof r!=`string`||r===``)return null;switch(e){case`run`:{let{project:e,...t}=n;return so(t)?{project:r,event:{type:`run`,run:t}}:null}case`run-deleted`:{let e=n.id;return typeof e==`string`&&e?{project:r,event:{type:`run-deleted`,id:e}}:null}case`todos`:return Array.isArray(n.items)?{project:r,event:{type:`todos`,items:n.items}}:null;case`usage`:return oo(n.usage)?{project:r,event:{type:`usage`,usage:n.usage}}:null;default:return null}}function oo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function so(e){return oo(e)&&typeof e.id==`string`&&e.id!==``}function co(e){return typeof e.task==`string`&&Array.isArray(e.steps)}function lo(e,t){if(!e)return;let n=e.findIndex(e=>e.id===t.id),r=n<0?void 0:e[n];if(r!==void 0){let i=[...e];return i[n]=fo(r,t),i}if(!co(t))return e;let i=t.createdAt??``,a=e.findIndex(e=>(e.createdAt??``).localeCompare(i)<0),o=[...e];return o.splice(a<0?e.length:a,0,t),o}function uo(e,t){if(!e)return;let n=e.filter(e=>e.id!==t);return n.length===e.length?e:n}function fo(e,t){let n={...t};if(!co(t)){let t=n;for(let n of u)n in e&&(t[n]=e[n])}let r=e=>e===`user`?2:+(e===`marker`);return r(e.titleOrigin)>r(t.titleOrigin)&&(n.title=e.title,n.titleSummary=e.titleSummary,n.titleOrigin=e.titleOrigin),e.usage&&(n.usage=e.usage),n}var po=Object.freeze({});function mo(){let e=po,t=new Set;return{subscribe(e){return t.add(e),()=>t.delete(e)},get:()=>e,set(n){e=n;for(let e of t)e()}}}var ho={draft:{label:`Draft`,hint:`the author has not marked it ready for review`,tone:`neutral`},"review-required":{label:`Waiting for review`,hint:`checks are fine, no one has reviewed it yet`,tone:`info`},"changes-requested":{label:`Changes requested`,hint:`a reviewer asked for edits before this can merge`,tone:`danger`},"checks-pending":{label:`Checks running`,hint:`CI has not finished on the latest commit`,tone:`pending`},"checks-failing":{label:`Checks failing`,hint:`CI is red on the latest commit`,tone:`danger`},ready:{label:`Ready to merge`,hint:`open, checks pass, nothing is waiting on a reviewer`,tone:`success`},merged:{label:`Merged`,hint:`this landed on its base branch`,tone:`violet`},closed:{label:`Closed`,hint:`closed without merging — the work did not land`,tone:`danger`},open:{label:`Open`,hint:`still open on the tracker`,tone:`success`},completed:{label:`Closed as completed`,hint:`the issue was resolved`,tone:`violet`},"not-planned":{label:`Closed as not planned`,hint:`the issue was declined — nothing shipped for it`,tone:`neutral`}},go={label:`Merge conflicts`,hint:`this branch no longer merges cleanly into its base — rebase or merge the base in`,tone:`conflict`};function _o(e){return typeof e==`string`&&Object.hasOwn(ho,e)}function vo(e){return e!==void 0&&_o(e)?ho[e]:void 0}var yo={permission:0,error:1,waiting:2,running:3,unseen:4,none:5};function bo(e){return!1}function xo(e){return!1}function So(e){let t=e.dispatch?.overBudget?e.dispatch.budgetUsd:void 0;if(!(e.status!==`waiting`||t===void 0))return{spent:e.costUsd??0,ceiling:t}}function K(e){return e.status===`failed`&&e.awaitingAnswerSince!==void 0}function Co(e){return!!e.worktreeLifecycle?.needsAttention||e.status===`waiting`||e.status===`review`||K(e)}function wo(e){let t=e.worktreeLifecycle;return t?.needsAttention?{bucket:`waiting`,tone:`pending`,pulse:!1,label:t.phase===`setup`?`setup needs attention`:`cleanup needs attention`}:t?.activeOperationId?{bucket:`running`,tone:`pending`,pulse:!0,label:t.phase===`setup`?`preparing worktree`:`cleaning up worktree`}:bo(e)?{bucket:`permission`,tone:`violet`,pulse:!0,label:`needs permission`}:e.status===`failed`&&e.autoResumeAt?{bucket:`none`,tone:`pending`,pulse:!1,label:`scheduled`}:K(e)?{bucket:`waiting`,tone:`pending`,pulse:!0,label:`needs you`}:e.status===`failed`?{bucket:`error`,tone:`danger`,pulse:!1,label:`failed`}:e.status===`waiting`?{bucket:`waiting`,tone:`pending`,pulse:!0,label:So(e)?.ceiling===void 0?`needs you`:`budget reached`}:e.status===`review`?{bucket:`waiting`,tone:`violet`,pulse:!0,label:`needs review`}:e.status===`running`&&e.activity===`monitoring`?{bucket:`running`,tone:`violet`,pulse:!0,label:`monitoring`}:e.status===`running`?{bucket:`running`,tone:`violet`,pulse:!0,label:`running`}:xo(e)?{bucket:`unseen`,tone:`violet`,pulse:!1,label:`unseen`}:e.status===`queued`?{bucket:`none`,tone:`neutral`,pulse:!1,label:`queued`}:e.status===`done`?{bucket:`none`,tone:`success`,pulse:!1,label:`done`}:{bucket:`none`,tone:`neutral`,pulse:!1,label:`cancelled`}}function To(e){return yo[wo(e).bucket]<=yo.waiting}var Eo=[`Pinned`,`Needs you`,`Working`,`Recent`,`Archived`],Do={waiting:0,review:1,running:2,queued:4,done:5,failed:5,cancelled:5},Oo=3,ko=e=>e.status===`failed`&&e.autoResumeAt!==void 0?Oo:K(e)?Do.waiting??0:Do[e.status]??9;function Ao(e,t){return t===`archived`?`Archived`:e.pinned?`Pinned`:Co(e)?`Needs you`:e.status===`running`||e.status===`queued`||e.status===`failed`&&e.autoResumeAt?`Working`:`Recent`}function jo(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function Mo(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function No(e,t){return t!==void 0&&Mo(e).ref===t}function Po(e){return e.title.replace(/ \([A-C]\)$/,``)}function Fo(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}var Io=[{value:`recent`,label:`Recent`},{value:`created`,label:`Created`}];function Lo(e,t){let n=Date.parse(e),r=Date.parse(t);return Number.isNaN(n)||Number.isNaN(r)?t.localeCompare(e):r-n}function Ro(e){if(e.lastActivityAt!==void 0)return e.lastActivityAt;let t=e.finishedAt??e.startedAt??e.createdAt;for(let n of e.steps??[]){let e=n.finishedAt??n.startedAt;e!==void 0&&Lo(e,t)<0&&(t=e)}return t}function zo(e,t){return t===`created`?e.createdAt:Ro(e)}function Bo(e){return e===`created`?`Created`:`Updated`}function Vo(e,t){if(t===`archived`)return[{key:`rest`,label:null,runs:[...e]}];let n=new Map(e.map(e=>[e.id,e])),r=e=>{let t=new Set;for(let r=e;r&&!t.has(r.id);r=n.get(r.dispatch?.parentRunId??``)){if(r.pinned)return!0;t.add(r.id)}return!1},i=e.filter(r);if(i.length===0)return[{key:`rest`,label:null,runs:[...e]}];let a=e.filter(e=>!r(e));return[{key:`pinned`,label:`Pinned`,runs:i},...a.length>0?[{key:`rest`,label:`All tasks`,runs:a}]:[]]}function Ho(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,n)=>{if(t!==`archived`){let t=Number(!!n.pinned)-Number(!!e.pinned);if(t!==0)return t}let r=ko(e)-ko(n);if(r!==0)return r;if(ko(e)===Oo&&e.autoResumeAt&&n.autoResumeAt){let t=e.autoResumeAt.localeCompare(n.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&n.status===`queued`?e.createdAt.localeCompare(n.createdAt):Lo(Ro(e),Ro(n))})}function Uo(e,t,n){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,r)=>{if(t!==`archived`){let t=Number(!!r.pinned)-Number(!!e.pinned);if(t!==0)return t}return Lo(zo(e,n),zo(r,n))})}function Wo(e,t){let n=Fo(e),r=Ho(e,t),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])},o=new Set;for(let e of r){if(e.groupId){if(o.has(e.groupId))continue;o.add(e.groupId);let n=r.filter(t=>t.groupId===e.groupId).sort((e,t)=>(e.variant??``).localeCompare(t.variant??``));if(n.length>1){a(Ao(e,t),{kind:`group`,groupId:e.groupId,title:Po(e),members:n});continue}}a(Ao(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null})}return Eo.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function Go(e,t){let n=[],r=t;for(let t of e){if(t.label===`Pinned`){n.push({label:t.label,rows:[...t.rows]});continue}if(r<=0)continue;let e=t.rows.slice(0,r);r-=e.length,n.push({label:t.label,rows:e})}return n}function Ko(e){let t=0,n=0,r=0;for(let i of e){if(i.archived){n+=1;continue}t+=1,Co(i)&&(r+=1)}return{active:t,archived:n,waiting:r}}var qo=new Set([`running`,`waiting`]),Jo=new Set([`done`,`failed`,`review`,`cancelled`]),Yo=new Set([`done`,`failed`,`cancelled`]);function Xo(e){return e?e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} kB`:``}function Zo(e){return e?`$${e>=10?e.toFixed(0):e.toFixed(2)}`:``}function Qo(e,t=new Date){if(e.status!==`failed`||!e.autoResumeAt)return;let n=new Date(e.autoResumeAt);if(!Number.isFinite(n.getTime()))return;let r=n.toDateString()===t.toDateString(),i=new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(n);return{label:r?i:`${new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(n)} ${i}`,title:`Resumes automatically at ${new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(n)}`}}function $o(e){if(e.workflow===`(planned)`||e.workflow===`(inbox)`){let t=e.steps.find(e=>e.kind===`agent`);if(t?.name)return t.name}return e.workflow}function es(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[jo(e),e.branch??``,e.workflow,$o(e)].some(e=>e.toLowerCase().includes(n))):[...e]}function ts(e){return e.filter(e=>!e.archived&&Yo.has(e.status)&&!K(e)).length}function ns(e,t=!1){if(!e)return;let n=e.trim().replace(/\/+$/,``),r=/^(?:https?|ssh|git|git\+ssh):\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/.exec(n),i=r?null:/^(?:[^@/:]+@)?([^:/]+):(.+)$/.exec(n),a=r??i;if(!a)return;let[,o,s]=a;if(!s||!o||!t&&o.toLowerCase()!==`github.com`)return;let c=s.replace(/\.git$/i,``).split(`/`).filter(Boolean),l=c[c.length-2],u=c[c.length-1];return l&&u?`https://${o.toLowerCase()}/${l}/${u}`:void 0}function rs(e){if(e.pullRequestUrl){let t=Number(q(e.pullRequestUrl));return{url:e.pullRequestUrl,...t>0?{number:t}:{}}}let t=e.prRefs?.find(e=>e.origin===`created`||e.origin===`marker`);if(t)return{number:t.number,...t.url?{url:t.url}:{}};let n=e.markerRefs?.pr;return n===void 0?void 0:{number:n}}function is(e){return as(e)[0]?.url??os(e)[0]}function as(e,t){if(!e.prRefs?.length)return os(e).map(e=>({number:Number(q(e)),url:e,origin:`legacy`})).filter(e=>Number.isInteger(e.number)&&e.number>0);let n={created:0,marker:1,legacy:2,derived:3};return[...e.prRefs].sort((e,t)=>n[e.origin]-n[t.origin]).map(e=>({number:e.number,url:e.url??ps(`PR`,e.number,t),origin:e.origin}))}function os(e){let t=[];return e.pullRequestUrl&&t.push(e.pullRequestUrl),!(e.markerRefs?.issue!==void 0&&e.markerRefs?.pr===void 0)&&e.referencedPullRequestUrl&&t.push(e.referencedPullRequestUrl),t}function ss(e,t){if(e.referencedIssueUrl)return e.referencedIssueUrl;let n=e.markerRefs?.issue??e.issueNumber;if(!(!n||!t)&&!cs(e.referencedIssueCandidates,n,t))return`${t}/issues/${n}`}function cs(e,t,n){let r=`${n.toLowerCase()}/`;return(e??[]).some(e=>e.endsWith(`/${t}`)&&!e.toLowerCase().startsWith(r))}function ls(e,t){return e.map((e,t)=>({reference:e,index:t})).sort((e,n)=>{let r=e.reference.kind===`PR`&&t(e.reference)===`closed`,i=n.reference.kind===`PR`&&t(n.reference)===`closed`;return Number(r)-Number(i)||e.index-n.index}).map(({reference:e})=>e)}function us(e,t){let n=e.prRefs?.length?as(e,t).map(e=>({number:e.number,url:e.url})):os(e).map(e=>({url:e,number:Number(q(e))||void 0})),r=e.markerRefs?.pr,i=[...r===void 0||n.some(e=>e.number===r)?[]:[{kind:`PR`,number:r}],...n.map(e=>({kind:`PR`,url:e.url,number:e.number})),{kind:`PR`,number:fs(e,t)},{kind:`Issue`,url:ss(e,t)},{kind:`Issue`,number:ds(e,t)}],a=new Set,o=[];for(let e of i){let n=e.url?Number(q(e.url)):e.number;if(!n||!Number.isInteger(n))continue;let r=e.url??ps(e.kind,n,t),i=o.findIndex(t=>t.kind===e.kind&&t.number===n&&(!t.url||!r||t.url===r));if(i>=0){!o[i].url&&r&&(o[i]={...o[i],url:r});continue}let s=`${e.kind}#${n}#${r??``}`;a.has(s)||(a.add(s),o.push({kind:e.kind,number:n,...r?{url:r}:{}}))}return o}function ds(e,t){let n=e.issueNumber;return n===void 0||!t?n:cs(e.referencedIssueCandidates,n,t)?void 0:n}function fs(e,t){let n=e.prNumber;return n===void 0||!t?n:cs(e.referencedPrCandidates,n,t)?void 0:n}function ps(e,t,n){if(n)return`${n}/${e===`PR`?`pull`:`issues`}/${t}`}function ms(e,t){return us(e,t)[0]}function q(e){let t=e.split(`/`).pop()??``;return/^\d+$/.test(t)?t:null}function hs(e,t){let n=qo.has(e.status)?t:void 0;if(n)return{cpu:{text:`${n.cpuPct.toFixed(0)}%`,kind:`live`},mem:{text:Xo(n.rssBytes),kind:`live`}};let r=Xo(e.peakRssBytes);return{cpu:{text:``,kind:`none`},mem:r?{text:`peak ${r}`,kind:`peak`,title:`peak — run finished${e.peakProcCount?` · ${e.peakProcCount} procs`:``}`}:{text:``,kind:`none`}}}function gs(e,t){let n=e.filter(e=>t===`archived`?e.archived:!e.archived),r=new Map;for(let e of n){if(!e.groupId)continue;let t=r.get(e.groupId);t?t.push(e):r.set(e.groupId,[e])}return[...r.entries()].flatMap(([e,t])=>{let n=t[0];return!n||t.length<2||!t.every(e=>Jo.has(e.status))?[]:[{groupId:e,title:Po(n),count:t.length}]})}function _s(e){let t=new Map;for(let n of e)for(let e of n.tags??[]){let n=e.toLowerCase();t.has(n)||t.set(n,e)}return[...t.values()].sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}))}function vs(e,t,n,r=8){let i=n.trim().toLowerCase(),a=new Set(t.map(e=>e.toLowerCase())),o=e.filter(e=>{let t=e.toLowerCase();return a.has(t)?!1:i===``||t.includes(i)&&t!==i});return i===``?o.slice(0,r):o.sort((e,t)=>Number(t.toLowerCase().startsWith(i))-Number(e.toLowerCase().startsWith(i))||e.localeCompare(t,void 0,{sensitivity:`base`})).slice(0,r)}function ys(e){let t=new Map;for(let n of e){let e=n.trim();if(!e)continue;let r=e.toLowerCase();t.has(r)||t.set(r,e)}return[...t.values()].sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}))}var bs=`/api/v1/ws`,xs=3e3,Ss=1e3,Cs=7e4,ws=0,Ts=1;function Es(e){let t=new Map,n=new Map,r=null,i,a,o,s=()=>{clearTimeout(o),o=setTimeout(()=>{o=void 0,r?.close()},Cs)},c=()=>e??`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}${bs}`,l=e=>{r?.readyState===Ts&&r.send(JSON.stringify(e))},u=()=>{let e=globalThis.WebSocket;if(typeof e!=`function`||r&&(r.readyState===ws||r.readyState===Ts))return;let a=new e(c());r=a,a.addEventListener(`open`,()=>{if(a===r){s();for(let e of t.keys())l({type:`subscribe`,topic:e})}}),a.addEventListener(`message`,e=>{if(a!==r)return;s();let i;try{i=JSON.parse(e.data)}catch{return}if(typeof i!=`object`||!i)return;let{type:o,topic:c,data:l}=i;if(typeof c!=`string`)return;if(o===`error`){for(let e of[...n.get(c)??[]])e();return}if(o!==`event`)return;let u=t.get(c);if(u)for(let e of[...u])e(l)}),a.addEventListener(`close`,()=>{a===r&&(r=null,clearTimeout(o),o=void 0,t.size>0&&i===void 0&&(i=setTimeout(()=>{i=void 0,t.size>0&&u()},xs)))}),a.addEventListener(`error`,()=>void 0)};return{subscribe(e,s,c){let d=()=>c?.();c&&(n.has(e)||n.set(e,new Set),n.get(e).add(d));let f=t.get(e);f||(f=new Set,t.set(e,f));let p=f.size===0;f.add(s),clearTimeout(a),a=void 0,r?p&&l({type:`subscribe`,topic:e}):(clearTimeout(i),i=void 0,u());let m=!0;return()=>{m&&(m=!1,n.get(e)?.delete(d),n.get(e)?.size||n.delete(e),f.delete(s),!(f.size>0)&&(t.delete(e),l({type:`unsubscribe`,topic:e}),t.size===0&&a===void 0&&(a=setTimeout(()=>{a=void 0,!(t.size>0)&&(clearTimeout(i),i=void 0,clearTimeout(o),o=void 0,r?.close(),r=null)},Ss))))}}}}var Ds=null;function Os(e,t,n){return Ds??=Es(),Ds.subscribe(e,t,n)}var J={secrets:{allFor:e=>[`secrets`,e],list:()=>[`secrets`,m()]},e2e:{allFor:e=>[`e2e`,e],status:()=>[`e2e`,m()]},tracker:{allFor:e=>[`tracker`,e],all:()=>[`tracker`,m()],associationFor:e=>[`tracker`,e,`association`],association:()=>[`tracker`,m(),`association`],candidates:(e,t=``)=>[`tracker`,m(),`candidates`,e,t],connection:()=>[`tracker`,m(),`connection`],items:(e,t)=>[`tracker`,m(),`items`,e.kind,e.source.id,e.source.webUrl,e.externalId,e.connectionId??null,t.state,[...t.labels],t.query??``],detail:(e,t)=>[`tracker`,m(),`detail`,e.kind,e.source.id,e.source.webUrl,e.externalId,e.connectionId??null,t]},get health(){return[m(),`health`]},runs:{get all(){return[m(),`runs`]},list:()=>[m(),`runs`,`list`],detail:e=>[m(),`runs`,`detail`,e],diff:e=>[m(),`runs`,`diff`,e],changes:e=>[m(),`runs`,`changes`,e],gitStatus:e=>[m(),`runs`,`git-status`,e],file:(e,t)=>[m(),`runs`,`files`,e,t],handoff:e=>[m(),`runs`,`handoff`,e],drafts:e=>[m(),`runs`,`drafts`,e],commits:e=>[m(),`runs`,`commits`,e],tree:e=>[m(),`runs`,`tree`,e],commit:(e,t)=>[m(),`runs`,`commit`,e,t]},groups:{detail:e=>[m(),`groups`,e]},get todos(){return[m(),`todos`]},get workflows(){return[m(),`workflows`]},get workflowNodes(){return[m(),`workflow-nodes`]},get skills(){return[m(),`skills`]},get skillsReady(){return[m(),`skills`,`ready`]},get importableSkills(){return[m(),`skills`,`importable`]},get importableSkillsReady(){return[m(),`skills`,`importable`,`ready`]},get launchKey(){return[m(),`launch-key`]},get repo(){return[m(),`repo`]},get repoChanges(){return[m(),`repo`,`changes`]},repoCommit:e=>[m(),`repo`,`commit`,e],get repoSync(){return[m(),`repo`,`sync`]},get repoTree(){return[m(),`repo`,`tree`]},repoFile:e=>[m(),`repo`,`file`,e],get uiState(){return[m(),`ui-state`]},get config(){return[m(),`config`]},get agentConfig(){return[m(),`agent-config`]},agentConfigFile:e=>[m(),`agent-config`,`file`,e],get worktrees(){return[m(),`worktrees`]},github:(e={})=>[m(),`github`,e.limit??null],githubPages:(e=50)=>[m(),`github`,`pages`,e],githubChecks:e=>[m(),`github`,`checks`,[...e].sort((e,t)=>e-t).join(`,`)],githubSearch:(e,t)=>[m(),`github`,`search`,e,t],githubRefStatus:(e,t,n)=>[e,`github`,`ref-status`,[...t].sort((e,t)=>e-t).join(`,`),[...n].sort((e,t)=>e-t).join(`,`)],githubComments:(e,t)=>[m(),`github`,`comments`,e,t],githubMergeState:e=>[m(),`github`,`merge-state`,e],get openTargets(){return[m(),`open-targets`]}},ks=6e4;function As(){return M({queryKey:J.secrets.list(),queryFn:({signal:e})=>rr({signal:e})})}function js(){return M({queryKey:Y.secrets,queryFn:({signal:e})=>ir({signal:e})})}function Ms(){return M({queryKey:J.e2e.status(),queryFn:({signal:e})=>ur({signal:e})})}function Ns(){return M({queryKey:J.tracker.connection(),queryFn:({signal:e})=>er({signal:e})})}function Ps(){return M({queryKey:J.tracker.association(),queryFn:({signal:e})=>fr({signal:e})})}function Fs(e,t,n){return P({queryKey:J.tracker.candidates(e,t),staleTime:ks,queryFn:({pageParam:n,signal:r})=>pr(e,{q:t.trim()||void 0,cursor:n,limit:50},{signal:r}),initialPageParam:void 0,getNextPageParam:e=>e.available&&e.truncated?e.nextCursor:void 0,enabled:n})}var Is=class extends Error{failure;constructor(e){super(e.reason),this.failure=e,this.name=`TrackerRefreshError`}};function Ls(e,t,n=!0){let r=t.query.trim(),i=j(),a=e?J.tracker.items(e,{...t,query:r}):[`tracker`,m(),`items`,`unassociated`];return{...P({queryKey:a,staleTime:1/0,queryFn:({pageParam:n,signal:i})=>r?vr(r,{association:e??void 0,cursor:n,limit:50,state:t.state,labels:t.labels,refresh:!0},{signal:i}):_r({association:e??void 0,cursor:n,limit:50,state:t.state,labels:t.labels,refresh:!1},{signal:i}),initialPageParam:void 0,getNextPageParam:e=>e.available&&e.truncated?e.nextCursor:void 0,enabled:e!=null&&n}),queryKey:a,restart:async()=>{await i.cancelQueries({queryKey:a,exact:!0});try{await i.fetchInfiniteQuery({queryKey:a,initialPageParam:void 0,pages:1,getNextPageParam:e=>e.available&&e.truncated?e.nextCursor:void 0,staleTime:0,retry:!1,queryFn:async({signal:n})=>{let i={association:e??void 0,limit:50,state:t.state,labels:t.labels,refresh:!0},a=r?await vr(r,i,{signal:n}):await _r(i,{signal:n});if(!a.available)throw new Is(a);return a}})}catch{}}}}function Rs(e,t){return M({staleTime:ks,queryKey:e&&t?J.tracker.detail(e,t):[`tracker`,m(),`detail`,`disabled`],queryFn:({signal:n})=>yr(t,{signal:n,association:e??void 0}),enabled:e!=null&&t!=null&&t!==``})}var Y={dashboard:[`workspace`,`dashboard`],models:e=>[`workspace`,`models`,e],providerStatus:[`workspace`,`providers`,`status`],projects:[`workspace`,`projects`],githubOwners:[`workspace`,`github-owners`],runsIndex:[`workspace`,`runs-index`],secrets:[`workspace`,`secrets`],uiState:[`workspace`,`ui-state`],config:[`workspace`,`config`],hostUsage:[`workspace`,`host-usage`],agentProfiles:[`workspace`,`agent-profiles`],agentAccountDetails:e=>[`workspace`,`agent-profiles`,`details`,e],agentAccountStatus:e=>[`workspace`,`agent-profiles`,`status`,e],skillsUpdateAll:[`workspace`,`skills-update`],skillsUpdate:e=>[`workspace`,`skills-update`,e],selfUpdate:[`workspace`,`self-update`],selfUpdateDevelopment:[`workspace`,`self-update`,`development`],starCount:[`workspace`,`star-count`],telemetryConsent:[`workspace`,`telemetry-consent`],fsBrowseRoot:[`workspace`,`fs-browse`],fsBrowse:(e,t=!1)=>[...Y.fsBrowseRoot,e,t]};function X(e,t=!0){return M({queryKey:Y.models(e),queryFn:({signal:t})=>a(e)?yn(e,{signal:t}):Promise.reject(Error(`${e} has no host model catalog`)),staleTime:300*1e3,enabled:t&&a(e)})}function zs(e=!0){let t=X(`claude`,e),n=X(`codex`,e),r=X(`opencode`,e),i=X(`cursor`,e),a=X(`pi`,e);return{claude:t,codex:n,junie:X(`junie`,e),opencode:r,cursor:i,pi:a,copilot:X(`copilot`,e)}}function Bs(){let e=j();return M({queryKey:Y.providerStatus,queryFn:async({signal:t})=>{let n=e.getQueryData(Y.providerStatus),r=await bn(!1,{signal:t});return Ut(n,e.getQueryData(Y.providerStatus),r)},staleTime:5*6e4,refetchInterval:!1,refetchOnWindowFocus:!0})}function Vs(){let e=j();return N({mutationFn:()=>bn(!0),onMutate:()=>e.getQueryData(Y.providerStatus),onSuccess:(t,n,r)=>e.setQueryData(Y.providerStatus,e=>Ut(r,e,t))})}function Hs(){let e=j();return N({mutationFn:({provider:e,authFailureId:t})=>Ir(e,t),onMutate:()=>e.getQueryData(Y.providerStatus),onSuccess:(t,n,r)=>{e.setQueryData(Y.providerStatus,e=>Ut(r,e,t,n.authFailureId))}})}function Us(){return M({queryKey:Y.projects,queryFn:({signal:e})=>Sn({signal:e})})}function Ws(e,t=!1){return M({queryKey:Y.fsBrowse(e,t),queryFn:({signal:n})=>Cn(e??void 0,{signal:n,showHidden:t}),retry:!1})}function Gs(){let e=j();return N({mutationFn:e=>Lr(e),onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function Ks(){let e=j();return N({mutationFn:e=>Vr(e),retry:!1,onSuccess:()=>{e.invalidateQueries({queryKey:Y.projects})}})}function qs(){let e=j();return N({mutationFn:e=>{let{id:t,...n}=e;return Hr(t,n)},retry:!1,onMutate:async({id:t,...n})=>{await e.cancelQueries({queryKey:Y.projects});let r=e.getQueryData(Y.projects);return e.setQueryData(Y.projects,e=>e===void 0?e:{...e,projects:e.projects.map(e=>e.id===t?Js(e,n):e)}),{previous:r}},onError:(t,n,r)=>{r?.previous&&e.setQueryData(Y.projects,r.previous)},onSuccess:({project:t})=>{e.setQueryData(Y.projects,e=>e===void 0?e:{...e,projects:e.projects.map(e=>e.id===t.id?t:e)})},onSettled:()=>e.invalidateQueries({queryKey:Y.projects})})}function Js(e,t){let{maxParallel:n,tags:r,...i}=e,a={...i},o=`maxParallel`in t?t.maxParallel:e.maxParallel;o!=null&&(a.maxParallel=o);let s=`tags`in t&&t.tags!==void 0?t.tags:e.tags,c=s==null?[]:ys(s);return c.length>0&&(a.tags=c),a}function Ys(e){let t=j();return N({mutationFn:e,retry:!1,onSuccess:async()=>{await Promise.all([t.invalidateQueries({queryKey:Y.agentProfiles}),t.invalidateQueries({queryKey:Y.projects})])}})}function Xs(){return Ys(e=>da(e))}function Zs(){return Ys(e=>{let{id:t,...n}=e;return ga(t,n)})}function Qs(){return Ys(e=>_a(e))}function $s(){return Ys(e=>ha(e))}function ec(e,t){return M({queryKey:Y.agentAccountDetails(e),queryFn:({signal:t})=>pa(e,{signal:t}),enabled:t,staleTime:0,retry:!1})}function tc(e,t){return M({queryKey:Y.agentAccountStatus(e),queryFn:({signal:t})=>fa(e,{signal:t}),enabled:t,staleTime:6e4,retry:!1})}function nc(){let e=j();return N({mutationFn:({provider:e,profileId:t})=>Nr(e,t),retry:!1,onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:Y.agentProfiles}),e.invalidateQueries({queryKey:Y.providerStatus})])}})}function rc(){let e=j();return N({mutationFn:e=>fa(e,{recheck:!0}),retry:!1,onSuccess:(t,n)=>{e.setQueryData(Y.agentAccountStatus(n),t),e.invalidateQueries({queryKey:Y.agentProfiles})}})}function ic(){return N({mutationFn:e=>{let{routeId:t,...n}=e;return ma(t,n)},retry:!1})}function ac(){let e=j();return N({mutationFn:e=>Rr(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function oc(){let e=j();return N({mutationFn:e=>zr(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function sc(){return M({queryKey:Y.githubOwners,queryFn:({signal:e})=>Br({signal:e}),staleTime:5*6e4,retry:!1})}function cc(){let e=j();(0,A.useEffect)(()=>{let t,n=()=>{let n=e.getQueryData(J.health)?.capabilities?.localHandoff===!0;n&&t===void 0?t=Os(`health`,t=>{e.setQueryData(J.health,t)}):!n&&t!==void 0&&(t(),t=void 0)};n();let r=e.getQueryCache().subscribe(n);return()=>{r(),t?.()}},[e])}function lc(){return M({queryKey:J.health,queryFn:({signal:e})=>mn({signal:e}),refetchInterval:e=>dc(e.state.data)})}var uc=3e4;function dc(e){return e?.capabilities?.localHandoff===!1&&e.forge!=null&&e.forge.available!==!0&&uc}function fc(){let e=lc().data,t=Us().data?.projects,{projectId:n}=Ft(),r=n??e?.bootProject,i=r===void 0?void 0:t?.find(e=>e.id===r);return i?.repoUrl?i.repoUrl:n===null||n===e?.bootProject?ns(e?.repo?.remote,e?.forge?.kind===`github`):void 0}function pc(){return M({queryKey:J.openTargets,queryFn:({signal:e})=>hi({signal:e}),staleTime:5*6e4})}function mc(e){return M({queryKey:J.runs.list(),queryFn:({signal:e})=>wn({signal:e}),select:e})}function hc(e=!0,t){return M({queryKey:Y.runsIndex,queryFn:({signal:e})=>En({signal:e}),enabled:e,staleTime:3e4,...t===void 0?{}:{refetchInterval:typeof t==`function`?e=>t(e.state.data):t}})}function gc(e,t=!0,n=!1,r){return M({queryKey:[n?`default`:e,`runs`,`list`],queryFn:({signal:t})=>Tn(e,{signal:t}),enabled:t,select:r})}function _c(e,t,n){let r=e==="default"?null:e,i=r===null||t!=null&&r===t;return gc(i?`default`:r??`default`,!0,i,n)}function vc(e){return{queryKey:J.runs.detail(e),queryFn:({signal:t})=>Dn(e,{signal:t})}}function yc(e){return M({...vc(e??``),enabled:!!e})}function bc(e,t,n=!0){return M({queryKey:[e??`default`,`runs`,`detail`,t??``],queryFn:({signal:n})=>On(e,t,{signal:n}),enabled:n&&!!e&&!!t})}function xc(e){return M({queryKey:J.runs.diff(e??``),queryFn:({signal:t})=>Dr(e,{signal:t}),enabled:!!e})}function Sc(e,t=!1){return M({queryKey:J.runs.changes(e??``),queryFn:({signal:t})=>kr(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?4e3:!1,refetchOnWindowFocus:!0,staleTime:0})}function Cc(e,t,n=!1){return M({queryKey:J.runs.gitStatus(e),queryFn:({signal:t})=>bi(e,{signal:t}),enabled:t,retry:!1,refetchInterval:n?1e4:!1,refetchOnWindowFocus:!0,staleTime:0})}function wc(e,t=!0){return M({queryKey:J.runs.tree(e??``),queryFn:({signal:t})=>Yn(e,{signal:t}),enabled:t&&!!e,retry:!1,staleTime:0})}function Tc(e,t){return M({queryKey:J.runs.file(e??``,t??``),queryFn:({signal:n})=>Ar(e,t,{signal:n}),enabled:!!e&&t!==void 0,retry:!1})}function Ec(e){return M({queryKey:J.groups.detail(e??``),queryFn:({signal:t})=>Mr(e,{signal:t}),enabled:!!e})}function Dc(e,t=!1){return M({queryKey:J.runs.commits(e??``),queryFn:({signal:t})=>Xn(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?5e3:!1})}function Oc(e,t){return M({queryKey:J.runs.commit(e??``,t??``),queryFn:({signal:n})=>Zn(e,t,{signal:n}),enabled:!!e&&!!t,retry:!1})}function kc(e,t=!0){return M({queryKey:J.runs.handoff(e??``),queryFn:({signal:t})=>Or(e,{signal:t}),enabled:!!e&&t})}function Ac(e){return M({queryKey:J.runs.drafts(e??``),queryFn:({signal:t})=>ki(e,{signal:t}),enabled:!!e,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1})}function jc(e=!0){return M({queryKey:J.todos,queryFn:({signal:e})=>Rn({signal:e}),enabled:e})}function Mc(){return M({queryKey:J.workflowNodes,queryFn:({signal:e})=>Qi({signal:e}),staleTime:1/0})}function Nc(e={}){return M({queryKey:J.workflows,enabled:e.enabled??!0,queryFn:({signal:e})=>Mn({signal:e})})}function Pc(e=!0){let t=j(),n=J.skills,r=n[0],i=M({queryKey:n,queryFn:({signal:e})=>Nn({signal:e}),enabled:e}),a=M({queryKey:J.skillsReady,queryFn:({signal:e})=>Pn({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,A.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`],a.data)},[t,a.data,r]),i}function Fc(e=!0){let t=j(),n=J.importableSkills,r=n[0],i=M({queryKey:n,queryFn:({signal:e})=>In({signal:e}),enabled:e}),a=M({queryKey:J.importableSkillsReady,queryFn:({signal:e})=>Ln({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,A.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`,`importable`],a.data)},[t,a.data,r]),i}function Ic(){return M({queryKey:J.launchKey,queryFn:({signal:e})=>xn({signal:e}),staleTime:1/0})}function Lc(){return M({queryKey:J.repo,queryFn:({signal:e})=>zn({signal:e})})}function Rc(){return M({queryKey:J.repoSync,queryFn:({signal:e})=>Ri({signal:e}),refetchOnWindowFocus:!0})}function zc(){let e=j();return N({mutationFn:e=>zi(e),onSuccess:t=>{e.setQueryData(J.repoSync,t.sync),e.invalidateQueries({queryKey:J.repo,predicate:e=>e.queryKey[2]!==`sync`})}})}function Bc(){return M({queryKey:J.repoChanges,queryFn:({signal:e})=>Wn({signal:e}),retry:!1})}function Vc(){return M({queryKey:J.repoTree,queryFn:({signal:e})=>Gn({signal:e}),retry:!1,refetchOnWindowFocus:!0,staleTime:0})}function Hc(e){return M({queryKey:J.repoFile(e??``),queryFn:({signal:t})=>Kn(e,{signal:t}),enabled:e!==void 0&&e!==``,retry:!1,refetchOnWindowFocus:!0,staleTime:0})}function Uc(e){return M({queryKey:J.repoCommit(e??``),queryFn:({signal:t})=>Jn(e,{signal:t}),enabled:!!e,retry:!1})}function Wc(){return M({queryKey:J.config,queryFn:({signal:e})=>Bn({signal:e})})}function Gc(){return M({queryKey:J.worktrees,queryFn:({signal:e})=>Aa({signal:e})})}function Kc(){return M({queryKey:J.uiState,queryFn:({signal:e})=>jn({signal:e})})}function qc(){return M({queryKey:J.agentConfig,queryFn:({signal:e})=>Vn({signal:e})})}function Jc(e){return M({queryKey:J.agentConfigFile(e??``),queryFn:({signal:t})=>Hn(e,{signal:t}),enabled:e!==null})}function Yc(e){let t=j(),n=J.agentConfig,r=J.agentConfigFile(e);return N({mutationFn:t=>Un(e,t),onSuccess:e=>{t.setQueryData(r,e),t.invalidateQueries({queryKey:n})}})}function Xc(){return M({queryKey:Y.uiState,queryFn:({signal:e})=>ia({signal:e})})}function Zc(){return M({queryKey:Y.config,queryFn:({signal:e})=>oa({signal:e})})}function Qc(){return M({queryKey:Y.agentProfiles,queryFn:({signal:e})=>ua({signal:e})})}var $c=1e4;function el(e=!0){return M({queryKey:Y.starCount,queryFn:({signal:e})=>hn({signal:e}),enabled:e,staleTime:$c,refetchInterval:$c,retry:!1,refetchOnMount:!1})}function tl(){return M({queryKey:Y.telemetryConsent,queryFn:({signal:e})=>_n({signal:e}),staleTime:1/0,retry:!1})}var nl=6;function rl(e,t=!0){return M({queryKey:Y.skillsUpdate(e),queryFn:({signal:t})=>va(e,{signal:t}),enabled:t,refetchInterval:e=>{let t=e.state.data?.status;return(t===void 0||t===`checking`||t===`updating`||t===`idle`&&e.state.dataUpdateCount<nl)&&6e4}})}function il(e=!0){return M({queryKey:Y.selfUpdate,queryFn:({signal:e})=>xa({signal:e}),enabled:e,refetchInterval:e=>e.state.data?.job?.status===`running`?1e3:e.state.data?.scheduled?5e3:!1})}function al(e=!0){return M({queryKey:Y.selfUpdateDevelopment,queryFn:({signal:e})=>Ca({signal:e}),enabled:e,staleTime:3e4})}function ol(){let e=j();return N({mutationFn:()=>Ca({refresh:!0}),onSuccess:t=>e.setQueryData(Y.selfUpdateDevelopment,t)})}function sl(){let e=j();return N({mutationFn:()=>Sa(),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function cl(){let e=j();return N({mutationFn:e=>wa(e),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function ll(){let e=j();return N({mutationFn:e=>Ta(e),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function ul(){let e=j();return N({mutationFn:e=>Ea(e),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function dl(){let e=j();return N({mutationFn:()=>Da(),onSuccess:t=>e.setQueryData(Y.selfUpdate,t)})}function fl(e){let t=j();return N({mutationFn:t=>li(e,t),onSuccess:e=>{pl(t,e),t.invalidateQueries({queryKey:J.runs.all})}})}function pl(e,t){e.setQueryData(J.runs.list(),e=>e?.map(e=>e.id===t.id?fo(e,t):e)),e.setQueryData(J.runs.detail(t.id),e=>e?fo(e,t):t),ml(e)}function ml(e){e.invalidateQueries({queryKey:Y.runsIndex})}function hl(){let e=j();return N({mutationFn:e=>$r(e),onMutate:async t=>{await e.cancelQueries({queryKey:J.runs.list()}),await e.cancelQueries({queryKey:J.runs.detail(t)});let n=e.getQueryData(J.runs.list()),r=e.getQueryData(J.runs.detail(t)),i=new Date().toISOString();return e.setQueryData(J.runs.list(),e=>e?.map(e=>e.id===t?{...e,seenAt:i}:e)),e.setQueryData(J.runs.detail(t),e=>e&&{...e,seenAt:i}),{prevList:n,prevDetail:r,id:t}},onError:(t,n,r)=>{r?.prevList&&e.setQueryData(J.runs.list(),r.prevList),r?.prevDetail&&e.setQueryData(J.runs.detail(n),r.prevDetail)},onSuccess:t=>{let n=e=>e.id===t.id?{...e,seenAt:t.seenAt}:e;e.setQueryData(J.runs.list(),e=>e?.map(n)),e.setQueryData(J.runs.detail(t.id),e=>e?n(e):t),ml(e)}})}function gl(){let e=j();return N({mutationFn:e=>ei(e),onMutate:async t=>{await e.cancelQueries({queryKey:J.runs.list()}),await e.cancelQueries({queryKey:J.runs.detail(t)});let n=e.getQueryData(J.runs.list()),r=e.getQueryData(J.runs.detail(t));return e.setQueryData(J.runs.list(),e=>e?.map(e=>e.id===t?_l(e):e)),e.setQueryData(J.runs.detail(t),e=>e&&_l(e)),{prevList:n,prevDetail:r,id:t}},onError:(t,n,r)=>{r?.prevList&&e.setQueryData(J.runs.list(),r.prevList),r?.prevDetail&&e.setQueryData(J.runs.detail(n),r.prevDetail)},onSuccess:t=>{let n=e=>e.id===t.id?_l(e):e;e.setQueryData(J.runs.list(),e=>e?.map(n)),e.setQueryData(J.runs.detail(t.id),e=>e?n(e):t),ml(e)}})}function _l(e){let{seenAt:t,...n}=e;return n}function vl(e,t,n){let r=j();return N({mutationFn:({id:n,pinned:r,surface:i})=>t===void 0?qr(n,r,i??e):Jr(t,n,r,i??e),onSuccess:()=>r.invalidateQueries({queryKey:n===void 0?J.runs.all:[n,`runs`]})})}function yl(e,t,n){let r=j();return N({mutationFn:({id:n,archived:r})=>t===void 0?Kr(n,r,e):Yr(t,n,r,e),onSuccess:()=>r.invalidateQueries({queryKey:n===void 0?J.runs.all:[n,`runs`]})})}function bl(e,t){let n=j();return N({mutationFn:n=>t===void 0?Ti(e,n):Ei(t,e,n),onSuccess:()=>n.invalidateQueries({queryKey:J.runs.all}),onError:e=>{e instanceof R&&e.status===409&&n.invalidateQueries({queryKey:J.runs.all})}})}function xl(e,t){let n=j();return N({mutationFn:(n={})=>t===void 0?ii(e,n):ai(t,e,n),onSuccess:()=>n.invalidateQueries({queryKey:J.runs.all})})}function Sl(e){let t=j();return N({mutationFn:({msgId:t,message:n})=>Di(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function Cl(e){let t=j();return N({mutationFn:t=>Oi(e,t),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function wl(e={},t=!0){return M({queryKey:J.github(e),queryFn:({signal:t})=>Qn({limit:e.limit},{signal:t}),enabled:t})}function Tl(e=50,t=!0){return P({queryKey:J.githubPages(e),queryFn:({pageParam:t,signal:n})=>Qn({limit:e,issuesCursor:t.issuesCursor,prsCursor:t.prsCursor},{signal:n}),initialPageParam:{issuesCursor:void 0,prsCursor:void 0},getNextPageParam:e=>{let t=e.issuesNextCursor??void 0,n=e.prsNextCursor??void 0;return t||n?{issuesCursor:t,prsCursor:n}:void 0},enabled:t,staleTime:6e4})}function El(e,t=!0){return M({queryKey:J.githubChecks(e),queryFn:({signal:t})=>br(e,{signal:t}),enabled:t&&e.length>0,staleTime:6e4})}function Dl(e,t,n=!0){return M({queryKey:J.githubSearch(e,t),queryFn:({signal:n})=>xr(e,t,{},{signal:n}),enabled:n&&t.trim()!==``,staleTime:6e4})}var Ol=100;function kl(e){return[...e].sort((e,t)=>t-e).slice(0,Ol).sort((e,t)=>e-t)}var Z=new Map(Fl()),Al=1e3;function jl(e,t){if(Z.get(e)!==t){for(Z.delete(e),Z.set(e,t);Z.size>Al;){let e=Z.keys().next().value;if(e===void 0)break;Z.delete(e)}Rl()}}var Q=new Set(Il());function Ml(e,t){if(Q.has(e)!==t){if(t)for(Q.add(e);Q.size>Al;){let e=Q.values().next().value;if(e===void 0)break;Q.delete(e)}else Q.delete(e);Rl()}}var Nl=`cez.reference-statuses.v1`,Pl=`cez.reference-conflicts.v1`;function Fl(){try{let e=globalThis.sessionStorage?.getItem(Nl);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>Array.isArray(e)&&e.length===2&&typeof e[0]==`string`&&_o(e[1])):[]}catch{return[]}}function Il(){try{let e=globalThis.sessionStorage?.getItem(Pl);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}var Ll;function Rl(){Ll===void 0&&(Ll=setTimeout(()=>{Ll=void 0;try{globalThis.sessionStorage?.setItem(Nl,JSON.stringify([...Z])),globalThis.sessionStorage?.setItem(Pl,JSON.stringify([...Q]))}catch{}},250))}function zl(){let e=Ft(),t=lc();return e.projectId??t.data?.bootProject}function Bl(e){for(let[t,n]of Object.entries(e)){for(let[e,r]of Object.entries(n.prs))jl($({projectId:t,kind:`PR`,number:Number(e)}),r);for(let[e,r]of Object.entries(n.issues))jl($({projectId:t,kind:`Issue`,number:Number(e)}),r)}}var Vl=5*6e4;function Hl(e){return e?e.recheckAfterMs:Vl}var $=e=>`${e.projectId}\u0000${e.kind}#${e.number}`;function Ul(e,t=!0){let n=(0,A.useMemo)(()=>{let t=new Map;for(let n of e){let e=t.get(n.projectId)??{prs:new Set,issues:new Set};e[n.kind===`PR`?`prs`:`issues`].add(n.number),t.set(n.projectId,e)}return[...t.entries()].map(([e,t])=>({projectId:e,prs:kl(t.prs),issues:kl(t.issues)}))},[e.map($).sort().join(`|`)]),r=jt({queries:n.map(e=>({queryKey:J.githubRefStatus(e.projectId,e.prs,e.issues),queryFn:({signal:t})=>Sr(e.projectId,{prs:e.prs,issues:e.issues},{signal:t}),enabled:t&&e.prs.length+e.issues.length>0,staleTime:e=>Hl(e.state.data)??1/0,refetchInterval:e=>Hl(e.state.data)??!1,refetchOnWindowFocus:!0}))}),{byRef:i,learned:a}=(0,A.useMemo)(()=>{let e=new Map,t=[];return r.forEach((r,i)=>{let a=n[i];if(!a)return;let o=[...a.prs.map(e=>({projectId:a.projectId,kind:`PR`,number:e})),...a.issues.map(e=>({projectId:a.projectId,kind:`Issue`,number:e}))],s=r.data;for(let n of o){let i=$(n),a=Z.get(i),o=Q.has(i)?!0:void 0;if(s?.available){let r=s.prs[n.number]??s.issues[n.number];if(r){let a=s.conflicts?s.conflicts.includes(n.number):void 0;t.push({key:i,status:r,conflicting:a}),e.set(i,{state:`ready`,status:r,...a??o?{conflicting:!0}:{}})}else e.set(i,{state:`unknown`,...a?{status:a}:{}})}else s?e.set(i,{state:`unavailable`,reason:s.reason,...a?{status:a}:{},...o?{conflicting:!0}:{}}):r.isError?e.set(i,{state:`unavailable`,reason:r.error instanceof Error?r.error.message:void 0,...a?{status:a}:{},...o?{conflicting:!0}:{}}):e.set(i,{state:`loading`,...a?{status:a}:{},...o?{conflicting:!0}:{}})}}),{byRef:e,learned:t}},[n,r.map(e=>`${e.dataUpdatedAt}:${e.status}`).join(`,`)]);return(0,A.useEffect)(()=>{for(let{key:e,status:t,conflicting:n}of a)jl(e,t),n!==void 0&&Ml(e,n)},[a]),(0,A.useCallback)(e=>{let t=$(e),n=i.get(t);if(n)return n;let r=Z.get(t);return{state:`idle`,...r?{status:r}:{},...Q.has(t)?{conflicting:!0}:{}}},[i])}function Wl(e,t,n=!0){return M({queryKey:J.githubComments(e,t),queryFn:({signal:n})=>Cr(e,t,{},{signal:n}),enabled:n,staleTime:6e4})}function Gl(e){return M({queryKey:[`github`,`pr-changes`,e??0],queryFn:({signal:t})=>Er(e,{},{signal:t}),enabled:e!==void 0,staleTime:6e4,retry:!1})}export{ol as $,Fr as $i,ci as $n,Qa as $r,pl as $t,Ec as A,vt as Aa,aa as Ai,Uo as An,Vi as Ar,al as At,vl as B,Se as Ba,lr as Bi,To as Bn,Ba as Br,Ns as Bt,wl as C,Kt as Ca,xi as Ci,Po as Cn,Pi as Cr,X as Ct,sc as D,P as Da,vn as Di,No as Dn,fa as Dr,ul as Dt,Tl as E,Ft as Ea,to as Ei,Fo as En,ri as Er,hc as Et,hl as F,O as Fa,Fa as Fi,yo as Fn,Er as Fr,el as Ft,Us as G,he as Ga,jr as Gi,lo as Gn,kn as Gr,qs as Gt,bc as H,Te as Ha,Ja as Hi,vo as Hn,Fi as Hr,Ls as Ht,gl as I,ye as Ia,sr as Ii,So as In,wr as Ir,tl as It,rc as J,tr as Ji,fo as Jn,Wa as Jr,Zc as Jt,Bs as K,b as Ka,or as Ki,mo as Kn,An as Kr,Mc as Kt,ic as L,T as La,Ma as Li,wo as Ln,mn as Lr,jc as Lt,cc as M,ut as Ma,Pa as Mi,zo as Mn,io as Mr,cl as Mt,Fc as N,$e as Na,ja as Ni,Mo as Nn,Qn as Nr,Pc as Nt,Gl as O,N as Oa,ra as Oi,jo as On,Ki as Or,$s as Ot,Ic as P,He as Pa,Fn as Pi,Vo as Pn,Cr as Pr,rl as Pt,sl as Q,Xr as Qi,Ha as Qn,va as Qr,Y as Qt,pc as R,we as Ra,di as Ri,K as Rn,xn as Rr,Ps as Rt,Ws as S,L as Sa,Ua as Si,Wo as Sn,Ii as Sr,zs as St,Wl as T,It as Ta,ji as Ti,Ko as Tn,ca as Tr,_c as Tt,gc as U,C as Ua,qi as Ui,po as Un,ki as Ur,Kc as Ut,fc as V,S as Va,qn as Vi,go as Vn,On as Vr,Rs as Vt,As as W,Fe as Wa,Ji as Wi,uo as Wn,Ar as Wr,Zs as Wt,Ul as X,cr as Xi,R as Xn,Xa as Xr,Xc as Xt,zl as Y,ea as Yi,ao as Yn,Za as Yr,js as Yt,Vs as Z,Wi as Zi,Si as Zn,xa as Zr,Gc as Zt,xl as _,Xt as _a,li as _i,hs as _n,si as _r,Ac as _t,vc as a,fi as aa,La as ai,es as an,Wr as ar,Bc as at,Ms as b,Ht as ba,Mi as bi,Go as bn,Yi as br,kc as bt,qc as c,Ui as ca,ti as ci,Xo as cn,ya as cr,Rc as ct,ll as d,$i as da,gi as di,ls as dn,Nr as dr,Hs as dt,$a as ea,$n as ei,Os as en,ba as er,Gs as et,yl as f,Ia as fa,vi as fi,Qo as fn,ii as fr,yc as ft,nc as g,Qt as ga,ta as gi,us as gn,Ur as gr,xc as gt,Wc as h,Zt as ha,Na as hi,ms as hn,Li as hr,Dc as ht,Bl as i,Gr as ia,ia as ii,gs as in,Zr as ir,Lc as it,lc as j,j as ja,Ka as ji,Bo as jn,Bn as jr,bl as jt,Dl as k,M as ka,Oa as ki,Ho as kn,Xi as kr,il as kt,Jc as l,Pr as la,Tr as li,rs as ln,hr as lr,zc as lt,ac as m,an as ma,mi,is as mn,ro as mr,Oc as mt,Is as n,dr as na,_r as ni,vs as nn,Yr as nr,Ks as nt,ec as o,Ya as oa,Ra as oi,ts as on,V as or,Uc as ot,dl as p,qa as pa,_i as pi,ss as pn,Hi as pr,Sc as pt,Yc as q,mr as qi,co as qn,eo as qr,Nc as qt,J as r,Va as ra,la as ri,Jo as rn,Kr as rr,Cl as rt,tc as s,W as sa,ni as si,Zo as sn,Gi as sr,Hc as st,ks as t,Ni as ta,yr as ti,_s as tn,Qr as tr,Qs as tt,Qc as u,sa as ua,gn as ui,q as un,yi as ur,Vc as ut,Xs as v,Yt as va,pi as vi,$o as vn,Ga as vr,Tc as vt,El as w,Gt as wa,ka as wi,Ro as wn,na as wr,mc as wt,Sl as x,Bt as xa,no as xi,Lo as xn,ui as xr,wc as xt,oc as y,F as ya,Bi as yi,Io as yn,Zi as yr,Cc as yt,fl as z,Ce as za,nr as zi,Co as zn,za as zr,Fs as zt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Br as r,Da as i,Ea as a,Hn as o,Oa as s,Qn as c,Vn as l,X as u,ai as d,ja as f,ka as p,oi as m,zr as h}from"./queries-XYjXpa8s.js";import{A as g,C as _,D as v,E as y,F as b,N as x,S,T as C,V as w,_ as ee,a as te,c as ne,d as re,g as ie,h as ae,i as T,l as oe,m as se,o as E,r as D,s as ce,t as le,u as ue,v as de,x as fe,y as pe}from"./button-vdGgKu1b.js";import{a as O,c as me,l as k,o as he,s as ge}from"./tooltip-7suUQClM.js";import{t as A}from"./circle-check-G0BDdNX3.js";import{n as _e,r as ve,t as ye}from"./triangle-alert-hMpQrXJS.js";import{t as be}from"./git-pull-request-draft-Bqwhflhv.js";import{n as xe}from"./clipboard-B9AGRj3s.js";import{i as Se}from"./token-metrics-BiFl2ovY.js";var j={all:(e=w())=>[`worktree-lifecycle`,e],list:(e=w())=>[...j.all(e),`list`],detail:(e,t=w())=>[...j.all(t),`worktree`,e],operation:(e,t=w())=>[...j.all(t),`operation`,e],output:(e,t=w())=>[...j.all(t),`output`,e]};function Ce(){return a(),p({queryKey:j.list(),queryFn:async({signal:e})=>{let t=await d({limit:100},{signal:e}),n=new Map(t.worktrees.map(e=>[e.worktreeId,e])),r=new Set,i=t.nextCursor;for(;i&&!r.has(i);){r.add(i);let t=await d({limit:100,cursor:i},{signal:e});for(let e of t.worktrees)n.set(e.worktreeId,e);i=t.nextCursor}return{worktrees:[...n.values()]}}})}function we(e,t=!0){return a(),p({queryKey:j.detail(e),enabled:t,queryFn:({signal:t})=>m(e,{signal:t})})}function Te(e){return a(),p({queryKey:j.operation(e),queryFn:({signal:t})=>h(e,{signal:t})})}function Ee(e,t){return a(),i({queryKey:j.output(e),enabled:t,initialPageParam:0,queryFn:({signal:t,pageParam:n})=>r(e,n,{signal:t}),getNextPageParam:e=>e.items.length>=100?e.nextSeq:void 0,maxPages:5})}function De(e){let t=f();a();let n=w();return s({mutationFn:t=>c(e,t),onSuccess:r=>{t.setQueryData(j.operation(e,n),r),t.invalidateQueries({queryKey:j.all(n)}),t.invalidateQueries({queryKey:[`runs`,n]}),t.invalidateQueries({queryKey:[`worktrees`,n]})},onError:()=>{t.invalidateQueries({queryKey:j.operation(e,n)})}})}var M=b(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),N=b(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),P=b(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),F=b(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Oe=b(`git-pull-request-closed`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`path`,{d:`m21 3-6 6`,key:`16nqsk`}],[`path`,{d:`m21 9-6-6`,key:`9j17rh`}],[`path`,{d:`M18 11.5V15`,key:`65xf6f`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]]),ke=b(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),Ae=b(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),I=e(t(),1),L=n(),R=`Popover`,[z,je]=y(R,[k]),B=k(),[Me,V]=z(R),H=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=B(t),c=I.useRef(null),[l,u]=I.useState(!1),[d,f]=_({prop:r,defaultProp:i??!1,onChange:a,caller:R});return(0,L.jsx)(me,{...s,children:(0,L.jsx)(Me,{scope:t,contentId:fe(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:I.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:I.useCallback(()=>u(!0),[]),onCustomAnchorRemove:I.useCallback(()=>u(!1),[]),modal:o,children:n})})};H.displayName=R;var U=`PopoverAnchor`,W=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=V(U,n),a=B(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return I.useEffect(()=>(o(),()=>s()),[o,s]),(0,L.jsx)(O,{...a,...r,ref:t})});W.displayName=U;var G=`PopoverTrigger`,K=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=V(G,n),a=B(n),o=x(t,i.triggerRef),s=(0,L.jsx)(v.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Ue(i.open),...r,ref:o,onClick:C(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,L.jsx)(O,{asChild:!0,...a,children:s})});K.displayName=G;var q=`PopoverPortal`,[Ne,Pe]=z(q,{forceMount:void 0}),J=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=V(q,t);return(0,L.jsx)(Ne,{scope:t,forceMount:n,children:(0,L.jsx)(S,{present:n||a.open,children:(0,L.jsx)(ee,{asChild:!0,container:i,children:r})})})};J.displayName=q;var Y=`PopoverContent`,X=I.forwardRef((e,t)=>{let n=Pe(Y,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=V(Y,e.__scopePopover);return(0,L.jsx)(S,{present:r||a.open,children:a.modal?(0,L.jsx)(Ie,{...i,ref:t}):(0,L.jsx)(Le,{...i,ref:t})})});X.displayName=Y;var Fe=g(`PopoverContent.RemoveScroll`),Ie=I.forwardRef((e,t)=>{let n=V(Y,e.__scopePopover),r=I.useRef(null),i=x(t,r),a=I.useRef(!1);return I.useEffect(()=>{let e=r.current;if(e)return se(e)},[]),(0,L.jsx)(ae,{as:Fe,allowPinchZoom:!0,children:(0,L.jsx)(Re,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:C(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:C(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:C(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Le=I.forwardRef((e,t)=>{let n=V(Y,e.__scopePopover),r=I.useRef(!1),i=I.useRef(!1);return(0,L.jsx)(Re,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Re=I.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=V(Y,n),p=B(n);return ie(),(0,L.jsx)(de,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(pe,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,L.jsx)(ge,{"data-state":Ue(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),ze=`PopoverClose`,Be=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=V(ze,n);return(0,L.jsx)(v.button,{type:`button`,...r,ref:t,onClick:C(e.onClick,()=>i.onOpenChange(!1))})});Be.displayName=ze;var Ve=`PopoverArrow`,He=I.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=B(n);return(0,L.jsx)(he,{...i,...r,ref:t})});He.displayName=Ve;function Ue(e){return e?`open`:`closed`}var We=H,Ge=W,Ke=K,qe=J,Je=X;function Ye({...e}){return(0,L.jsx)(te,{"data-slot":`dialog`,...e})}function Xe({...e}){return(0,L.jsx)(ue,{"data-slot":`dialog-portal`,...e})}function Ze({className:e,...t}){return(0,L.jsx)(oe,{"data-slot":`dialog-overlay`,className:D(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Qe({className:e,children:t,showCloseButton:n=!0,...r}){return(0,L.jsxs)(Xe,{"data-slot":`dialog-portal`,children:[(0,L.jsx)(Ze,{}),(0,L.jsxs)(ce,{"data-slot":`dialog-content`,className:D(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,L.jsxs)(E,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,L.jsx)(xe,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function $e({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`dialog-header`,className:D(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function et({className:e,showCloseButton:t=!1,children:n,...r}){return(0,L.jsxs)(`div`,{"data-slot":`dialog-footer`,className:D(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,L.jsx)(E,{asChild:!0,children:(0,L.jsx)(le,{variant:`outline`,children:`Close`})})]})}function tt({className:e,...t}){return(0,L.jsx)(re,{"data-slot":`dialog-title`,className:D(`text-lg leading-none font-semibold`,e),...t})}function nt({className:e,...t}){return(0,L.jsx)(ne,{"data-slot":`dialog-description`,className:D(`text-sm text-muted-foreground`,e),...t})}var rt=(0,I.createContext)(null);function it({children:e}){let[t,n]=(0,I.useState)(()=>new Map),r=(0,I.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.set(e,t),r})},[]),i=(0,I.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),a=u((0,I.useMemo)(()=>[...t.values()].flat(),[t])),o=(0,I.useMemo)(()=>({publish:r,retract:i,lookup:a}),[r,i,a]);return(0,L.jsx)(rt.Provider,{value:o,children:e})}var Z=(0,I.createContext)(null);function at({projectId:e,requests:t,children:n}){let r=(0,I.useContext)(rt),i=(0,I.useId)(),a=t.map(e=>`${e.projectId} ${e.kind}#${e.number}`).sort().join(`|`),o=r?.publish,s=r?.retract;(0,I.useEffect)(()=>{if(!(!o||!s))return o(i,t),()=>s(i)},[o,s,i,a]);let c=u(r?ot:t),l=r?.lookup??c,d=(0,I.useMemo)(()=>({lookup:l,projectId:e}),[l,e]);return(0,L.jsx)(Z.Provider,{value:d,children:n})}var ot=[];function st(e,t,n){let r=(0,I.useContext)(Z),i=n??r?.projectId;return!r||!i||t===void 0?lt:r.lookup({projectId:i,kind:e,number:t})}function ct(){let e=(0,I.useContext)(Z);return{lookup:e?.lookup??(()=>lt),projectId:e?.projectId}}var lt=Object.freeze({state:`idle`});function Q(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function ut(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=Q(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(Q(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function dt(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:Q(e)}:{top:0,bottom:0}}function ft(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function pt(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(dt(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function mt(){let[e,t]=(0,I.useState)({top:0,bottom:0});return(0,I.useEffect)(()=>pt(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function ht(e){let t=(0,I.useRef)(e);t.current=e,(0,I.useEffect)(()=>{let e=document.documentElement;return ut(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}function gt({...e}){return(0,L.jsx)(We,{"data-slot":`popover`,...e})}function _t({...e}){return(0,L.jsx)(Ke,{"data-slot":`popover-trigger`,...e})}function vt({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:r,...i}){let a=mt();return(0,L.jsx)(qe,{children:(0,L.jsx)(Je,{"data-slot":`popover-content`,align:t,sideOffset:n,collisionPadding:ft(a,r),className:D(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...i})})}function yt({...e}){return(0,L.jsx)(Ge,{"data-slot":`popover-anchor`,...e})}var bt={success:`border-success/40 text-success`,danger:`border-danger/40 text-danger`,violet:`border-violet/35 text-violet`,info:`border-info/40 text-info`,neutral:`border-border text-muted-foreground`,pending:`border-pending-strong/45 text-pending-strong`,conflict:`border-conflict/45 text-conflict`},xt={success:`hover:bg-success/10`,danger:`hover:bg-danger/10`,violet:`hover:bg-violet/10`,info:`hover:bg-info/10`,neutral:`hover:bg-muted`,pending:`hover:bg-pending-strong/10`,conflict:`hover:bg-conflict/10`},St={draft:be,"review-required":_e,"changes-requested":ke,"checks-pending":null,"checks-failing":F,ready:A,merged:ve,closed:Oe,open:N,completed:A,"not-planned":P};function Ct({reference:e,taskTitle:t,status:n,conflicting:r,conflictAction:i,projectId:a,className:s,compact:c=!1}){let{kind:u,number:d,url:f}=e,p=st(u,d,a),m=n??p.status,h=o(m),g=u===`PR`&&(r??p.conflicting)===!0,_=g?l:h,v=D(`inline-flex h-[22px] items-center gap-1 rounded-full border px-2 font-mono text-[11px] font-semibold`,bt[_?.tone??`violet`],s),y=Ot(p,_,g?h:void 0),b=d?`${!c&&u===`Issue`?`Issue `:``}#${d}`:u,x=u===`PR`?`pull request`:`issue`,S=`Open the ${x} for ${t}${_?` — ${_.label}`:``}`,C=(0,L.jsxs)(L.Fragment,{children:[g?(0,L.jsx)(ye,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):(0,L.jsx)(At,{status:_?m:void 0}),b]}),w=!f||!T(f)?(0,L.jsx)(`span`,{"data-slot":u===`PR`?`pr-chip`:`issue-chip`,"data-status":m,...g?{"data-conflicting":`true`}:{},"aria-label":_?`${x} ${b} — ${_.label}`:void 0,className:v,children:C}):(0,L.jsxs)(`a`,{"data-slot":u===`PR`?`pr-chip`:`issue-chip`,"data-status":m,...g?{"data-conflicting":`true`}:{},href:f,target:`_blank`,rel:`noopener noreferrer`,title:y?void 0:f,"aria-label":S,className:D(v,xt[_?.tone??`violet`]),children:[C,(0,L.jsx)(M,{className:`size-2.5`,"aria-hidden":`true`})]});if(!y)return w;let ee=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`span`,{className:`block font-medium`,children:[u===`PR`?`Pull request`:`Issue`,d?` #${d}`:``,` · `,y.headline]}),(0,L.jsx)(`span`,{className:`block`,children:y.detail}),y.also?(0,L.jsx)(`span`,{className:`block opacity-70`,children:y.also}):null,f&&T(f)?(0,L.jsx)(`span`,{className:`block opacity-70`,children:f.replace(/^https?:\/\//,``)}):null]});return(0,L.jsx)(Dt,{chip:w,action:g?i:void 0,state:p.state,children:ee})}var wt=(0,I.createContext)(()=>{});function Tt(){return(0,I.useContext)(wt)}var Et=150,$=120;function Dt({chip:e,action:t,state:n,children:r}){let[i,a]=(0,I.useState)(!1),o=(0,I.useRef)(null),s=(0,I.useRef)(null),c=(0,I.useRef)(void 0),l=(0,I.useCallback)((e,t)=>{clearTimeout(c.current),c.current=setTimeout(()=>a(e),t)},[]),u=(0,I.useCallback)(()=>{clearTimeout(c.current),a(!1)},[]);(0,I.useEffect)(()=>()=>clearTimeout(c.current),[]);let d=e=>e instanceof Node&&(s.current?.contains(e)||o.current?.contains(e));return(0,L.jsxs)(gt,{open:i,onOpenChange:e=>e?a(!0):u(),children:[(0,L.jsx)(yt,{asChild:!0,ref:o,onPointerEnter:e=>{e.pointerType!==`touch`&&l(!0,Et)},onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,$)},onFocus:()=>a(!0),onBlur:e=>{d(e.relatedTarget)||u()},onKeyDown:e=>{if(e.key===`Escape`)return u();if(e.key!==`Tab`||e.shiftKey||!t)return;let n=s.current?.querySelector(`button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);n&&(e.preventDefault(),n.focus())},...t?{"aria-haspopup":`dialog`,"aria-expanded":i}:{},children:e}),(0,L.jsxs)(vt,{ref:s,side:`top`,role:t?`dialog`:`tooltip`,"data-slot":`reference-status-card`,"data-tooltip-state":n,className:`w-64 space-y-2 p-3 text-xs`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),d(document.activeElement)&&o.current?.focus()},onPointerEnter:()=>clearTimeout(c.current),onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,$)},children:[(0,L.jsx)(`div`,{className:`space-y-0.5`,children:r}),t?(0,L.jsx)(wt.Provider,{value:u,children:t}):null]})]})}function Ot(e,t,n){if(t){let{label:r,hint:i}=t,a=n?`also ${kt(n.label)} — ${n.hint}`:void 0;return e.state===`unavailable`?{headline:r,detail:`last known — GitHub is unreachable${e.reason?` (${e.reason})`:``}`,...a?{also:a}:{}}:{headline:r,detail:i,...a?{also:a}:{}}}switch(e.state){case`loading`:return{headline:`Checking GitHub…`,detail:`the status of this reference is on its way`};case`unavailable`:return{headline:`Status unavailable`,detail:e.reason??`GitHub could not be reached — the chip says nothing rather than guessing`};case`unknown`:return{headline:`Not found on this repository`,detail:`GitHub has no such number here — the reference may point at another repo`};default:return null}}function kt(e){return e.charAt(0).toLowerCase()+e.slice(1)}function At({status:e}){if(!e)return null;if(e===`checks-pending`)return(0,L.jsx)(Se,{tone:`pending`,pulse:!0,className:`size-[6px]`,"aria-hidden":`true`});let t=St[e];return t?(0,L.jsx)(t,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):null}export{j as C,we as D,Ee as E,Ce as O,M as S,Te as T,tt as _,vt as a,P as b,at as c,ct as d,Ye as f,$e as g,et as h,yt as i,it as l,nt as m,Tt as n,_t as o,Qe as p,gt as r,ht as s,Ct as t,st as u,Ae as v,De as w,N as x,F as y};
|