turtlecode 0.1.1 → 0.1.5
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/assets/assets/{_basePickBy-BcOvpC5b.js → _basePickBy-Cbr9kF3W.js} +1 -1
- package/assets/assets/{_baseUniq-D9AKNI-S.js → _baseUniq-90p3K5mX.js} +1 -1
- package/assets/assets/{arc-ClcBVsDq.js → arc-zwceMo7E.js} +1 -1
- package/assets/assets/{architectureDiagram-2XIMDMQ5-CRV28Qi0.js → architectureDiagram-2XIMDMQ5-DTVoAXan.js} +1 -1
- package/assets/assets/{auth-callback-D7CK9pHp.js → auth-callback-DDriykxK.js} +1 -1
- package/assets/assets/{blockDiagram-WCTKOSBZ-CL-sI8NU.js → blockDiagram-WCTKOSBZ-BSWFoRB4.js} +1 -1
- package/assets/assets/{c4Diagram-IC4MRINW-AFG5p1yt.js → c4Diagram-IC4MRINW-DMGytLY0.js} +1 -1
- package/assets/assets/channel-Dt5bKHJY.js +1 -0
- package/assets/assets/{chunk-4BX2VUAB-CgNy2Qqu.js → chunk-4BX2VUAB-DK5USEsv.js} +1 -1
- package/assets/assets/{chunk-55IACEB6-Bsz0SHtO.js → chunk-55IACEB6-Dwuz2gci.js} +1 -1
- package/assets/assets/{chunk-FMBD7UC4-BRuwu34q.js → chunk-FMBD7UC4-D3Ar5GCw.js} +1 -1
- package/assets/assets/{chunk-JSJVCQXG-Bt0GkrjS.js → chunk-JSJVCQXG-BsqvZqFi.js} +1 -1
- package/assets/assets/{chunk-KX2RTZJC-BiUvn-D7.js → chunk-KX2RTZJC-BEGDcj79.js} +1 -1
- package/assets/assets/{chunk-NQ4KR5QH-DH4YUQE9.js → chunk-NQ4KR5QH-DIhUZLGW.js} +1 -1
- package/assets/assets/{chunk-QZHKN3VN-CrLB363X.js → chunk-QZHKN3VN-BayZzXcy.js} +1 -1
- package/assets/assets/{chunk-VVM5DH6Z-D2vG_ZPx.js → chunk-VVM5DH6Z-CUl6IXI5.js} +1 -1
- package/assets/assets/{chunk-WL4C6EOR-913dgDB-.js → chunk-WL4C6EOR-vhjolSEq.js} +1 -1
- package/assets/assets/classDiagram-VBA2DB6C-DnXPRHLd.js +1 -0
- package/assets/assets/classDiagram-v2-RAHNMMFH-DnXPRHLd.js +1 -0
- package/assets/assets/clone-CbaHYGYw.js +1 -0
- package/assets/assets/{connection-popover-D2MEtT6z.js → connection-popover-CEFQbPWK.js} +1 -1
- package/assets/assets/{context-popover-C1ZDT4aK.js → context-popover-CKXEgeIh.js} +1 -1
- package/assets/assets/{cose-bilkent-S5V4N54A-DRWnwV5H.js → cose-bilkent-S5V4N54A--B-DQXvI.js} +1 -1
- package/assets/assets/{cssMode-DX-s2EC8.js → cssMode-CWSvB3aC.js} +1 -1
- package/assets/assets/{dagre-KLK3FWXG-CN4ule0l.js → dagre-KLK3FWXG-DY0eSi8o.js} +1 -1
- package/assets/assets/{diagram-E7M64L7V-docJyJu4.js → diagram-E7M64L7V-CbCSS_sV.js} +1 -1
- package/assets/assets/{diagram-IFDJBPK2-ChVpZldk.js → diagram-IFDJBPK2-NUrmqese.js} +1 -1
- package/assets/assets/{diagram-P4PSJMXO-Bf1-kRnd.js → diagram-P4PSJMXO-CbqxmMLJ.js} +1 -1
- package/assets/assets/{dialog-clone-project-B1wF7jYQ.js → dialog-clone-project-BRaGZzJN.js} +1 -1
- package/assets/assets/{dialog-connect-provider-Ot6Qr5dL.js → dialog-connect-provider-DpPISveC.js} +2 -2
- package/assets/assets/{dialog-create-project-BUc4DxX6.js → dialog-create-project-a3Uo_guc.js} +1 -1
- package/assets/assets/{dialog-edit-project-BrkjzrGe.js → dialog-edit-project-CgJu_xty.js} +1 -1
- package/assets/assets/{dialog-fork-CyeKjf0e.js → dialog-fork-CmIIdrc_.js} +1 -1
- package/assets/assets/{dialog-manage-models-CoiwPdu-.js → dialog-manage-models-YoikGlYY.js} +1 -1
- package/assets/assets/{dialog-select-directory-K0nOY5Ky.js → dialog-select-directory-D7DAqsnF.js} +3 -3
- package/assets/assets/{dialog-select-file-Dx0Bny2E.js → dialog-select-file-DfsyN5Rc.js} +1 -1
- package/assets/assets/{dialog-select-mcp-ehJzhdpz.js → dialog-select-mcp-BURynziq.js} +1 -1
- package/assets/assets/{dialog-select-model-unpaid-IVl97Sa_.js → dialog-select-model-unpaid-DKgrX02q.js} +2 -2
- package/assets/assets/{dialog-select-provider-CBq6hNDx.js → dialog-select-provider-0ixbAs1U.js} +1 -1
- package/assets/assets/{dialog-select-server-DA5hATxx.js → dialog-select-server-DgqWEODB.js} +1 -1
- package/assets/assets/{dialog-settings-BoOPbXZp.js → dialog-settings-BZpXHdr7.js} +1 -1
- package/assets/assets/{erDiagram-INFDFZHY-kDj6gvOH.js → erDiagram-INFDFZHY-C-XwpEYU.js} +1 -1
- package/assets/assets/{file-icon-DVEMs7Sx.js → file-icon-lmIpAi7j.js} +1 -1
- package/assets/assets/{flowDiagram-PKNHOUZH-CsQeJUub.js → flowDiagram-PKNHOUZH-CNyRmJrg.js} +1 -1
- package/assets/assets/{freemarker2-B_-gEFnj.js → freemarker2-aAsBprVy.js} +1 -1
- package/assets/assets/{ganttDiagram-A5KZAMGK-D1W7NciY.js → ganttDiagram-A5KZAMGK-VDRJPysM.js} +1 -1
- package/assets/assets/{ghostty-web-BQl0ls6m.js → ghostty-web-CDoiu3Yc.js} +1 -1
- package/assets/assets/{gitGraphDiagram-K3NZZRJ6-D4eeLV-l.js → gitGraphDiagram-K3NZZRJ6-yqJaE10b.js} +1 -1
- package/assets/assets/{graph-KGuLNbW2.js → graph-Blkyeyzn.js} +1 -1
- package/assets/assets/{handlebars-DlnQtQmF.js → handlebars-B9y9KVva.js} +1 -1
- package/assets/assets/{home-BnHPimua.js → home-Dl-ohVE3.js} +1 -1
- package/assets/assets/{html-DrjCwvQg.js → html-B4yimBtZ.js} +1 -1
- package/assets/assets/{htmlMode-C1xX0YwN.js → htmlMode-XkoEE1Us.js} +1 -1
- package/assets/assets/{index-DTxAHLat.css → index-9-q5x_AZ.css} +1 -1
- package/assets/assets/{index-DKwABhnu.js → index-Dxo83Gsl.js} +4 -4
- package/assets/assets/{infoDiagram-LFFYTUFH-DsQ9EVx0.js → infoDiagram-LFFYTUFH-C1FkzzLJ.js} +1 -1
- package/assets/assets/{ishikawaDiagram-PHBUUO56-MzetUfFK.js → ishikawaDiagram-PHBUUO56-SVTYyzMy.js} +1 -1
- package/assets/assets/{javascript-CBQQIA5q.js → javascript-xyQKZDGW.js} +1 -1
- package/assets/assets/{jobs-popover-DQmVz-e0.js → jobs-popover-BAyLs5rR.js} +1 -1
- package/assets/assets/{journeyDiagram-4ABVD52K-BkKgSN_9.js → journeyDiagram-4ABVD52K-CftC00L0.js} +1 -1
- package/assets/assets/{jsonMode-B2Ye6w7y.js → jsonMode-PsmTZD9i.js} +1 -1
- package/assets/assets/{kanban-definition-K7BYSVSG-DIJz6AsI.js → kanban-definition-K7BYSVSG-D8rVztxr.js} +1 -1
- package/assets/assets/{layout-BZKpv2Gr.js → layout-DKRzsYmw.js} +1 -1
- package/assets/assets/{liquid-CQXVmj19.js → liquid-B5YkEln-.js} +1 -1
- package/assets/assets/{list-DPJi0fzr.js → list-IrfozpgY.js} +1 -1
- package/assets/assets/{mdx-QuCI1OJC.js → mdx-IAVXqYJ2.js} +1 -1
- package/assets/assets/{mermaid.core-bhqKFRxj.js → mermaid.core-D7ns-Nfl.js} +5 -5
- package/assets/assets/{mindmap-definition-YRQLILUH-CVv44i-B.js → mindmap-definition-YRQLILUH-Bzur0Tav.js} +1 -1
- package/assets/assets/{pieDiagram-SKSYHLDU-2ekrtn6z.js → pieDiagram-SKSYHLDU-BquIe11C.js} +1 -1
- package/assets/assets/{python-Bx2b-xP4.js → python-BcPmedha.js} +1 -1
- package/assets/assets/{quadrantDiagram-337W2JSQ-BoTofVsV.js → quadrantDiagram-337W2JSQ-DfIw-PhP.js} +1 -1
- package/assets/assets/{razor-2zgukQRj.js → razor-Dae0nPVH.js} +1 -1
- package/assets/assets/{requirementDiagram-Z7DCOOCP-LSodooxy.js → requirementDiagram-Z7DCOOCP-Cjlz-DEQ.js} +1 -1
- package/assets/assets/{sankeyDiagram-WA2Y5GQK-DUXSSMar.js → sankeyDiagram-WA2Y5GQK-bGfKg-Gi.js} +1 -1
- package/assets/assets/{select-BbwOgh1Q.js → select-COPHquWP.js} +1 -1
- package/assets/assets/{sequenceDiagram-2WXFIKYE-C01qZdHR.js → sequenceDiagram-2WXFIKYE-B5qLrUGE.js} +1 -1
- package/assets/assets/{server-row-mRVGCgvL.js → server-row-D1rDT8vK.js} +1 -1
- package/assets/assets/{session-BXKBDkSI.js → session-kVY7vYXa.js} +15 -15
- package/assets/assets/{stateDiagram-RAJIS63D-BuPj1Py4.js → stateDiagram-RAJIS63D-BEP_JgCk.js} +1 -1
- package/assets/assets/stateDiagram-v2-FVOUBMTO-DEd6U9Bm.js +1 -0
- package/assets/assets/{status-popover-body-9YRn8z8W.js → status-popover-body-BDnY5y5A.js} +2 -2
- package/assets/assets/{switch-CHySmW8J.js → switch-CDJuR31O.js} +1 -1
- package/assets/assets/{tabs-CKNlwTKd.js → tabs-IESTlWqJ.js} +1 -1
- package/assets/assets/{tag-C4xikCZp.js → tag-DjGMdUtp.js} +1 -1
- package/assets/assets/{timeline-definition-YZTLITO2-CPcDqVYw.js → timeline-definition-YZTLITO2-D6uWycI3.js} +1 -1
- package/assets/assets/{treemap-KZPCXAKY-Bin819KW.js → treemap-KZPCXAKY-DH-YINf4.js} +1 -1
- package/assets/assets/{trellis-Csm7WAqm.js → trellis-CGL9IdAb.js} +7 -7
- package/assets/assets/{trellis-badge-demo-nxtlIRoh.js → trellis-badge-demo-R0tqETOm.js} +1 -1
- package/assets/assets/{trellis-op-icon-CzIuo5X7.js → trellis-op-icon-7bLDDzgi.js} +1 -1
- package/assets/assets/{tsMode-qOM514sL.js → tsMode-C8IFzmUX.js} +1 -1
- package/assets/assets/{typescript-XOJMwr_m.js → typescript-BRzjXkWD.js} +1 -1
- package/assets/assets/{vennDiagram-LZ73GAT5-BDAdfrV5.js → vennDiagram-LZ73GAT5-CTkGiV8C.js} +1 -1
- package/assets/assets/{xml-BIwomT_0.js → xml-DwrPHn8a.js} +1 -1
- package/assets/assets/{xychartDiagram-JWTSCODW-Be2x0vdX.js → xychartDiagram-JWTSCODW-DYfMOVBa.js} +1 -1
- package/assets/assets/{yaml-BZMZa-4Z.js → yaml-D5NhyUmN.js} +1 -1
- package/assets/index.html +2 -2
- package/bin/cli.mjs +43 -3
- package/package.json +6 -2
- package/assets/assets/channel-BXqEQVGi.js +0 -1
- package/assets/assets/classDiagram-VBA2DB6C-gcpKg8SN.js +0 -1
- package/assets/assets/classDiagram-v2-RAHNMMFH-gcpKg8SN.js +0 -1
- package/assets/assets/clone-oMsF326O.js +0 -1
- package/assets/assets/stateDiagram-v2-FVOUBMTO-CjYACBI3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-DVc8C-J4.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-CE9lU5zL.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/mermaid.core-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-DVc8C-J4.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-CE9lU5zL.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/mermaid.core-D7ns-Nfl.js","assets/transform-BwXaE9hv.js","assets/dialog-settings-BZpXHdr7.js","assets/tabs-IESTlWqJ.js","assets/select-COPHquWP.js","assets/chunk-VVM5DH6Z-CUl6IXI5.js","assets/switch-CDJuR31O.js","assets/dialog-connect-provider-DpPISveC.js","assets/list-IrfozpgY.js","assets/tag-DjGMdUtp.js","assets/dialog-select-provider-0ixbAs1U.js","assets/dialog-select-server-DgqWEODB.js","assets/server-row-D1rDT8vK.js","assets/dialog-select-directory-D7DAqsnF.js","assets/file-icon-lmIpAi7j.js","assets/home-Dl-ohVE3.js","assets/dialog-create-project-a3Uo_guc.js","assets/session-kVY7vYXa.js","assets/trellis-CGL9IdAb.js","assets/trellis-op-icon-7bLDDzgi.js","assets/trellis-CZsWDIog.css","assets/trellis-badge-demo-R0tqETOm.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();const Xe={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return sX(this.context.count)},getNextContextId(){return sX(this.context.count++)}};function sX(e){const t=String(e),n=t.length-1;return Xe.context.id+(n?String.fromCharCode(96+n):"")+t}function Wo(e){Xe.context=e}const jne=!1,Ige=(e,t)=>e===t,za=Symbol("solid-proxy"),Hne=typeof Proxy=="function",$R=Symbol("solid-track"),TR={equals:Ige};let jp=null,Fne=Wne;const aa=1,t2=2,Vne={owned:null,cleanups:null,context:null,owner:null},eH={};var ht=null;let Pe=null,Nge=null,Zt=null,jr=null,vr=null,nq=0;function br(e,t){const n=Zt,r=ht,i=e.length===0,a=t===void 0?r:t,o=i?Vne:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>lt(()=>Ws(o)));ht=o,Zt=null;try{return Oi(s,!0)}finally{Zt=n,ht=r}}function Ce(e,t){t=t?Object.assign({},TR,t):TR;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(Pe&&Pe.running&&Pe.sources.has(n)?i=i(n.tValue):i=i(n.value)),Une(n,i));return[Bne.bind(n),r]}function n2(e,t,n){const r=F2(e,t,!0,aa);sf(r)}function Qe(e,t,n){const r=F2(e,t,!1,aa);sf(r)}function fe(e,t,n){Fne=Oge;const r=F2(e,t,!1,aa),i=n0&&Lt(n0);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),vr?vr.push(r):sf(r)}function Z(e,t,n){n=n?Object.assign({},TR,n):TR;const r=F2(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,sf(r),Bne.bind(r)}function Age(e){return e&&typeof e=="object"&&"then"in e}function Jr(e,t,n){let r,i,a;typeof t=="function"?(r=e,i=t,a=n||{}):(r=!0,i=e,a=t||{});let o=null,s=eH,l=null,c=!1,u=!1,h="initialValue"in a,m=typeof r=="function"&&Z(r);const g=new Set,[y,v]=(a.storage||Ce)(a.initialValue),[k,b]=Ce(void 0),[x,w]=Ce(void 0,{equals:!1}),[M,_]=Ce(h?"ready":"unresolved");Xe.context&&(l=Xe.getNextContextId(),a.ssrLoadFrom==="initial"?s=a.initialValue:Xe.load&&Xe.has(l)&&(s=Xe.load(l)));function C(D,P,O,E){return o===D&&(o=null,E!==void 0&&(h=!0),(D===s||P===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(E,{value:P})),s=eH,Pe&&D&&c?(Pe.promises.delete(D),c=!1,Oi(()=>{Pe.running=!0,L(P,O)},!1)):L(P,O)),P}function L(D,P){Oi(()=>{P===void 0&&v(()=>D),_(P!==void 0?"errored":h?"ready":"unresolved"),b(P);for(const O of g.keys())O.decrement();g.clear()},!1)}function S(){const D=n0&&Lt(n0),P=y(),O=k();if(O!==void 0&&!o)throw O;return Zt&&!Zt.user&&D&&n2(()=>{x(),o&&(D.resolved&&Pe&&c?Pe.promises.add(o):g.has(D)||(D.increment(),g.add(D)))}),P}function I(D=!0){if(D!==!1&&u)return;u=!1;const P=m?m():r;if(c=Pe&&Pe.running,P==null||P===!1){C(o,lt(y));return}Pe&&o&&Pe.promises.delete(o);let O;const E=s!==eH?s:lt(()=>{try{return i(P,{value:y(),refetching:D})}catch(T){O=T}});if(O!==void 0){C(o,void 0,ty(O),P);return}else if(!Age(E))return C(o,E,void 0,P),E;return o=E,"v"in E?(E.s===1?C(o,E.v,void 0,P):C(o,void 0,ty(E.v),P),E):(u=!0,queueMicrotask(()=>u=!1),Oi(()=>{_(h?"refreshing":"pending"),w()},!1),E.then(T=>C(E,T,void 0,P),T=>C(E,void 0,ty(T),P)))}Object.defineProperties(S,{state:{get:()=>M()},error:{get:()=>k()},loading:{get(){const D=M();return D==="pending"||D==="refreshing"}},latest:{get(){if(!h)return S();const D=k();if(D&&!o)throw D;return y()}}});let A=ht;return m?n2(()=>(A=ht,I(!1))):I(!1),[S,{refetch:D=>Go(A,()=>I(D)),mutate:v}]}function ct(e){return Oi(e,!1)}function lt(e){if(Zt===null)return e();const t=Zt;Zt=null;try{return e()}finally{Zt=t}}function vn(e,t,n){const r=Array.isArray(e);let i,a=n&&n.defer;return o=>{let s;if(r){s=Array(e.length);for(let c=0;c<e.length;c++)s[c]=e[c]()}else s=e();if(a)return a=!1,o;const l=lt(()=>t(s,i,o));return i=s,l}}function dn(e){fe(()=>lt(e))}function me(e){return ht===null||(ht.cleanups===null?ht.cleanups=[e]:ht.cleanups.push(e)),e}function $ge(e,t){jp||(jp=Symbol("error")),ht=F2(void 0,void 0,!0),ht.context={...ht.context,[jp]:[t]},Pe&&Pe.running&&Pe.sources.add(ht);try{return e()}catch(n){V2(n)}finally{ht=ht.owner}}function aV(){return Zt}function qa(){return ht}function Go(e,t){const n=ht,r=Zt;ht=e,Zt=null;try{return Oi(t,!0)}catch(i){V2(i)}finally{ht=n,Zt=r}}function Tge(e){if(Pe&&Pe.running)return e(),Pe.done;const t=Zt,n=ht;return Promise.resolve().then(()=>{Zt=t,ht=n;let r;return n0&&(r=Pe||(Pe={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(i=>r.resolve=i)),r.running=!0),Oi(e,!1),Zt=ht=null,r?r.done:void 0})}const[fYt,lX]=Ce(!1);function Ege(e){vr.push.apply(vr,e),e.length=0}function Tt(e,t){const n=Symbol("context");return{id:n,Provider:Rge(n),defaultValue:e}}function Lt(e){let t;return ht&&ht.context&&(t=ht.context[e.id])!==void 0?t:e.defaultValue}function rq(e){const t=Z(e),n=Z(()=>oV(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let n0;function Pge(){return n0||(n0=Tt())}function Bne(){const e=Pe&&Pe.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===aa)sf(this);else{const t=jr;jr=null,Oi(()=>PR(this),!1),jr=t}if(Zt){const t=this.observers?this.observers.length:0;Zt.sources?(Zt.sources.push(this),Zt.sourceSlots.push(t)):(Zt.sources=[this],Zt.sourceSlots=[t]),this.observers?(this.observers.push(Zt),this.observerSlots.push(Zt.sources.length-1)):(this.observers=[Zt],this.observerSlots=[Zt.sources.length-1])}return e&&Pe.sources.has(this)?this.tValue:this.value}function Une(e,t,n){let r=Pe&&Pe.running&&Pe.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(Pe){const i=Pe.running;(i||!n&&Pe.sources.has(e))&&(Pe.sources.add(e),e.tValue=t),i||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&Oi(()=>{for(let i=0;i<e.observers.length;i+=1){const a=e.observers[i],o=Pe&&Pe.running;o&&Pe.disposed.has(a)||((o?!a.tState:!a.state)&&(a.pure?jr.push(a):vr.push(a),a.observers&&Gne(a)),o?a.tState=aa:a.state=aa)}if(jr.length>1e6)throw jr=[],new Error},!1)}return t}function sf(e){if(!e.fn)return;Ws(e);const t=nq;cX(e,Pe&&Pe.running&&Pe.sources.has(e)?e.tValue:e.value,t),Pe&&!Pe.running&&Pe.sources.has(e)&&queueMicrotask(()=>{Oi(()=>{Pe&&(Pe.running=!0),Zt=ht=e,cX(e,e.tValue,t),Zt=ht=null},!1)})}function cX(e,t,n){let r;const i=ht,a=Zt;Zt=ht=e;try{r=e.fn(t)}catch(o){return e.pure&&(Pe&&Pe.running?(e.tState=aa,e.tOwned&&e.tOwned.forEach(Ws),e.tOwned=void 0):(e.state=aa,e.owned&&e.owned.forEach(Ws),e.owned=null)),e.updatedAt=n+1,V2(o)}finally{Zt=a,ht=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Une(e,r,!0):Pe&&Pe.running&&e.pure?(Pe.sources.has(e)||(e.value=r),Pe.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function F2(e,t,n,r=aa,i){const a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ht,context:ht?ht.context:null,pure:n};return Pe&&Pe.running&&(a.state=0,a.tState=r),ht===null||ht!==Vne&&(Pe&&Pe.running&&ht.pure?ht.tOwned?ht.tOwned.push(a):ht.tOwned=[a]:ht.owned?ht.owned.push(a):ht.owned=[a]),a}function ER(e){const t=Pe&&Pe.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===t2)return PR(e);if(e.suspense&<(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<nq);){if(t&&Pe.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let i=e,a=n[r+1];for(;(i=i.owner)&&i!==a;)if(Pe.disposed.has(i))return}if((t?e.tState:e.state)===aa)sf(e);else if((t?e.tState:e.state)===t2){const i=jr;jr=null,Oi(()=>PR(e,n[0]),!1),jr=i}}}function Oi(e,t){if(jr)return e();let n=!1;t||(jr=[]),vr?n=!0:vr=[],nq++;try{const r=e();return Dge(n),r}catch(r){n||(vr=null),jr=null,V2(r)}}function Dge(e){if(jr&&(Wne(jr),jr=null),e)return;let t;if(Pe){if(!Pe.promises.size&&!Pe.queue.size){const r=Pe.sources,i=Pe.disposed;vr.push.apply(vr,Pe.effects),t=Pe.resolve;for(const a of vr)"tState"in a&&(a.state=a.tState),delete a.tState;Pe=null,Oi(()=>{for(const a of i)Ws(a);for(const a of r){if(a.value=a.tValue,a.owned)for(let o=0,s=a.owned.length;o<s;o++)Ws(a.owned[o]);a.tOwned&&(a.owned=a.tOwned),delete a.tValue,delete a.tOwned,a.tState=0}lX(!1)},!1)}else if(Pe.running){Pe.running=!1,Pe.effects.push.apply(Pe.effects,vr),vr=null,lX(!0);return}}const n=vr;vr=null,n.length&&Oi(()=>Fne(n),!1),t&&t()}function Wne(e){for(let t=0;t<e.length;t++)ER(e[t])}function Oge(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:ER(r)}if(Xe.context){if(Xe.count){Xe.effects||(Xe.effects=[]),Xe.effects.push(...e.slice(0,n));return}Wo()}for(Xe.effects&&(Xe.done||!Xe.count)&&(e=[...Xe.effects,...e],n+=Xe.effects.length,delete Xe.effects),t=0;t<n;t++)ER(e[t])}function PR(e,t){const n=Pe&&Pe.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){const i=e.sources[r];if(i.sources){const a=n?i.tState:i.state;a===aa?i!==t&&(!i.updatedAt||i.updatedAt<nq)&&ER(i):a===t2&&PR(i,t)}}}function Gne(e){const t=Pe&&Pe.running;for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=t2:r.state=t2,r.pure?jr.push(r):vr.push(r),r.observers&&Gne(r))}}function Ws(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const a=i.pop(),o=n.observerSlots.pop();r<i.length&&(a.sourceSlots[o]=r,i[r]=a,n.observerSlots[r]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Ws(e.tOwned[t]);delete e.tOwned}if(Pe&&Pe.running&&e.pure)Zne(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Ws(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}Pe&&Pe.running?e.tState=0:e.state=0}function Zne(e,t){if(t||(e.tState=0,Pe.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)Zne(e.owned[n])}function ty(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function dX(e,t,n){try{for(const r of t)r(e)}catch(r){V2(r,n&&n.owner||null)}}function V2(e,t=ht){const n=jp&&t&&t.context&&t.context[jp],r=ty(e);if(!n)throw r;vr?vr.push({fn(){dX(r,n,t)},state:aa}):dX(r,n,t)}function oV(e){if(typeof e=="function"&&!e.length)return oV(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=oV(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function Rge(e,t){return function(r){let i;return Qe(()=>i=lt(()=>(ht.context={...ht.context,[e]:r.value},rq(()=>r.children))),void 0),i}}const sV=Symbol("fallback");function DR(e){for(let t=0;t<e.length;t++)e[t]()}function zge(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return me(()=>DR(a)),()=>{let l=e()||[],c=l.length,u,h;return l[$R],lt(()=>{let g,y,v,k,b,x,w,M,_;if(c===0)o!==0&&(DR(a),a=[],r=[],i=[],o=0,s&&(s=[])),n.fallback&&(r=[sV],i[0]=br(C=>(a[0]=C,n.fallback())),o=1);else if(o===0){for(i=new Array(c),h=0;h<c;h++)r[h]=l[h],i[h]=br(m);o=c}else{for(v=new Array(c),k=new Array(c),s&&(b=new Array(c)),x=0,w=Math.min(o,c);x<w&&r[x]===l[x];x++);for(w=o-1,M=c-1;w>=x&&M>=x&&r[w]===l[M];w--,M--)v[M]=i[w],k[M]=a[w],s&&(b[M]=s[w]);for(g=new Map,y=new Array(M+1),h=M;h>=x;h--)_=l[h],u=g.get(_),y[h]=u===void 0?-1:u,g.set(_,h);for(u=x;u<=w;u++)_=r[u],h=g.get(_),h!==void 0&&h!==-1?(v[h]=i[u],k[h]=a[u],s&&(b[h]=s[u]),h=y[h],g.set(_,h)):a[u]();for(h=x;h<c;h++)h in v?(i[h]=v[h],a[h]=k[h],s&&(s[h]=b[h],s[h](h))):i[h]=br(m);i=i.slice(0,o=c),r=l.slice(0)}return i});function m(g){if(a[h]=g,s){const[y,v]=Ce(h);return s[h]=v,t(l[h],y)}return t(l[h])}}}function qge(e,t,n={}){let r=[],i=[],a=[],o=[],s=0,l;return me(()=>DR(a)),()=>{const c=e()||[],u=c.length;return c[$R],lt(()=>{if(u===0)return s!==0&&(DR(a),a=[],r=[],i=[],s=0,o=[]),n.fallback&&(r=[sV],i[0]=br(m=>(a[0]=m,n.fallback())),s=1),i;for(r[0]===sV&&(a[0](),a=[],r=[],i=[],s=0),l=0;l<u;l++)l<r.length&&r[l]!==c[l]?o[l](()=>c[l]):l>=r.length&&(i[l]=br(h));for(;l<r.length;l++)a[l]();return s=o.length=a.length=u,r=c.slice(0),i=i.slice(0,s)});function h(m){a[l]=m;const[g,y]=Ce(c[l]);return o[l]=y,t(g,l)}}}function d(e,t){return lt(()=>e(t||{}))}function Hm(){return!0}const lV={get(e,t,n){return t===za?n:e.get(t)},has(e,t){return t===za?!0:e.has(t)},set:Hm,deleteProperty:Hm,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Hm,deleteProperty:Hm}},ownKeys(e){return e.keys()}};function tH(e){return(e=typeof e=="function"?e():e)?e:{}}function jge(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function f(...e){let t=!1;for(let o=0;o<e.length;o++){const s=e[o];t=t||!!s&&za in s,e[o]=typeof s=="function"?(t=!0,Z(s)):s}if(Hne&&t)return new Proxy({get(o){for(let s=e.length-1;s>=0;s--){const l=tH(e[s])[o];if(l!==void 0)return l}},has(o){for(let s=e.length-1;s>=0;s--)if(o in tH(e[s]))return!0;return!1},keys(){const o=[];for(let s=0;s<e.length;s++)o.push(...Object.keys(tH(e[s])));return[...new Set(o)]}},lV);const n={},r=Object.create(null);for(let o=e.length-1;o>=0;o--){const s=e[o];if(!s)continue;const l=Object.getOwnPropertyNames(s);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const h=Object.getOwnPropertyDescriptor(s,u);if(!r[u])r[u]=h.get?{enumerable:!0,configurable:!0,get:jge.bind(n[u]=[h.get.bind(s)])}:h.value!==void 0?h:void 0;else{const m=n[u];m&&(h.get?m.push(h.get.bind(s)):h.value!==void 0&&m.push(()=>h.value))}}}const i={},a=Object.keys(r);for(let o=a.length-1;o>=0;o--){const s=a[o],l=r[s];l&&l.get?Object.defineProperty(i,s,l):i[s]=l?l.value:void 0}return i}function Me(e,...t){const n=t.length;if(Hne&&za in e){const i=n>1?t.flat():t[0],a=t.map(o=>new Proxy({get(s){return o.includes(s)?e[s]:void 0},has(s){return o.includes(s)&&s in e},keys(){return o.filter(s=>s in e)}},lV));return a.push(new Proxy({get(o){return i.includes(o)?void 0:e[o]},has(o){return i.includes(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.includes(o))}},lV)),a}const r=[];for(let i=0;i<=n;i++)r[i]={};for(const i of Object.getOwnPropertyNames(e)){let a=n;for(let l=0;l<t.length;l++)if(t[l].includes(i)){a=l;break}const o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}function B2(e){let t,n;const r=i=>{const a=Xe.context;if(a){const[s,l]=Ce();Xe.count||(Xe.count=0),Xe.count++,(n||(n=e())).then(c=>{!Xe.done&&Wo(a),Xe.count--,l(()=>c.default),Wo()}),t=s}else if(!t){const[s]=Jr(()=>(n||(n=e())).then(l=>l.default));t=s}let o;return Z(()=>(o=t())?lt(()=>{if(!a||Xe.done)return o(i);const s=Xe.context;Wo(a);const l=o(i);return Wo(s),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}let Hge=0;function wr(){return Xe.context?Xe.getNextContextId():`cl-${Hge++}`}const Kne=e=>`Stale read from <${e}>.`;function Qt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Z(zge(()=>e.each,e.children,t||void 0))}function pYt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Z(qge(()=>e.each,e.children,t||void 0))}function ve(e){const t=e.keyed,n=Z(()=>e.when,void 0,void 0),r=t?n:Z(n,void 0,{equals:(i,a)=>!i==!a});return Z(()=>{const i=r();if(i){const a=e.children;return typeof a=="function"&&a.length>0?lt(()=>a(t?i:()=>{if(!lt(r))throw Kne("Show");return n()})):a}return e.fallback},void 0,void 0)}function r0(e){const t=rq(()=>e.children),n=Z(()=>{const r=t(),i=Array.isArray(r)?r:[r];let a=()=>{};for(let o=0;o<i.length;o++){const s=o,l=i[o],c=a,u=Z(()=>c()?void 0:l.when,void 0,void 0),h=l.keyed?u:Z(u,void 0,{equals:(m,g)=>!m==!g});a=()=>c()||(h()?[s,u,l]:void 0)}return a});return Z(()=>{const r=n()();if(!r)return e.fallback;const[i,a,o]=r,s=o.children;return typeof s=="function"&&s.length>0?lt(()=>s(o.keyed?a():()=>{if(lt(n)()?.[0]!==i)throw Kne("Match");return a()})):s},void 0,void 0)}function Zn(e){return e}let gh;function Fge(){gh&&[...gh].forEach(e=>e())}function Vge(e){let t;Xe.context&&Xe.load&&(t=Xe.load(Xe.getContextId()));const[n,r]=Ce(t,void 0);return gh||(gh=new Set),gh.add(r),me(()=>gh.delete(r)),Z(()=>{let i;if(i=n()){const a=e.fallback;return typeof a=="function"&&a.length?lt(()=>a(i,()=>r())):a}return $ge(()=>e.children,r)},void 0,void 0)}const Bge=Tt();function Uge(e){let t=0,n,r,i,a,o;const[s,l]=Ce(!1),c=Pge(),u={increment:()=>{++t===1&&l(!0)},decrement:()=>{--t===0&&l(!1)},inFallback:s,effects:[],resolved:!1},h=qa();if(Xe.context&&Xe.load){const y=Xe.getContextId();let v=Xe.load(y);if(v&&(typeof v!="object"||v.s!==1?i=v:Xe.gather(y)),i&&i!=="$$f"){const[k,b]=Ce(void 0,{equals:!1});a=k,i.then(()=>{if(Xe.done)return b();Xe.gather(y),Wo(r),b(),Wo()},x=>{o=x,b()})}}const m=Lt(Bge);m&&(n=m.register(u.inFallback));let g;return me(()=>g&&g()),d(c.Provider,{value:u,get children(){return Z(()=>{if(o)throw o;if(r=Xe.context,a)return a(),a=void 0;r&&i==="$$f"&&Wo();const y=Z(()=>e.children);return Z(v=>{const k=u.inFallback(),{showContent:b=!0,showFallback:x=!0}=n?n():{};if((!k||i&&i!=="$$f")&&b)return u.resolved=!0,g&&g(),g=r=i=void 0,Ege(u.effects),y();if(x)return g?v:br(w=>(g=w,r&&(Wo({id:r.id+"F",count:0}),r=void 0),e.fallback),h)})})}})}const Wge=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],Gge=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...Wge]),Zge=new Set(["innerHTML","textContent","innerText","children"]),Kge=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Xge=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function Jge(e,t){const n=Xge[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Yge=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Qge=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),eye={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},kt=e=>Z(()=>e());function tye(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,l=t[i-1].nextSibling,c=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){const u=a<r?s?n[s-1].nextSibling:n[a-s]:l;for(;s<a;)e.insertBefore(n[s++],u)}else if(a===s)for(;o<i;)(!c||!c.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],u),t[i]=n[a]}else{if(!c){c=new Map;let h=s;for(;h<a;)c.set(n[h],h++)}const u=c.get(t[o]);if(u!=null)if(s<u&&u<a){let h=o,m=1,g;for(;++h<i&&h<a&&!((g=c.get(t[h]))==null||g!==u+m);)m++;if(m>u-s){const y=t[o];for(;s<u;)e.insertBefore(n[s++],y)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const uX="_$DX_DELEGATE";function nye(e,t,n,r={}){let i;return br(a=>{i=a,t===document?e():K(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function ie(e,t,n,r){let i;const a=()=>{const s=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:r?s.firstChild:s.content.firstChild},o=t?()=>lt(()=>document.importNode(i||(i=a()),!0)):()=>(i||(i=a())).cloneNode(!0);return o.cloneNode=o,o}function li(e,t=window.document){const n=t[uX]||(t[uX]=new Set);for(let r=0,i=e.length;r<i;r++){const a=e[r];n.has(a)||(n.add(a),t.addEventListener(a,lye))}}function wt(e,t,n){b0(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function rye(e,t,n,r){b0(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function iye(e,t,n){b0(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function U2(e,t){b0(e)||(t==null?e.removeAttribute("class"):e.className=t)}function J1(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=a=>i.call(e,n[1],a))}else e.addEventListener(t,n,typeof n!="function"&&n)}function hr(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let a,o;for(a=0,o=i.length;a<o;a++){const s=i[a];!s||s==="undefined"||t[s]||(hX(e,s,!1),delete n[s])}for(a=0,o=r.length;a<o;a++){const s=r[a],l=!!t[s];!s||s==="undefined"||n[s]===l||!l||(hX(e,s,!0),n[s]=l)}return n}function iq(e,t,n){if(!t)return n?wt(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,a;for(a in n)t[a]==null&&r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function Rr(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t)}function ki(e,t={},n,r){const i={};return r||Qe(()=>i.children=r2(e,t.children,i.children)),Qe(()=>typeof t.ref=="function"&&Hr(t.ref,e)),Qe(()=>aye(e,t,n,!0,i,!0)),i}function Hr(e,t,n){return lt(()=>e(t,n))}function K(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return r2(e,t,r,n);Qe(i=>r2(e,t(),i,n),r)}function aye(e,t,n,r,i={},a=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=fX(e,o,null,i[o],n,a,t)}for(const o in t){if(o==="children")continue;const s=t[o];i[o]=fX(e,o,s,i[o],n,a,t)}}function oye(e){let t,n;return!b0()||!(t=Xe.registry.get(n=cye()))?e():(Xe.completed&&Xe.completed.add(t),Xe.registry.delete(n),t)}function b0(e){return!!Xe.context&&!Xe.done&&(!e||e.isConnected)}function sye(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function hX(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,a=r.length;i<a;i++)e.classList.toggle(r[i],n)}function fX(e,t,n,r,i,a,o){let s,l,c,u,h;if(t==="style")return iq(e,n,r);if(t==="classList")return hr(e,n,r);if(n===r)return r;if(t==="ref")a||n(e);else if(t.slice(0,3)==="on:"){const m=t.slice(3);r&&e.removeEventListener(m,r,typeof r!="function"&&r),n&&e.addEventListener(m,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const m=t.slice(10);r&&e.removeEventListener(m,r,!0),n&&e.addEventListener(m,n,!0)}else if(t.slice(0,2)==="on"){const m=t.slice(2).toLowerCase(),g=Yge.has(m);if(!g&&r){const y=Array.isArray(r)?r[0]:r;e.removeEventListener(m,y)}(g||n)&&(J1(e,m,n,g),g&&li([m]))}else if(t.slice(0,5)==="attr:")wt(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")iye(e,t.slice(5),n);else if((h=t.slice(0,5)==="prop:")||(c=Zge.has(t))||!i&&((u=Jge(t,e.tagName))||(l=Gge.has(t)))||(s=e.nodeName.includes("-")||"is"in o)){if(h)t=t.slice(5),l=!0;else if(b0(e))return n;t==="class"||t==="className"?U2(e,n):s&&!l&&!c?e[sye(t)]=n:e[u||t]=n}else{const m=i&&t.indexOf(":")>-1&&eye[t.split(":")[0]];m?rye(e,m,t,n):wt(e,Kge[t]||t,n)}return n}function lye(e){if(Xe.registry&&Xe.events&&Xe.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),o=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Xe.registry&&!Xe.done&&(Xe.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();a(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!o());c++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function r2(e,t,n,r,i){const a=b0(e);if(a){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const u=n[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(a||o==="number"&&(t=t.toString(),t===n))return n;if(s){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=j0(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(a)return n;n=j0(e,n,r)}else{if(o==="function")return Qe(()=>{let l=t();for(;typeof l=="function";)l=l();n=r2(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(cV(l,t,n,i))return Qe(()=>n=r2(e,l,n,r,!0)),()=>n;if(a){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;const h=[u];for(;(u=u.nextSibling)!==r;)h.push(u);return n=h}if(l.length===0){if(n=j0(e,n,r),s)return n}else c?n.length===0?pX(e,l,r):tye(e,n,l):(n&&j0(e),pX(e,l));n=l}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=j0(e,n,r,t);j0(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function cV(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let s=t[a],l=n&&n[e.length],c;if(!(s==null||s===!0||s===!1))if((c=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=cV(e,s,l)||i;else if(c==="function")if(r){for(;typeof s=="function";)s=s();i=cV(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||i}else e.push(s),i=!0;else{const u=String(s);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return i}function pX(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function j0(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let a=!1;for(let o=t.length-1;o>=0;o--){const s=t[o];if(i!==s){const l=s.parentNode===e;!a&&!o?l?e.replaceChild(i,s):e.insertBefore(i,n):l&&s.remove()}else a=!0}}else e.insertBefore(i,n);return[i]}function cye(){return Xe.getNextContextId()}const dye=!1,uye="http://www.w3.org/2000/svg";function Xne(e,t=!1,n=void 0){return t?document.createElementNS(uye,e):document.createElement(e,{is:n})}function w0(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=qa();let a,o=!!Xe.context;return fe(()=>{o&&(qa().user=o=!1),a||(a=Go(i,()=>Z(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[l,c]=Ce(!1),u=()=>c(!0);br(h=>K(s,()=>l()?h():a(),null)),me(u)}else{const l=Xne(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),K(c,a),s.appendChild(l),e.ref&&e.ref(l),me(()=>s.removeChild(l))}},void 0,{render:!o}),n}function hye(e,t){const n=Z(e);return Z(()=>{const r=n();switch(typeof r){case"function":return lt(()=>r(t));case"string":const i=Qge.has(r),a=Xe.context?oye():Xne(r,i,lt(()=>t.is));return ki(a,t,i),a}})}function aq(e){const[,t]=Me(e,["component"]);return hye(()=>e.component,t)}const fye="modulepreload",pye=function(e){return"/"+e},mX={},z=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),s=o?.nonce||o?.getAttribute("nonce");i=l(n.map(c=>{if(c=pye(c),c in mX)return;mX[c]=!0;const u=c.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const m=document.createElement("link");if(m.rel=u?"stylesheet":fye,u||(m.as="script"),m.crossOrigin="",m.href=c,s&&m.setAttribute("nonce",s),document.head.appendChild(m),u)return new Promise((g,y)=>{m.addEventListener("load",g),m.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return i.then(o=>{for(const s of o||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})};function Nn(e){const t=Tt();return{provider:n=>{const r=e.init(n);if(!(e.gate??!0))return d(t.Provider,{value:r,get children(){return n.children}});const a=Z(()=>{const o=r.ready;return o===void 0||(typeof o=="function"?o():o)});return d(ve,{get when(){return a()},get children(){return d(t.Provider,{value:r,get children(){return n.children}})}})},use(){const n=Lt(t);if(!n)throw new Error(`${e.name} context must be used within a context provider`);return n}}}const{use:mye,provider:Jne}=Nn({name:"Data",init:e=>({get store(){return e.data},get directory(){return e.directory},get mediaUrl(){return e.mediaUrl},navigateToSession:e.onNavigateToSession,sessionHref:e.onSessionHref})}),Yne=Nn({name:"FileComponent",init:e=>e.component}),gye=Yne.provider,mYt=Yne.use,yye=e=>e!=null,gYt=e=>e.filter(yye);function vye(e){return(...t)=>{for(const n of e)n&&n(...t)}}const ke=e=>typeof e=="function"&&!e.length?e():e,gX=e=>Array.isArray(e)?e:e?[e]:[];function kye(e,...t){return typeof e=="function"?e(...t):e}const DU=me;function bye(e,t,n){if(Xe.context){const[r,i]=Ce(e,n);return dn(()=>i(()=>t())),[r,i]}return Ce(t(),n)}function yYt(e,t,n,r){const i=e.length,a=t.length;let o=0;if(!a){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<a;o++)r(t[o]);return}for(;o<a&&t[o]===e[o];o++);let s,l;t=t.slice(o),e=e.slice(o);for(s of t)e.includes(s)||r(s);for(l of e)t.includes(l)||n(l)}function Qne(e,t,n,r){return e.addEventListener(t,n,r),DU(e.removeEventListener.bind(e,t,n,r))}function wye(e,t,n,r){const i=()=>{gX(ke(e)).forEach(a=>{a&&gX(ke(t)).forEach(o=>Qne(a,o,n,r))})};typeof e=="function"?fe(i):Qe(i)}function xye(e,t=qa()){let n=0,r,i;return()=>(n++,me(()=>{n--,queueMicrotask(()=>{!n&&i&&(i(),i=r=void 0)})}),i||br(a=>r=e(i=a),t),r)}function _ye(e){const t=qa(),n=xye(e,t);return()=>Xe.context?br(e,t):n()}function OU(e,t=!1){const n=window.matchMedia(e),[r,i]=bye(t,()=>n.matches);return Qne(n,"change",()=>i(n.matches)),r}function Mye(e){return OU("(prefers-color-scheme: dark)",e)}Mye.bind(void 0,!1);const Sye=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function yX(e){const t={};let n;for(;n=Sye.exec(e);)t[n[1]]=n[2];return t}function Wa(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=yX(e)}else typeof t=="string"&&(t=yX(t));return{...e,...t}}function hn(...e){return vye(e)}function Cye(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function dV(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Lye(e){return typeof e=="number"}function lh(e){return Object.prototype.toString.call(e)==="[object String]"}function ere(e){return typeof e=="function"}function Io(e){return t=>`${e()}-${t}`}function Iye(){const e=new Map,t=(i,a,o,s)=>{const l=s?.once?(...c)=>{e.delete(o),o(...c)}:o;e.set(o,{type:a,eventTarget:i,fn:l,options:s}),i.addEventListener(a,o,s)},n=(i,a,o,s)=>{const l=e.get(o)?.fn||o;i.removeEventListener(a,l,s),e.delete(o)},r=()=>{e.forEach((i,a)=>{n(i.eventTarget,i.type,a,i.options)})};return me(()=>{r()}),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Jn(e,t){return e?e===t||e.contains(t):!1}function _p(e,t=!1){const{activeElement:n}=ri(e);if(!n?.nodeName)return null;if(tre(n)&&n.contentDocument)return _p(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=ri(n).getElementById(r);if(i)return i}}return n}function RU(e){return ri(e).defaultView||window}function ri(e){return e?e.ownerDocument||e:document}function tre(e){return e.tagName==="IFRAME"}var nre=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(nre||{});function rre(e){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function zU(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function oq(){return zU(/^Mac/i)}function Nye(){return zU(/^iPhone/i)}function Aye(){return zU(/^iPad/i)||oq()&&navigator.maxTouchPoints>1}function $ye(){return Nye()||Aye()}function Tye(){return oq()||$ye()}function vYt(){return rre(/AppleWebKit/i)&&!Eye()}function Eye(){return rre(/Chrome/i)}function dt(e,t){return t&&(ere(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function Kn(e){return t=>{for(const n of e)dt(t,n)}}function Pye(e){return oq()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function ur(e){if(e)if(Dye())e.focus({preventScroll:!0});else{const t=Oye(e);e.focus(),Rye(t)}}var Fm=null;function Dye(){if(Fm==null){Fm=!1;try{document.createElement("div").focus({get preventScroll(){return Fm=!0,!0}})}catch{}}return Fm}function Oye(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Rye(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var ire=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],zye=[...ire,'[tabindex]:not([tabindex="-1"]):not([disabled])'],qU=`${ire.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,qye=zye.join(':not([hidden]):not([tabindex="-1"]),');function are(e,t){const r=Array.from(e.querySelectorAll(qU)).filter(vX);return t&&vX(e)&&r.unshift(e),r.forEach((i,a)=>{if(tre(i)&&i.contentDocument){const o=i.contentDocument.body,s=are(o,!1);r.splice(a,1,...s)}}),r}function vX(e){return ore(e)&&!jye(e)}function ore(e){return e.matches(qU)&&jU(e)}function jye(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function jU(e,t){return e.nodeName!=="#comment"&&Hye(e)&&Fye(e,t)&&(!e.parentElement||jU(e.parentElement,e))}function Hye(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:a,visibility:o}=i(e);r=a!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function Fye(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Vye(e,t,n){const r=t?.tabbable?qye:qU,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(a){return t?.from?.contains(a)?NodeFilter.FILTER_REJECT:a.matches(r)&&jU(a)&&(!t?.accept||t.accept(a))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}function kX(e){let t=e;for(;t&&!Bye(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Bye(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Uye(){}function sre(e){return[e.clientX,e.clientY]}function HU(e,t){const[n,r]=e;let i=!1;const a=t.length;for(let o=a,s=0,l=o-1;s<o;l=s++){const[c,u]=t[s],[h,m]=t[l],[,g]=t[l===0?o-1:l-1]||[0,0],y=(u-m)*(n-c)-(c-h)*(r-u);if(m<u){if(r>=m&&r<u){if(y===0)return!0;y>0&&(r===m?r>g&&(i=!i):i=!i)}}else if(u<m){if(r>u&&r<=m){if(y===0)return!0;y<0&&(r===m?r<g&&(i=!i):i=!i)}}else if(r===u&&(n>=h&&n<=c||n>=c&&n<=h))return!0}return i}function ft(e,t){return f(e,t)}var Jf=new Map,bX=new Set;function wX(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Jf.get(n.target);r||(r=new Set,Jf.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Jf.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Jf.delete(n.target)),Jf.size===0)){for(const i of bX)i();bX.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?wX():document.addEventListener("DOMContentLoaded",wX));function uV(e,t){const n=xX(e,t,"left"),r=xX(e,t,"top"),i=t.offsetWidth,a=t.offsetHeight;let o=e.scrollLeft,s=e.scrollTop;const l=o+e.offsetWidth,c=s+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=s?s=r:r+a>c&&(s+=r+a-c),e.scrollLeft=o,e.scrollTop=s}function xX(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function Wye(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let i=kX(e);for(;e&&i&&e!==n&&i!==n;)uV(i,e),e=i,i=kX(e)}else{const{left:i,top:a}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:o,top:s}=e.getBoundingClientRect();(Math.abs(i-o)>1||Math.abs(a-s)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var Gye={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"},i2="data-kb-top-layer",lre,hV=!1,rs=[];function a2(e){return rs.findIndex(t=>t.node===e)}function Zye(e){return rs[a2(e)]}function Kye(e){return rs[rs.length-1].node===e}function cre(){return rs.filter(e=>e.isPointerBlocking)}function Xye(){return[...cre()].slice(-1)[0]}function FU(){return cre().length>0}function dre(e){const t=a2(Xye()?.node);return a2(e)<t}function Jye(e){rs.push(e)}function Yye(e){const t=a2(e);t<0||rs.splice(t,1)}function Qye(){for(const{node:e}of rs)e.style.pointerEvents=dre(e)?"none":"auto"}function eve(e){if(FU()&&!hV){const t=ri(e);lre=document.body.style.pointerEvents,t.body.style.pointerEvents="none",hV=!0}}function tve(e){if(FU())return;const t=ri(e);t.body.style.pointerEvents=lre,t.body.style.length===0&&t.body.removeAttribute("style"),hV=!1}var Si={layers:rs,isTopMostLayer:Kye,hasPointerBlockingLayer:FU,isBelowPointerBlockingLayer:dre,addLayer:Jye,removeLayer:Yye,indexOf:a2,find:Zye,assignPointerEventToLayers:Qye,disableBodyPointerEvents:eve,restoreBodyPointerEvents:tve},nH="focusScope.autoFocusOnMount",rH="focusScope.autoFocusOnUnmount",_X={bubbles:!1,cancelable:!0},MX={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=dV(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=dV(this.stack,e),this.active()?.resume()}};function ure(e,t){const[n,r]=Ce(!1),i={pause(){r(!0)},resume(){r(!1)}};let a=null;const o=y=>e.onMountAutoFocus?.(y),s=y=>e.onUnmountAutoFocus?.(y),l=()=>ri(t()),c=()=>{const y=l().createElement("span");return y.setAttribute("data-focus-trap",""),y.tabIndex=0,Object.assign(y.style,Gye),y},u=()=>{const y=t();return y?are(y,!0).filter(v=>!v.hasAttribute("data-focus-trap")):[]},h=()=>{const y=u();return y.length>0?y[0]:null},m=()=>{const y=u();return y.length>0?y[y.length-1]:null},g=()=>{const y=t();if(!y)return!1;const v=_p(y);return!v||Jn(y,v)?!1:ore(v)};fe(()=>{const y=t();if(!y)return;MX.add(i);const v=_p(y);if(!Jn(y,v)){const b=new CustomEvent(nH,_X);y.addEventListener(nH,o),y.dispatchEvent(b),b.defaultPrevented||setTimeout(()=>{ur(h()),_p(y)===v&&ur(y)},0)}me(()=>{y.removeEventListener(nH,o),setTimeout(()=>{const b=new CustomEvent(rH,_X);g()&&b.preventDefault(),y.addEventListener(rH,s),y.dispatchEvent(b),b.defaultPrevented||ur(v??l().body),y.removeEventListener(rH,s),MX.remove(i)},0)})}),fe(()=>{const y=t();if(!y||!ke(e.trapFocus)||n())return;const v=b=>{const x=b.target;x?.closest(`[${i2}]`)||(Jn(y,x)?a=x:ur(a))},k=b=>{const w=b.relatedTarget??_p(y);w?.closest(`[${i2}]`)||Jn(y,w)||ur(a)};l().addEventListener("focusin",v),l().addEventListener("focusout",k),me(()=>{l().removeEventListener("focusin",v),l().removeEventListener("focusout",k)})}),fe(()=>{const y=t();if(!y||!ke(e.trapFocus)||n())return;const v=c();y.insertAdjacentElement("afterbegin",v);const k=c();y.insertAdjacentElement("beforeend",k);function b(w){const M=h(),_=m();w.relatedTarget===M?ur(_):ur(M)}v.addEventListener("focusin",b),k.addEventListener("focusin",b);const x=new MutationObserver(w=>{for(const M of w)M.previousSibling===k&&(k.remove(),y.insertAdjacentElement("beforeend",k)),M.nextSibling===v&&(v.remove(),y.insertAdjacentElement("afterbegin",v))});x.observe(y,{childList:!0,subtree:!1}),me(()=>{v.removeEventListener("focusin",b),k.removeEventListener("focusin",b),v.remove(),k.remove(),x.disconnect()})})}var nve="data-live-announcer";function hre(e){fe(()=>{ke(e.isDisabled)||me(rve(ke(e.targets),ke(e.root)))})}var Yf=new WeakMap,Ui=[];function rve(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const m of l.querySelectorAll(`[${nve}], [${i2}]`))n.add(m);const c=m=>{if(n.has(m)||m.parentElement&&r.has(m.parentElement)&&m.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const g of n)if(m.contains(g))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),h=c(l);if(h===NodeFilter.FILTER_ACCEPT&&a(l),h!==NodeFilter.FILTER_REJECT){let m=u.nextNode();for(;m!=null;)a(m),m=u.nextNode()}},a=l=>{const c=Yf.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Yf.set(l,c+1))};Ui.length&&Ui[Ui.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&i(u)}});o.observe(t,{childList:!0,subtree:!0});const s={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return Ui.push(s),()=>{o.disconnect();for(const l of r){const c=Yf.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Yf.delete(l)):Yf.set(l,c-1)}s===Ui[Ui.length-1]?(Ui.pop(),Ui.length&&Ui[Ui.length-1].observe()):Ui.splice(Ui.indexOf(s),1)}}var SX="interactOutside.pointerDownOutside",CX="interactOutside.focusOutside";function ive(e,t){let n,r=Uye;const i=()=>ri(t()),a=h=>e.onPointerDownOutside?.(h),o=h=>e.onFocusOutside?.(h),s=h=>e.onInteractOutside?.(h),l=h=>{const m=h.target;return!(m instanceof Element)||m.closest(`[${i2}]`)||!Jn(i(),m)||Jn(t(),m)?!1:!e.shouldExcludeElement?.(m)},c=h=>{function m(){const g=t(),y=h.target;if(!g||!y||!l(h))return;const v=Kn([a,s]);y.addEventListener(SX,v,{once:!0});const k=new CustomEvent(SX,{bubbles:!1,cancelable:!0,detail:{originalEvent:h,isContextMenu:h.button===2||Pye(h)&&h.button===0}});y.dispatchEvent(k)}h.pointerType==="touch"?(i().removeEventListener("click",m),r=m,i().addEventListener("click",m,{once:!0})):m()},u=h=>{const m=t(),g=h.target;if(!m||!g||!l(h))return;const y=Kn([o,s]);g.addEventListener(CX,y,{once:!0});const v=new CustomEvent(CX,{bubbles:!1,cancelable:!0,detail:{originalEvent:h,isContextMenu:!1}});g.dispatchEvent(v)};fe(()=>{ke(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),me(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}function ave(e){const t=n=>{n.key===nre.Escape&&e.onEscapeKeyDown?.(n)};fe(()=>{if(ke(e.isDisabled))return;const n=e.ownerDocument?.()??ri();n.addEventListener("keydown",t),me(()=>{n.removeEventListener("keydown",t)})})}function zt(e){const[t,n]=Me(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return d(aq,f(n,{get component(){return t.as}}))}var fre=Tt();function ove(){return Lt(fre)}function sq(e){let t;const n=ove(),[r,i]=Me(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),a=new Set([]),o=h=>{a.add(h);const m=n?.registerNestedLayer(h);return()=>{a.delete(h),m?.()}};ive({shouldExcludeElement:h=>t?r.excludedElements?.some(m=>Jn(m(),h))||[...a].some(m=>Jn(m,h)):!1,onPointerDownOutside:h=>{!t||Si.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Si.isTopMostLayer(t)||(r.onPointerDownOutside?.(h),r.onInteractOutside?.(h),h.defaultPrevented||r.onDismiss?.())},onFocusOutside:h=>{r.onFocusOutside?.(h),r.onInteractOutside?.(h),h.defaultPrevented||r.onDismiss?.()}},()=>t),ave({ownerDocument:()=>ri(t),onEscapeKeyDown:h=>{!t||!Si.isTopMostLayer(t)||(r.onEscapeKeyDown?.(h),!h.defaultPrevented&&r.onDismiss&&(h.preventDefault(),r.onDismiss()))}}),dn(()=>{if(!t)return;Si.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const h=n?.registerNestedLayer(t);Si.assignPointerEventToLayers(),Si.disableBodyPointerEvents(t),me(()=>{t&&(Si.removeLayer(t),h?.(),Si.assignPointerEventToLayers(),Si.restoreBodyPointerEvents(t))})}),fe(vn([()=>t,()=>r.disableOutsidePointerEvents],([h,m])=>{if(!h)return;const g=Si.find(h);g&&g.isPointerBlocking!==m&&(g.isPointerBlocking=m,Si.assignPointerEventToLayers()),m&&Si.disableBodyPointerEvents(h),me(()=>{Si.restoreBodyPointerEvents(h)})},{defer:!0}));const u={registerNestedLayer:o};return d(fre.Provider,{value:u,get children(){return d(zt,f({as:"div",ref(h){var m=hn(g=>t=g,r.ref);typeof m=="function"&&m(h)}},i))}})}function W2(e){const[t,n]=Ce(e.defaultValue?.()),r=Z(()=>e.value?.()!==void 0),i=Z(()=>r()?e.value?.():t());return[i,o=>{lt(()=>{const s=kye(o,i());return Object.is(s,i())||(r()||n(s),e.onChange?.(s)),s})}]}function pre(e){const[t,n]=W2(e);return[()=>t()??!1,n]}function sve(e){const[t,n]=W2(e);return[()=>t()??[],n]}function x0(e={}){const[t,n]=pre({value:()=>ke(e.open),defaultValue:()=>!!ke(e.defaultOpen),onChange:o=>e.onOpenChange?.(o)}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}function G2(e,t){const[n,r]=Ce(LX(t?.()));return fe(()=>{r(e()?.tagName.toLowerCase()||LX(t?.()))}),n}function LX(e){return lh(e)?e:void 0}var lve=Object.defineProperty,Ga=(e,t)=>{for(var n in t)lve(e,n,{get:t[n],enumerable:!0})},cve={};Ga(cve,{Button:()=>VU,Root:()=>_0});var dve=["button","color","file","image","reset","submit"];function uve(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?dve.indexOf(e.type)!==-1:!1}function _0(e){let t;const n=ft({type:"button"},e),[r,i]=Me(n,["ref","type","disabled"]),a=G2(()=>t,()=>"button"),o=Z(()=>{const c=a();return c==null?!1:uve({tagName:c,type:r.type})}),s=Z(()=>a()==="input"),l=Z(()=>a()==="a"&&t?.getAttribute("href")!=null);return d(zt,f({as:"button",ref(c){var u=hn(h=>t=h,r.ref);typeof u=="function"&&u(c)},get type(){return kt(()=>!!(o()||s()))()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return kt(()=>!!(o()||s()))()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!s()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var VU=_0;function zr(e){return t=>(e(t),()=>e(void 0))}var Tr=e=>typeof e=="function"?e():e,fV=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},Vm=new Map,hve=e=>{fe(()=>{const t=Tr(e.style)??{},n=Tr(e.properties)??[],r={};for(const a in t)r[a]=e.element.style[a];const i=Vm.get(e.key);i?i.activeCount++:Vm.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(a=>a.key)}),Object.assign(e.element.style,e.style);for(const a of n)e.element.style.setProperty(a.key,a.value);me(()=>{const a=Vm.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}Vm.delete(e.key);for(const[o,s]of Object.entries(a.originalStyles))e.element.style[o]=s;for(const o of a.properties)e.element.style.removeProperty(o);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},IX=hve,fve=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},pve=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},mve=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,a=0,o=0,s=!1;do{const[l,c,u]=fve(i,t),h=u-l-r*c;(c!==0||h!==0)&&pve(i,t)&&(a+=h,o+=c),i===(n??document.documentElement)?s=!0:i=i._$host??i.parentElement}while(i&&!s);return[a,o]},[NX,AX]=Ce([]),gve=e=>NX().indexOf(e)===NX().length-1,yve=e=>{const t=f({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=wr();let r=[0,0],i=null,a=null;fe(()=>{Tr(t.enabled)&&(AX(c=>[...c,n]),me(()=>{AX(c=>c.filter(u=>u!==n))}))}),fe(()=>{if(!Tr(t.enabled)||!Tr(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(Tr(t.preventScrollbarShift)){const h={overflow:"hidden"},m=[];u>0&&(Tr(t.preventScrollbarShiftMode)==="padding"?h.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:h.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,m.push({key:"--scrollbar-width",value:`${u}px`}));const g=window.scrollY,y=window.scrollX;IX({key:"prevent-scroll",element:c,style:h,properties:m,cleanup:()=>{Tr(t.restoreScrollPosition)&&u>0&&window.scrollTo(y,g)}})}else IX({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),fe(()=>{!gve(n)||!Tr(t.enabled)||(document.addEventListener("wheel",s,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),me(()=>{document.removeEventListener("wheel",s),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=c=>{r=$X(c),i=null,a=null},s=c=>{const u=c.target,h=Tr(t.element),m=vve(c),g=Math.abs(m[0])>Math.abs(m[1])?"x":"y",y=g==="x"?m[0]:m[1],v=TX(u,g,y,h);let k;h&&fV(h,u)?k=!v:k=!0,k&&c.cancelable&&c.preventDefault()},l=c=>{const u=Tr(t.element),h=c.target;let m;if(c.touches.length===2)m=!Tr(t.allowPinchZoom);else{if(i==null||a===null){const g=$X(c).map((v,k)=>r[k]-v),y=Math.abs(g[0])>Math.abs(g[1])?"x":"y";i=y,a=y==="x"?g[0]:g[1]}if(h.type==="range")m=!1;else{const g=TX(h,i,a,u);u&&fV(u,h)?m=!g:m=!0}}m&&c.cancelable&&c.preventDefault()}},vve=e=>[e.deltaX,e.deltaY],$X=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],TX=(e,t,n,r)=>{const i=r!==null&&fV(r,e),[a,o]=mve(e,t,i?r:void 0);return!(n>0&&Math.abs(a)<=1||n<0&&Math.abs(o)<1)},kve=yve,mre=kve,bve=e=>{const t=Z(()=>{const o=Tr(e.element);if(o)return getComputedStyle(o)}),n=()=>t()?.animationName??"none",[r,i]=Ce(Tr(e.show)?"present":"hidden");let a="none";return fe(o=>{const s=Tr(e.show);return lt(()=>{if(o===s)return s;const l=a,c=n();s?i("present"):c==="none"||t()?.display==="none"?i("hidden"):i(o===!0&&l!==c?"hiding":"hidden")}),s}),fe(()=>{const o=Tr(e.element);if(!o)return;const s=c=>{c.target===o&&(a=n())},l=c=>{const h=n().includes(c.animationName);c.target===o&&h&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",s),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),me(()=>{o.removeEventListener("animationstart",s),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:i}},wve=bve,i0=wve,xve={};Ga(xve,{CloseButton:()=>yre,Content:()=>vre,Description:()=>kre,Dialog:()=>Ds,Overlay:()=>bre,Portal:()=>wre,Root:()=>xre,Title:()=>_re,Trigger:()=>Mre,useDialogContext:()=>al});var gre=Tt();function al(){const e=Lt(gre);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function yre(e){const t=al(),[n,r]=Me(e,["aria-label","onClick"]);return d(_0,f({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:a=>{dt(a,n.onClick),t.close()}},r))}function vre(e){let t;const n=al(),r=ft({id:n.generateId("content")},e),[i,a]=Me(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let o=!1,s=!1;const l=m=>{i.onPointerDownOutside?.(m),n.modal()&&m.detail.isContextMenu&&m.preventDefault()},c=m=>{i.onFocusOutside?.(m),n.modal()&&m.preventDefault()},u=m=>{i.onInteractOutside?.(m),!n.modal()&&(m.defaultPrevented||(o=!0,m.detail.originalEvent.type==="pointerdown"&&(s=!0)),Jn(n.triggerRef(),m.target)&&m.preventDefault(),m.detail.originalEvent.type==="focusin"&&s&&m.preventDefault())},h=m=>{i.onCloseAutoFocus?.(m),n.modal()?(m.preventDefault(),ur(n.triggerRef())):(m.defaultPrevented||(o||ur(n.triggerRef()),m.preventDefault()),o=!1,s=!1)};return hre({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),mre({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),ure({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:i.onOpenAutoFocus,onUnmountAutoFocus:h},()=>t),fe(()=>me(n.registerContentId(a.id))),d(ve,{get when(){return n.contentPresent()},get children(){return d(sq,f({ref(m){var g=hn(y=>{n.setContentRef(y),t=y},i.ref);typeof g=="function"&&g(m)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return kt(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,get onDismiss(){return n.close}},a))}})}function kre(e){const t=al(),n=ft({id:t.generateId("description")},e),[r,i]=Me(n,["id"]);return fe(()=>me(t.registerDescriptionId(r.id))),d(zt,f({as:"p",get id(){return r.id}},i))}function bre(e){const t=al(),[n,r]=Me(e,["ref","style","onPointerDown"]),i=a=>{dt(a,n.onPointerDown),a.target===a.currentTarget&&a.preventDefault()};return d(ve,{get when(){return t.overlayPresent()},get children(){return d(zt,f({as:"div",ref(a){var o=hn(t.setOverlayRef,n.ref);typeof o=="function"&&o(a)},get style(){return Wa({"pointer-events":"auto"},n.style)},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onPointerDown:i},r))}})}function wre(e){const t=al();return d(ve,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return d(w0,e)}})}var EX={dismiss:"Dismiss"};function xre(e){const t=`dialog-${wr()}`,n=ft({id:t,modal:!0,translations:EX},e),[r,i]=Ce(),[a,o]=Ce(),[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(),[g,y]=Ce(),v=x0({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:M=>n.onOpenChange?.(M)}),k=()=>n.forceMount||v.isOpen(),{present:b}=i0({show:k,element:()=>c()??null}),{present:x}=i0({show:k,element:()=>h()??null}),w={translations:()=>n.translations??EX,isOpen:v.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??w.modal(),contentId:r,titleId:a,descriptionId:s,triggerRef:g,overlayRef:c,setOverlayRef:u,contentRef:h,setContentRef:m,overlayPresent:b,contentPresent:x,close:v.close,toggle:v.toggle,setTriggerRef:y,generateId:Io(()=>n.id),registerContentId:zr(i),registerTitleId:zr(o),registerDescriptionId:zr(l)};return d(gre.Provider,{value:w,get children(){return n.children}})}function _re(e){const t=al(),n=ft({id:t.generateId("title")},e),[r,i]=Me(n,["id"]);return fe(()=>me(t.registerTitleId(r.id))),d(zt,f({as:"h2",get id(){return r.id}},i))}function Mre(e){const t=al(),[n,r]=Me(e,["ref","onClick"]);return d(_0,f({ref(a){var o=hn(t.setTriggerRef,n.ref);typeof o=="function"&&o(a)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return kt(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:a=>{dt(a,n.onClick),t.toggle()}},r))}var Ds=Object.assign(xre,{CloseButton:yre,Content:vre,Description:kre,Overlay:bre,Portal:wre,Title:_re,Trigger:Mre}),_ve=ie("<div data-component=dialog-stack>");const Sre=Tt();function Mve(){const[e,t]=Ce(),n={current:void 0},r={value:!1};me(()=>{n.current!==void 0&&(clearTimeout(n.current),n.current=void 0)});const i=()=>{const o=e();if(!o||r.value)return;r.value=!0,o.onClose?.(),o.setClosing(!0);const s=o.id;n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),n.current=setTimeout(()=>{n.current=void 0,o.dispose(),e()?.id===s&&t(void 0),r.value=!1},100)};return fe(()=>{if(!e())return;const o=s=>{s.key==="Escape"&&(i(),s.preventDefault(),s.stopPropagation())};window.addEventListener("keydown",o,!0),me(()=>window.removeEventListener("keydown",o,!0))}),{get active(){return e()},close:i,show:(o,s,l)=>{const c=e();c&&(c.dispose(),t(void 0)),n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),r.value=!1;const u=Math.random().toString(36).slice(2);let h,m;const g=Go(s,()=>br(y=>{h=y;const[v,k]=Ce(!1);return m=k,d(Ds,{modal:!0,get open(){return!v()},onOpenChange:b=>{b||i()},get children(){return d(Ds.Portal,{get children(){return[d(Ds.Overlay,{"data-component":"dialog-overlay",onClick:i}),kt(()=>o())]}})}})}));!h||!m||t({id:u,node:g,dispose:h,owner:s,onClose:l,setClosing:m})}}}function Sve(e){const t=Mve();return d(Sre.Provider,{value:t,get children(){return[kt(()=>e.children),(()=>{var n=_ve();return K(n,()=>t.active?.node),n})()]}})}function lf(){const e=Lt(Sre),t=qa();if(!t)throw new Error("useDialog must be used within a DialogProvider");if(!e)throw new Error("useDialog must be used within a DialogProvider");return{get active(){return e.active},show(n,r){const i=e.active?.owner??t;e.show(n,i,r)},close(){e.close()}}}const Cre={"ui.sessionReview.title":"Session changes","ui.sessionReview.title.lastTurn":"Last turn changes","ui.sessionReview.diffStyle.unified":"Unified","ui.sessionReview.diffStyle.split":"Split","ui.sessionReview.expandAll":"Expand all","ui.sessionReview.collapseAll":"Collapse all","ui.sessionReview.change.added":"Added","ui.sessionReview.change.removed":"Removed","ui.sessionReview.change.modified":"Modified","ui.sessionReview.image.loading":"Loading...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff too large to render","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} changed lines. Current: {{current}} changed lines.","ui.sessionReview.largeDiff.renderAnyway":"Render anyway","ui.sessionReview.openFile":"Open file","ui.sessionReview.selection.line":"line {{line}}","ui.sessionReview.selection.lines":"lines {{start}}-{{end}}","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Removed {{kind}} file.","ui.fileMedia.state.loading":"Loading {{kind}}...","ui.fileMedia.state.error":"Unable to load {{kind}}.","ui.fileMedia.state.unavailable":"{{kind}} preview unavailable.","ui.fileMedia.binary.title":"Binary file","ui.fileMedia.binary.description.path":"{{path}} is binary.","ui.fileMedia.binary.description.default":"Binary content","ui.lineComment.label.prefix":"Comment on ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commenting on ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Add comment","ui.lineComment.submit":"Comment","ui.sessionTurn.steps.show":"Show steps","ui.sessionTurn.steps.hide":"Hide steps","ui.sessionTurn.summary.response":"Response","ui.sessionTurn.diff.showMore":"Show more changes ({{count}})","ui.sessionTurn.retry.retrying":"retrying","ui.sessionTurn.retry.inSeconds":"in {{seconds}}s","ui.sessionTurn.retry.attempt":"attempt #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - attempt #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini is way too hot right now","ui.sessionTurn.error.freeUsageExceeded":"Free usage exceeded","ui.sessionTurn.error.addCredits":"Add credits","ui.sessionTurn.status.delegating":"Delegating work","ui.sessionTurn.status.planning":"Planning next steps","ui.sessionTurn.status.gatheringContext":"Exploring","ui.sessionTurn.status.gatheredContext":"Explored","ui.sessionTurn.status.searchingCodebase":"Searching the codebase","ui.sessionTurn.status.searchingWeb":"Searching the web","ui.sessionTurn.status.makingEdits":"Making edits","ui.sessionTurn.status.runningCommands":"Running commands","ui.sessionTurn.status.thinking":"Thinking","ui.sessionTurn.status.thinkingWithTopic":"Thinking - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Gathering thoughts","ui.sessionTurn.status.consideringNextSteps":"Considering next steps","ui.messagePart.diagnostic.error":"Error","ui.messagePart.title.edit":"Edit","ui.messagePart.title.write":"Write","ui.messagePart.option.typeOwnAnswer":"Type your own answer","ui.messagePart.review.title":"Review your answers","ui.messagePart.questions.dismissed":"Questions dismissed","ui.messagePart.compaction":"Session compacted","ui.messagePart.context.read.one":"{{count}} read","ui.messagePart.context.read.other":"{{count}} reads","ui.messagePart.context.search.one":"{{count}} search","ui.messagePart.context.search.other":"{{count}} searches","ui.messagePart.context.list.one":"{{count}} list","ui.messagePart.context.list.other":"{{count}} lists","ui.list.loading":"Loading","ui.list.empty":"No results","ui.list.clearFilter":"Clear filter","ui.list.emptyWithFilter.prefix":"No results for","ui.list.emptyWithFilter.suffix":"","ui.fileSearch.placeholder":"Find","ui.fileSearch.previousMatch":"Previous match","ui.fileSearch.nextMatch":"Next match","ui.fileSearch.close":"Close search","ui.messageNav.newMessage":"New message","ui.textField.copyToClipboard":"Copy to clipboard","ui.textField.copyLink":"Copy link","ui.textField.copied":"Copied","ui.imagePreview.alt":"Image preview","ui.scrollView.ariaLabel":"scrollable content","ui.tool.read":"Read","ui.tool.loaded":"Loaded","ui.tool.list":"List","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.task":"Task","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Web Search","ui.tool.codesearch":"Code Search","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"To-dos","ui.tool.todos.read":"Read to-dos","ui.tool.questions":"Questions","ui.tool.agent":"{{type}} Agent","ui.tool.agent.default":"Agent","ui.tool.skill":"Skill","ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":"Failed","ui.toolErrorCard.copyError":"Copy error","ui.common.file.one":"file","ui.common.file.other":"files","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Add","ui.common.back":"Back","ui.common.cancel":"Cancel","ui.common.confirm":"Confirm","ui.common.dismiss":"Dismiss","ui.common.close":"Close","ui.common.next":"Next","ui.common.submit":"Submit","ui.permission.deny":"Deny","ui.permission.allowAlways":"Allow always","ui.permission.allowOnce":"Allow once","ui.message.expand":"Expand message","ui.message.collapse":"Collapse message","ui.message.copy":"Copy","ui.message.copyMessage":"Copy message","ui.message.forkMessage":"Fork to new session","ui.message.revertMessage":"Revert message","ui.message.copyResponse":"Copy response","ui.message.copied":"Copied","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s","ui.message.interrupted":"Interrupted","ui.message.queued":"Queued","ui.message.attachment.alt":"attachment","ui.patch.action.deleted":"Deleted","ui.patch.action.created":"Created","ui.patch.action.moved":"Moved","ui.patch.action.patched":"Patched","ui.question.subtitle.answered":"{{count}} answered","ui.question.answer.none":"(no answer)","ui.question.review.notAnswered":"(not answered)","ui.question.multiHint":"Select all answers that apply","ui.question.singleHint":"Select one answer","ui.question.custom.placeholder":"Type your answer..."};function Cve(e,t){return t?e.replace(/{{\s*([^}]+?)\s*}}/g,(n,r)=>{const i=String(r),a=t[i];return a===void 0?"":String(a)}):e}const Lve={locale:()=>"en",t:(e,t)=>{const n=Cre[e]??String(e);return Cve(n,t)}},Lre=Tt(Lve);function Ive(e){return d(Lre.Provider,{get value(){return e.value},get children(){return e.children}})}function M0(){return Lt(Lre)}function BU(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var S0=BU();function Ire(e){S0=e}var Hp={exec:()=>null};function Ut(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Yr.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,t)};return r}var Nve=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Yr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Ave=/^(?:[ \t]*(?:\n|$))+/,$ve=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Tve=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Z2=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Eve=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,UU=/(?:[*+-]|\d{1,9}[.)])/,Nre=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Are=Ut(Nre).replace(/bull/g,UU).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Pve=Ut(Nre).replace(/bull/g,UU).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),WU=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Dve=/^[^\n]+/,GU=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ove=Ut(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",GU).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Rve=Ut(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,UU).getRegex(),lq="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ZU=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,zve=Ut("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ZU).replace("tag",lq).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$re=Ut(WU).replace("hr",Z2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",lq).getRegex(),qve=Ut(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",$re).getRegex(),KU={blockquote:qve,code:$ve,def:Ove,fences:Tve,heading:Eve,hr:Z2,html:zve,lheading:Are,list:Rve,newline:Ave,paragraph:$re,table:Hp,text:Dve},PX=Ut("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Z2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",lq).getRegex(),jve={...KU,lheading:Pve,table:PX,paragraph:Ut(WU).replace("hr",Z2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",PX).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",lq).getRegex()},Hve={...KU,html:Ut(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ZU).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Hp,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ut(WU).replace("hr",Z2).replace("heading",` *#{1,6} *[^
|
|
3
3
|
]`).replace("lheading",Are).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Fve=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Vve=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Tre=/^( {2,}|\\)\n(?!\s*$)/,Bve=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,cq=/[\p{P}\p{S}]/u,XU=/[\s\p{P}\p{S}]/u,Ere=/[^\s\p{P}\p{S}]/u,Uve=Ut(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,XU).getRegex(),Pre=/(?!~)[\p{P}\p{S}]/u,Wve=/(?!~)[\s\p{P}\p{S}]/u,Gve=/(?:[^\s\p{P}\p{S}]|~)/u,Zve=Ut(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Nve?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Dre=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Kve=Ut(Dre,"u").replace(/punct/g,cq).getRegex(),Xve=Ut(Dre,"u").replace(/punct/g,Pre).getRegex(),Ore="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Jve=Ut(Ore,"gu").replace(/notPunctSpace/g,Ere).replace(/punctSpace/g,XU).replace(/punct/g,cq).getRegex(),Yve=Ut(Ore,"gu").replace(/notPunctSpace/g,Gve).replace(/punctSpace/g,Wve).replace(/punct/g,Pre).getRegex(),Qve=Ut("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ere).replace(/punctSpace/g,XU).replace(/punct/g,cq).getRegex(),e4e=Ut(/\\(punct)/,"gu").replace(/punct/g,cq).getRegex(),t4e=Ut(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),n4e=Ut(ZU).replace("(?:-->|$)","-->").getRegex(),r4e=Ut("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",n4e).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),OR=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,i4e=Ut(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",OR).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Rre=Ut(/^!?\[(label)\]\[(ref)\]/).replace("label",OR).replace("ref",GU).getRegex(),zre=Ut(/^!?\[(ref)\](?:\[\])?/).replace("ref",GU).getRegex(),a4e=Ut("reflink|nolink(?!\\()","g").replace("reflink",Rre).replace("nolink",zre).getRegex(),DX=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,JU={_backpedal:Hp,anyPunctuation:e4e,autolink:t4e,blockSkip:Zve,br:Tre,code:Vve,del:Hp,emStrongLDelim:Kve,emStrongRDelimAst:Jve,emStrongRDelimUnd:Qve,escape:Fve,link:i4e,nolink:zre,punctuation:Uve,reflink:Rre,reflinkSearch:a4e,tag:r4e,text:Bve,url:Hp},o4e={...JU,link:Ut(/^!?\[(label)\]\((.*?)\)/).replace("label",OR).getRegex(),reflink:Ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",OR).getRegex()},pV={...JU,emStrongRDelimAst:Yve,emStrongLDelim:Xve,url:Ut(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",DX).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ut(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",DX).getRegex()},s4e={...pV,br:Ut(Tre).replace("{2,}","*").getRegex(),text:Ut(pV.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Bm={normal:KU,gfm:jve,pedantic:Hve},Qf={normal:JU,gfm:pV,breaks:s4e,pedantic:o4e},l4e={"&":"&","<":"<",">":">",'"':""","'":"'"},OX=e=>l4e[e];function Fo(e,t){if(t){if(Yr.escapeTest.test(e))return e.replace(Yr.escapeReplace,OX)}else if(Yr.escapeTestNoEncode.test(e))return e.replace(Yr.escapeReplaceNoEncode,OX);return e}function RX(e){try{e=encodeURI(e).replace(Yr.percentDecode,"%")}catch{return null}return e}function zX(e,t){let n=e.replace(Yr.findPipe,(a,o,s)=>{let l=!1,c=o;for(;--c>=0&&s[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(Yr.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Yr.slashPipe,"|");return r}function ep(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function c4e(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function qX(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function d4e(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
4
4
|
`).map(a=>{let o=a.match(n.other.beginningSpace);if(o===null)return a;let[s]=o;return s.length>=i.length?a.slice(i.length):a}).join(`
|
|
@@ -2543,7 +2543,7 @@ $$`:`${e}$$`},qjt=e=>Ojt(e)%2===0?e:zjt(e),jjt=e=>Rjt(e)%2===1?`${e}$`:e,Hjt=(e,
|
|
|
2543
2543
|
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(Vjt.test(i)&&!n.match(Bjt)){let a=r.split(`
|
|
2544
2544
|
`).at(-1);if(a&&a.trim().length>0)return`${e}`}if(Ujt.test(i)&&!n.match(Wjt)){let a=r.split(`
|
|
2545
2545
|
`).at(-1);if(a&&a.trim().length>0)return`${e}`}return e},Zjt=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),Kjt=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(Zjt,(t,n)=>si(e,n)?t:"\\~"),Xjt=e=>{var t,n;let r=e.match(ojt);if(r){let i=r[2];if(!i||D0.test(i))return e;let a=e.lastIndexOf(r[1]);if(si(e,a)||Ys(e,a))return e;if(((t=e.match(Mte))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(ujt);if(i){let a=e.lastIndexOf(i[0].slice(0,2));if(si(e,a)||Ys(e,a))return e;if(((n=e.match(Mte))==null?void 0:n.length)%2===1)return`${e}~`}}return e},UF=e=>e!==!1,Jjt=e=>e===!0,Zr={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},Yjt=[{handler:{name:"singleTilde",handle:Kjt,priority:Zr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:Qqt,priority:Zr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:Tjt,priority:Zr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:Gjt,priority:Zr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:ype,priority:Zr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:Ajt,priority:Zr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:bjt,priority:Zr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:xjt,priority:Zr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:Mjt,priority:Zr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:Ljt,priority:Zr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:Djt,priority:Zr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:Xjt,priority:Zr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:qjt,priority:Zr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:jjt,priority:Zr.INLINE_KATEX},optionKey:"inlineKatex"}],Qjt=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return Yjt.filter(({handler:r,optionKey:i})=>r.name==="links"?UF(e?.links)||UF(e?.images):r.name==="inlineKatex"?Jjt(e?.inlineKatex):UF(e?.[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:dpe(cpe({},r),{handle:a=>ype(a,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},eHt=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=Qjt(t),a=((n=t?.handlers)!=null?n:[]).map(s=>{var l;return{handler:dpe(cpe({},s),{priority:(l=s.priority)!=null?l:Zr.DEFAULT}),earlyReturn:void 0}}),o=[...i,...a].sort((s,l)=>{var c,u;return((c=s.handler.priority)!=null?c:0)-((u=l.handler.priority)!=null?u:0)});for(let{handler:s,earlyReturn:l}of o)if(r=s.handle(r),l!=null&&l(r))return r;return r},tHt=eHt;function nHt(e){return/^\[[^\]]+\]:\s+\S+/m.test(e)||/^\[\^[^\]]+\]:\s+/m.test(e)}function rHt(e){const t=e.match(/^[ \t]{0,3}(`{3,}|~{3,})/);if(!t)return!1;const n=t[1];if(!n)return!1;const r=n[0],i=n.length,a=e.trimEnd().split(`
|
|
2546
|
-
`).at(-1)?.trim()??"";return!new RegExp(`^[\\t ]{0,3}${r}{${i},}[\\t ]*$`).test(a)}function Lte(e){return tHt(e,{linkMode:"text-only"})}function iHt(e,t){if(!t)return[{raw:e,src:e,mode:"full"}];const n=Lte(e);if(nHt(e))return[{raw:e,src:n,mode:"live"}];const r=Yt.lexer(e),i=r.findLastIndex(l=>l.type!=="space");if(i<0)return[{raw:e,src:n,mode:"live"}];const a=r[i];if(!a||a.type!=="code")return[{raw:e,src:n,mode:"live"}];const o=a;if(!rHt(o.raw))return[{raw:e,src:n,mode:"live"}];const s=r.slice(0,i).map(l=>l.raw).join("");return s?[{raw:s,src:Lte(s),mode:"live"},{raw:o.raw,src:o.raw,mode:"live"}]:[{raw:o.raw,src:o.raw,mode:"live"}]}let aHt=0,Ite=Promise.resolve(),kp=null;function oHt(){return kp||(kp=document.createElement("div"),kp.style.cssText="visibility:hidden;position:fixed;top:-9999px;left:-9999px;width:0;height:0;overflow:hidden;",document.body.appendChild(kp)),kp}async function sHt(){return(await z(()=>import("./mermaid.core-
|
|
2546
|
+
`).at(-1)?.trim()??"";return!new RegExp(`^[\\t ]{0,3}${r}{${i},}[\\t ]*$`).test(a)}function Lte(e){return tHt(e,{linkMode:"text-only"})}function iHt(e,t){if(!t)return[{raw:e,src:e,mode:"full"}];const n=Lte(e);if(nHt(e))return[{raw:e,src:n,mode:"live"}];const r=Yt.lexer(e),i=r.findLastIndex(l=>l.type!=="space");if(i<0)return[{raw:e,src:n,mode:"live"}];const a=r[i];if(!a||a.type!=="code")return[{raw:e,src:n,mode:"live"}];const o=a;if(!rHt(o.raw))return[{raw:e,src:n,mode:"live"}];const s=r.slice(0,i).map(l=>l.raw).join("");return s?[{raw:s,src:Lte(s),mode:"live"},{raw:o.raw,src:o.raw,mode:"live"}]:[{raw:o.raw,src:o.raw,mode:"live"}]}let aHt=0,Ite=Promise.resolve(),kp=null;function oHt(){return kp||(kp=document.createElement("div"),kp.style.cssText="visibility:hidden;position:fixed;top:-9999px;left:-9999px;width:0;height:0;overflow:hidden;",document.body.appendChild(kp)),kp}async function sHt(){return(await z(()=>import("./mermaid.core-D7ns-Nfl.js").then(t=>t.br),__vite__mapDeps([97,98]))).default}let WF;function lHt(){return WF||(WF=sHt()),WF}function cHt(e,t){const n=Ite.then(async()=>{const r=await lHt();r.initialize({startOnLoad:!1,theme:t?"dark":"default",fontFamily:"inherit",securityLevel:"loose"});const i=`mermaid-${++aHt}`,{svg:a}=await r.render(i,e,oHt());return a}).catch(r=>{throw r});return Ite=n.then(()=>{},()=>{}),n}var IR={exports:{}};/* @license
|
|
2547
2547
|
Papa Parse
|
|
2548
2548
|
v5.5.3
|
|
2549
2549
|
https://github.com/mholt/PapaParse
|
|
@@ -2561,7 +2561,7 @@ License: MIT
|
|
|
2561
2561
|
`).replace(/\n/g,"<br>")}const wHt=/^https?:\/\/[^\s<>()`"']+$/;function xHt(e){const t=e.trim().replace(/[),.;!?]+$/,"");if(wHt.test(t))try{return new URL(t).toString()}catch{return}}function Ete(e,t){const n=document.createElement("div");n.setAttribute("data-component","icon"),n.setAttribute("data-size","small"),n.setAttribute("data-slot",t);const r=document.createElementNS("http://www.w3.org/2000/svg","svg");return r.setAttribute("data-slot","icon-svg"),r.setAttribute("fill","none"),r.setAttribute("viewBox","0 0 20 20"),r.setAttribute("aria-hidden","true"),r.innerHTML=e,n.appendChild(r),n}function Pte(e){const t=document.createElement("button");return t.type="button",t.setAttribute("data-component","icon-button"),t.setAttribute("data-variant","secondary"),t.setAttribute("data-size","small"),t.setAttribute("data-slot","markdown-copy-button"),t.setAttribute("aria-label",e.copy),t.setAttribute("data-tooltip",e.copy),t.appendChild(Ete($te.copy,"copy-icon")),t.appendChild(Ete($te.check,"check-icon")),t}function NR(e,t,n){if(n){e.setAttribute("data-copied","true"),e.setAttribute("aria-label",t.copied),e.setAttribute("data-tooltip",t.copied);return}e.removeAttribute("data-copied"),e.setAttribute("aria-label",t.copy),e.setAttribute("data-tooltip",t.copy)}function _Ht(e,t){const n=e.parentElement;if(!n)return;if(!(n.getAttribute("data-component")==="markdown-code")){const a=document.createElement("div");a.setAttribute("data-component","markdown-code"),n.replaceChild(a,e),a.appendChild(e),a.appendChild(Pte(t));return}const i=Array.from(n.querySelectorAll('[data-slot="markdown-copy-button"]')).filter(a=>a instanceof HTMLButtonElement);if(i.length===0){n.appendChild(Pte(t));return}for(const a of i.slice(1))a.remove()}function MHt(e){const t=Array.from(e.querySelectorAll(":not(pre) > code"));for(const n of t){const r=xHt(n.textContent??""),i=n.parentElement instanceof HTMLAnchorElement&&n.parentElement.classList.contains("external-link")?n.parentElement:null;if(!r){i&&i.replaceWith(n);continue}if(i){i.href=r;continue}const a=document.createElement("a");a.href=r,a.className="external-link",a.target="_blank",a.rel="noopener noreferrer",n.parentNode?.replaceChild(a,n),a.appendChild(n)}}function bpe(e){const t=e.querySelector("code");return t?(t.getAttribute("class")??"").match(/language-(\S+)/)?.[1]:void 0}const SHt='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>';function CHt(e){const t=Array.from(e.querySelectorAll("a.file-link"));for(const n of t){if(n.querySelector(".file-link-icon"))continue;const r=document.createElement("span");r.className="file-link-icon",r.innerHTML=SHt,n.insertBefore(r,n.firstChild)}}function LHt(e,t){if(!t)return;const n=Array.from(e.querySelectorAll("img"));for(const r of n){const i=r.getAttribute("src");if(i&&i.startsWith("/"))try{r.src=new URL(i,t).toString()}catch{console.error("Failed to resolve image URL:",i)}}}function IHt(e,t,n){const r=Array.from(e.querySelectorAll("pre"));for(const i of r)_Ht(i,t);MHt(e),CHt(e),LHt(e,n)}function NHt(){let e=null,t=!1,n=null;function r(a,o,s,l,c){if(n&&(clearTimeout(n),n=null),e){const M=e.querySelector(".mention-preview-input");if(M&&M.value===o)return}i(),t=!0,e=document.createElement("div"),e.className="mention-preview";const u=document.createElement("div");u.className="mention-preview-header",u.style.display="flex",u.style.gap="0.5rem",u.style.alignItems="center";const h=document.createElement("span");h.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>',h.style.flexShrink="0",h.style.opacity="0.7";const m=document.createElement("input");m.className="mention-preview-input",m.value=o,m.style.flex="1",m.style.minWidth="0",m.style.background="transparent",m.style.border="none",m.style.outline="none",m.style.color="inherit",m.style.fontSize="inherit",m.style.fontFamily="inherit",m.style.padding="0",m.spellcheck=!1,m.addEventListener("keydown",M=>{M.key==="Enter"&&(M.preventDefault(),m.blur(),c?.(m.value.trim()),i()),M.key==="Escape"&&(m.blur(),i())}),m.addEventListener("blur",()=>{m.value.trim()!==o&&c?.(m.value.trim())}),u.appendChild(h),u.appendChild(m),e.appendChild(u);const g=document.createElement("pre");g.className="mention-preview-body";const y=s.split(`
|
|
2562
2562
|
`);g.textContent=y.length>12?y.slice(0,12).join(`
|
|
2563
2563
|
`)+`
|
|
2564
|
-
...`:s,e.appendChild(g);const v=document.createElement("div");v.className="mention-preview-footer",v.style.cursor="pointer",v.innerHTML="<span>Click to open</span>",v.addEventListener("click",()=>{l?.(),i()}),e.appendChild(v),e.style.position="fixed";const k=8,b=360,x=Math.min(a.left,window.innerWidth-b-16);e.style.left=`${x}px`,e.style.width=`${b}px`,window.innerHeight-a.bottom-k>200?e.style.top=`${a.bottom+k}px`:e.style.bottom=`${window.innerHeight-a.top+k}px`,e.addEventListener("mouseenter",()=>{t=!0,n&&(clearTimeout(n),n=null)}),e.addEventListener("mouseleave",()=>{t=!1,n=setTimeout(()=>{t||i()},400)}),document.body.appendChild(e),requestAnimationFrame(()=>{e?.classList.add("is-visible")})}function i(){n&&(clearTimeout(n),n=null),t=!1,e&&(e.classList.remove("is-visible"),setTimeout(()=>{e?.remove(),e=null},150))}return{show:r,hide:i,isActive:()=>t||!!n}}const AHt='<svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M10 4.5C5.5 4.5 2.5 10 2.5 10s3 5.5 7.5 5.5 7.5-5.5 7.5-5.5-3-5.5-7.5-5.5z"/><circle cx="10" cy="10" r="2.5"/></svg>',Dte='<svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M6.5 6.5L2 10l4.5 3.5M13.5 6.5L18 10l-4.5 3.5M11.5 4.5l-3 11"/></svg>';function $Ht(e,t){const n=Array.from(e.querySelectorAll("pre")).filter(r=>bpe(r)==="mermaid");for(const r of n){const i=r.querySelector("code")?.textContent??"";if(!i.trim())continue;const a=r.closest('[data-component="markdown-code"]')??r;a.getAttribute("data-mermaid")||(a.setAttribute("data-mermaid","pending"),cHt(i,t).then(o=>{const s=document.createElement("div");s.setAttribute("data-component","mermaid-block");const l=document.createElement("div");l.setAttribute("data-component","mermaid-block-header");const c=document.createElement("span");c.setAttribute("data-component","code-block-lang"),c.textContent="mermaid";const u=document.createElement("button");u.type="button",u.setAttribute("data-component","mermaid-toggle"),u.setAttribute("aria-label","Show code"),u.innerHTML=Dte,l.appendChild(c),l.appendChild(u),s.appendChild(l);const h=document.createElement("div");h.setAttribute("data-component","mermaid-diagram"),h.innerHTML=o,s.appendChild(h);const m=a.cloneNode(!0);m.removeAttribute("data-mermaid"),m.style.display="none",s.appendChild(m);let g=!0;u.addEventListener("click",()=>{g=!g,h.style.display=g?"":"none",m.style.display=g?"none":"",u.innerHTML=g?Dte:AHt,u.setAttribute("aria-label",g?"Show code":"Show diagram")}),a.replaceWith(s)}).catch(()=>{a.removeAttribute("data-mermaid")}))}}function THt(e){const t=Array.from(e.querySelectorAll("pre")).filter(n=>bpe(n)==="csv");for(const n of t){const r=n.querySelector("code")?.textContent??"";if(!r.trim())continue;const i=kpe(r);if(!i)continue;const a=n.closest('[data-component="markdown-code"]')??n,o=document.createElement("div");o.innerHTML=pHt(i);const s=o.firstElementChild;s&&a.replaceWith(s)}}function EHt(e,t){const n=new Map,r=o=>{const s=t(),l=o.getAttribute("data-copied")==="true";NR(o,s,l)},i=async o=>{const s=o.target;if(!(s instanceof Element))return;const l=s.closest('[data-slot="markdown-copy-button"]');if(!(l instanceof HTMLButtonElement))return;const u=l.closest('[data-component="markdown-code"]')?.querySelector("code")?.textContent??"";if(!u)return;const h=navigator?.clipboard;if(!h)return;await h.writeText(u);const m=t();NR(l,m,!0);const g=n.get(l);g&&clearTimeout(g);const y=setTimeout(()=>NR(l,m,!1),2e3);n.set(l,y)},a=Array.from(e.querySelectorAll('[data-slot="markdown-copy-button"]'));for(const o of a)o instanceof HTMLButtonElement&&r(o);return e.addEventListener("click",i),()=>{e.removeEventListener("click",i);for(const o of n.values())clearTimeout(o)}}function Ote(e,t){if(ph.delete(e),ph.set(e,t),ph.size<=yHt)return;const n=ph.keys().next().value;n&&ph.delete(n)}function PHt(e){const[t,n]=Me(e,["text","cacheKey","streaming","class","classList","onLinkClick","fileFetch"]),r=Z9e(),i=M0(),[a,o]=Ce(),[s]=Jr(()=>({text:t.text,key:t.cacheKey,streaming:t.streaming??!1}),async v=>{if(!v.text)return"";const k=v.key??Wh(v.text);return Promise.all(iHt(v.text,v.streaming).map(async(b,x)=>{const w=Wh(b.raw),M=k?`${k}:${x}:${b.mode}`:w;if(M&&w){const L=ph.get(M);if(L&&L.hash===w)return Ote(M,L),L.html}const _=await Promise.resolve(r.parse(b.src)),C=kHt(_);return M&&w&&Ote(M,{hash:w,html:C}),C})).then(b=>b.join("")).catch(()=>Tte(v.text))},{initialValue:Tte(t.text)});let l;const c=NHt(),u=new Map,h=v=>{const k=v.target;if(!(k instanceof Element))return;const b=k.closest("a[href]");if(!(b instanceof HTMLAnchorElement))return;const x=b.getAttribute("href");x&&(/^(?:https?|mailto|tel|blob|data):/.test(x)||v.preventDefault(),t.onLinkClick?.(x,v))},m=v=>{if(!t.fileFetch)return;const k=v.target;if(!(k instanceof Element))return;const b=k.closest("a.file-link");if(!b){c.isActive()||c.hide();return}const x=b.getAttribute("data-file-path");if(!x)return;const w=()=>{const C=b.getAttribute("href")||x;t.onLinkClick?.(C,new MouseEvent("click"))},M=C=>{const L=b.getAttribute("href")||x,S=C.startsWith("http")||C.startsWith("/")||C.startsWith("./")||C.startsWith("#")?C:`./${C}`;b.setAttribute("href",S),b.setAttribute("data-file-path",C);const I=a();if(!I)return;b.textContent?.replace(/^\s*\S+\s*/,"");const A=u.get(x);A&&(u.delete(x),u.set(C,A)),I.dispatchEvent(new CustomEvent("fileLinkUpdated",{bubbles:!0,detail:{oldHref:L,newHref:S,oldPath:x,newPath:C}}))},_=u.get(x);if(_){c.show(b.getBoundingClientRect(),x,_,w,M);return}t.fileFetch(x).then(C=>{C&&(u.set(x,C),b.matches(":hover")&&c.show(b.getBoundingClientRect(),x,C,w,M))})},g=v=>{const k=v.relatedTarget;k?.closest?.(".mention-preview")||k?.closest?.("a.file-link")},y=v=>{if(v.type==="mousedown"&&!c.isActive()){c.hide();return}if(v.type==="scroll"){if(c.isActive())return;c.hide()}};return fe(()=>{const v=mye(),k=a(),b=t.text?s.latest??s()??"":"";if(!k)return;if(!b){k.innerHTML="";return}const x={copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")},w=document.createElement("div");w.innerHTML=b,IHt(w,x,v.mediaUrl),Bqt(k,w,{childrenOnly:!0,onBeforeElUpdated:(M,_)=>(M instanceof HTMLButtonElement&&_ instanceof HTMLButtonElement&&M.getAttribute("data-slot")==="markdown-copy-button"&&_.getAttribute("data-slot")==="markdown-copy-button"&&M.getAttribute("data-copied")==="true"&&NR(_,x,!0),!M.isEqualNode(_))}),THt(k),$Ht(k,mHt()),l||(l=EHt(k,()=>({copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")}))),t.onLinkClick&&k.addEventListener("click",h),t.fileFetch&&(k.addEventListener("mouseover",m),k.addEventListener("mouseout",g),document.addEventListener("scroll",y,{passive:!0,capture:!0}),document.addEventListener("mousedown",y,{capture:!0}))}),me(()=>{l&&l(),c.hide();const v=a();v&&(t.onLinkClick&&v.removeEventListener("click",h),t.fileFetch&&(v.removeEventListener("mouseover",m),v.removeEventListener("mouseout",g),document.removeEventListener("scroll",y,{capture:!0}),document.removeEventListener("mousedown",y,{capture:!0})))}),(()=>{var v=gHt();return Hr(o,v),ki(v,f({get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}},n),!1,!1),v})()}var DHt=ie("<svg>"),OHt=ie("<svg><rect width=3 height=3 rx=1></svg>",!1,!0,!1);const RHt=new Set([1,2,4,7,8,11,13,14]),zHt=new Set([0,3,12,15]),qHt=Array.from({length:16},(e,t)=>({id:t,x:t%4*4,y:Math.floor(t/4)*4,delay:Math.random()*1.5,duration:1+Math.random()*1,outer:RHt.has(t),corner:zHt.has(t)}));function P2(e){return(()=>{var t=DHt();return ki(t,f(e,{viewBox:"0 0 15 15","data-component":"spinner",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},fill:"currentColor"}),!0,!0),K(t,d(Qt,{each:qHt,children:n=>(()=>{var r=OHt();return Qe(i=>{var a=n.x,o=n.y,s=n.corner?0:void 0,l=n.corner?void 0:`${n.outer?"pulse-opacity-dim":"pulse-opacity"} ${n.duration}s ease-in-out infinite`,c=n.corner?void 0:"both",u=n.corner?void 0:`${n.delay}s`;return a!==i.e&&wt(r,"x",i.e=a),o!==i.t&&wt(r,"y",i.t=o),s!==i.a&&Rr(r,"opacity",i.a=s),l!==i.o&&Rr(r,"animation",i.o=l),c!==i.i&&Rr(r,"animation-fill-mode",i.i=c),u!==i.n&&Rr(r,"animation-delay",i.n=u),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),r})()})),t})()}var jHt=ie('<div class="h-full flex items-center justify-center text-text-weak">Unable to parse CSV'),HHt=ie('<div data-component=csv-table-editor class="h-full overflow-auto"><table data-slot=csv-table-inner class="w-full border-collapse text-13-regular"><thead class="sticky top-0 z-10"><tr></tr></thead><tbody>'),FHt=ie("<span class=text-text-weak>"),VHt=ie('<th data-slot=csv-th class="px-3 py-2 text-left font-medium text-text-base border-b border-border-weaker-base cursor-pointer select-none hover:bg-surface-raised-base/20 transition-colors"><span class="inline-flex items-center gap-1">'),BHt=ie("<tr class=bg-transparent>"),UHt=ie('<input type=text class="bg-transparent border border-border-weak-base rounded px-1.5 py-0.5 text-13-regular text-text-base outline-none focus:border-border-base w-full min-w-[60px]"autofocus>'),WHt=ie('<td data-slot=csv-td class="px-3 py-1.5 text-text-base border-b border-border-weaker-base whitespace-nowrap bg-transparent">');function GHt(e){const t=()=>!!e.onChange,[n,r]=Ce(void 0),[i,a]=Ce(!0),[o,s]=Ce(null),[l,c]=Ce(""),u=Z(()=>kpe(e.value)),h=Z(()=>{const v=u();if(!v)return;const k=n();if(k==null)return v;const b=[...v.rows].sort((x,w)=>{const M=x[k]??"",_=w[k]??"",C=Number(M),L=Number(_);return!isNaN(C)&&!isNaN(L)?i()?C-L:L-C:i()?M.localeCompare(_):_.localeCompare(M)});return{headers:v.headers,rows:b}}),m=(v,k,b)=>{if(!e.onChange)return;const x=u();if(!x)return;const w=x.rows.map((M,_)=>_===v?M.map((C,L)=>L===k?b:C):M);e.onChange(fHt({headers:x.headers,rows:w})),s(null)},g=(v,k,b)=>{t()&&(s({row:v,col:k}),c(b))},y=v=>{n()===v?a(!i()):(r(v),a(!0))};return d(ve,{get when(){return h()},get fallback(){return jHt()},children:v=>(()=>{var k=HHt(),b=k.firstChild,x=b.firstChild,w=x.firstChild,M=x.nextSibling;return K(w,d(Qt,{get each(){return v().headers},children:(_,C)=>(()=>{var L=VHt(),S=L.firstChild;return L.$$click=()=>y(C()),K(S,_,null),K(S,d(ve,{get when(){return n()===C()},get children(){var I=FHt();return K(I,()=>i()?"↑":"↓"),I}}),null),L})()})),K(M,d(Qt,{get each(){return v().rows},children:(_,C)=>(()=>{var L=BHt();return K(L,d(Qt,{each:_,children:(S,I)=>{const A=()=>o()?.row===C()&&o()?.col===I();return(()=>{var D=WHt();return D.$$dblclick=()=>g(C(),I(),S),K(D,d(ve,{get when(){return A()},fallback:S,get children(){var P=UHt();return P.$$keydown=O=>{O.key==="Enter"&&m(C(),I(),l()),O.key==="Escape"&&s(null)},P.addEventListener("blur",()=>m(C(),I(),l())),P.$$input=O=>c(O.currentTarget.value),Qe(()=>P.value=l()),P}})),D})()}})),L})()})),k})()})}li(["click","dblclick","input","keydown"]);var ZHt=ie('<div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-12-regular text-text-weak">Preview unavailable'),KHt=ie('<div class="rounded-md border border-border-base bg-background-base overflow-hidden">'),XHt=ie('<div class="max-h-[420px] overflow-auto p-3">'),JHt=ie('<div class="max-h-[420px] overflow-auto">'),YHt=ie('<div class="max-h-[420px] overflow-auto p-4">'),QHt=ie('<div class="relative h-full w-full overflow-visible">'),eFt=ie('<button class="inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-xs text-text-weak hover:text-text-base hover:bg-surface-raised-base/60 transition-colors"><span class="truncate max-w-40">'),tFt=ie('<div class="absolute inset-0 rounded-xl border border-border-weaker-base bg-surface-base shadow-xl flex flex-col overflow-hidden"style="transform-origin:center center;transition:transform 200ms ease, filter 200ms ease"><div class="shrink-0 border-b border-border-weaker-base px-4 py-3 flex items-center gap-3"><div class="flex-1 min-w-0 flex items-center gap-2"><span class="rounded-full bg-surface-raised-base px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-text-weak"></span><span class="truncate text-12-medium text-text-strong font-mono"></span></div></div><div class="min-h-0 flex-1 overflow-hidden">'),nFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">Attributes</div><div class="flex flex-col gap-1.5">'),rFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">Links</div><div class="flex flex-col gap-1">'),iFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">References</div><div class="flex flex-col gap-1">'),aFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">Backlinks</div><div class="flex flex-col gap-1">'),oFt=ie('<div class="w-72 shrink-0 border-l border-border-weaker-base bg-surface-raised-base/30 flex flex-col"><div class="flex-1 overflow-y-auto p-3 flex flex-col gap-4">'),sFt=ie('<div class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5"><div class="text-10-medium uppercase tracking-wide text-text-weaker"></div><div class="mt-0.5 text-11-regular text-text-strong truncate">'),lFt=ie('<button class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 text-left hover:bg-surface-raised-base/60 transition-colors"><div class="text-10-medium uppercase tracking-wide text-text-weaker"></div><div class="mt-0.5 text-11-medium text-text-strong font-mono truncate">'),cFt=ie('<div class="text-10-regular text-text-warning capitalize">'),dFt=ie('<button class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 text-left transition-colors flex items-start gap-1.5"><div class="flex-1 min-w-0"><div class="text-11-medium text-text-strong font-mono truncate">'),uFt=ie('<div class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 flex items-start gap-1.5"><div class="flex-1 min-w-0"><div class="text-11-medium text-text-strong font-mono truncate"></div><div class="text-10-regular text-text-weak truncate">Line '),hFt=ie('<div class="flex h-full"><div class="flex-1 min-h-0 overflow-auto p-4">'),fFt=ie('<div class="flex flex-col items-center gap-2 py-8 text-text-weak"><div class=text-12-regular>Loading details...'),pFt=ie('<div class="text-13-regular text-text-base whitespace-pre-wrap">'),mFt=ie('<div class="flex flex-wrap gap-1.5">'),gFt=ie('<div class="flex items-center gap-2 flex-wrap">'),yFt=ie('<div class="flex items-center gap-2 p-2 rounded-md bg-background-base border border-border-base">'),vFt=ie('<div class="p-3 rounded-md bg-background-base border border-border-base flex flex-col gap-2"><div class="flex items-center gap-2">'),kFt=ie('<div class="flex flex-col gap-3"><div class="text-12-medium uppercase tracking-wide text-text-weak">Decision Traces</div><div class="flex flex-col gap-2 max-h-[200px] overflow-y-auto">'),bFt=ie('<div class="flex justify-between"><span>Assignee</span><span>'),wFt=ie('<div class="flex justify-between"><span>Branch</span><span class=text-11-mono>'),xFt=ie('<div class="flex flex-col gap-4"><div class="flex items-center gap-2"><span class="text-12-medium text-text-info"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span></div><h1 class="text-16-semibold text-text-strong leading-tight"></h1><div class="flex flex-col gap-3"><div class="flex items-center justify-between"><div class="text-12-medium uppercase tracking-wide text-text-weak">Acceptance Criteria</div><div class="flex items-center gap-1"></div></div><div class="flex flex-col gap-2 max-h-[300px] overflow-y-auto"></div></div><div class="pt-4 border-t border-border-weaker-base flex flex-col gap-3 text-12-regular text-text-weak"><div class="flex justify-between"><span>Created</span><span>'),_Ft=ie('<span class="rounded-full bg-surface-raised-base px-2.5 py-0.5 text-11-medium text-text-weak">'),MFt=ie('<div class="text-12-regular text-text-weaker italic">No criteria defined'),SFt=ie('<code class="text-11-mono text-text-weak block mt-1 p-1 rounded bg-surface-raised-base truncate">'),CFt=ie('<pre class="mt-1 p-2 rounded bg-background-stronger text-11-mono text-text-weak overflow-x-auto max-h-24">'),LFt=ie('<div class="p-3 rounded-md bg-background-base border border-border-base flex flex-col gap-2"><div class="flex items-start gap-3"><button class="mt-1 shrink-0 cursor-pointer hover:opacity-70 transition-opacity"title="Click to toggle status"></button><div class="flex-1 min-w-0"><div class="text-13-medium text-text-strong leading-normal">'),IFt=ie('<div class="size-3 rounded-full border-2 border-border-strong-base">'),NFt=ie('<div class="text-11-regular text-text-weak truncate">'),AFt=ie('<div class="p-2 rounded-md bg-background-base border border-border-base flex items-start gap-2"><div class="flex-1 min-w-0"><div class="text-12-medium text-text-strong"></div></div><div class="shrink-0 text-11-regular text-text-weaker whitespace-nowrap">'),$Ft=ie('<div class="flex flex-col gap-2"><div class="text-12-medium uppercase tracking-wide text-text-weak">Preview'),TFt=ie('<div class="flex flex-col gap-1.5 max-h-[220px] overflow-y-auto">'),EFt=ie('<div class="flex flex-col gap-2"><div class="text-12-medium uppercase tracking-wide text-text-weak">Contents'),PFt=ie('<div class="flex flex-col gap-2"><div class="text-11-medium uppercase tracking-wide text-text-weak">Recent Ops</div><div class="flex flex-col gap-1 max-h-[180px] overflow-y-auto">'),DFt=ie('<div class="flex h-full"><div class="flex-1 min-h-0 overflow-auto p-4 flex flex-col gap-4">'),OFt=ie('<div class="flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>Loading file...'),RFt=ie('<div class="flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>Loading directory...'),zFt=ie('<div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-12-regular text-text-weak">Empty directory'),qFt=ie('<button class="rounded-md border border-border-base bg-background-base px-3 py-2 text-left hover:bg-surface-raised-base/60 transition-colors"><div class="flex items-center gap-2"><span class="rounded-full bg-surface-raised-base px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-text-weak"></span><span class="truncate text-12-medium text-text-strong"></span></div><div class="mt-1 truncate text-11-regular text-text-weak font-mono">'),jFt=ie('<div class="rounded-md border border-border-base bg-background-base px-2 py-1.5 text-11-regular text-text-weak"><div class="truncate font-mono"></div><div class=text-text-weaker>'),HFt=ie('<span class="w-2 h-2 rounded-full bg-text-success shrink-0 mt-1">');const Rte={w:760,h:620},dU=Tt();function zte(e,t,n){return Math.max(t,Math.min(e,n))}function FFt(e,t){return t||e.includes(":")&&e.split(":")[0]||"entity"}function VFt(e,t){return e.includes(":")?e:t==="issue"?`issue:${e}`:e}function Wz(e){return e.includes(":")?e.split(":").slice(1).join(":"):e}function wpe(e){const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.round(t/6e4)}m ago`:t<864e5?`${Math.round(t/36e5)}h ago`:`${Math.round(t/864e5)}d ago`}const BFt=new Set(["title","name","message","description","purpose","summary","type","kind"]);function qte(e){return e.split("/").pop()||e}function uU(e){return typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e,null,2)??""}function jte(e,t){const n=t.flatMap(r=>e?.facts.filter(i=>i.a===r)??[])[0];return n?uU(n.v):void 0}function UFt(e){return/\.(md|markdown|mdx|note)$/i.test(e)}function WFt(e){return/\.csv$/i.test(e)}function Hte(e){return e.replaceAll("\\","/").replace(/\/+/g,"/")}function Fte(e,t){const n=t.split("#")[0]?.split("?")[0]?.trim();if(!n||/^(?:[a-z]+:|\/\/)/i.test(n))return;const r=Hte(n);if(r.startsWith("/"))return r.replace(/^\/+/,"");const i=Hte(e).split("/").slice(0,-1);for(const a of r.split("/"))if(!(!a||a===".")){if(a===".."){i.pop();continue}i.push(a)}return i.join("/")}function GFt(e){const t=Ef(),n=Z(()=>{if(!(!e.file||e.file.type!=="text"||e.file.encoding==="base64"))return e.file.content}),r=Z(()=>{const l=n();if(!(!l||!UFt(e.path)))return l}),i=Z(()=>{const l=n();if(!(!l||!WFt(e.path)))return l}),a=Z(()=>oB(e.file?.content??"")),o=l=>t.sdk.client.file.read({path:l}).then(c=>c.data).catch(()=>{}),s=async l=>{const c=await o(l);if(!(!c||c.type!=="text"||c.encoding==="base64"))return c.content};return d(ve,{get when(){return e.file},get fallback(){return ZHt()},children:l=>(()=>{var c=KHt();return K(c,d(ve,{get when(){return r()},get fallback(){return d(ve,{get when(){return i()},get fallback(){return(()=>{var u=XHt();return K(u,d(Jse,{mode:"text",get file(){return{name:e.path,contents:l().content,cacheKey:a()}},class:"text-11-mono",get media(){return{mode:"auto",path:e.path,current:l(),readFile:o}}})),u})()},children:u=>(()=>{var h=JHt();return K(h,d(GHt,{get value(){return u()}})),h})()})},children:u=>d(Jne,{data:ZFt,get directory(){return t.sdk.directory},get mediaUrl(){return t.sdk.url},get children(){var h=YHt();return K(h,d(PHt,{get text(){return u()},get cacheKey(){return a()},onLinkClick:m=>{const g=Fte(e.path,m);g&&t.push(`file:${g}`,"file")},fileFetch:m=>{const g=Fte(e.path,m);return g?s(g):Promise.resolve(void 0)}})),h}})})),c})()})}const ZFt={session:[],session_status:{},session_diff:{},message:{},part:{}};function KFt(e){const t=lf(),n=rpe(),r=Cf(),[i,a]=nt({stack:[],size:Rte,open:!1,closing:!1}),o={stack:()=>i.stack,size:()=>i.size,trellis:n,sdk:r,push(s,l){const c=VFt(s,l);a("stack",Ye(u=>{u[u.length-1]?.id!==c&&u.push({key:`${c}:${Date.now()}`,id:c,type:FFt(c,l)})}))},pop(){if(i.stack.length<=1){a("stack",[]);return}a("stack",i.stack.slice(0,-1))},clear(){a("stack",[])},setSize(s,l){a("size",{w:zte(s,560,Math.min(920,window.innerWidth-96)),h:zte(l,420,Math.min(760,window.innerHeight-120))})},getTransform(s){const l=i.stack.length-1-s;return l<=0?{scale:1,offsetY:16,brightness:1,interactive:!0}:{scale:Math.max(.82,1-l*.04),offsetY:l*-28,brightness:Math.max(.5,1-l*.14),interactive:!1}}};return fe(()=>{if(i.stack.length>0){!i.open&&!i.closing&&(a("open",!0),t.show(()=>d(dU.Provider,{value:o,get children(){return d(XFt,{})}}),()=>{ct(()=>{a("open",!1),a("closing",!1),a("stack",[]),a("size",Rte)})}));return}i.open&&!i.closing&&(a("closing",!0),t.close())}),d(dU.Provider,{value:o,get children(){return e.children}})}function Ef(){const e=Lt(dU);if(!e)throw new Error("useEntityDialog must be used within EntityDialogProvider");return e}function XFt(){const e=Ef();return d(qz,{size:"x-large",transition:!0,class:"!h-full !bg-transparent !shadow-none !overflow-visible",get children(){var t=QHt();return K(t,d(Qt,{get each(){return e.stack()},children:(n,r)=>d(JFt,{entry:n,get index(){return r()}})})),t}})}function JFt(e){const t=Ef(),n=Z(()=>t.getTransform(e.index)),r=Z(()=>e.index===t.stack().length-1),i=Z(()=>t.stack()[e.index-1]);return(()=>{var a=tFt(),o=a.firstChild,s=o.firstChild,l=s.firstChild,c=l.nextSibling,u=o.nextSibling;return K(o,d(ve,{get when(){return e.index>0},get children(){var h=eFt(),m=h.firstChild;return h.$$click=()=>t.pop(),K(h,d(Kt,{name:"arrow-left",size:"small"}),m),K(m,(()=>{var g=kt(()=>!!i());return()=>g()?Wz(i().id):"Back"})()),h}}),s),K(l,()=>e.entry.type),K(c,()=>Wz(e.entry.id)),K(o,d(ve,{get when(){return r()},get children(){return d(Sr,{icon:"close-small",variant:"ghost",onClick:()=>t.clear()})}}),null),K(u,d(ve,{get when(){return e.entry.type==="issue"},get fallback(){return d(_pe,{get id(){return e.entry.id},get type(){return e.entry.type}})},get children(){return d(YFt,{get id(){return e.entry.id}})}})),Qe(h=>{var m=`translateY(${n().offsetY}px) scale(${n().scale})`,g=`brightness(${n().brightness})`,y=n().interactive?"auto":"none",v=`${100+e.index}`;return m!==h.e&&Rr(a,"transform",h.e=m),g!==h.t&&Rr(a,"filter",h.t=g),y!==h.a&&Rr(a,"pointer-events",h.a=y),v!==h.o&&Rr(a,"z-index",h.o=v),h},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()}function xpe(e){const t=Ef(),[n]=Jr(()=>e.entityId,t.trellis.fetchEntity),[r]=Jr(()=>e.entityId,t.trellis.fetchRefs),i=Z(()=>(n()?.facts??[]).filter(s=>!BFt.has(s.a))),a=Z(()=>n()?.links??[]),o=Z(()=>i().length>0||a().length>0||(r()?.outgoing.length??0)>0||(r()?.incoming.length??0)>0);return d(ve,{get when(){return o()},get children(){var s=oFt(),l=s.firstChild;return K(l,d(ve,{get when(){return i().length>0},get children(){var c=nFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"tag",size:"small"}),h),K(m,d(Qt,{get each(){return i().slice(0,24)},children:g=>(()=>{var y=sFt(),v=y.firstChild,k=v.nextSibling;return K(v,()=>g.a),K(k,()=>uU(g.v)),Qe(()=>wt(k,"title",uU(g.v))),y})()})),c}}),null),K(l,d(ve,{get when(){return a().length>0},get children(){var c=rFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"arrow-right",size:"small"}),h),K(m,d(Qt,{get each(){return a().slice(0,16)},children:g=>(()=>{var y=lFt(),v=y.firstChild,k=v.nextSibling;return y.$$click=()=>t.push(g.e2),K(v,()=>g.a),K(k,()=>Wz(g.e2)),y})()})),c}}),null),K(l,d(ve,{get when(){return(r()?.outgoing.length??0)>0},get children(){var c=iFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"link",size:"small"}),h),K(m,d(Qt,{get each(){return r()?.outgoing},children:g=>{const y=`${g.namespace}:${g.target}`,v=g.state==="resolved"&&!!g.namespace&&!!g.target;return(()=>{var k=dFt(),b=k.firstChild,x=b.firstChild;return k.$$click=()=>v&&t.push(y,g.namespace),K(k,d(QFt,{get state(){return g.state}}),b),K(x,()=>g.title??y),K(b,d(ve,{get when(){return g.state!=="resolved"},get children(){var w=cFt();return K(w,()=>g.state,null),K(w,(()=>{var M=kt(()=>!!g.staleReason);return()=>M()?` (${g.staleReason})`:""})(),null),w}}),null),Qe(w=>hr(k,{"hover:bg-surface-raised-base/60 cursor-pointer":v,"cursor-default":!v},w)),k})()}})),c}}),null),K(l,d(ve,{get when(){return(r()?.incoming.length??0)>0},get children(){var c=aFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"arrow-left",size:"small"}),h),K(m,d(Qt,{get each(){return r()?.incoming},children:g=>(()=>{var y=uFt(),v=y.firstChild,k=v.firstChild,b=k.nextSibling;return b.firstChild,K(y,d(Kt,{name:"link",size:"small",class:"mt-0.5 shrink-0 text-icon-weak"}),v),K(k,()=>g.filePath),K(b,()=>g.line,null),y})()})),c}}),null),s}})}function YFt(e){const n=Ef().trellis,[r,i]=nt({busy:!1,adding:!1,newAcDesc:"",newAcCmd:"",assigning:!1,assignee:""}),a=Z(()=>e.id.replace(/^issue:/,"")),[o,s]=Jr(a,g=>n.getIssue(g)),[l]=Jr(a,g=>n.fetchDecisionChain(`issue:${g}`)),c=async g=>{i("busy",!0);try{await g(),await n.refresh(),s.refetch()}catch(y){console.error("[entity-dialog] action failed:",y)}finally{i("busy",!1)}},u=Z(()=>{const g=o();if(!g)return[];const y=[];return g.status==="backlog"&&y.push({label:"Triage",run:()=>void c(()=>n.triageIssue(a()))}),(g.status==="backlog"||g.status==="queue")&&y.push({label:"Start",run:()=>void c(()=>n.startIssue(a()))}),g.status==="in_progress"&&y.push({label:"Pause",run:()=>void c(()=>n.pauseIssue(a()))}),g.status==="paused"&&y.push({label:"Resume",run:()=>void c(()=>n.resumeIssue(a()))}),(g.status==="in_progress"||g.status==="paused")&&y.push({label:"Close",run:()=>void c(()=>n.closeIssue(a(),!0))}),g.status==="closed"&&y.push({label:"Reopen",run:()=>void c(()=>n.reopenIssue(a()))}),y}),h=async()=>{const g=r.newAcDesc.trim();g&&(await c(()=>n.addCriterion(a(),g,r.newAcCmd.trim()||void 0)),ct(()=>{i("newAcDesc",""),i("newAcCmd",""),i("adding",!1)}))},m=async()=>{const g=r.assignee.trim();g&&(await c(()=>n.assignIssue(a(),g)),ct(()=>{i("assignee",""),i("assigning",!1)}))};return(()=>{var g=hFt(),y=g.firstChild;return K(y,d(ve,{get when(){return!o.loading},get fallback(){return(()=>{var v=fFt(),k=v.firstChild;return K(v,d(P2,{}),k),v})()},get children(){return d(ve,{get when(){return o()},get fallback(){return d(_pe,{get id(){return e.id},type:"issue"})},children:v=>(()=>{var k=xFt(),b=k.firstChild,x=b.firstChild,w=x.nextSibling,M=w.nextSibling,_=b.nextSibling,C=_.nextSibling,L=C.firstChild,S=L.firstChild,I=S.nextSibling,A=L.nextSibling,D=C.nextSibling,P=D.firstChild,O=P.firstChild,E=O.nextSibling;return K(x,()=>v().id),K(w,()=>v().priority),K(M,()=>v().status),K(_,()=>v().title),K(k,d(ve,{get when(){return v().description},get children(){var T=pFt();return K(T,()=>v().description),T}}),C),K(k,d(ve,{get when(){return v().labels.length>0},get children(){var T=mFt();return K(T,d(Qt,{get each(){return v().labels},children:R=>(()=>{var H=_Ft();return K(H,R),H})()})),T}}),C),K(k,d(ve,{get when(){return u().length>0},get children(){var T=gFt();return K(T,d(Qt,{get each(){return u()},children:R=>d(Mn,{size:"small",variant:"ghost",get onClick(){return R.run},get disabled(){return r.busy},get children(){return R.label}})}),null),K(T,d(ve,{get when(){return!r.assigning},get children(){return d(Mn,{size:"small",variant:"ghost",onClick:()=>i("assigning",!0),get disabled(){return r.busy},children:"Assign"})}}),null),T}}),C),K(k,d(ve,{get when(){return r.assigning},get children(){var T=yFt();return K(T,d(CR,{placeholder:"Agent ID...",get value(){return r.assignee},onInput:R=>i("assignee",R.target.value),onKeyDown:R=>R.key==="Enter"&&void m(),class:"flex-1",autofocus:!0}),null),K(T,d(Sr,{icon:"check-small",variant:"ghost",onClick:()=>void m(),get disabled(){return!r.assignee.trim()}}),null),K(T,d(Sr,{icon:"close-small",variant:"ghost",onClick:()=>i("assigning",!1)}),null),T}}),C),K(I,d(Mn,{size:"small",variant:"ghost",onClick:()=>i("adding",!0),get disabled(){return r.adding},children:"Add"}),null),K(I,d(Mn,{size:"small",variant:"ghost",onClick:()=>void c(async()=>{await n.runCriteria(a())}),get disabled(){return r.busy},children:"Run All"}),null),K(A,d(Qt,{get each(){return v().criteria},get fallback(){return MFt()},children:(T,R)=>(()=>{var H=LFt(),J=H.firstChild,j=J.firstChild,X=j.nextSibling,W=X.firstChild;return j.$$click=()=>{const G=T.status==="passed"?"failed":T.status==="failed"?"pending":"passed";c(()=>n.setCriterionStatus(a(),R(),G))},K(j,d(ve,{get when(){return T.status==="passed"},get fallback(){return d(ve,{get when(){return T.status==="failed"},get fallback(){return IFt()},get children(){return d(Kt,{name:"close-small",size:"small",class:"text-icon-error"})}})},get children(){return d(Kt,{name:"checklist",size:"small",class:"text-icon-success"})}})),K(W,()=>T.description),K(X,d(ve,{get when(){return T.command},get children(){var G=SFt();return K(G,()=>T.command),G}}),null),K(H,d(ve,{get when(){return T.lastOutput},get children(){var G=CFt();return K(G,()=>T.lastOutput),G}}),null),Qe(()=>j.disabled=r.busy),H})()}),null),K(A,d(ve,{get when(){return r.adding},get children(){var T=vFt(),R=T.firstChild;return K(T,d(CR,{placeholder:"Criterion description...",get value(){return r.newAcDesc},onInput:H=>i("newAcDesc",H.target.value),onKeyDown:H=>H.key==="Enter"&&void h(),class:"w-full",autofocus:!0}),R),K(R,d(CR,{placeholder:"Command (optional)...",get value(){return r.newAcCmd},onInput:H=>i("newAcCmd",H.target.value),onKeyDown:H=>H.key==="Enter"&&void h(),class:"flex-1"}),null),K(R,d(Sr,{icon:"check-small",variant:"ghost",onClick:()=>void h(),get disabled(){return!r.newAcDesc.trim()}}),null),K(R,d(Sr,{icon:"close-small",variant:"ghost",onClick:()=>{ct(()=>{i("adding",!1),i("newAcDesc",""),i("newAcCmd","")})}}),null),T}}),null),K(k,d(ve,{get when(){return kt(()=>!!l())()&&l().length>0},get children(){var T=kFt(),R=T.firstChild,H=R.nextSibling;return K(H,d(Qt,{get each(){return l()},children:J=>(()=>{var j=AFt(),X=j.firstChild,W=X.firstChild,G=X.nextSibling;return K(j,d(Kt,{name:"brain",size:"small",class:"mt-0.5 shrink-0 text-icon-weak"}),X),K(W,()=>J.toolName),K(X,d(ve,{get when(){return J.outputSummary},get children(){var Y=NFt();return K(Y,()=>J.outputSummary),Y}}),null),K(G,()=>wpe(J.timestamp)),j})()})),T}}),D),K(E,()=>v().createdAt),K(D,d(ve,{get when(){return v().assignee},get children(){var T=bFt(),R=T.firstChild,H=R.nextSibling;return K(H,()=>v().assignee),T}}),null),K(D,d(ve,{get when(){return v().branch},get children(){var T=wFt(),R=T.firstChild,H=R.nextSibling;return K(H,()=>v().branch),T}}),null),k})()})}})),K(g,d(xpe,{get entityId(){return`issue:${a()}`},type:"issue"}),null),g})()}function _pe(e){const t=Ef(),[n]=Jr(()=>e.id,t.trellis.fetchEntity),[r]=Jr(()=>e.id,t.trellis.fetchDecisionChain),i=Z(()=>Wz(e.id)),[a]=Jr(()=>e.type==="file"?i():void 0,async s=>(await t.sdk.client.file.read({path:s})).data),[o]=Jr(()=>e.type==="directory"?i():void 0,async s=>(await t.sdk.client.file.list({path:s})).data??[]);return Z(()=>jte(n(),["title","name","message","estimatedIntent","url"])??qte(i())),Z(()=>jte(n(),["description","purpose","summary"])),(()=>{var s=DFt(),l=s.firstChild;return K(l,d(ve,{get when(){return e.type==="file"},get children(){var c=$Ft();return c.firstChild,K(c,d(ve,{get when(){return!a.loading},get fallback(){return(()=>{var u=OFt(),h=u.firstChild;return K(u,d(P2,{}),h),u})()},get children(){return d(GFt,{get path(){return i()},get file(){return a()}})}}),null),c}}),null),K(l,d(ve,{get when(){return e.type==="directory"},get children(){var c=EFt();return c.firstChild,K(c,d(ve,{get when(){return!o.loading},get fallback(){return(()=>{var u=RFt(),h=u.firstChild;return K(u,d(P2,{}),h),u})()},get children(){return d(ve,{get when(){return(o()?.length??0)>0},get fallback(){return zFt()},get children(){var u=TFt();return K(u,d(Qt,{get each(){return o()?.slice(0,40)},children:h=>(()=>{var m=qFt(),g=m.firstChild,y=g.firstChild,v=y.nextSibling,k=g.nextSibling;return m.$$click=()=>t.push(h.type==="directory"?`dir:${h.path}`:`file:${h.path}`,h.type),K(y,()=>h.type),K(v,()=>qte(h.path)),K(k,()=>h.path),m})()})),u}})}}),null),c}}),null),K(l,d(ve,{get when(){return kt(()=>!!r())()&&r().length>0},get children(){var c=PFt(),u=c.firstChild,h=u.nextSibling;return K(h,d(Qt,{get each(){return r().slice(0,8)},children:m=>(()=>{var g=jFt(),y=g.firstChild,v=y.nextSibling;return K(y,()=>m.toolName),K(v,()=>wpe(m.timestamp)),g})()})),c}}),null),K(s,d(xpe,{get entityId(){return e.id},get type(){return e.type}}),null),s})()}function QFt(e){return e.state==="resolved"?HFt():e.state==="stale"?d(Kt,{name:"alert-triangle",size:"small",class:"shrink-0 text-text-warning mt-0.5"}):d(Kt,{name:"x-circle",size:"small",class:"shrink-0 text-text-danger mt-0.5"})}li(["click"]);function eVt(){const e=wj(),t=oqt(),n=di();let r,i;return fe(()=>{const a=n.id;if(!a){r&&(t.removeJob(r),r=void 0);return}(e.data.session_status[a]?.type??"idle")!=="idle"?r||(r=t.addJob({type:"generate",label:"Generating...",status:"running"})):r&&(t.removeJob(r),r=void 0)}),fe(()=>{const a=e.data.status;a==="loading"||a==="partial"?i||(i=t.addJob({type:"sync",label:"Syncing project...",status:"running"})):i&&(t.removeJob(i),i=void 0)}),me(()=>{r&&t.removeJob(r),i&&t.removeJob(i),r=void 0,i=void 0}),null}const Mpe=Tt(),Vte=50;function tVt(e){const t=ipe(),[n,r]=nt({items:[],seen:new Set}),i=(h,m)=>{const g={id:crypto.randomUUID(),title:h,type:m,timestamp:Date.now(),read:!1};r(Ye(y=>{y.items.unshift(g),y.items.length>Vte&&(y.items.length=Vte)}))};fe(vn(()=>t?.issues?.map(h=>h.id).join(",")??"",(h,m)=>{if(m===void 0)return;const g=new Set(m.split(",").filter(Boolean));for(const y of t?.issues??[])g.has(y.id)||i(`Issue created: ${y.title}`,"issue")})),fe(vn(()=>t?.workUnits?.map(h=>h.id).join(",")??"",(h,m)=>{if(m===void 0)return;const g=new Set(m.split(",").filter(Boolean));for(const y of t?.workUnits??[])g.has(y.id)||i(`Work unit: ${y.title}`,"op")}));const a=()=>n.items,o=Z(()=>n.items.filter(h=>!h.read).length),s=Z(()=>n.items[0]),u={items:a,unread:o,latest:s,markRead:h=>{r("items",m=>m.id===h,"read",!0)},markAllRead:()=>{r("items",()=>!0,"read",!0)},push:i};return d(Mpe.Provider,{value:u,get children(){return e.children}})}function hQt(){return Lt(Mpe)}function nVt(e,t){e.indexOf(t)===-1&&e.push(t)}function wK(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const el=(e,t,n)=>n>t?t:n<e?e:n;let xK=()=>{};const tl={},Spe=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function rVt(e){return typeof e=="object"&&e!==null}const Cpe=e=>/^0[^.\s]+$/u.test(e);function Lpe(e){let t;return()=>(t===void 0&&(t=e()),t)}const Pf=e=>e,iVt=(e,t)=>n=>t(e(n)),_K=(...e)=>e.reduce(iVt),MK=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Ipe{constructor(){this.subscriptions=[]}add(t){return nVt(this.subscriptions,t),()=>wK(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ia=e=>e*1e3,Ta=e=>e/1e3;function Npe(e,t){return t?e*(1e3/t):0}const aVt=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},Ape=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,oVt=1e-7,sVt=12;function lVt(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Ape(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>oVt&&++s<sVt);return o}function Sm(e,t,n,r){if(e===t&&n===r)return Pf;const i=a=>lVt(a,0,1,e,n);return a=>a===0||a===1?a:Ape(i(a),t,r)}const $pe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Tpe=e=>t=>1-e(1-t),Epe=Sm(.33,1.53,.69,.99),SK=Tpe(Epe),Ppe=$pe(SK),Dpe=e=>e>=1?1:(e*=2)<1?.5*SK(e):.5*(2-Math.pow(2,-10*(e-1))),CK=e=>1-Math.sin(Math.acos(e)),cVt=Tpe(CK),Ope=$pe(CK),dVt=Sm(.42,0,1,1),uVt=Sm(0,0,.58,1),Rpe=Sm(.42,0,.58,1),zpe=e=>Array.isArray(e)&&typeof e[0]!="number";function qpe(e,t){return zpe(e)?e[aVt(0,e.length,t)]:e}const jpe=e=>Array.isArray(e)&&typeof e[0]=="number",hVt={linear:Pf,easeIn:dVt,easeInOut:Rpe,easeOut:uVt,circIn:CK,circInOut:Ope,circOut:cVt,backIn:SK,backInOut:Ppe,backOut:Epe,anticipate:Dpe},fVt=e=>typeof e=="string",Bte=e=>{if(jpe(e)){xK(e.length===4);const[t,n,r,i]=e;return Sm(t,n,r,i)}else if(fVt(e))return hVt[e];return e},Zg=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function pVt(e,t){let n=new Set,r=new Set,i=!1,a=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),e()),u(s)}const c={schedule:(u,h=!1,m=!1)=>{const y=m&&i?n:r;return h&&o.add(u),y.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(s=u,i){a=!0;return}i=!0;const h=n;n=r,r=h,n.forEach(l),n.clear(),i=!1,a&&(a=!1,c.process(u))}};return c}const mVt=40;function Hpe(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Zg.reduce((w,M)=>(w[M]=pVt(a),w),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:m,render:g,postRender:y}=o,v=()=>{const w=tl.useManualTiming,M=w?i.timestamp:performance.now();n=!1,w||(i.delta=r?1e3/60:Math.max(Math.min(M-i.timestamp,mVt),1)),i.timestamp=M,i.isProcessing=!0,s.process(i),l.process(i),c.process(i),u.process(i),h.process(i),m.process(i),g.process(i),y.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(v))},k=()=>{n=!0,r=!0,i.isProcessing||e(v)};return{schedule:Zg.reduce((w,M)=>{const _=o[M];return w[M]=(C,L=!1,S=!1)=>(n||k(),_.schedule(C,L,S)),w},{}),cancel:w=>{for(let M=0;M<Zg.length;M++)o[Zg[M]].cancel(w)},state:i,steps:o}}const{schedule:_o,cancel:hU,state:Gz}=Hpe(typeof requestAnimationFrame<"u"?requestAnimationFrame:Pf,!0);let AR;function gVt(){AR=void 0}const Di={now:()=>(AR===void 0&&Di.set(Gz.isProcessing||tl.useManualTiming?Gz.timestamp:performance.now()),AR),set:e=>{AR=e,queueMicrotask(gVt)}},Fpe=e=>t=>typeof t=="string"&&t.startsWith(e),Vpe=Fpe("--"),yVt=Fpe("var(--"),LK=e=>yVt(e)?vVt.test(e.split("/*")[0].trim()):!1,vVt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ute(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Df={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},D2={...Df,transform:e=>el(0,1,e)},Kg={...Df,default:1},Qp=e=>Math.round(e*1e5)/1e5,IK=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function kVt(e){return e==null}const bVt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,NK=(e,t)=>n=>!!(typeof n=="string"&&bVt.test(n)&&n.startsWith(e)||t&&!kVt(n)&&Object.prototype.hasOwnProperty.call(n,t)),Bpe=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,o,s]=r.match(IK);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},wVt=e=>el(0,255,e),GF={...Df,transform:e=>Math.round(wVt(e))},K1={test:NK("rgb","red"),parse:Bpe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+GF.transform(e)+", "+GF.transform(t)+", "+GF.transform(n)+", "+Qp(D2.transform(r))+")"};function xVt(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const fU={test:NK("#"),parse:xVt,transform:K1.transform},Cm=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),$s=Cm("deg"),zh=Cm("%"),Ze=Cm("px"),_Vt=Cm("vh"),MVt=Cm("vw"),Wte={...zh,parse:e=>zh.parse(e)/100,transform:e=>zh.transform(e*100)},Mh={test:NK("hsl","hue"),parse:Bpe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+zh.transform(Qp(t))+", "+zh.transform(Qp(n))+", "+Qp(D2.transform(r))+")"},Un={test:e=>K1.test(e)||fU.test(e)||Mh.test(e),parse:e=>K1.test(e)?K1.parse(e):Mh.test(e)?Mh.parse(e):fU.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?K1.transform(e):Mh.transform(e),getAnimatableNone:e=>{const t=Un.parse(e);return t.alpha=0,Un.transform(t)}},SVt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function CVt(e){return isNaN(e)&&typeof e=="string"&&(e.match(IK)?.length||0)+(e.match(SVt)?.length||0)>0}const Upe="number",Wpe="color",LVt="var",IVt="var(",Gte="${}",NVt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function rf(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(NVt,l=>(Un.test(l)?(r.color.push(a),i.push(Wpe),n.push(Un.parse(l))):l.startsWith(IVt)?(r.var.push(a),i.push(LVt),n.push(l)):(r.number.push(a),i.push(Upe),n.push(parseFloat(l))),++a,Gte)).split(Gte);return{values:n,split:s,indexes:r,types:i}}function AVt(e){return rf(e).values}function Gpe({split:e,types:t}){const n=e.length;return r=>{let i="";for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){const o=t[a];o===Upe?i+=Qp(r[a]):o===Wpe?i+=Un.transform(r[a]):i+=r[a]}return i}}function $Vt(e){return Gpe(rf(e))}const TVt=e=>typeof e=="number"?0:Un.test(e)?Un.getAnimatableNone(e):e,EVt=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:TVt(e);function PVt(e){const t=rf(e);return Gpe(t)(t.values.map((r,i)=>EVt(r,t.split[i])))}const Ra={test:CVt,parse:AVt,createTransformer:$Vt,getAnimatableNone:PVt};function ZF(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function DVt({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=ZF(l,s,e+1/3),a=ZF(l,s,e),o=ZF(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Zz(e,t){return n=>n>0?t:e}const Of=(e,t,n)=>e+(t-e)*n,KF=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},OVt=[fU,K1,Mh],RVt=e=>OVt.find(t=>t.test(e));function Zte(e){const t=RVt(e);if(!t)return!1;let n=t.parse(e);return t===Mh&&(n=DVt(n)),n}const Kte=(e,t)=>{const n=Zte(e),r=Zte(t);if(!n||!r)return Zz(e,t);const i={...n};return a=>(i.red=KF(n.red,r.red,a),i.green=KF(n.green,r.green,a),i.blue=KF(n.blue,r.blue,a),i.alpha=Of(n.alpha,r.alpha,a),K1.transform(i))},pU=new Set(["none","hidden"]);function zVt(e,t){return pU.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function qVt(e,t){return n=>Of(e,t,n)}function AK(e){return typeof e=="number"?qVt:typeof e=="string"?LK(e)?Zz:Un.test(e)?Kte:FVt:Array.isArray(e)?Zpe:typeof e=="object"?Un.test(e)?Kte:jVt:Zz}function Zpe(e,t){const n=[...e],r=n.length,i=e.map((a,o)=>AK(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=i[o](a);return n}}function jVt(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=AK(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function HVt(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const FVt=(e,t)=>{const n=Ra.createTransformer(t),r=rf(e),i=rf(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?pU.has(e)&&!i.values.length||pU.has(t)&&!r.values.length?zVt(e,t):_K(Zpe(HVt(r,i),i.values),n):Zz(e,t)};function Kpe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Of(e,t,n):AK(e)(e,t)}const VVt=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>_o.update(t,n),stop:()=>hU(t),now:()=>Gz.isProcessing?Gz.timestamp:Di.now()}},Xpe=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=Math.round(e(a/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Kz=2e4;function $K(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Kz;)t+=n,r=e.next(t);return t>=Kz?1/0:t}function Jpe(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min($K(r),Kz);return{type:"keyframes",ease:a=>r.next(i*a).value/t,duration:Ta(i)}}const Dn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function mU(e,t){return e*Math.sqrt(1-t*t)}const BVt=12;function UVt(e,t,n){let r=n;for(let i=1;i<BVt;i++)r=r-e(r)/t(r);return r}const XF=.001;function WVt({duration:e=Dn.duration,bounce:t=Dn.bounce,velocity:n=Dn.velocity,mass:r=Dn.mass}){let i,a,o=1-t;o=el(Dn.minDamping,Dn.maxDamping,o),e=el(Dn.minDuration,Dn.maxDuration,Ta(e)),o<1?(i=c=>{const u=c*o,h=u*e,m=u-n,g=mU(c,o),y=Math.exp(-h);return XF-m/g*y},a=c=>{const h=c*o*e,m=h*n+n,g=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-h),v=mU(Math.pow(c,2),o);return(-i(c)+XF>0?-1:1)*((m-g)*y)/v}):(i=c=>{const u=Math.exp(-c*e),h=(c-n)*e+1;return-XF+u*h},a=c=>{const u=Math.exp(-c*e),h=(n-c)*(e*e);return u*h});const s=5/e,l=UVt(i,a,s);if(e=ia(e),isNaN(l))return{stiffness:Dn.stiffness,damping:Dn.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const GVt=["duration","bounce"],ZVt=["stiffness","damping","mass"];function Xte(e,t){return t.some(n=>e[n]!==void 0)}function KVt(e){let t={velocity:Dn.velocity,stiffness:Dn.stiffness,damping:Dn.damping,mass:Dn.mass,isResolvedFromDuration:!1,...e};if(!Xte(e,ZVt)&&Xte(e,GVt))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*el(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Dn.mass,stiffness:i,damping:a}}else{const n=WVt({...e,velocity:0});t={...t,...n,mass:Dn.mass},t.isResolvedFromDuration=!0}return t}function O2(e=Dn.visualDuration,t=Dn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:h,velocity:m,isResolvedFromDuration:g}=KVt({...n,velocity:-Ta(n.velocity||0)}),y=m||0,v=c/(2*Math.sqrt(l*u)),k=o-a,b=Ta(Math.sqrt(l/u)),x=Math.abs(k)<5;r||(r=x?Dn.restSpeed.granular:Dn.restSpeed.default),i||(i=x?Dn.restDelta.granular:Dn.restDelta.default);let w,M,_,C,L,S;if(v<1)_=mU(b,v),C=(y+v*b*k)/_,w=A=>{const D=Math.exp(-v*b*A);return o-D*(C*Math.sin(_*A)+k*Math.cos(_*A))},L=v*b*C+k*_,S=v*b*k-C*_,M=A=>Math.exp(-v*b*A)*(L*Math.sin(_*A)+S*Math.cos(_*A));else if(v===1){w=D=>o-Math.exp(-b*D)*(k+(y+b*k)*D);const A=y+b*k;M=D=>Math.exp(-b*D)*(b*A*D-y)}else{const A=b*Math.sqrt(v*v-1);w=E=>{const T=Math.exp(-v*b*E),R=Math.min(A*E,300);return o-T*((y+v*b*k)*Math.sinh(R)+A*k*Math.cosh(R))/A};const D=(y+v*b*k)/A,P=v*b*D-k*A,O=v*b*k-D*A;M=E=>{const T=Math.exp(-v*b*E),R=Math.min(A*E,300);return T*(P*Math.sinh(R)+O*Math.cosh(R))}}const I={calculatedDuration:g&&h||null,velocity:A=>ia(M(A)),next:A=>{if(!g&&v<1){const P=Math.exp(-v*b*A),O=Math.sin(_*A),E=Math.cos(_*A),T=o-P*(C*O+k*E),R=ia(P*(L*O+S*E));return s.done=Math.abs(R)<=r&&Math.abs(o-T)<=i,s.value=s.done?o:T,s}const D=w(A);if(g)s.done=A>=h;else{const P=ia(M(A));s.done=Math.abs(P)<=r&&Math.abs(o-D)<=i}return s.value=s.done?o:D,s},toString:()=>{const A=Math.min($K(I),Kz),D=Xpe(P=>I.next(A*P).value,A,30);return A+"ms "+D},toTransition:()=>{}};return I}O2.applyToOptions=e=>{const t=Jpe(e,100,O2);return e.ease=t.ease,e.duration=ia(t.duration),e.type="keyframes",e};const XVt=5;function Ype(e,t,n){const r=Math.max(t-XVt,0);return Npe(n-e(r),t-r)}function gU({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:c=.5,restSpeed:u}){const h=e[0],m={done:!1,value:h},g=S=>s!==void 0&&S<s||l!==void 0&&S>l,y=S=>s===void 0?l:l===void 0||Math.abs(s-S)<Math.abs(l-S)?s:l;let v=n*t;const k=h+v,b=o===void 0?k:o(k);b!==k&&(v=b-h);const x=S=>-v*Math.exp(-S/r),w=S=>b+x(S),M=S=>{const I=x(S),A=w(S);m.done=Math.abs(I)<=c,m.value=m.done?b:A};let _,C;const L=S=>{g(m.value)&&(_=S,C=O2({keyframes:[m.value,y(m.value)],velocity:Ype(w,S,m.value),damping:i,stiffness:a,restDelta:c,restSpeed:u}))};return L(0),{calculatedDuration:null,next:S=>{let I=!1;return!C&&_===void 0&&(I=!0,M(S),L(S)),_!==void 0&&S>=_?C.next(S-_):(!I&&M(S),m)}}}function JVt(e,t,n){const r=[],i=n||tl.mix||Kpe,a=e.length-1;for(let o=0;o<a;o++){let s=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Pf:t;s=_K(l,s)}r.push(s)}return r}function YVt(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(xK(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=JVt(t,r,i),l=s.length,c=u=>{if(o&&u<e[0])return t[0];let h=0;if(l>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const m=MK(e[h],e[h+1],u);return s[h](m)};return n?u=>c(el(e[0],e[a-1],u)):c}function Qpe(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=MK(0,t,r);e.push(Of(n,1,i))}}function e2e(e){const t=[0];return Qpe(t,e.length-1),t}function QVt(e,t){return e.map(n=>n*t)}function eBt(e,t){return e.map(()=>t||Rpe).splice(0,e.length-1)}function e2({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=zpe(r)?r.map(Bte):Bte(r),a={done:!1,value:t[0]},o=QVt(n&&n.length===t.length?n:e2e(t),e),s=YVt(o,t,{ease:Array.isArray(i)?i:eBt(t,i)});return{calculatedDuration:e,next:l=>(a.value=s(l),a.done=l>=e,a)}}const tBt=e=>e!==null;function Aj(e,{repeat:t,repeatType:n="loop"},r,i=1){const a=e.filter(tBt),s=i<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!s||r===void 0?a[s]:r}const nBt={decay:gU,inertia:gU,tween:e2,keyframes:e2,spring:O2};function t2e(e){typeof e.type=="string"&&(e.type=nBt[e.type])}class TK{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const rBt=e=>e/100;class Xz extends TK{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Di.now()&&this.tick(Di.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;t2e(t);const{type:n=e2,repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=t;let{keyframes:s}=t;const l=n||e2;l!==e2&&typeof s[0]!="number"&&(this.mixKeyframes=_K(rBt,Kpe(s[0],s[1])),s=[0,100]);const c=l({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...s].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=$K(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:s,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:m,repeatDelay:g,type:y,onUpdate:v,finalKeyframe:k}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const b=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?b<0:b>i;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,M=r;if(h){const S=Math.min(this.currentTime,i)/s;let I=Math.floor(S),A=S%1;!A&&S>=1&&(A=1),A===1&&I--,I=Math.min(I,h+1),!!(I%2)&&(m==="reverse"?(A=1-A,g&&(A-=g/s)):m==="mirror"&&(M=o)),w=el(0,1,A)*s}let _;x?(this.delayState.value=u[0],_=this.delayState):_=M.next(w),a&&!x&&(_.value=a(_.value));let{done:C}=_;!x&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return L&&y!==gU&&(_.value=Aj(u,this.options,k,this.speed)),v&&v(_.value),L&&this.finish(),_}then(t,n){return this.finished.then(t,n)}get duration(){return Ta(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ta(t)}get time(){return Ta(this.currentTime)}set time(t){t=ia(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Ype(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Di.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Ta(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=VVt,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Di.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function iBt(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const X1=e=>e*180/Math.PI,yU=e=>{const t=X1(Math.atan2(e[1],e[0]));return vU(t)},aBt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:yU,rotateZ:yU,skewX:e=>X1(Math.atan(e[1])),skewY:e=>X1(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vU=e=>(e=e%360,e<0&&(e+=360),e),Jte=yU,Yte=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Qte=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),oBt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Yte,scaleY:Qte,scale:e=>(Yte(e)+Qte(e))/2,rotateX:e=>vU(X1(Math.atan2(e[6],e[5]))),rotateY:e=>vU(X1(Math.atan2(-e[2],e[0]))),rotateZ:Jte,rotate:Jte,skewX:e=>X1(Math.atan(e[4])),skewY:e=>X1(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function kU(e){return e.includes("scale")?1:0}function bU(e,t){if(!e||e==="none")return kU(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=oBt,i=n;else{const s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=aBt,i=s}if(!i)return kU(t);const a=r[t],o=i[1].split(",").map(lBt);return typeof a=="function"?a(o):o[a]}const sBt=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return bU(n,t)};function lBt(e){return parseFloat(e.trim())}const Rf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zf=new Set(Rf),ene=e=>e===Df||e===Ze,cBt=new Set(["x","y","z"]),dBt=Rf.filter(e=>!cBt.has(e));function uBt(e){const t=[];return dBt.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const zs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>bU(t,"x"),y:(e,{transform:t})=>bU(t,"y")};zs.translateX=zs.x;zs.translateY=zs.y;const t0=new Set;let wU=!1,xU=!1,_U=!1;function n2e(){if(xU){const e=Array.from(t0).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=uBt(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,o])=>{r.getValue(a)?.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}xU=!1,wU=!1,t0.forEach(e=>e.complete(_U)),t0.clear()}function r2e(){t0.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xU=!0)})}function hBt(){_U=!0,r2e(),n2e(),_U=!1}class EK{constructor(t,n,r,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(t0.add(this),wU||(wU=!0,_o.read(r2e),_o.resolveKeyframes(n2e))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const a=i?.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const s=r.readValue(n,o);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=o),i&&a===void 0&&i.set(t[0])}iBt(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),t0.delete(this)}cancel(){this.state==="scheduled"&&(t0.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const fBt=e=>e.startsWith("--");function i2e(e,t,n){fBt(t)?e.style.setProperty(t,n):e.style[t]=n}const pBt={};function a2e(e,t){const n=Lpe(e);return()=>pBt[t]??n()}const mBt=a2e(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),o2e=a2e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Op=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,tne={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Op([0,.65,.55,1]),circOut:Op([.55,0,1,.45]),backIn:Op([.31,.01,.66,-.59]),backOut:Op([.33,1.53,.69,.99])};function s2e(e,t){if(e)return typeof e=="function"?o2e()?Xpe(e,t):"ease-out":jpe(e)?Op(e):Array.isArray(e)?e.map(n=>s2e(n,t)||tne.easeOut):tne[e]}function gBt(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const h=s2e(s,i);Array.isArray(h)&&(u.easing=h);const m={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(u,m)}function PK(e){return typeof e=="function"&&"applyToOptions"in e}function yBt({type:e,...t}){return PK(e)&&o2e()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class l2e extends TK{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:s,onComplete:l}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,xK(typeof t.type!="string");const c=yBt(t);this.animation=gBt(n,r,i,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const u=Aj(i,this.options,s,this.speed);this.updateMotionValue&&this.updateMotionValue(u),i2e(n,r,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Ta(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ta(t)}get time(){return Ta(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ia(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&mBt()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Pf):i(this)}}const c2e={anticipate:Dpe,backInOut:Ppe,circInOut:Ope};function vBt(e){return e in c2e}function kBt(e){typeof e.ease=="string"&&vBt(e.ease)&&(e.ease=c2e[e.ease])}const JF=10;class bBt extends l2e{constructor(t){kBt(t),t2e(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:a,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const s=new Xz({...o,autoplay:!1}),l=Math.max(JF,Di.now()-this.startTime),c=el(0,JF,l-JF),u=s.sample(l).value,{name:h}=this.options;a&&h&&i2e(a,h,u),n.setWithVelocity(s.sample(Math.max(0,l-c)).value,u,c),s.stop()}}const nne=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ra.test(e)||e==="0")&&!e.startsWith("url("));function wBt(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function xBt(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=nne(i,t),s=nne(a,t);return!o||!s?!1:wBt(e)||(n==="spring"||PK(n))&&r}function MU(e){e.duration=0,e.type="keyframes"}const d2e=new Set(["opacity","clipPath","filter","transform"]),_Bt=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function MBt(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&_Bt.test(e[t]))return!0;return!1}const SBt=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),CBt=Lpe(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function LBt(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return CBt()&&n&&(d2e.has(n)||SBt.has(n)&&MBt(s))&&(n!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&a!==0&&o!=="inertia"}const IBt=40;class NBt extends TK{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:s,name:l,motionValue:c,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Di.now();const m={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:o,name:l,motionValue:c,element:u,...h},g=u?.KeyframeResolver||EK;this.keyframeResolver=new g(s,(y,v,k)=>this.onKeyframesResolved(y,v,m,!k),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:s,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Di.now();let h=!0;xBt(t,a,o,s)||(h=!1,(tl.instantAnimations||!l)&&u?.(Aj(t,r,n)),t[0]=t[t.length-1],MU(r),r.repeat=0);const g={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>IBt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},y=h&&!c&&LBt(g),v=g.motionValue?.owner?.current;let k;if(y)try{k=new bBt({...g,element:v})}catch{k=new Xz(g)}else k=new Xz(g);k.finished.then(()=>{this.notifyFinished()}).catch(Pf),this.pendingTimeline&&(this.stopTimeline=k.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=k}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),hBt()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class ABt{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t){const n=this.animations.map(r=>r.attachTimeline(t));return()=>{n.forEach((r,i)=>{r&&r(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return rne(this.animations,"duration")}get iterationDuration(){return rne(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function rne(e,t){let n=0;for(let r=0;r<e.length;r++){const i=e[r][t];i!==null&&i>n&&(n=i)}return n}class $Bt extends ABt{then(t,n){return this.finished.finally(t).then(()=>{})}}const TBt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function EBt(e){const t=TBt.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function u2e(e,t,n=1){const[r,i]=EBt(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return Spe(o)?parseFloat(o):o}return LK(i)?u2e(i,t,n+1):i}const PBt={type:"spring",stiffness:500,damping:25,restSpeed:10},DBt=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),OBt={type:"keyframes",duration:.8},RBt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},zBt=(e,{keyframes:t})=>t.length>2?OBt:zf.has(e)?e.startsWith("scale")?DBt(t[1]):PBt:RBt;function h2e(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function f2e(e,t){const n=e?.[t]??e?.default??e;return n!==e?h2e(n,e):n}const qBt=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function jBt(e){for(const t in e)if(!qBt.has(t))return!0;return!1}const p2e=(e,t,n,r={},i,a)=>o=>{const s=f2e(r,e)||{},l=s.delay||r.delay||0;let{elapsed:c=0}=r;c=c-ia(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:m=>{t.set(m),s.onUpdate&&s.onUpdate(m)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};jBt(s)||Object.assign(u,zBt(e,u)),u.duration&&(u.duration=ia(u.duration)),u.repeatDelay&&(u.repeatDelay=ia(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(MU(u),u.delay===0&&(h=!0)),(tl.instantAnimations||tl.skipAnimations||i?.shouldSkipAnimations)&&(h=!0,MU(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,h&&!a&&t.get()!==void 0){const m=Aj(u.keyframes,s);if(m!==void 0){_o.update(()=>{u.onUpdate(m),u.onComplete()});return}}return s.isSync?new Xz(u):new NBt(u)};function ine(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function m2e(e,t,n,r){if(typeof t=="function"){const[i,a]=ine(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=ine(r);t=t(n!==void 0?n:e.custom,i,a)}return t}function HBt(e,t,n){const r=e.getProps();return m2e(r,t,r.custom,e)}const g2e=new Set(["width","height","top","left","right","bottom",...Rf]),ane=30,FBt=e=>!isNaN(parseFloat(e));class VBt{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const i=Di.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Di.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=FBt(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ipe);const r=this.events[t].add(n);return t==="change"?()=>{r(),_o.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Di.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ane)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ane);return Npe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function af(e,t){return new VBt(e,t)}const BBt=e=>Array.isArray(e);function UBt(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,af(n))}function WBt(e){return BBt(e)?e[e.length-1]||0:e}function GBt(e,t){const n=HBt(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a){const s=WBt(a[o]);UBt(e,o,s)}}const ni=e=>!!(e&&e.getVelocity);function ZBt(e){return!!(ni(e)&&e.add)}function KBt(e,t){const n=e.getValue("willChange");if(ZBt(n))return n.add(t);if(!n&&tl.WillChange){const r=new tl.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function DK(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const XBt="framerAppearId",JBt="data-"+DK(XBt);function YBt(e){return e.props[JBt]}function QBt({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function eUt(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t;const l=e.getDefaultTransition();a=a?h2e(a,l):l;const c=a?.reduceMotion;r&&(a=r);const u=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const m in s){const g=e.getValue(m,e.latestValues[m]??null),y=s[m];if(y===void 0||h&&QBt(h,m))continue;const v={delay:n,...f2e(a||{},m)},k=g.get();if(k!==void 0&&!g.isAnimating()&&!Array.isArray(y)&&y===k&&!v.velocity){_o.update(()=>g.set(y));continue}let b=!1;if(window.MotionHandoffAnimation){const M=YBt(e);if(M){const _=window.MotionHandoffAnimation(M,m,_o);_!==null&&(v.startTime=_,b=!0)}}KBt(e,m);const x=c??e.shouldReduceMotion;g.start(p2e(m,g,y,x&&g2e.has(m)?{type:!1}:v,e,b));const w=g.animation;w&&u.push(w)}if(o){const m=()=>_o.update(()=>{o&&GBt(e,o)});u.length?Promise.all(u).then(m):m()}return u}const tUt={test:e=>e==="auto",parse:e=>e},y2e=e=>t=>t.test(e),v2e=[Df,Ze,zh,$s,MVt,_Vt,tUt],one=e=>v2e.find(y2e(e));function nUt(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Cpe(e):!0}const rUt=new Set(["brightness","contrast","saturate","opacity"]);function iUt(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(IK)||[];if(!r)return e;const i=n.replace(r,"");let a=rUt.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const aUt=/\b([a-z-]*)\(.*?\)/gu,SU={...Ra,getAnimatableNone:e=>{const t=e.match(aUt);return t?t.map(iUt).join(" "):e}},CU={...Ra,getAnimatableNone:e=>{const t=Ra.parse(e);return Ra.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},sne={...Df,transform:Math.round},oUt={rotate:$s,rotateX:$s,rotateY:$s,rotateZ:$s,scale:Kg,scaleX:Kg,scaleY:Kg,scaleZ:Kg,skew:$s,skewX:$s,skewY:$s,distance:Ze,translateX:Ze,translateY:Ze,translateZ:Ze,x:Ze,y:Ze,z:Ze,perspective:Ze,transformPerspective:Ze,opacity:D2,originX:Wte,originY:Wte,originZ:Ze},OK={borderWidth:Ze,borderTopWidth:Ze,borderRightWidth:Ze,borderBottomWidth:Ze,borderLeftWidth:Ze,borderRadius:Ze,borderTopLeftRadius:Ze,borderTopRightRadius:Ze,borderBottomRightRadius:Ze,borderBottomLeftRadius:Ze,width:Ze,maxWidth:Ze,height:Ze,maxHeight:Ze,top:Ze,right:Ze,bottom:Ze,left:Ze,inset:Ze,insetBlock:Ze,insetBlockStart:Ze,insetBlockEnd:Ze,insetInline:Ze,insetInlineStart:Ze,insetInlineEnd:Ze,padding:Ze,paddingTop:Ze,paddingRight:Ze,paddingBottom:Ze,paddingLeft:Ze,paddingBlock:Ze,paddingBlockStart:Ze,paddingBlockEnd:Ze,paddingInline:Ze,paddingInlineStart:Ze,paddingInlineEnd:Ze,margin:Ze,marginTop:Ze,marginRight:Ze,marginBottom:Ze,marginLeft:Ze,marginBlock:Ze,marginBlockStart:Ze,marginBlockEnd:Ze,marginInline:Ze,marginInlineStart:Ze,marginInlineEnd:Ze,fontSize:Ze,backgroundPositionX:Ze,backgroundPositionY:Ze,...oUt,zIndex:sne,fillOpacity:D2,strokeOpacity:D2,numOctaves:sne},sUt={...OK,color:Un,backgroundColor:Un,outlineColor:Un,fill:Un,stroke:Un,borderColor:Un,borderTopColor:Un,borderRightColor:Un,borderBottomColor:Un,borderLeftColor:Un,filter:SU,WebkitFilter:SU,mask:CU,WebkitMask:CU},k2e=e=>sUt[e],lUt=new Set([SU,CU]);function b2e(e,t){let n=k2e(e);return lUt.has(n)||(n=Ra),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const cUt=new Set(["auto","none","0"]);function dUt(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!cUt.has(a)&&rf(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=b2e(n,i)}class uUt extends EK{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let h=t[u];if(typeof h=="string"&&(h=h.trim(),LK(h))){const m=u2e(h,n.current);m!==void 0&&(t[u]=m),u===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!g2e.has(r)||t.length!==2)return;const[i,a]=t,o=one(i),s=one(a),l=Ute(i),c=Ute(a);if(l!==c&&zs[r]){this.needsMeasurement=!0;return}if(o!==s)if(ene(o)&&ene(s))for(let u=0;u<t.length;u++){const h=t[u];typeof h=="string"&&(t[u]=parseFloat(h))}else zs[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||nUt(t[i]))&&r.push(i);r.length&&dUt(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=zs[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=zs[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,l])=>{t.getValue(s).set(l)}),this.resolveNoneKeyframes()}}function hUt(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const w2e=(e,t)=>t&&typeof e=="number"?t.transform(e):e,{schedule:fUt}=Hpe(queueMicrotask,!1);function x2e(e){return rVt(e)&&"ownerSVGElement"in e}function pUt(e){return x2e(e)&&e.tagName==="svg"}const mUt=[...v2e,Un,Ra],gUt=e=>mUt.find(y2e(e)),lne=()=>({min:0,max:0}),RK=()=>({x:lne(),y:lne()}),R2=new WeakMap;function yUt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function vUt(e){return typeof e=="string"||Array.isArray(e)}const kUt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bUt=["initial",...kUt];function _2e(e){return yUt(e.animate)||bUt.some(t=>vUt(e[t]))}function wUt(e){return!!(_2e(e)||e.variants)}function xUt(e,t,n){for(const r in t){const i=t[r],a=n[r];if(ni(i))e.addValue(r,i);else if(ni(a))e.addValue(r,af(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,af(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const LU={current:null},M2e={current:!1},_Ut=typeof window<"u";function MUt(){if(M2e.current=!0,!!_Ut)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>LU.current=e.matches;e.addEventListener("change",t),t()}else LU.current=!1}const cne=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let dne={};class S2e{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=EK,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const g=Di.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,_o.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=s;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=_2e(n),this.isVariantNode=wUt(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in m){const y=m[g];c[g]!==void 0&&ni(y)&&y.set(c[g])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,R2.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(M2e.current||MUt(),this.shouldReduceMotion=LU.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),hU(this.notifyUpdate),hU(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&d2e.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:s,times:l,ease:c,duration:u}=n.accelerate,h=new l2e({element:this.current,name:t,keyframes:s,times:l,ease:c,duration:ia(u)}),m=o(h);this.valueSubscriptions.set(t,()=>{m(),h.cancel()});return}const r=zf.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&_o.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in dne){const n=dne[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):RK()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<cne.length;r++){const i=cne[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=xUt(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=af(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Spe(r)||Cpe(r))?r=parseFloat(r):!gUt(r)&&Ra.test(n)&&(r=b2e(t,n)),this.setBaseTarget(t,ni(r)?r.get():r)),ni(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=m2e(this.props,n,this.presenceContext?.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ni(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ipe),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){fUt.render(this.render)}}class C2e extends S2e{constructor(){super(...arguments),this.KeyframeResolver=uUt}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ni(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function SUt({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function CUt(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function LUt(e,t){return SUt(CUt(e.getBoundingClientRect(),t))}const IUt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},NUt=Rf.length;function AUt(e,t,n){let r="",i=!0;for(let a=0;a<NUt;a++){const o=Rf[a],s=e[o];if(s===void 0)continue;let l=!0;if(typeof s=="number")l=s===(o.startsWith("scale")?1:0);else{const c=parseFloat(s);l=o.startsWith("scale")?c===1:c===0}if(!l||n){const c=w2e(s,OK[o]);if(!l){i=!1;const u=IUt[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function L2e(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,s=!1;for(const l in t){const c=t[l];if(zf.has(l)){o=!0;continue}else if(Vpe(l)){i[l]=c;continue}else{const u=w2e(c,OK[l]);l.startsWith("origin")?(s=!0,a[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=AUt(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:l="50%",originY:c="50%",originZ:u=0}=a;r.transformOrigin=`${l} ${c} ${u}`}}function I2e(e,{style:t,vars:n},r,i){const a=e.style;let o;for(o in t)a[o]=t[o];i?.applyProjectionStyles(a,r);for(o in n)a.setProperty(o,n[o])}function une(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const bp={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ze.test(e))e=parseFloat(e);else return e;const n=une(e,t.target.x),r=une(e,t.target.y);return`${n}% ${r}%`}},$Ut={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Ra.parse(e);if(i.length>5)return r;const a=Ra.createTransformer(e),o=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=l;const c=Of(s,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),a(i)}},TUt={borderRadius:{...bp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bp,borderTopRightRadius:bp,borderBottomLeftRadius:bp,borderBottomRightRadius:bp,boxShadow:$Ut};function EUt(e,{layout:t,layoutId:n}){return zf.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!TUt[e]||e==="opacity")}function N2e(e,t,n){const r=e.style,i=t?.style,a={};if(!r)return a;for(const o in r)(ni(r[o])||i&&ni(i[o])||EUt(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(a[o]=r[o]);return a}function PUt(e){return window.getComputedStyle(e)}class DUt extends C2e{constructor(){super(...arguments),this.type="html",this.renderInstance=I2e}readValueFromInstance(t,n){if(zf.has(n))return this.projection?.isProjecting?kU(n):sBt(t,n);{const r=PUt(t),i=(Vpe(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return LUt(t,n)}build(t,n,r){L2e(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return N2e(t,n,r)}}function OUt(e,t){return e in t}class RUt extends S2e{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(OUt(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return RK()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}const zUt={offset:"stroke-dashoffset",array:"stroke-dasharray"},qUt={offset:"strokeDashoffset",array:"strokeDasharray"};function jUt(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?zUt:qUt;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const HUt=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function FUt(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},l,c,u){if(L2e(e,s,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m}=e;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const g of HUt)h[g]!==void 0&&(m[g]=h[g],delete h[g]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&jUt(h,i,a,o,!1)}const A2e=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),VUt=e=>typeof e=="string"&&e.toLowerCase()==="svg";function BUt(e,t,n,r){I2e(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(A2e.has(i)?i:DK(i),t.attrs[i])}function UUt(e,t,n){const r=N2e(e,t,n);for(const i in e)if(ni(e[i])||ni(t[i])){const a=Rf.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}class WUt extends C2e{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=RK}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(zf.has(n)){const r=k2e(n);return r&&r.default||0}return n=A2e.has(n)?n:DK(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return UUt(t,n,r)}build(t,n,r){FUt(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){BUt(t,n,r,i)}mount(t){this.isSVGTag=VUt(t.tagName),super.mount(t)}}function GUt(e,t,n){const r=ni(e)?e:af(e);return r.start(p2e("",r,t,n)),r.animation}function zK(e){return typeof e=="object"&&!Array.isArray(e)}function $2e(e,t,n,r){return e==null?[]:typeof e=="string"&&zK(t)?hUt(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(i=>i!=null):[e]}function ZUt(e,t,n){return e*(t+1)}function hne(e,t,n,r){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function KUt(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];i.at>t&&i.at<n&&(wK(e,i),r--)}}function XUt(e,t,n,r,i,a){KUt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Of(i,a,r[o]),easing:qpe(n,o)})}function JUt(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function YUt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const QUt="easeInOut";function eWt(e,{defaultTransition:t={},...n}={},r,i){const a=t.duration||.3,o=new Map,s=new Map,l={},c=new Map;let u=0,h=0,m=0;for(let g=0;g<e.length;g++){const y=e[g];if(typeof y=="string"){c.set(y,h);continue}else if(!Array.isArray(y)){c.set(y.name,hne(h,y.at,u,c));continue}let[v,k,b={}]=y;b.at!==void 0&&(h=hne(h,b.at,u,c));let x=0;const w=(M,_,C,L=0,S=0)=>{const I=tWt(M),{delay:A=0,times:D=e2e(I),type:P=t.type||"keyframes",repeat:O,repeatType:E,repeatDelay:T=0,...R}=_;let{ease:H=t.ease||"easeOut",duration:J}=_;const j=typeof A=="function"?A(L,S):A,X=I.length,W=PK(P)?P:i?.[P||"keyframes"];if(X<=2&&W){let ue=100;if(X===2&&iWt(I)){const le=I[1]-I[0];ue=Math.abs(le)}const ye={...t,...R};J!==void 0&&(ye.duration=ia(J));const de=Jpe(ye,ue,W);H=de.ease,J=de.duration}J??(J=a);const G=h+j;D.length===1&&D[0]===0&&(D[1]=1);const Y=D.length-I.length;if(Y>0&&Qpe(D,Y),I.length===1&&I.unshift(null),O){J=ZUt(J,O);const ue=[...I],ye=[...D];H=Array.isArray(H)?[...H]:[H];const de=[...H];for(let le=0;le<O;le++){I.push(...ue);for(let Se=0;Se<ue.length;Se++)D.push(ye[Se]+(le+1)),H.push(Se===0?"linear":qpe(de,Se-1))}JUt(D,O)}const oe=G+J;XUt(C,I,H,D,G,oe),x=Math.max(j+J,x),m=Math.max(oe,m)};if(ni(v)){const M=fne(v,s);w(k,b,pne("default",M))}else{const M=$2e(v,k,r,l),_=M.length;for(let C=0;C<_;C++){k=k,b=b;const L=M[C],S=fne(L,s);for(const I in k)w(k[I],nWt(b,I),pne(I,S),C,_)}}u=h,h+=x}return s.forEach((g,y)=>{for(const v in g){const k=g[v];k.sort(YUt);const b=[],x=[],w=[];for(let L=0;L<k.length;L++){const{at:S,value:I,easing:A}=k[L];b.push(I),x.push(MK(0,m,S)),w.push(A||"easeOut")}x[0]!==0&&(x.unshift(0),b.unshift(b[0]),w.unshift(QUt)),x[x.length-1]!==1&&(x.push(1),b.push(null)),o.has(y)||o.set(y,{keyframes:{},transition:{}});const M=o.get(y);M.keyframes[v]=b;const{type:_,...C}=t;M.transition[v]={...C,duration:m,ease:w,times:x,...n}}}),o}function fne(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function pne(e,t){return t[e]||(t[e]=[]),t[e]}function tWt(e){return Array.isArray(e)?e:[e]}function nWt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const rWt=e=>typeof e=="number",iWt=e=>e.every(rWt);function aWt(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=x2e(e)&&!pUt(e)?new WUt(t):new DUt(t);n.mount(e),R2.set(e,n)}function oWt(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new RUt(t);n.mount(e),R2.set(e,n)}function sWt(e,t){return ni(e)||typeof e=="number"||typeof e=="string"&&!zK(t)}function T2e(e,t,n,r){const i=[];if(sWt(e,t))i.push(GUt(e,zK(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;const a=$2e(e,t,r),o=a.length;for(let s=0;s<o;s++){const l=a[s],c=l instanceof Element?aWt:oWt;R2.has(l)||c(l);const u=R2.get(l),h={...n};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(s,o)),i.push(...eUt(u,{...t,transition:h},{}))}}return i}function lWt(e,t,n){const r=[],i=e.map(o=>{if(Array.isArray(o)&&typeof o[0]=="function"){const s=o[0],l=af(0);return l.on("change",s),o.length===1?[l,[0,1]]:o.length===2?[l,[0,1],o[1]]:[l,o[1],o[2]]}return o});return eWt(i,t,n,{spring:O2}).forEach(({keyframes:o,transition:s},l)=>{r.push(...T2e(l,o,s))}),r}function cWt(e){return Array.isArray(e)&&e.some(Array.isArray)}function dWt(e={}){const{scope:t,reduceMotion:n}=e;function r(i,a,o){let s=[],l;if(cWt(i)){const{onComplete:u,...h}=a||{};typeof u=="function"&&(l=u),s=lWt(i,n!==void 0?{reduceMotion:n,...h}:h,t)}else{const{onComplete:u,...h}=o||{};typeof u=="function"&&(l=u),s=T2e(i,a,n!==void 0?{reduceMotion:n,...h}:h,t)}const c=new $Bt(s);return l&&c.finished.then(l),t&&(t.animations.push(c),c.finished.then(()=>{wK(t.animations,c)})),c}return r}const E2e=dWt();var uWt=ie("<div class=size-full>");function hWt(e){const t=bf(),n=ll(),r=di(),i=wj(),a=E0(),o=Z(()=>St(e.directory));return fe(()=>{const s=i.data.path.directory;if(!s||s===e.directory)return;const l=t.pathname.slice(o().length+1);n(`/${St(s)}${l}${t.search}${t.hash}`,{replace:!0})}),fe(()=>{const s=r.id;s&&i.session.sync(s)}),d(Jne,{get data(){return i.data},get directory(){return e.directory},get mediaUrl(){return a.url},onNavigateToSession:s=>n(`/${o()}/session/${s}`),onSessionHref:s=>`/${o()}/session/${s}`,get children(){return d(iqt,{get children(){return e.children}})}})}function fWt(e){const t=di(),n=xr(),r=ll();let i="";const a=Z(()=>t.dir?xo(t.dir)??"":"");return fe(()=>{const o=t.dir;if(o){if(a()){i="";return}i!==o&&(i=o,lr({variant:"error",title:n.t("common.requestFailed"),description:n.t("directory.error.invalidUrl")}),r("/",{replace:!0}))}}),d(ve,{get when(){return a()},keyed:!0,children:o=>d(dPt,{directory:()=>o,get children(){return d(cqt,{get children(){return d(KFt,{get children(){return d(tVt,{get children(){return d(YPt,{get children(){return[d(eVt,{}),(()=>{var s=uWt();return Hr(l=>requestAnimationFrame(()=>E2e(l,{opacity:[0,1],y:[4,0]},{type:"spring",stiffness:400,damping:30})),s),K(s,d(hWt,{directory:o,get children(){return e.children}})),s})()]}})}})}})}})}})})}var pWt=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),mWt=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function gWt(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return pWt.has(n)}const t=e.split("-")[0];return mWt.has(t)}function yWt(e){return gWt(e)?"rtl":"ltr"}function P2e(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:yWt(e)}}var IU=P2e(),Rp=new Set;function mne(){IU=P2e();for(const e of Rp)e(IU)}function vWt(){const[e,t]=Ce(IU),n=Z(()=>e());return dn(()=>{Rp.size===0&&window.addEventListener("languagechange",mne),Rp.add(t),me(()=>{Rp.delete(t),Rp.size===0&&window.removeEventListener("languagechange",mne)})}),{locale:()=>n().locale,direction:()=>n().direction}}var kWt=Tt();function gs(){const e=vWt();return Lt(kWt)||e}var YF=new Map;function bWt(e){const{locale:t}=gs(),n=Z(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return Z(()=>{const r=n();let i;return YF.has(r)&&(i=YF.get(r)),i||(i=new Intl.Collator(t(),e),YF.set(r,i)),i})}const wWt=["top","right","bottom","left"],nl=Math.min,$i=Math.max,Jz=Math.round,Xg=Math.floor,Mo=e=>({x:e,y:e}),xWt={left:"right",right:"left",bottom:"top",top:"bottom"};function NU(e,t,n){return $i(e,nl(t,n))}function O0(e,t){return typeof e=="function"?e(t):e}function rl(e){return e.split("-")[0]}function qf(e){return e.split("-")[1]}function D2e(e){return e==="x"?"y":"x"}function qK(e){return e==="y"?"height":"width"}function Yo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function jK(e){return D2e(Yo(e))}function _Wt(e,t,n){n===void 0&&(n=!1);const r=qf(e),i=jK(e),a=qK(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Yz(o)),[o,Yz(o)]}function MWt(e){const t=Yz(e);return[AU(e),t,AU(t)]}function AU(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const gne=["left","right"],yne=["right","left"],SWt=["top","bottom"],CWt=["bottom","top"];function LWt(e,t,n){switch(e){case"top":case"bottom":return n?t?yne:gne:t?gne:yne;case"left":case"right":return t?SWt:CWt;default:return[]}}function IWt(e,t,n,r){const i=qf(e);let a=LWt(rl(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(AU)))),a}function Yz(e){const t=rl(e);return xWt[t]+e.slice(t.length)}function NWt(e){return{top:0,right:0,bottom:0,left:0,...e}}function O2e(e){return typeof e!="number"?NWt(e):{top:e,right:e,bottom:e,left:e}}function Qz(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function vne(e,t,n){let{reference:r,floating:i}=e;const a=Yo(t),o=jK(t),s=qK(o),l=rl(t),c=a==="y",u=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,m=r[s]/2-i[s]/2;let g;switch(l){case"top":g={x:u,y:r.y-i.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-i.width,y:h};break;default:g={x:r.x,y:r.y}}switch(qf(t)){case"start":g[o]-=m*(n&&c?-1:1);break;case"end":g[o]+=m*(n&&c?-1:1);break}return g}async function AWt(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=O0(t,e),y=O2e(g),k=s[m?h==="floating"?"reference":"floating":h],b=Qz(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(k)))==null||n?k:k.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),x=h==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),M=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},_=Qz(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:w,strategy:l}):x);return{top:(b.top-_.top+y.top)/M.y,bottom:(_.bottom-b.bottom+y.bottom)/M.y,left:(b.left-_.left+y.left)/M.x,right:(_.right-b.right+y.right)/M.x}}const $Wt=50,TWt=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:AWt},l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:h}=vne(c,r,l),m=r,g=0;const y={};for(let v=0;v<a.length;v++){const k=a[v];if(!k)continue;const{name:b,fn:x}=k,{x:w,y:M,data:_,reset:C}=await x({x:u,y:h,initialPlacement:r,placement:m,strategy:i,middlewareData:y,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,h=M??h,y[b]={...y[b],..._},C&&g<$Wt&&(g++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(c=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:u,y:h}=vne(c,m,l)),v=-1)}return{x:u,y:h,placement:m,strategy:i,middlewareData:y}},EWt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=O0(e,t)||{};if(c==null)return{};const h=O2e(u),m={x:n,y:r},g=jK(i),y=qK(g),v=await o.getDimensions(c),k=g==="y",b=k?"top":"left",x=k?"bottom":"right",w=k?"clientHeight":"clientWidth",M=a.reference[y]+a.reference[g]-m[g]-a.floating[y],_=m[g]-a.reference[g],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let L=C?C[w]:0;(!L||!await(o.isElement==null?void 0:o.isElement(C)))&&(L=s.floating[w]||a.floating[y]);const S=M/2-_/2,I=L/2-v[y]/2-1,A=nl(h[b],I),D=nl(h[x],I),P=A,O=L-v[y]-D,E=L/2-v[y]/2+S,T=NU(P,E,O),R=!l.arrow&&qf(i)!=null&&E!==T&&a.reference[y]/2-(E<P?A:D)-v[y]/2<0,H=R?E<P?E-P:E-O:0;return{[g]:m[g]+H,data:{[g]:T,centerOffset:E-T-H,...R&&{alignmentOffset:H}},reset:R}}}),PWt=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...k}=O0(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=rl(i),x=Yo(s),w=rl(s)===s,M=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=m||(w||!v?[Yz(s)]:MWt(s)),C=y!=="none";!m&&C&&_.push(...IWt(s,v,y,M));const L=[s,..._],S=await l.detectOverflow(t,k),I=[];let A=((r=a.flip)==null?void 0:r.overflows)||[];if(u&&I.push(S[b]),h){const E=_Wt(i,o,M);I.push(S[E[0]],S[E[1]])}if(A=[...A,{placement:i,overflows:I}],!I.every(E=>E<=0)){var D,P;const E=(((D=a.flip)==null?void 0:D.index)||0)+1,T=L[E];if(T&&(!(h==="alignment"?x!==Yo(T):!1)||A.every(J=>Yo(J.placement)===x?J.overflows[0]>0:!0)))return{data:{index:E,overflows:A},reset:{placement:T}};let R=(P=A.filter(H=>H.overflows[0]<=0).sort((H,J)=>H.overflows[1]-J.overflows[1])[0])==null?void 0:P.placement;if(!R)switch(g){case"bestFit":{var O;const H=(O=A.filter(J=>{if(C){const j=Yo(J.placement);return j===x||j==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(j=>j>0).reduce((j,X)=>j+X,0)]).sort((J,j)=>J[1]-j[1])[0])==null?void 0:O[0];H&&(R=H);break}case"initialPlacement":R=s;break}if(i!==R)return{reset:{placement:R}}}return{}}}};function kne(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bne(e){return wWt.some(t=>e[t]>=0)}const DWt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=O0(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),s=kne(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:bne(s)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),s=kne(o,n.floating);return{data:{escapedOffsets:s,escaped:bne(s)}}}default:return{}}}}},OWt=new Set(["left","top"]);async function RWt(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rl(n),s=qf(n),l=Yo(n)==="y",c=OWt.has(o)?-1:1,u=a&&l?-1:1,h=O0(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&typeof y=="number"&&(g=s==="end"?y*-1:y),l?{x:g*u,y:m*c}:{x:m*c,y:g*u}}const zWt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await RWt(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},qWt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y:w}=b;return{x,y:w}}},...c}=O0(e,t),u={x:n,y:r},h=await a.detectOverflow(t,c),m=Yo(rl(i)),g=D2e(m);let y=u[g],v=u[m];if(o){const b=g==="y"?"top":"left",x=g==="y"?"bottom":"right",w=y+h[b],M=y-h[x];y=NU(w,y,M)}if(s){const b=m==="y"?"top":"left",x=m==="y"?"bottom":"right",w=v+h[b],M=v-h[x];v=NU(w,v,M)}const k=l.fn({...t,[g]:y,[m]:v});return{...k,data:{x:k.x-n,y:k.y-r,enabled:{[g]:o,[m]:s}}}}}},jWt=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:l=()=>{},...c}=O0(e,t),u=await o.detectOverflow(t,c),h=rl(i),m=qf(i),g=Yo(i)==="y",{width:y,height:v}=a.floating;let k,b;h==="top"||h==="bottom"?(k=h,b=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=h,k=m==="end"?"top":"bottom");const x=v-u.top-u.bottom,w=y-u.left-u.right,M=nl(v-u[k],x),_=nl(y-u[b],w),C=!t.middlewareData.shift;let L=M,S=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=x),C&&!m){const A=$i(u.left,0),D=$i(u.right,0),P=$i(u.top,0),O=$i(u.bottom,0);g?S=y-2*(A!==0||D!==0?A+D:$i(u.left,u.right)):L=v-2*(P!==0||O!==0?P+O:$i(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:L});const I=await o.getDimensions(s.floating);return y!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function $j(){return typeof window<"u"}function jf(e){return R2e(e)?(e.nodeName||"").toLowerCase():"#document"}function qi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Eo(e){var t;return(t=(R2e(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function R2e(e){return $j()?e instanceof Node||e instanceof qi(e).Node:!1}function Va(e){return $j()?e instanceof Element||e instanceof qi(e).Element:!1}function ys(e){return $j()?e instanceof HTMLElement||e instanceof qi(e).HTMLElement:!1}function wne(e){return!$j()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qi(e).ShadowRoot}function Lm(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ba(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function HWt(e){return/^(table|td|th)$/.test(jf(e))}function Tj(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const FWt=/transform|translate|scale|rotate|perspective|filter/,VWt=/paint|layout|strict|content/,Cl=e=>!!e&&e!=="none";let QF;function HK(e){const t=Va(e)?Ba(e):e;return Cl(t.transform)||Cl(t.translate)||Cl(t.scale)||Cl(t.rotate)||Cl(t.perspective)||!FK()&&(Cl(t.backdropFilter)||Cl(t.filter))||FWt.test(t.willChange||"")||VWt.test(t.contain||"")}function BWt(e){let t=il(e);for(;ys(t)&&!of(t);){if(HK(t))return t;if(Tj(t))return null;t=il(t)}return null}function FK(){return QF==null&&(QF=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),QF}function of(e){return/^(html|body|#document)$/.test(jf(e))}function Ba(e){return qi(e).getComputedStyle(e)}function Ej(e){return Va(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function il(e){if(jf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wne(e)&&e.host||Eo(e);return wne(t)?t.host:t}function z2e(e){const t=il(e);return of(t)?e.ownerDocument?e.ownerDocument.body:e.body:ys(t)&&Lm(t)?t:z2e(t)}function z2(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=z2e(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=qi(i);if(a){const s=$U(o);return t.concat(o,o.visualViewport||[],Lm(i)?i:[],s&&n?z2(s):[])}else return t.concat(i,z2(i,[],n))}function $U(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function q2e(e){const t=Ba(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ys(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Jz(n)!==a||Jz(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function VK(e){return Va(e)?e:e.contextElement}function qh(e){const t=VK(e);if(!ys(t))return Mo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=q2e(t);let o=(a?Jz(n.width):n.width)/r,s=(a?Jz(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const UWt=Mo(0);function j2e(e){const t=qi(e);return!FK()||!t.visualViewport?UWt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function WWt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qi(e)?!1:t}function k0(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=VK(e);let o=Mo(1);t&&(r?Va(r)&&(o=qh(r)):o=qh(e));const s=WWt(a,n,r)?j2e(a):Mo(0);let l=(i.left+s.x)/o.x,c=(i.top+s.y)/o.y,u=i.width/o.x,h=i.height/o.y;if(a){const m=qi(a),g=r&&Va(r)?qi(r):r;let y=m,v=$U(y);for(;v&&r&&g!==y;){const k=qh(v),b=v.getBoundingClientRect(),x=Ba(v),w=b.left+(v.clientLeft+parseFloat(x.paddingLeft))*k.x,M=b.top+(v.clientTop+parseFloat(x.paddingTop))*k.y;l*=k.x,c*=k.y,u*=k.x,h*=k.y,l+=w,c+=M,y=qi(v),v=$U(y)}}return Qz({width:u,height:h,x:l,y:c})}function Pj(e,t){const n=Ej(e).scrollLeft;return t?t.left+n:k0(Eo(e)).left+n}function H2e(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Pj(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function GWt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Eo(r),s=t?Tj(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Mo(1);const u=Mo(0),h=ys(r);if((h||!h&&!a)&&((jf(r)!=="body"||Lm(o))&&(l=Ej(r)),h)){const g=k0(r);c=qh(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const m=o&&!h&&!a?H2e(o,l):Mo(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+m.x,y:n.y*c.y-l.scrollTop*c.y+u.y+m.y}}function ZWt(e){return Array.from(e.getClientRects())}function KWt(e){const t=Eo(e),n=Ej(e),r=e.ownerDocument.body,i=$i(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=$i(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Pj(e);const s=-n.scrollTop;return Ba(r).direction==="rtl"&&(o+=$i(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}const xne=25;function XWt(e,t){const n=qi(e),r=Eo(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=FK();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=Pj(r);if(c<=0){const u=r.ownerDocument,h=u.body,m=getComputedStyle(h),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,y=Math.abs(r.clientWidth-h.clientWidth-g);y<=xne&&(a-=y)}else c<=xne&&(a+=c);return{width:a,height:o,x:s,y:l}}function JWt(e,t){const n=k0(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ys(e)?qh(e):Mo(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,c=r*a.y;return{width:o,height:s,x:l,y:c}}function _ne(e,t,n){let r;if(t==="viewport")r=XWt(e,n);else if(t==="document")r=KWt(Eo(e));else if(Va(t))r=JWt(t,n);else{const i=j2e(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Qz(r)}function F2e(e,t){const n=il(e);return n===t||!Va(n)||of(n)?!1:Ba(n).position==="fixed"||F2e(n,t)}function YWt(e,t){const n=t.get(e);if(n)return n;let r=z2(e,[],!1).filter(s=>Va(s)&&jf(s)!=="body"),i=null;const a=Ba(e).position==="fixed";let o=a?il(e):e;for(;Va(o)&&!of(o);){const s=Ba(o),l=HK(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Lm(o)&&!l&&F2e(e,o))?r=r.filter(u=>u!==o):i=s,o=il(o)}return t.set(e,r),r}function QWt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Tj(t)?[]:YWt(t,this._c):[].concat(n),r],s=_ne(t,o[0],i);let l=s.top,c=s.right,u=s.bottom,h=s.left;for(let m=1;m<o.length;m++){const g=_ne(t,o[m],i);l=$i(g.top,l),c=nl(g.right,c),u=nl(g.bottom,u),h=$i(g.left,h)}return{width:c-h,height:u-l,x:h,y:l}}function eGt(e){const{width:t,height:n}=q2e(e);return{width:t,height:n}}function tGt(e,t,n){const r=ys(t),i=Eo(t),a=n==="fixed",o=k0(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Mo(0);function c(){l.x=Pj(i)}if(r||!r&&!a)if((jf(t)!=="body"||Lm(i))&&(s=Ej(t)),r){const g=k0(t,!0,a,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else i&&c();a&&!r&&i&&c();const u=i&&!r&&!a?H2e(i,s):Mo(0),h=o.left+s.scrollLeft-l.x-u.x,m=o.top+s.scrollTop-l.y-u.y;return{x:h,y:m,width:o.width,height:o.height}}function eV(e){return Ba(e).position==="static"}function Mne(e,t){if(!ys(e)||Ba(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Eo(e)===n&&(n=n.ownerDocument.body),n}function V2e(e,t){const n=qi(e);if(Tj(e))return n;if(!ys(e)){let i=il(e);for(;i&&!of(i);){if(Va(i)&&!eV(i))return i;i=il(i)}return n}let r=Mne(e,t);for(;r&&HWt(r)&&eV(r);)r=Mne(r,t);return r&&of(r)&&eV(r)&&!HK(r)?n:r||BWt(e)||n}const nGt=async function(e){const t=this.getOffsetParent||V2e,n=this.getDimensions,r=await n(e.floating);return{reference:tGt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rGt(e){return Ba(e).direction==="rtl"}const B2e={convertOffsetParentRelativeRectToViewportRelativeRect:GWt,getDocumentElement:Eo,getClippingRect:QWt,getOffsetParent:V2e,getElementRects:nGt,getClientRects:ZWt,getDimensions:eGt,getScale:qh,isElement:Va,isRTL:rGt};function U2e(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function iGt(e,t){let n=null,r;const i=Eo(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:h,width:m,height:g}=c;if(s||t(),!m||!g)return;const y=Xg(h),v=Xg(i.clientWidth-(u+m)),k=Xg(i.clientHeight-(h+g)),b=Xg(u),w={rootMargin:-y+"px "+-v+"px "+-k+"px "+-b+"px",threshold:$i(0,nl(1,l))||1};let M=!0;function _(C){const L=C[0].intersectionRatio;if(L!==l){if(!M)return o();L?o(!1,L):r=setTimeout(()=>{o(!1,1e-7)},1e3)}L===1&&!U2e(c,e.getBoundingClientRect())&&o(),M=!1}try{n=new IntersectionObserver(_,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,w)}n.observe(e)}return o(!0),a}function aGt(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=VK(e),u=i||a?[...c?z2(c):[],...t?z2(t):[]]:[];u.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const h=c&&s?iGt(c,n):null;let m=-1,g=null;o&&(g=new ResizeObserver(b=>{let[x]=b;x&&x.target===c&&g&&t&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),n()}),c&&!l&&g.observe(c),t&&g.observe(t));let y,v=l?k0(e):null;l&&k();function k(){const b=k0(e);v&&!U2e(v,b)&&n(),v=b,y=requestAnimationFrame(k)}return n(),()=>{var b;u.forEach(x=>{i&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),h?.(),(b=g)==null||b.disconnect(),g=null,l&&cancelAnimationFrame(y)}}const oGt=zWt,sGt=qWt,lGt=PWt,cGt=jWt,dGt=DWt,uGt=EWt,hGt=(e,t,n)=>{const r=new Map,i={platform:B2e,...n},a={...i.platform,_c:r};return TWt(e,t,{...i,platform:a})};var fGt=ie('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),BK=Tt();function UK(){const e=Lt(BK);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var TU=30,Sne=TU/2,pGt={top:180,right:-90,bottom:0,left:90};function vs(e){const t=UK(),n=ft({size:TU},e),[r,i]=Me(n,["ref","style","size"]),a=()=>t.currentPlacement().split("-")[0],o=mGt(t.contentRef),s=()=>o()?.getPropertyValue("background-color")||"none",l=()=>o()?.getPropertyValue(`border-${a()}-color`)||"none",c=()=>o()?.getPropertyValue(`border-${a()}-width`)||"0px",u=()=>Number.parseInt(c())*2*(TU/r.size),h=()=>`rotate(${pGt[a()]} ${Sne} ${Sne}) translate(0 2)`;return d(zt,f({as:"div",ref(m){var g=hn(t.setArrowRef,r.ref);typeof g=="function"&&g(m)},"aria-hidden":"true",get style(){return Wa({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:s(),stroke:l(),"stroke-width":u()},r.style)}},i,{get children(){var m=fGt(),g=m.firstChild,y=g.firstChild;return y.nextSibling,Qe(()=>wt(g,"transform",h())),m}}))}function mGt(e){const[t,n]=Ce();return fe(()=>{const r=e();r&&n(RU(r).getComputedStyle(r))}),t}function gGt(e){const t=UK(),[n,r]=Me(e,["ref","style"]);return d(zt,f({as:"div",ref(i){var a=hn(t.setPositionerRef,n.ref);typeof a=="function"&&a(i)},"data-popper-positioner":"",get style(){return Wa({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Cne(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const a={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...a,toJSON:()=>a}}function yGt(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Cne(r):e?e.getBoundingClientRect():Cne()}}}function vGt(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var kGt={top:"bottom",right:"left",bottom:"top",left:"right"};function bGt(e,t){const[n,r]=e.split("-"),i=kGt[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function wGt(e){const t=ft({getAnchorRect:m=>m?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=Ce(),[i,a]=Ce(),[o,s]=Ce(t.placement),l=()=>yGt(t.anchorRef?.(),t.getAnchorRect),{direction:c}=gs();async function u(){const m=l(),g=n(),y=i();if(!m||!g)return;const v=(y?.clientHeight||0)/2,k=typeof t.gutter=="number"?t.gutter+v:t.gutter??v;g.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),m.getBoundingClientRect();const b=[oGt(({placement:C})=>{const L=!!C.split("-")[1];return{mainAxis:k,crossAxis:L?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const C=typeof t.flip=="string"?t.flip.split(" "):void 0;if(C!==void 0&&!C.every(vGt))throw new Error("`flip` expects a spaced-delimited list of placements");b.push(lGt({padding:t.overflowPadding,fallbackPlacements:C}))}(t.slide||t.overlap)&&b.push(sGt({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(cGt({padding:t.overflowPadding,apply({availableWidth:C,availableHeight:L,rects:S}){const I=Math.round(S.reference.width);C=Math.floor(C),L=Math.floor(L),g.style.setProperty("--kb-popper-anchor-width",`${I}px`),g.style.setProperty("--kb-popper-content-available-width",`${C}px`),g.style.setProperty("--kb-popper-content-available-height",`${L}px`),t.sameWidth&&(g.style.width=`${I}px`),t.fitViewport&&(g.style.maxWidth=`${C}px`,g.style.maxHeight=`${L}px`)}})),t.hideWhenDetached&&b.push(dGt({padding:t.detachedPadding})),y&&b.push(uGt({element:y,padding:t.arrowPadding}));const x=await hGt(m,g,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...B2e,isRTL:()=>c()==="rtl"}});if(s(x.placement),t.onCurrentPlacementChange?.(x.placement),!g)return;g.style.setProperty("--kb-popper-content-transform-origin",bGt(x.placement,c()));const w=Math.round(x.x),M=Math.round(x.y);let _;if(t.hideWhenDetached&&(_=x.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(g.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${M}px, 0)`,visibility:_}),y&&x.middlewareData.arrow){const{x:C,y:L}=x.middlewareData.arrow,S=x.placement.split("-")[0];Object.assign(y.style,{left:C!=null?`${C}px`:"",top:L!=null?`${L}px`:"",[S]:"100%"})}}fe(()=>{const m=l(),g=n();if(!m||!g)return;const y=aGt(m,g,u,{elementResize:typeof ResizeObserver=="function"});me(y)}),fe(()=>{const m=n(),g=t.contentRef?.();!m||!g||queueMicrotask(()=>{m.style.zIndex=getComputedStyle(g).zIndex})});const h={currentPlacement:o,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:a};return d(BK.Provider,{value:h,get children(){return t.children}})}var Hf=Object.assign(wGt,{Arrow:vs,Context:BK,usePopperContext:UK,Positioner:gGt}),xGt={};Ga(xGt,{Arrow:()=>vs,Content:()=>G2e,Portal:()=>Z2e,Root:()=>K2e,Tooltip:()=>zp,Trigger:()=>X2e,useTooltipContext:()=>Dj});var W2e=Tt();function Dj(){const e=Lt(W2e);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function G2e(e){const t=Dj(),n=ft({id:t.generateId("content")},e),[r,i]=Me(n,["ref","style"]);return fe(()=>me(t.registerContentId(i.id))),d(ve,{get when(){return t.contentPresent()},get children(){return d(Hf.Positioner,{get children(){return d(sq,f({ref(a){var o=hn(s=>{t.setContentRef(s)},r.ref);typeof o=="function"&&o(a)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return Wa({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:a=>a.preventDefault(),onDismiss:()=>t.hideTooltip(!0)},()=>t.dataset(),i))}})}})}function Z2e(e){const t=Dj();return d(ve,{get when(){return t.contentPresent()},get children(){return d(w0,e)}})}function _Gt(e,t,n){const r=e.split("-")[0],i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=[],s=i.left+i.width/2,l=i.top+i.height/2;switch(r){case"top":o.push([i.left,l]),o.push([a.left,a.bottom]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([i.right,l]);break;case"right":o.push([s,i.top]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([a.left,a.bottom]),o.push([s,i.bottom]);break;case"bottom":o.push([i.left,l]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([a.right,a.top]),o.push([i.right,l]);break;case"left":o.push([s,i.top]),o.push([a.right,a.top]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([s,i.bottom]);break}return o}var Ll={},MGt=0,ih=!1,Ho,wp,ah;function K2e(e){const t=`tooltip-${wr()}`,n=`${++MGt}`,r=ft({id:t,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[i,a]=Me(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let o;const[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(),[g,y]=Ce(a.placement),v=x0({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:E=>i.onOpenChange?.(E)}),{present:k}=i0({show:()=>i.forceMount||v.isOpen(),element:()=>h()??null}),b=()=>{Ll[n]=w},x=()=>{for(const E in Ll)E!==n&&(Ll[E](!0),delete Ll[E])},w=(E=!1)=>{E||i.closeDelay&&i.closeDelay<=0?(window.clearTimeout(o),o=void 0,v.close()):o||(o=window.setTimeout(()=>{o=void 0,v.close()},i.closeDelay)),window.clearTimeout(Ho),Ho=void 0,i.skipDelayDuration&&i.skipDelayDuration>=0&&(ah=window.setTimeout(()=>{window.clearTimeout(ah),ah=void 0},i.skipDelayDuration)),ih&&(window.clearTimeout(wp),wp=window.setTimeout(()=>{delete Ll[n],wp=void 0,ih=!1},i.closeDelay))},M=()=>{clearTimeout(o),o=void 0,x(),b(),ih=!0,v.open(),window.clearTimeout(Ho),Ho=void 0,window.clearTimeout(wp),wp=void 0,window.clearTimeout(ah),ah=void 0},_=()=>{x(),b(),!v.isOpen()&&!Ho&&!ih?Ho=window.setTimeout(()=>{Ho=void 0,ih=!0,M()},i.openDelay):v.isOpen()||M()},C=(E=!1)=>{!E&&i.openDelay&&i.openDelay>0&&!o&&!ah?_():M()},L=()=>{window.clearTimeout(Ho),Ho=void 0,ih=!1},S=()=>{window.clearTimeout(o),o=void 0},I=E=>Jn(c(),E)||Jn(h(),E),A=E=>{const T=c(),R=h();if(!(!T||!R))return _Gt(E,T,R)},D=E=>{const T=E.target;if(I(T)){S();return}if(!i.ignoreSafeArea){const R=A(g());if(R&&HU(sre(E),R)){S();return}}o||w()};fe(()=>{if(!v.isOpen())return;const E=ri();E.addEventListener("pointermove",D,!0),me(()=>{E.removeEventListener("pointermove",D,!0)})}),fe(()=>{const E=c();if(!E||!v.isOpen())return;const T=H=>{const J=H.target;Jn(J,E)&&w(!0)},R=RU();R.addEventListener("scroll",T,{capture:!0}),me(()=>{R.removeEventListener("scroll",T,{capture:!0})})}),me(()=>{clearTimeout(o),Ll[n]&&delete Ll[n]});const O={dataset:Z(()=>({"data-expanded":v.isOpen()?"":void 0,"data-closed":v.isOpen()?void 0:""})),isOpen:v.isOpen,isDisabled:()=>i.disabled??!1,triggerOnFocusOnly:()=>i.triggerOnFocusOnly??!1,contentId:s,contentPresent:k,openTooltip:C,hideTooltip:w,cancelOpening:L,generateId:Io(()=>r.id),registerContentId:zr(l),isTargetOnTooltip:I,setTriggerRef:u,setContentRef:m};return d(W2e.Provider,{value:O,get children(){return d(Hf,f({anchorRef:c,contentRef:h,onCurrentPlacementChange:y},a))}})}function X2e(e){let t;const n=Dj(),[r,i]=Me(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let a=!1,o=!1,s=!1;const l=()=>{a=!1},c=()=>{!n.isOpen()&&(o||s)&&n.openTooltip(s)},u=b=>{n.isOpen()&&!o&&!s&&n.hideTooltip(b)},h=b=>{dt(b,r.onPointerEnter),!(b.pointerType==="touch"||n.triggerOnFocusOnly()||n.isDisabled()||b.defaultPrevented)&&(o=!0,c())},m=b=>{dt(b,r.onPointerLeave),b.pointerType!=="touch"&&(o=!1,s=!1,n.isOpen()?u():n.cancelOpening())},g=b=>{dt(b,r.onPointerDown),a=!0,ri(t).addEventListener("pointerup",l,{once:!0})},y=b=>{dt(b,r.onClick),o=!1,s=!1,u(!0)},v=b=>{dt(b,r.onFocus),!(n.isDisabled()||b.defaultPrevented||a)&&(s=!0,c())},k=b=>{dt(b,r.onBlur);const x=b.relatedTarget;n.isTargetOnTooltip(x)||(o=!1,s=!1,u(!0))};return me(()=>{ri(t).removeEventListener("pointerup",l)}),d(zt,f({as:"button",ref(b){var x=hn(w=>{n.setTriggerRef(w),t=w},r.ref);typeof x=="function"&&x(b)},get"aria-describedby"(){return kt(()=>!!n.isOpen())()?n.contentId():void 0},onPointerEnter:h,onPointerLeave:m,onPointerDown:g,onClick:y,onFocus:v,onBlur:k},()=>n.dataset(),i))}var zp=Object.assign(K2e,{Arrow:vs,Content:G2e,Portal:Z2e,Trigger:X2e}),SGt=ie("<div data-slot=tooltip-keybind><span></span><span data-slot=tooltip-keybind-key>");function J2e(e){const[t,n]=Me(e,["title","keybind"]);return d(Ua,f(n,{get value(){return(()=>{var r=SGt(),i=r.firstChild,a=i.nextSibling;return K(i,()=>t.title),K(a,()=>t.keybind),r})()}}))}function Ua(e){let t;const[n,r]=nt({open:!1,block:!1,expand:!1}),[i,a]=Me(e,["children","class","contentClass","contentStyle","inactive","forceOpen","ignoreSafeArea","value"]),o=()=>r("open",!1),s=()=>{const m=document.activeElement;return!t||!m?!1:t.contains(m)},l=(m=n.expand)=>{m||t?.matches(":hover")||s()||r("block",!1)},c=()=>{const m=!!t?.querySelector('[aria-expanded="true"], [data-expanded]');if(r("expand",m),m){r("block",!0),o();return}l(m)},u=()=>{r("block",!0),o()},h=()=>{s()||o(),l()};return fe(()=>{if(!t)return;c();const m=new MutationObserver(c);m.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-expanded","data-expanded"]}),me(()=>m.disconnect())}),d(r0,{get children(){return[d(Zn,{get when(){return i.inactive},get children(){return i.children}}),d(Zn,{when:!0,get children(){return d(zp,f({gutter:4},a,{closeDelay:0,get ignoreSafeArea(){return i.ignoreSafeArea??!0},get open(){return i.forceOpen||n.open},onOpenChange:m=>{i.forceOpen||n.block&&m||r("open",m)},get children(){return[d(zp.Trigger,{ref(m){var g=t;typeof g=="function"?g(m):t=m},as:"div","data-component":"tooltip-trigger",get class(){return i.class},onPointerDownCapture:u,onKeyDownCapture:m=>{m.key!=="Enter"&&m.key!==" "||u()},onPointerLeave:h,onFocusOut:()=>requestAnimationFrame(()=>l()),get children(){return i.children}}),d(zp.Portal,{get children(){return d(zp.Content,{"data-component":"tooltip",get"data-placement"(){return e.placement},get"data-force-open"(){return i.forceOpen},get class(){return i.contentClass},get style(){return i.contentStyle},get children(){return i.value}})}})]}}))}})]}})}function Y2e(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],i=l=>{if(l==null)return"";const c=e.getKey??"key",u=lh(c)?l[c]:c(l);return u!=null?String(u):""},a=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=lh(c)?l[c]:c(l);return u!=null?String(u):""},o=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(lh(c)?l[c]:c(l))??!1},s=l=>{if(l!=null)return lh(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(lh(l)||Lye(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:o(l),level:n,index:t}),t++;continue}if(s(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=s(l)??[];if(c.length>0){const u=Y2e({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:i(l),textValue:a(l),disabled:o(l),level:n,index:t}),t++}return r}function CGt(e,t=[]){return Z(()=>{const n=Y2e({dataSource:ke(e.dataSource),getKey:ke(e.getKey),getTextValue:ke(e.getTextValue),getDisabled:ke(e.getDisabled),getSectionChildren:ke(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var Uo=class Q2e extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof Q2e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function LGt(e){const[t,n]=W2(e);return[()=>t()??new Uo,n]}function eme(e){return Tye()?e.altKey:e.ctrlKey}function mh(e){return oq()?e.metaKey:e.ctrlKey}function Lne(e){return new Uo(e)}function IGt(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function NGt(e){const t=ft({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=Ce(!1),[i,a]=Ce(),o=Z(()=>{const v=ke(t.selectedKeys);return v!=null?Lne(v):v}),s=Z(()=>{const v=ke(t.defaultSelectedKeys);return v!=null?Lne(v):new Uo}),[l,c]=LGt({value:o,defaultValue:s,onChange:v=>t.onSelectionChange?.(v)}),[u,h]=Ce(ke(t.selectionBehavior)),m=()=>ke(t.selectionMode),g=()=>ke(t.disallowEmptySelection)??!1,y=v=>{(ke(t.allowDuplicateSelectionEvents)||!IGt(v,l()))&&c(v)};return fe(()=>{const v=l();ke(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof v=="object"&&v.size===0&&h("replace")}),fe(()=>{h(ke(t.selectionBehavior)??"toggle")}),{selectionMode:m,disallowEmptySelection:g,selectionBehavior:u,setSelectionBehavior:h,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:a,selectedKeys:l,setSelectedKeys:y}}function AGt(e){const[t,n]=Ce(""),[r,i]=Ce(-1);return{typeSelectHandlers:{onKeyDown:o=>{if(ke(e.isDisabled))return;const s=ke(e.keyboardDelegate),l=ke(e.selectionManager);if(!s.getKeyForSearch)return;const c=$Gt(o.key);if(!c||o.ctrlKey||o.metaKey)return;c===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let u=n(m=>m+c),h=s.getKeyForSearch(u,l.focusedKey())??s.getKeyForSearch(u);h==null&&TGt(u)&&(u=u[0],h=s.getKeyForSearch(u,l.focusedKey())??s.getKeyForSearch(u)),h!=null&&(l.setFocusedKey(h),e.onTypeSelect?.(h)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function $Gt(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function TGt(e){return e.split("").every(t=>t===e[0])}function EGt(e,t,n){const i=f({selectOnFocus:()=>ke(e.selectionManager).selectionBehavior()==="replace"},e),a=()=>n?.()??t(),{direction:o}=gs();let s={top:0,left:0};wye(()=>ke(i.isVirtualized)?void 0:a(),"scroll",()=>{const k=a();k&&(s={top:k.scrollTop,left:k.scrollLeft})});const{typeSelectHandlers:l}=AGt({isDisabled:()=>ke(i.disallowTypeAhead),keyboardDelegate:()=>ke(i.keyboardDelegate),selectionManager:()=>ke(i.selectionManager)}),c=()=>ke(i.orientation)??"vertical",u=k=>{dt(k,l.onKeyDown),k.altKey&&k.key==="Tab"&&k.preventDefault();const b=t();if(!b?.contains(k.target))return;const x=ke(i.selectionManager),w=ke(i.selectOnFocus),M=S=>{S!=null&&(x.setFocusedKey(S),k.shiftKey&&x.selectionMode()==="multiple"?x.extendSelection(S):w&&!eme(k)&&x.replaceSelection(S))},_=ke(i.keyboardDelegate),C=ke(i.shouldFocusWrap),L=x.focusedKey();switch(k.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(_.getKeyBelow){k.preventDefault();let S;L!=null?S=_.getKeyBelow(L):S=_.getFirstKey?.(),S==null&&C&&(S=_.getFirstKey?.(L)),M(S)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(_.getKeyAbove){k.preventDefault();let S;L!=null?S=_.getKeyAbove(L):S=_.getLastKey?.(),S==null&&C&&(S=_.getLastKey?.(L)),M(S)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(_.getKeyLeftOf){k.preventDefault();const S=o()==="rtl";let I;L!=null?I=_.getKeyLeftOf(L):I=S?_.getFirstKey?.():_.getLastKey?.(),M(I)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(_.getKeyRightOf){k.preventDefault();const S=o()==="rtl";let I;L!=null?I=_.getKeyRightOf(L):I=S?_.getLastKey?.():_.getFirstKey?.(),M(I)}break}case"Home":if(_.getFirstKey){k.preventDefault();const S=_.getFirstKey(L,mh(k));S!=null&&(x.setFocusedKey(S),mh(k)&&k.shiftKey&&x.selectionMode()==="multiple"?x.extendSelection(S):w&&x.replaceSelection(S))}break;case"End":if(_.getLastKey){k.preventDefault();const S=_.getLastKey(L,mh(k));S!=null&&(x.setFocusedKey(S),mh(k)&&k.shiftKey&&x.selectionMode()==="multiple"?x.extendSelection(S):w&&x.replaceSelection(S))}break;case"PageDown":if(_.getKeyPageBelow&&L!=null){k.preventDefault();const S=_.getKeyPageBelow(L);M(S)}break;case"PageUp":if(_.getKeyPageAbove&&L!=null){k.preventDefault();const S=_.getKeyPageAbove(L);M(S)}break;case"a":mh(k)&&x.selectionMode()==="multiple"&&ke(i.disallowSelectAll)!==!0&&(k.preventDefault(),x.selectAll());break;case"Escape":k.defaultPrevented||(k.preventDefault(),ke(i.disallowEmptySelection)||x.clearSelection());break;case"Tab":if(!ke(i.allowsTabNavigation)){if(k.shiftKey)b.focus();else{const S=Vye(b,{tabbable:!0});let I,A;do A=S.lastChild(),A&&(I=A);while(A);I&&!I.contains(document.activeElement)&&ur(I)}break}}},h=k=>{const b=ke(i.selectionManager),x=ke(i.keyboardDelegate),w=ke(i.selectOnFocus);if(b.isFocused()){k.currentTarget.contains(k.target)||b.setFocused(!1);return}if(k.currentTarget.contains(k.target)){if(b.setFocused(!0),b.focusedKey()==null){const M=C=>{C!=null&&(b.setFocusedKey(C),w&&b.replaceSelection(C))},_=k.relatedTarget;_&&k.currentTarget.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_FOLLOWING?M(b.lastSelectedKey()??x.getLastKey?.()):M(b.firstSelectedKey()??x.getFirstKey?.())}else if(!ke(i.isVirtualized)){const M=a();if(M){M.scrollTop=s.top,M.scrollLeft=s.left;const _=M.querySelector(`[data-key="${b.focusedKey()}"]`);_&&(ur(_),uV(M,_))}}}},m=k=>{const b=ke(i.selectionManager);k.currentTarget.contains(k.relatedTarget)||b.setFocused(!1)},g=k=>{a()===k.target&&k.preventDefault()},y=()=>{const k=ke(i.autoFocus);if(!k)return;const b=ke(i.selectionManager),x=ke(i.keyboardDelegate);let w;k==="first"&&(w=x.getFirstKey?.()),k==="last"&&(w=x.getLastKey?.());const M=b.selectedKeys();M.size&&(w=M.values().next().value),b.setFocused(!0),b.setFocusedKey(w);const _=t();_&&w==null&&!ke(i.shouldUseVirtualFocus)&&ur(_)};return dn(()=>{i.deferAutoFocus?setTimeout(y,0):y()}),fe(vn([a,()=>ke(i.isVirtualized),()=>ke(i.selectionManager).focusedKey()],k=>{const[b,x,w]=k;if(x)w&&i.scrollToKey?.(w);else if(w&&b){const M=b.querySelector(`[data-key="${w}"]`);M&&uV(b,M)}})),{tabIndex:Z(()=>{if(!ke(i.shouldUseVirtualFocus))return ke(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:g,onFocusIn:h,onFocusOut:m}}function tme(e,t){const n=()=>ke(e.selectionManager),r=()=>ke(e.key),i=()=>ke(e.shouldUseVirtualFocus),a=x=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):x?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||mh(x)||"pointerType"in x&&x.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),s=()=>ke(e.disabled)||n().isDisabled(r()),l=()=>!s()&&n().canSelectItem(r());let c=null;const u=x=>{l()&&(c=x.pointerType,x.pointerType==="mouse"&&x.button===0&&!ke(e.shouldSelectOnPressUp)&&a(x))},h=x=>{l()&&x.pointerType==="mouse"&&x.button===0&&ke(e.shouldSelectOnPressUp)&&ke(e.allowsDifferentPressOrigin)&&a(x)},m=x=>{l()&&(ke(e.shouldSelectOnPressUp)&&!ke(e.allowsDifferentPressOrigin)||c!=="mouse")&&a(x)},g=x=>{!l()||!["Enter"," "].includes(x.key)||(eme(x)?n().toggleSelection(r()):a(x))},y=x=>{s()&&x.preventDefault()},v=x=>{const w=t();i()||s()||!w||x.target===w&&n().setFocusedKey(r())},k=Z(()=>{if(!(i()||s()))return r()===n().focusedKey()?0:-1}),b=Z(()=>ke(e.virtualized)?void 0:r());return fe(vn([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([x,w,M,_,C])=>{x&&w===_&&C&&!M&&document.activeElement!==x&&(e.focus?e.focus():ur(x))})),{isSelected:o,isDisabled:s,allowsSelection:l,tabIndex:k,dataKey:b,onPointerDown:u,onPointerUp:h,onClick:m,onKeyDown:g,onMouseDown:y,onFocus:v}}var PGt=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index<e.index;(!e||r)&&(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index>e.index;(!e||r)&&(e=n)}return e?.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new Uo(n,r,t);for(const a of this.getKeyRange(r,n.currentKey||t))i.delete(a);for(const a of this.getKeyRange(t,r))this.canSelectItem(a)&&i.add(a);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new Uo(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new Uo([t],t,t):new Uo;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Uo;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Uo)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},Ine=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function DGt(e){const t=NGt(e),r=CGt({dataSource:()=>ke(e.dataSource),getKey:()=>ke(e.getKey),getTextValue:()=>ke(e.getTextValue),getDisabled:()=>ke(e.getDisabled),getSectionChildren:()=>ke(e.getSectionChildren),factory:a=>e.filter?new Ine(e.filter(a)):new Ine(a)},[()=>e.filter]),i=new PGt(r,t);return n2(()=>{const a=t.focusedKey();a!=null&&!r().getItem(a)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var OGt=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const i=this.collection().getItem(r);if(i){const a=i.textValue.slice(0,e.length);if(i.textValue&&n.compare(a,e)===0)return r}r=this.getKeyBelow(r)}}};function RGt(e,t,n){const r=bWt({usage:"search",sensitivity:"base"}),i=Z(()=>{const a=ke(e.keyboardDelegate);return a||new OGt(e.collection,t,r)});return EGt({selectionManager:()=>ke(e.selectionManager),keyboardDelegate:i,autoFocus:()=>ke(e.autoFocus),deferAutoFocus:()=>ke(e.deferAutoFocus),shouldFocusWrap:()=>ke(e.shouldFocusWrap),disallowEmptySelection:()=>ke(e.disallowEmptySelection),selectOnFocus:()=>ke(e.selectOnFocus),disallowTypeAhead:()=>ke(e.disallowTypeAhead),shouldUseVirtualFocus:()=>ke(e.shouldUseVirtualFocus),allowsTabNavigation:()=>ke(e.allowsTabNavigation),isVirtualized:()=>ke(e.isVirtualized),scrollToKey:a=>ke(e.scrollToKey)?.(a),orientation:()=>ke(e.orientation)},t,n)}var nme=Tt();function rme(){return Lt(nme)}function zGt(){const e=rme();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function ime(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function qGt(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const i=e[r]?.ref();if(i&&ime(i,n))return r+1}return 0}function jGt(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[a,o])=>{const s=i.ref(),l=o.ref();return s===l||!s||!l?0:ime(s,l)?(r>a&&(n=!0),-1):(r<a&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function ame(e,t){const n=jGt(e);e!==n&&t(n)}function HGt(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return ri(r).body}function FGt(e,t){fe(()=>{const n=setTimeout(()=>{ame(e(),t)});me(()=>clearTimeout(n))})}function VGt(e,t){if(typeof IntersectionObserver!="function"){FGt(e,t);return}let n=[];fe(()=>{const r=()=>{const o=!!n.length;n=e(),o&&ame(e(),t)},i=HGt(e()),a=new IntersectionObserver(r,{root:i});for(const o of e()){const s=o.ref();s&&a.observe(s)}me(()=>a.disconnect())})}function BGt(e={}){const[t,n]=sve({value:()=>ke(e.items),onChange:a=>e.onItemsChange?.(a)});VGt(t,n);const r=a=>(n(o=>{const s=qGt(o,a);return Cye(o,a,s)}),()=>{n(o=>{const s=o.filter(l=>l.ref()!==a.ref());return o.length===s.length?o:s})});return{DomCollectionProvider:a=>d(nme.Provider,{value:{registerItem:r},get children(){return a.children}})}}function UGt(e){const t=zGt(),n=ft({shouldRegisterItem:!0},e);fe(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());me(r)})}function WGt(e={}){const[t,n]=pre({value:()=>ke(e.isSelected),defaultValue:()=>!!ke(e.defaultIsSelected),onChange:a=>e.onSelectedChange?.(a)});return{isSelected:t,setIsSelected:a=>{!ke(e.isReadOnly)&&!ke(e.isDisabled)&&n(a)},toggle:()=>{!ke(e.isReadOnly)&&!ke(e.isDisabled)&&n(!t())}}}var GGt=Tt();function Oj(){return Lt(GGt)}var ZGt=Tt();function ome(){return Lt(ZGt)}var sme=Tt();function lme(){return Lt(sme)}function Po(){const e=lme();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var cme=Tt();function WK(){const e=Lt(cme);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var dme=Tt();function fa(){const e=Lt(dme);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function GK(e){let t;const n=fa(),r=Po(),i=ft({id:n.generateId(`item-${wr()}`)},e),[a,o]=Me(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(),g=()=>r.listState().selectionManager(),y=()=>o.id,v=()=>g().focusedKey()===y(),k=()=>{a.onSelect?.(),a.closeOnSelect&&setTimeout(()=>{r.close(!0)})};UGt({getItem:()=>({ref:()=>t,type:"item",key:y(),textValue:a.textValue??h()?.textContent??t?.textContent??"",disabled:a.disabled??!1})});const b=tme({key:y,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>a.disabled},()=>t),x=I=>{dt(I,a.onPointerMove),I.pointerType==="mouse"&&(a.disabled?r.onItemLeave(I):(r.onItemEnter(I),I.defaultPrevented||(ur(I.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(y()))))},w=I=>{dt(I,a.onPointerLeave),I.pointerType==="mouse"&&r.onItemLeave(I)},M=I=>{dt(I,a.onPointerUp),!a.disabled&&I.button===0&&k()},_=I=>{if(dt(I,a.onKeyDown),!I.repeat&&!a.disabled)switch(I.key){case"Enter":case" ":k();break}},C=Z(()=>{if(a.indeterminate)return"mixed";if(a.checked!=null)return a.checked}),L=Z(()=>({"data-indeterminate":a.indeterminate?"":void 0,"data-checked":a.checked&&!a.indeterminate?"":void 0,"data-disabled":a.disabled?"":void 0,"data-highlighted":v()?"":void 0})),S={isChecked:()=>a.checked,dataset:L,setLabelRef:m,generateId:Io(()=>o.id),registerLabel:zr(l),registerDescription:zr(u)};return d(cme.Provider,{value:S,get children(){return d(zt,f({as:"div",ref(I){var A=hn(D=>t=D,a.ref);typeof A=="function"&&A(I)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return C()},get"aria-disabled"(){return a.disabled},get"aria-labelledby"(){return s()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return Kn([a.onPointerDown,b.onPointerDown])},get onPointerUp(){return Kn([M,b.onPointerUp])},get onClick(){return Kn([a.onClick,b.onClick])},get onKeyDown(){return Kn([_,b.onKeyDown])},get onMouseDown(){return Kn([a.onMouseDown,b.onMouseDown])},get onFocus(){return Kn([a.onFocus,b.onFocus])},onPointerMove:x,onPointerLeave:w},L,o))}})}function Rj(e){const t=ft({closeOnSelect:!1},e),[n,r]=Me(t,["checked","defaultChecked","onChange","onSelect"]),i=WGt({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>n.onChange?.(o),isDisabled:()=>r.disabled});return d(GK,f({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{n.onSelect?.(),i.toggle()}},r))}var q2={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>q2.next(e==="ltr"?"rtl":"ltr",t)},Nne={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function ume(e){const t=fa(),n=Po(),r=Oj(),{direction:i}=gs(),a=ft({id:t.generateId("trigger")},e),[o,s]=Me(a,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>t.value()??o.id,r.lastValue()===void 0&&r.setLastValue(l));const c=G2(()=>n.triggerRef(),()=>"button"),u=Z(()=>c()==="a"&&n.triggerRef()?.getAttribute("href")!=null);fe(vn(()=>r?.value(),b=>{u()&&b===l()&&n.triggerRef()?.focus()}));const h=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},m=b=>{dt(b,o.onPointerDown),b.currentTarget.dataset.pointerType=b.pointerType,!o.disabled&&b.pointerType!=="touch"&&b.button===0&&h()},g=b=>{dt(b,o.onClick),o.disabled||b.currentTarget.dataset.pointerType==="touch"&&h()},y=b=>{if(dt(b,o.onKeyDown),!o.disabled){if(u())switch(b.key){case"Enter":case" ":return}switch(b.key){case"Enter":case" ":case Nne.first(t.orientation()):b.stopPropagation(),b.preventDefault(),Wye(b.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case Nne.last(t.orientation()):b.stopPropagation(),b.preventDefault(),n.open("last");break;case q2.next(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.nextMenu();break;case q2.previous(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.previousMenu();break}}},v=b=>{dt(b,o.onMouseOver),n.triggerRef()?.dataset.pointerType!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},k=b=>{dt(b,o.onFocus),r!==void 0&&b.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return fe(()=>me(n.registerTriggerId(o.id))),d(_0,f({ref(b){var x=hn(n.setTriggerRef,o.ref);typeof x=="function"&&x(b)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return kt(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&r?.value()===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:m,onMouseOver:v,onClick:g,onKeyDown:y,onFocus:k,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function hme(e){let t;const n=fa(),r=Po(),i=Oj(),a=ome(),{direction:o}=gs(),s=ft({id:n.generateId(`content-${wr()}`)},e),[l,c]=Me(s,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const h=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),m=RGt({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);ure({trapFocus:()=>h()&&r.isOpen(),onMountAutoFocus:w=>{i===void 0&&l.onOpenAutoFocus?.(w)},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const g=w=>{if(Jn(w.currentTarget,w.target)&&(w.key==="Tab"&&r.isOpen()&&w.preventDefault(),i!==void 0&&w.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(w.key){case q2.next(o(),n.orientation()):w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case q2.previous(o(),n.orientation()):if(w.currentTarget.hasAttribute("data-closed"))break;w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},y=w=>{l.onEscapeKeyDown?.(w),i?.setAutoFocusMenu(!1),r.close(!0)},v=w=>{l.onFocusOutside?.(w),n.isModal()&&w.preventDefault()},k=w=>{dt(w,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},b=w=>{if(dt(w,l.onPointerMove),w.pointerType!=="mouse")return;const M=w.target,_=u!==w.clientX;Jn(w.currentTarget,M)&&_&&(r.setPointerDir(w.clientX>u?"right":"left"),u=w.clientX)};fe(()=>me(r.registerContentId(l.id))),me(()=>r.setContentRef(void 0));const x={ref:hn(w=>{r.setContentRef(w),t=w},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return m.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:Kn([l.onKeyDown,m.onKeyDown,g]),onMouseDown:Kn([l.onMouseDown,m.onMouseDown]),onFocusIn:Kn([l.onFocusIn,m.onFocusIn]),onFocusOut:Kn([l.onFocusOut,m.onFocusOut]),onPointerEnter:k,onPointerMove:b,get"data-orientation"(){return n.orientation()}};return d(ve,{get when(){return r.contentPresent()},get children(){return d(ve,{get when(){return a===void 0||r.parentMenuContext()!=null},get fallback(){return d(zt,f({as:"div"},()=>r.dataset(),x,c))},get children(){return d(Hf.Positioner,{get children(){return d(sq,f({get disableOutsidePointerEvents(){return kt(()=>!!h())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Wa({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:y,onFocusOutside:v,get onDismiss(){return r.close}},()=>r.dataset(),x,c))}})}})}})}function fme(e){let t;const n=fa(),r=Po(),[i,a]=Me(e,["ref"]);return mre({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),d(hme,f({ref(o){var s=hn(l=>{t=l},i.ref);typeof s=="function"&&s(o)}},a))}var pme=Tt();function KGt(){const e=Lt(pme);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function Im(e){const t=fa(),n=ft({id:t.generateId(`group-${wr()}`)},e),[r,i]=Ce(),a={generateId:Io(()=>n.id),registerLabelId:zr(i)};return d(pme.Provider,{value:a,get children(){return d(zt,f({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function zj(e){const t=KGt(),n=ft({id:t.generateId("label")},e),[r,i]=Me(n,["id"]);return fe(()=>me(t.registerLabelId(r.id))),d(zt,f({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function qj(e){const t=Po(),n=ft({children:"▼"},e);return d(zt,f({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function jj(e){return d(GK,f({role:"menuitem",closeOnSelect:!0},e))}function Hj(e){const t=WK(),n=ft({id:t.generateId("description")},e),[r,i]=Me(n,["id"]);return fe(()=>me(t.registerDescription(r.id))),d(zt,f({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function Fj(e){const t=WK(),n=ft({id:t.generateId("indicator")},e),[r,i]=Me(n,["forceMount"]);return d(ve,{get when(){return r.forceMount||t.isChecked()},get children(){return d(zt,f({as:"div"},()=>t.dataset(),i))}})}function Vj(e){const t=WK(),n=ft({id:t.generateId("label")},e),[r,i]=Me(n,["ref","id"]);return fe(()=>me(t.registerLabel(r.id))),d(zt,f({as:"div",ref(a){var o=hn(t.setLabelRef,r.ref);typeof o=="function"&&o(a)},get id(){return r.id}},()=>t.dataset(),i))}function Bj(e){const t=Po();return d(ve,{get when(){return t.contentPresent()},get children(){return d(w0,e)}})}var mme=Tt();function XGt(){const e=Lt(mme);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function Uj(e){const n=fa().generateId(`radiogroup-${wr()}`),r=ft({id:n},e),[i,a]=Me(r,["value","defaultValue","onChange","disabled"]),[o,s]=W2({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:c=>i.onChange?.(c)}),l={isDisabled:()=>i.disabled,isSelectedValue:c=>c===o(),setSelectedValue:c=>s(c)};return d(mme.Provider,{value:l,get children(){return d(Im,a)}})}function Wj(e){const t=XGt(),n=ft({closeOnSelect:!1},e),[r,i]=Me(n,["value","onSelect"]);return d(GK,f({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},i))}function JGt(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),a=[],o=t.clientX,s=t.clientY;switch(r){case"top":a.push([o,s+5]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]);break;case"right":a.push([o-5,s]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]);break;case"bottom":a.push([o,s-5]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]);break;case"left":a.push([o+5,s]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top]);break}return a}function YGt(e,t){return t?HU([e.clientX,e.clientY],t):!1}function gme(e){const t=fa(),n=rme(),r=lme(),i=Oj(),a=ome(),o=ft({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[s,l]=Me(o,["open","defaultOpen","onOpenChange"]);let c=0,u=null,h="right";const[m,g]=Ce(),[y,v]=Ce(),[k,b]=Ce(),[x,w]=Ce(),[M,_]=Ce(!0),[C,L]=Ce(l.placement),[S,I]=Ce([]),[A,D]=Ce([]),{DomCollectionProvider:P}=BGt({items:A,onItemsChange:D}),O=x0({open:()=>s.open,defaultOpen:()=>s.defaultOpen,onOpenChange:le=>s.onOpenChange?.(le)}),{present:E}=i0({show:()=>t.forceMount()||O.isOpen(),element:()=>x()??null}),T=DGt({selectionMode:"none",dataSource:A}),R=le=>{_(le),O.open()},H=(le=!1)=>{O.close(),le&&r&&r.close(!0)},J=le=>{_(le),O.toggle()},j=()=>{const le=x();le&&(ur(le),T.selectionManager().setFocused(!0),T.selectionManager().setFocusedKey(void 0))},X=()=>{a!=null?setTimeout(()=>j()):j()},W=le=>{I(Ee=>[...Ee,le]);const Se=r?.registerNestedMenu(le);return()=>{I(Ee=>dV(Ee,le)),Se?.()}},G=le=>h===u?.side&&YGt(le,u?.area),Y=le=>{G(le)&&le.preventDefault()},oe=le=>{G(le)||X()},ue=le=>{G(le)&&le.preventDefault()};hre({isDisabled:()=>!(r==null&&O.isOpen()&&t.isModal()),targets:()=>[x(),...S()].filter(Boolean)}),fe(()=>{const le=x();if(!le||!r)return;const Se=r.registerNestedMenu(le);me(()=>{Se()})}),fe(()=>{r===void 0&&i?.registerMenu(t.value(),[x(),...S()])}),fe(()=>{r!==void 0||i===void 0||(i.value()===t.value()?(k()?.focus(),i.autoFocusMenu()&&R(!0)):H())}),fe(()=>{r!==void 0||i===void 0||O.isOpen()&&i.setValue(t.value())}),me(()=>{r===void 0&&i?.unregisterMenu(t.value())});const de={dataset:Z(()=>({"data-expanded":O.isOpen()?"":void 0,"data-closed":O.isOpen()?void 0:""})),isOpen:O.isOpen,contentPresent:E,nestedMenus:S,currentPlacement:C,pointerGraceTimeoutId:()=>c,autoFocus:M,listState:()=>T,parentMenuContext:()=>r,triggerRef:k,contentRef:x,triggerId:m,contentId:y,setTriggerRef:b,setContentRef:w,open:R,close:H,toggle:J,focusContent:X,onItemEnter:Y,onItemLeave:oe,onTriggerLeave:ue,setPointerDir:le=>h=le,setPointerGraceTimeoutId:le=>c=le,setPointerGraceIntent:le=>u=le,registerNestedMenu:W,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:zr(g),registerContentId:zr(v)};return d(P,{get children(){return d(sme.Provider,{value:de,get children(){return d(ve,{when:a===void 0,get fallback(){return l.children},get children(){return d(Hf,f({anchorRef:k,contentRef:x,onCurrentPlacementChange:L},l))}})}})}})}function Gj(e){const{direction:t}=gs();return d(gme,f({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var QGt={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Zj(e){const t=Po(),n=fa(),[r,i]=Me(e,["onFocusOutside","onKeyDown"]),{direction:a}=gs();return d(hme,f({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{r.onFocusOutside?.(u);const h=u.target;Jn(t.triggerRef(),h)||t.close()},onKeyDown:u=>{dt(u,r.onKeyDown);const h=Jn(u.currentTarget,u.target),m=QGt.close(a(),n.orientation()).includes(u.key),g=t.parentMenuContext()!=null;h&&m&&g&&(t.close(),ur(t.triggerRef()))}},i))}var Ane=["Enter"," "],eZt={open:(e,t)=>e==="ltr"?[...Ane,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Ane,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Kj(e){let t;const n=fa(),r=Po(),i=ft({id:n.generateId(`sub-trigger-${wr()}`)},e),[a,o]=Me(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let s=null;const l=()=>{s&&window.clearTimeout(s),s=null},{direction:c}=gs(),u=()=>a.id,h=()=>{const w=r.parentMenuContext();if(w==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return w.listState().selectionManager()},m=()=>r.listState().collection(),g=()=>h().focusedKey()===u(),y=tme({key:u,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>a.disabled},()=>t),v=w=>{dt(w,a.onClick),!r.isOpen()&&!a.disabled&&r.open(!0)},k=w=>{if(dt(w,a.onPointerMove),w.pointerType!=="mouse")return;const M=r.parentMenuContext();if(M?.onItemEnter(w),!w.defaultPrevented){if(a.disabled){M?.onItemLeave(w);return}!r.isOpen()&&!s&&(r.parentMenuContext()?.setPointerGraceIntent(null),s=window.setTimeout(()=>{r.open(!1),l()},100)),M?.onItemEnter(w),w.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),ur(w.currentTarget),M?.listState().selectionManager().setFocused(!0),M?.listState().selectionManager().setFocusedKey(u()))}},b=w=>{if(dt(w,a.onPointerLeave),w.pointerType!=="mouse")return;l();const M=r.parentMenuContext(),_=r.contentRef();if(_){M?.setPointerGraceIntent({area:JGt(r.currentPlacement(),w,_),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(M?.pointerGraceTimeoutId());const C=window.setTimeout(()=>{M?.setPointerGraceIntent(null)},300);M?.setPointerGraceTimeoutId(C)}else{if(M?.onTriggerLeave(w),w.defaultPrevented)return;M?.setPointerGraceIntent(null)}M?.onItemLeave(w)},x=w=>{dt(w,a.onKeyDown),!w.repeat&&(a.disabled||eZt.open(c(),n.orientation()).includes(w.key)&&(w.stopPropagation(),w.preventDefault(),h().setFocused(!1),h().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(m().getFirstKey())))};return fe(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const w=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:a.textValue??t?.textContent??"",disabled:a.disabled??!1});me(w)}),fe(vn(()=>r.parentMenuContext()?.pointerGraceTimeoutId(),w=>{me(()=>{window.clearTimeout(w),r.parentMenuContext()?.setPointerGraceIntent(null)})})),fe(()=>me(r.registerTriggerId(a.id))),me(()=>{l()}),d(zt,f({as:"div",ref(w){var M=hn(_=>{r.setTriggerRef(_),t=_},a.ref);typeof M=="function"&&M(w)},get id(){return a.id},role:"menuitem",get tabIndex(){return y.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return kt(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return a.disabled},get"data-key"(){return y.dataKey()},get"data-highlighted"(){return g()?"":void 0},get"data-disabled"(){return a.disabled?"":void 0},get onPointerDown(){return Kn([a.onPointerDown,y.onPointerDown])},get onPointerUp(){return Kn([a.onPointerUp,y.onPointerUp])},get onClick(){return Kn([v,y.onClick])},get onKeyDown(){return Kn([x,y.onKeyDown])},get onMouseDown(){return Kn([a.onMouseDown,y.onMouseDown])},get onFocus(){return Kn([a.onFocus,y.onFocus])},onPointerMove:k,onPointerLeave:b},()=>r.dataset(),o))}function yme(e){const t=Oj(),n=`menu-${wr()}`,r=ft({id:n,modal:!0},e),[i,a]=Me(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=x0({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>i.onOpenChange?.(l)}),s={isModal:()=>i.modal??!0,preventScroll:()=>i.preventScroll??s.isModal(),forceMount:()=>i.forceMount??!1,generateId:Io(()=>i.id),value:()=>i.value,orientation:()=>i.orientation??t?.orientation()??"horizontal"};return d(dme.Provider,{value:s,get children(){return d(gme,f({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},a))}})}var tZt={};Ga(tZt,{Root:()=>Ff,Separator:()=>nZt});function Ff(e){let t;const n=ft({orientation:"horizontal"},e),[r,i]=Me(n,["ref","orientation"]),a=G2(()=>t,()=>"hr");return d(zt,f({as:"hr",ref(o){var s=hn(l=>t=l,r.ref);typeof s=="function"&&s(o)},get role(){return a()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var nZt=Ff,rZt={};Ga(rZt,{Arrow:()=>vs,CheckboxItem:()=>Rj,Content:()=>vme,DropdownMenu:()=>er,Group:()=>Im,GroupLabel:()=>zj,Icon:()=>qj,Item:()=>jj,ItemDescription:()=>Hj,ItemIndicator:()=>Fj,ItemLabel:()=>Vj,Portal:()=>Bj,RadioGroup:()=>Uj,RadioItem:()=>Wj,Root:()=>kme,Separator:()=>Ff,Sub:()=>Gj,SubContent:()=>Zj,SubTrigger:()=>Kj,Trigger:()=>ume});function vme(e){const t=fa(),n=Po(),[r,i]=Me(e,["onCloseAutoFocus","onInteractOutside"]);let a=!1;return d(fme,f({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),a||ur(n.triggerRef()),a=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(a=!0)}},i))}function kme(e){const t=`dropdownmenu-${wr()}`,n=ft({id:t},e);return d(yme,n)}var er=Object.assign(kme,{Arrow:vs,CheckboxItem:Rj,Content:vme,Group:Im,GroupLabel:zj,Icon:qj,Item:jj,ItemDescription:Hj,ItemIndicator:Fj,ItemLabel:Vj,Portal:Bj,RadioGroup:Uj,RadioItem:Wj,Separator:Ff,Sub:Gj,SubContent:Zj,SubTrigger:Kj,Trigger:ume});function iZt(e){return d(er,f(e,{"data-component":"dropdown-menu"}))}function aZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.Trigger,f(n,{"data-slot":"dropdown-menu-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function oZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.Icon,f(n,{"data-slot":"dropdown-menu-icon",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function sZt(e){return d(er.Portal,e)}function lZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.Content,f(n,{"data-component":"dropdown-menu-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function cZt(e){const[t,n]=Me(e,["class","classList"]);return d(er.Arrow,f(n,{"data-slot":"dropdown-menu-arrow",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function dZt(e){const[t,n]=Me(e,["class","classList"]);return d(er.Separator,f(n,{"data-slot":"dropdown-menu-separator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function uZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.Group,f(n,{"data-slot":"dropdown-menu-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function hZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.GroupLabel,f(n,{"data-slot":"dropdown-menu-group-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function fZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.Item,f(n,{"data-slot":"dropdown-menu-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function pZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.ItemLabel,f(n,{"data-slot":"dropdown-menu-item-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function mZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.ItemDescription,f(n,{"data-slot":"dropdown-menu-item-description",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function gZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.ItemIndicator,f(n,{"data-slot":"dropdown-menu-item-indicator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function yZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.RadioGroup,f(n,{"data-slot":"dropdown-menu-radio-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function vZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.RadioItem,f(n,{"data-slot":"dropdown-menu-radio-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function kZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.CheckboxItem,f(n,{"data-slot":"dropdown-menu-checkbox-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function bZt(e){return d(er.Sub,e)}function wZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.SubTrigger,f(n,{"data-slot":"dropdown-menu-sub-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function xZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.SubContent,f(n,{"data-component":"dropdown-menu-sub-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}const Mt=Object.assign(iZt,{Trigger:aZt,Icon:oZt,Portal:sZt,Content:lZt,Arrow:cZt,Separator:dZt,Group:uZt,GroupLabel:hZt,Item:fZt,ItemLabel:pZt,ItemDescription:mZt,ItemIndicator:gZt,RadioGroup:yZt,RadioItem:vZt,CheckboxItem:kZt,Sub:bZt,SubTrigger:wZt,SubContent:xZt});var _Zt=ie("<div>"),Xj=class{x;y;width;height;constructor(t){this.x=Math.floor(t.x),this.y=Math.floor(t.y),this.width=Math.floor(t.width),this.height=Math.floor(t.height)}get rect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get center(){return{x:this.x+this.width*.5,y:this.y+this.height*.5}}get corners(){return{topLeft:{x:this.left,y:this.top},topRight:{x:this.right,y:this.top},bottomRight:{x:this.left,y:this.bottom},bottomLeft:{x:this.right,y:this.bottom}}}},jh=e=>{let t=new Xj(e.getBoundingClientRect());const{transform:n}=getComputedStyle(e);return n&&(t=MZt(t,n)),t},MZt=(e,t)=>{let n,r;if(t.startsWith("matrix3d(")){const i=t.slice(9,-1).split(/, /);n=+i[12],r=+i[13]}else if(t.startsWith("matrix(")){const i=t.slice(7,-1).split(/, /);n=+i[4],r=+i[5]}else n=0,r=0;return new Xj({...e,x:e.x-n,y:e.y-r})},Ea=()=>({x:0,y:0}),ZK=(e,t)=>e.x===t.x&&e.y===t.y,tV=(e,t)=>new Xj({...e,x:e.x+t.x,y:e.y+t.y}),SZt=(e,t)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),CZt=(e,t)=>{const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom),o=i-r,s=a-n;if(r<i&&n<a){const l=e.width*e.height,c=t.width*t.height,u=o*s;return u/(l+c-u)}return 0},nV=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,bme=(e,t,n)=>{const r=e.transformed.center,i={distance:1/0,droppable:null};for(const a of t){const o=SZt(r,a.layout.center);o<i.distance?(i.distance=o,i.droppable=a):o===i.distance&&a.id===n.activeDroppableId&&(i.droppable=a)}return i.droppable},LZt=(e,t,n)=>{const r=e.transformed,i={ratio:0,droppable:null};for(const a of t){const o=CZt(r,a.layout);o>i.ratio?(i.ratio=o,i.droppable=a):o>0&&o===i.ratio&&a.id===n.activeDroppableId&&(i.droppable=a)}return i.droppable},wme=Tt(),xme=e=>{const t=f({collisionDetector:LZt},e),[n,r]=nt({draggables:{},droppables:{},sensors:{},active:{draggableId:null,get draggable(){return n.active.draggableId!==null?n.draggables[n.active.draggableId]:null},droppableId:null,get droppable(){return n.active.droppableId!==null?n.droppables[n.active.droppableId]:null},sensorId:null,get sensor(){return n.active.sensorId!==null?n.sensors[n.active.sensorId]:null},overlay:null}}),i=(E,T,R)=>{E.substring(0,E.length-1),lt(()=>n[E][T])&&r(E,T,"transformers",R.id,R)},a=(E,T,R)=>{E.substring(0,E.length-1),lt(()=>n[E][T])&<(()=>n[E][T].transformers[R])&&r(E,T,"transformers",R,void 0)},o=({id:E,node:T,layout:R,data:H})=>{const J=n.draggables[E],j={id:E,node:T,layout:R,data:H,_pendingCleanup:!1};let X;if(!J)Object.defineProperties(j,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{if(n.active.overlay)return Ea();const W=Object.values(n.draggables[E].transformers);return W.sort((G,Y)=>G.order-Y.order),W.reduce((G,Y)=>Y.callback(G),Ea())}},transformed:{enumerable:!0,configurable:!0,get:()=>tV(n.draggables[E].layout,n.draggables[E].transform)}});else if(n.active.draggableId===E&&!n.active.overlay){const W={x:J.layout.x-R.x,y:J.layout.y-R.y},G="addDraggable-existing-offset",Y=J.transformers[G],oe=Y?Y.callback(W):W;X={id:G,order:100,callback:ue=>({x:ue.x+oe.x,y:ue.y+oe.y})},D(()=>a("draggables",E,G))}ct(()=>{r("draggables",E,j),X&&i("draggables",E,X)}),n.active.draggable&&M()},s=E=>{lt(()=>n.draggables[E])&&(r("draggables",E,"_pendingCleanup",!0),queueMicrotask(()=>l(E)))},l=E=>{if(n.draggables[E]?._pendingCleanup){const T=n.active.draggableId===E;ct(()=>{T&&r("active","draggableId",null),r("draggables",E,void 0)})}},c=({id:E,node:T,layout:R,data:H})=>{const J=n.droppables[E],j={id:E,node:T,layout:R,data:H,_pendingCleanup:!1};J||Object.defineProperties(j,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{const X=Object.values(n.droppables[E].transformers);return X.sort((W,G)=>W.order-G.order),X.reduce((W,G)=>G.callback(W),Ea())}},transformed:{enumerable:!0,configurable:!0,get:()=>tV(n.droppables[E].layout,n.droppables[E].transform)}}),r("droppables",E,j),n.active.draggable&&M()},u=E=>{lt(()=>n.droppables[E])&&(r("droppables",E,"_pendingCleanup",!0),queueMicrotask(()=>h(E)))},h=E=>{if(n.droppables[E]?._pendingCleanup){const T=n.active.droppableId===E;ct(()=>{T&&r("active","droppableId",null),r("droppables",E,void 0)})}},m=({id:E,activators:T})=>{r("sensors",E,{id:E,activators:T,coordinates:{origin:{x:0,y:0},current:{x:0,y:0},get delta(){return{x:n.sensors[E].coordinates.current.x-n.sensors[E].coordinates.origin.x,y:n.sensors[E].coordinates.current.y-n.sensors[E].coordinates.origin.y}}}})},g=E=>{if(!lt(()=>n.sensors[E]))return;const T=n.active.sensorId===E;ct(()=>{T&&r("active","sensorId",null),r("sensors",E,void 0)})},y=({node:E,layout:T})=>{const R=n.active.overlay,H={node:E,layout:T};R||Object.defineProperties(H,{id:{enumerable:!0,configurable:!0,get:()=>n.active.draggable?.id},data:{enumerable:!0,configurable:!0,get:()=>n.active.draggable?.data},transformers:{enumerable:!0,configurable:!0,get:()=>Object.fromEntries(Object.entries(n.active.draggable?n.active.draggable.transformers:{}).filter(([J])=>J!=="addDraggable-existing-offset"))},transform:{enumerable:!0,configurable:!0,get:()=>{const J=Object.values(n.active.overlay?n.active.overlay.transformers:[]);return J.sort((j,X)=>j.order-X.order),J.reduce((j,X)=>X.callback(j),Ea())}},transformed:{enumerable:!0,configurable:!0,get:()=>n.active.overlay?tV(n.active.overlay.layout,n.active.overlay.transform):new Xj({x:0,y:0,width:0,height:0})}}),r("active","overlay",H)},v=()=>r("active","overlay",null),k=(E,T)=>{ct(()=>{r("sensors",E,"coordinates",{origin:{...T},current:{...T}}),r("active","sensorId",E)})},b=E=>{const T=n.active.sensorId;T&&r("sensors",T,"coordinates","current",{...E})},x=()=>r("active","sensorId",null),w=(E,T)=>{const R={};for(const J of Object.values(n.sensors))if(J)for(const[j,X]of Object.entries(J.activators))R[j]??=[],R[j].push({sensor:J,activator:X});const H={};for(const J in R){let j=J;T&&(j=`on${J}`),H[j]=X=>{for(const{activator:W}of R[J]){if(n.active.sensor)break;W(X,E)}}}return H},M=()=>{let E=!1;const T=Object.values(n.draggables),R=Object.values(n.droppables),H=n.active.overlay;return ct(()=>{const J=new WeakMap;for(const j of T)if(j){const X=j.layout;J.has(j.node)||J.set(j.node,jh(j.node));const W=J.get(j.node);nV(X,W)||(r("draggables",j.id,"layout",W),E=!0)}for(const j of R)if(j){const X=j.layout;J.has(j.node)||J.set(j.node,jh(j.node));const W=J.get(j.node);nV(X,W)||(r("droppables",j.id,"layout",W),E=!0)}if(H){const j=H.layout,X=jh(H.node);nV(j,X)||(r("active","overlay","layout",X),E=!0)}}),E},_=()=>{const E=n.active.overlay??n.active.draggable;if(E){const T=t.collisionDetector(E,Object.values(n.droppables),{activeDroppableId:n.active.droppableId}),R=T?T.id:null;n.active.droppableId!==R&&r("active","droppableId",R)}},C=E=>{const T={id:"sensorMove",order:0,callback:R=>n.active.sensor?{x:R.x+n.active.sensor.coordinates.delta.x,y:R.y+n.active.sensor.coordinates.delta.y}:R};M(),ct(()=>{r("active","draggableId",E),i("draggables",E,T)}),_()},L=()=>{const E=lt(()=>n.active.draggableId);ct(()=>{E!==null&&a("draggables",E,"sensorMove"),r("active",["draggableId","droppableId"],null)}),M()},S=E=>{fe(()=>{const T=n.active.draggable;T&<(()=>E({draggable:T}))})},I=E=>{fe(()=>{const T=n.active.draggable;if(T){const R=lt(()=>n.active.overlay);Object.values(R?R.transform:T.transform),lt(()=>E({draggable:T,overlay:R}))}})},A=E=>{fe(()=>{const T=n.active.draggable,R=n.active.droppable;T&<(()=>E({draggable:T,droppable:R,overlay:n.active.overlay}))})},D=E=>{fe(({previousDraggable:T,previousDroppable:R,previousOverlay:H})=>{const J=n.active.draggable,j=J?n.active.droppable:null,X=J?n.active.overlay:null;return!J&&T&<(()=>E({draggable:T,droppable:R,overlay:H})),{previousDraggable:J,previousDroppable:j,previousOverlay:X}},{previousDraggable:null,previousDroppable:null,previousOverlay:null})};I(()=>_()),t.onDragStart&&S(t.onDragStart),t.onDragMove&&I(t.onDragMove),t.onDragOver&&A(t.onDragOver),t.onDragEnd&&D(t.onDragEnd);const O=[n,{addTransformer:i,removeTransformer:a,addDraggable:o,removeDraggable:s,addDroppable:c,removeDroppable:u,addSensor:m,removeSensor:g,setOverlay:y,clearOverlay:v,recomputeLayouts:M,detectCollisions:_,draggableActivators:w,sensorStart:k,sensorMove:b,sensorEnd:x,dragStart:C,dragEnd:L,onDragStart:S,onDragMove:I,onDragOver:A,onDragEnd:D}];return d(wme.Provider,{value:O,get children(){return t.children}})},R0=()=>Lt(wme)||null,IZt=(e="pointer-sensor")=>{const[t,{addSensor:n,removeSensor:r,sensorStart:i,sensorMove:a,sensorEnd:o,dragStart:s,dragEnd:l}]=R0(),c=250,u=10;dn(()=>{n({id:e,activators:{pointerdown:v}})}),me(()=>{r(e)});const h=()=>t.active.sensorId===e,m={x:0,y:0};let g=null,y=null;const v=(_,C)=>{_.button===0&&(document.addEventListener("pointermove",x),document.addEventListener("pointerup",w),y=C,m.x=_.clientX,m.y=_.clientY,g=window.setTimeout(b,c))},k=()=>{g&&(clearTimeout(g),g=null),document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",w),document.removeEventListener("selectionchange",M)},b=()=>{t.active.sensor?h()||k():(i(e,m),s(y),M(),document.addEventListener("selectionchange",M))},x=_=>{const C={x:_.clientX,y:_.clientY};if(!t.active.sensor){const L={x:C.x-m.x,y:C.y-m.y};Math.sqrt(L.x**2+L.y**2)>u&&b()}h()&&(_.preventDefault(),a(C))},w=_=>{k(),h()&&(_.preventDefault(),l(),o())},M=()=>{window.getSelection()?.removeAllRanges()}},_me=e=>(IZt(),kt(()=>e.children)),Jj=e=>({transform:`translate3d(${e.x}px, ${e.y}px, 0)`}),NZt=(e,t={})=>{const[n,{addDraggable:r,removeDraggable:i,draggableActivators:a}]=R0(),[o,s]=Ce(null);dn(()=>{const h=o();h&&r({id:e,node:h,layout:jh(h),data:t})}),me(()=>i(e));const l=()=>n.active.draggableId===e,c=()=>n.draggables[e]?.transform||Ea();return Object.defineProperties((h,m)=>{const g=m?m():{};fe(()=>{const y=o(),v=a(e);if(y)for(const k in v)y.addEventListener(k,v[k]);me(()=>{if(y)for(const k in v)y.removeEventListener(k,v[k])})}),s(h),g.skipTransform||fe(()=>{const y=c();if(ZK(y,Ea()))h.style.removeProperty("transform");else{const v=Jj(c());h.style.setProperty("transform",v.transform??null)}})},{ref:{enumerable:!0,value:s},isActiveDraggable:{enumerable:!0,get:l},dragActivators:{enumerable:!0,get:()=>a(e,!0)},transform:{enumerable:!0,get:c}})},AZt=(e,t={})=>{const[n,{addDroppable:r,removeDroppable:i}]=R0(),[a,o]=Ce(null);dn(()=>{const u=a();u&&r({id:e,node:u,layout:jh(u),data:t})}),me(()=>i(e));const s=()=>n.active.droppableId===e,l=()=>n.droppables[e]?.transform||Ea();return Object.defineProperties((u,h)=>{const m=h?h():{};o(u),m.skipTransform||fe(()=>{const g=l();if(ZK(g,Ea()))u.style.removeProperty("transform");else{const y=Jj(l());u.style.setProperty("transform",y.transform??null)}})},{ref:{enumerable:!0,value:o},isActiveDroppable:{enumerable:!0,get:s},transform:{enumerable:!0,get:l}})},Mme=e=>{const[t,{onDragStart:n,onDragEnd:r,setOverlay:i,clearOverlay:a}]=R0();let o;n(({draggable:l})=>{i({node:l.node,layout:l.layout}),queueMicrotask(()=>{if(o){const c=jh(o),u={x:(l.layout.width-c.width)/2,y:(l.layout.height-c.height)/2};c.x+=u.x,c.y+=u.y,i({node:o,layout:c})}})}),r(()=>queueMicrotask(a));const s=()=>{const l=t.active.overlay,c=t.active.draggable;return!l||!c?{}:{position:"fixed",transition:"transform 0s",top:`${l.layout.top}px`,left:`${l.layout.left}px`,"min-width":`${c.layout.width}px`,"min-height":`${c.layout.height}px`,...Jj(l.transform),...e.style}};return d(w0,{get mount(){return document.body},get children(){return d(ve,{get when(){return t.active.draggable},get children(){var l=_Zt(),c=o;return typeof c=="function"?Hr(c,l):o=l,K(l,(()=>{var u=kt(()=>typeof e.children=="function");return()=>u()?e.children(t.active.draggable):e.children})()),Qe(u=>{var h=e.class,m=s();return h!==u.e&&U2(l,u.e=h),u.t=iq(l,m,u.t),u},{e:void 0,t:void 0}),l}})}})},$Zt=(e,t,n)=>{const r=e.slice();return r.splice(n,0,...r.splice(t,1)),r},Sme=Tt(),Cme=e=>{const[t]=R0(),[n,r]=nt({initialIds:[],sortedIds:[]}),i=s=>s>=0&&s<n.initialIds.length;fe(()=>{r("initialIds",[...e.ids]),r("sortedIds",[...e.ids])}),fe(()=>{t.active.draggableId&&t.active.droppableId?lt(()=>{const s=n.sortedIds.indexOf(t.active.draggableId),l=n.initialIds.indexOf(t.active.droppableId);if(!i(s)||!i(l))r("sortedIds",[...e.ids]);else if(s!==l){const c=$Zt(n.sortedIds,s,l);r("sortedIds",c)}}):r("sortedIds",[...e.ids])});const o=[n,{}];return d(Sme.Provider,{value:o,get children(){return e.children}})},TZt=()=>Lt(Sme)||null,EZt=(e,t)=>n=>{e(n),t(n)},Lme=(e,t={})=>{const[n,{addTransformer:r,removeTransformer:i}]=R0(),[a]=TZt(),o=NZt(e,t),s=AZt(e,t),l=EZt(o.ref,s.ref),c=()=>a.initialIds.indexOf(e),u=()=>a.sortedIds.indexOf(e),h=k=>n.droppables[k]?.layout||null,m=()=>{const k=Ea(),b=c(),x=u();if(x!==b){const w=h(e),M=h(a.initialIds[x]);w&&M&&(k.x=M.x-w.x,k.y=M.y-w.y)}return k},g={id:"sortableOffset",order:100,callback:k=>{const b=m();return{x:k.x+b.x,y:k.y+b.y}}};dn(()=>r("droppables",e,g)),me(()=>i("droppables",e,g.id));const y=()=>(e===n.active.draggableId&&!n.active.overlay?n.draggables[e]?.transform:n.droppables[e]?.transform)||Ea();return Object.defineProperties(k=>{o(k,()=>({skipTransform:!0})),s(k,()=>({skipTransform:!0})),fe(()=>{const b=y();if(ZK(b,Ea()))k.style.removeProperty("transform");else{const x=Jj(y());k.style.setProperty("transform",x.transform??null)}})},{ref:{enumerable:!0,value:l},transform:{enumerable:!0,get:y},isActiveDraggable:{enumerable:!0,get:()=>o.isActiveDraggable},dragActivators:{enumerable:!0,get:()=>o.dragActivators},isActiveDroppable:{enumerable:!0,get:()=>s.isActiveDroppable}})};function PZt(e){const t={locs:[],timer:void 0,pending:void 0,over:void 0,last:void 0},n=e.delay??250,r=e.max??4,i=e.tolerance??80,a=e.edge??18,o=()=>{t.timer!==void 0&&clearTimeout(t.timer),t.timer=void 0,t.pending=void 0},s=()=>{o(),t.over=void 0,t.last=void 0,t.locs.length=0},l=y=>{if(!e.enabled())return;const v=e.el();if(!v)return;const k=v.getBoundingClientRect(),b=y.clientX,x=y.clientY;b<k.left||b>k.right||x<k.top||x>k.bottom||(t.locs.push({x:b,y:x}),t.locs.length>r&&t.locs.shift())},c=()=>{if(!e.enabled()||!e.active())return 0;const y=e.el();if(!y||t.locs.length<2)return 0;const v=y.getBoundingClientRect(),k=t.locs[t.locs.length-1];if(!k)return 0;const b=t.locs[0]??k;if(b.x<v.left||b.x>v.right||b.y<v.top||b.y>v.bottom||t.last&&k.x===t.last.x&&k.y===t.last.y)return 0;if(v.right-k.x<=a)return t.last=k,n;const x={x:v.right,y:v.top-i},w={x:v.right,y:v.bottom+i},M=(I,A)=>(A.y-I.y)/(A.x-I.x),_=M(k,x),C=M(k,w),L=M(b,x),S=M(b,w);return _<L&&C>S?(t.last=k,n):(t.last=void 0,0)},u=y=>{o(),e.onActivate(y)},h=y=>{if(!y||e.active()===y)return;if(!e.active()){u(y);return}const v=c();if(v===0){u(y);return}o(),t.pending=y,t.timer=window.setTimeout(()=>{t.timer=void 0,t.pending===y&&(t.pending=void 0,e.enabled()&&e.active()&&t.over===y&&e.onActivate(y))},v)};return{move:l,enter:(y,v)=>{e.enabled()&&(t.over=y,l(v),h(y))},leave:y=>{t.over===y&&(t.over=void 0),t.pending===y&&o()},activate:u,request:h,cancel:o,reset:s}}let EU;const DZt=e=>{EU=e},OZt=e=>{if(window.focus(),!!e){if(EU)return EU(e);console.warn("notification-click: navigate function not set, falling back to window.location.assign"),window.location.assign(e)}},xp=e=>e.replace(/[\\/]+$/,""),oh=new Map,sh=new Map;function RZt(){const e={resolve:n=>{}};return{promise:new Promise(n=>{e.resolve=n}),resolve:e.resolve}}const Jg={get(e){return oh.get(xp(e))},pending(e){const t=xp(e),n=oh.get(t);n&&n.status!=="pending"||oh.set(t,{status:"pending"})},ready(e){const t=xp(e),n={status:"ready"};oh.set(t,n);const r=sh.get(t);r&&(sh.delete(t),r.resolve(n))},failed(e,t){const n=xp(e),r={status:"failed",message:t};oh.set(n,r);const i=sh.get(n);i&&(sh.delete(n),i.resolve(r))},wait(e){const t=xp(e),n=oh.get(t);if(n&&n.status!=="pending")return Promise.resolve(n);const r=sh.get(t);if(r)return r.promise;const i=RZt();return sh.set(t,i),i.promise}},zZt=40,j2={session:new Map,terminal:new Map},Ime=(e,t,n)=>{for(e.delete(t),e.set(t,n);e.size>zZt;){const r=e.keys().next().value;if(r===void 0)return;e.delete(r)}},qZt=(e,t)=>{const n=j2.session.get(e)??{prompt:"",files:{}};Ime(j2.session,e,{...n,...t})},pQt=e=>j2.session.get(e),mQt=(e,t)=>{Ime(j2.terminal,e,t)},gQt=e=>j2.terminal.get(e),jZt=e=>typeof e!="object"||e===null?!1:"draggable"in e,eq=e=>{if(!jZt(e))return;const t=e.draggable;if(t)return typeof t.id=="string"?t.id:void 0},HZt=(e,t)=>({id:e,order:100,callback:n=>t==="x"?{...n,x:0}:{...n,y:0}}),Nme=(e,t)=>()=>{const n=R0();if(!n)return null;const[,{onDragStart:r,onDragEnd:i,addTransformer:a,removeTransformer:o}]=n,s=HZt(t,e),l=br(c=>(r(u=>{const h=eq(u);h&&a("draggables",h,s)}),i(u=>{const h=eq(u);h&&o("draggables",h,s.id)}),c));return me(l),null},Ame=Nme("x","constrain-x-axis"),yQt=Nme("y","constrain-y-axis"),KK=100;function FZt(e,t,n=KK){if(!e.stack.length){const i=t==="/"?["/"]:["/",t];return{stack:i,index:i.length-1,action:void 0}}const r=e.stack[e.index];return t===r?e.action?{...e,action:void 0}:e:e.action?{...e,action:void 0}:VZt(e,t,n)}function VZt(e,t,n=KK){const r=e.stack.slice(0,e.index+1).concat(t),i=BZt(r,r.length-1,n);return{...e,...i,action:void 0}}function BZt(e,t,n=KK){if(e.length<=n)return{stack:e,index:t};const r=e.length-n;return{stack:e.slice(r),index:Math.max(0,t-r)}}function UZt(e){if(e.index<=0)return;const t=e.index-1,n=e.stack[t];if(n)return{state:{...e,index:t,action:"back"},to:n}}function WZt(e){if(e.index>=e.stack.length-1)return;const t=e.index+1,n=e.stack[t];if(n)return{state:{...e,index:t,action:"forward"},to:n}}var GZt=ie('<div class="h-full shrink-0">'),ZZt=ie('<div class="xl:hidden w-10 shrink-0 flex items-center justify-center">'),KZt=ie('<div class="xl:hidden w-[32px] shrink-0 flex items-center justify-center mr-2">'),XZt=ie('<div class="flex items-center shrink-0 ml-2"><svg width=20 height=20 viewBox="0 0 800 800"fill=none xmlns=http://www.w3.org/2000/svg class=shrink-0><path d="M373.362 226.643C388.087 211.919 411.96 211.919 426.684 226.643L573.37 373.324C588.094 388.047 588.094 411.92 573.37 426.644L426.684 573.324C411.96 588.048 388.087 588.048 373.362 573.324L226.677 426.644C211.952 411.92 211.952 388.047 226.677 373.324L373.362 226.643Z"fill=currentColor class=text-text-base></path><path d="M586.658 513.282C594.02 505.921 605.956 505.921 613.318 513.282L686.659 586.621C694.021 593.983 694.021 605.919 686.659 613.28L613.318 686.619C605.956 693.981 594.02 693.981 586.658 686.619L513.317 613.28C505.955 605.919 505.955 593.983 513.317 586.621L586.658 513.282Z"fill=currentColor class=text-text-base></path><path d="M286.501 586.454C293.957 593.909 293.957 605.997 286.501 613.453L213.5 686.452C206.044 693.907 193.956 693.907 186.5 686.452L113.499 613.453C106.043 605.997 106.043 593.909 113.499 586.454L186.5 513.455C193.956 506 206.044 506 213.5 513.455L286.501 586.454Z"fill=currentColor class=text-text-base></path><path d="M406.524 93.4982C402.934 97.088 397.113 97.088 393.523 93.4982L356.523 56.499C352.933 52.9092 352.933 47.089 356.523 43.4992L393.523 6.50002C397.113 2.91025 402.934 2.91025 406.524 6.50003L443.524 43.4992C447.114 47.089 447.114 52.9092 443.524 56.499L406.524 93.4982Z"fill=currentColor class=text-text-base></path><path d="M186.502 113.498C193.958 106.042 206.046 106.042 213.502 113.498L286.503 186.496C293.959 193.952 293.959 206.04 286.503 213.496L213.502 286.494C206.046 293.95 193.958 293.95 186.502 286.494L113.501 213.496C106.045 206.04 106.045 193.952 113.501 186.496L186.502 113.498Z"fill=currentColor class=text-text-base></path><path d="M686.499 186.483C693.955 193.939 693.955 206.027 686.499 213.482L613.498 286.481C606.042 293.937 593.954 293.937 586.498 286.481L513.497 213.482C506.041 206.027 506.041 193.939 513.497 186.483L586.498 113.484C593.954 106.029 606.042 106.029 613.498 113.484L686.499 186.483Z"fill=currentColor class=text-text-base></path><path d="M356.689 756.666C353.007 752.985 353.007 747.017 356.689 743.336L393.359 706.667C397.04 702.986 403.008 702.986 406.689 706.667L443.359 743.336C447.041 747.017 447.041 752.985 443.359 756.666L406.689 793.335C403.008 797.016 397.04 797.016 393.359 793.335L356.689 756.666Z"fill=currentColor class=text-text-base>'),JZt=ie("<span class=truncate>"),YZt=ie('<div class="flex items-center gap-1.5 text-12-regular text-text-weaker select-none ml-1"><span class=text-text-weak>'),QZt=ie('<div data-tauri-decorum-tb class="flex flex-row">'),eKt=ie('<header class="h-12 shrink-0 bg-transparent relative grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center"data-tauri-drag-region><div><div id=opencode-titlebar-left class="flex items-center gap-3 min-w-0 px-2"></div></div><div class="min-w-0 flex items-center justify-center pointer-events-none"><div id=opencode-titlebar-center class="pointer-events-auto min-w-0 flex justify-center w-fit max-w-full"></div></div><div data-tauri-drag-region><div id=opencode-titlebar-right class="flex items-center gap-2">'),tKt=ie('<div class="w-36 shrink-0">');const XK=()=>window.__TAURI__,nKt=()=>XK()?.window?.getCurrentWindow?.(),rKt=()=>XK()?.webviewWindow?.getCurrentWebviewWindow?.();function iKt(){const e=If(),t=ms(),n=Cce(),r=xr(),i=cle(),a=lf(),o=ll(),s=bf(),l=di();ipe();const[c]=Jxt(),[u,h]=Ce(!1),[m,g]=Ce(""),[y,v]=Ce(""),[k,b]=Ce(!1);function x(){z(async()=>{const{DialogCreateProject:G}=await import("./dialog-create-project-BUc4DxX6.js");return{DialogCreateProject:G}},[]).then(({DialogCreateProject:G})=>{a.show(()=>d(G,{onSelect:Y=>{if(!Y)return;const oe=Array.isArray(Y)?Y[0]:Y;oe&&(e.projects.open(oe),o(`/${St(oe)}/session`))}}))})}function w(){z(async()=>{const{DialogCloneProject:G}=await import("./dialog-clone-project-B1wF7jYQ.js");return{DialogCloneProject:G}},[]).then(({DialogCloneProject:G})=>{a.show(()=>d(G,{onSelect:Y=>{Y&&(e.projects.open(Y),o(`/${St(Y)}/session`))}}))})}const M=Z(()=>t.platform==="desktop"&&t.os==="macos"),_=Z(()=>t.platform==="desktop"&&t.os==="windows");Z(()=>t.platform==="web");const C=()=>t.webviewZoom?.()??1,L=()=>M()?`${40/C()}px`:void 0,[S,I]=nt({stack:[],index:0,action:void 0}),A=()=>`${s.pathname}${s.search}${s.hash}`;Z(()=>!l.dir||l.id?!1:s.pathname.replace(/\/+$/,"").split("/").at(-1)==="session"),fe(()=>{const G=A();lt(()=>{const Y=FZt(S,G);Y!==S&&I(Y)})}),Z(()=>S.index>0),Z(()=>S.index<S.stack.length-1);const D=Z(()=>e.projects.list().length>0),P=Z(()=>e.projects.list().find(G=>St(G.worktree)===l.dir)),O=Z(()=>{const G=P();return G?G.name||Gn(G.worktree):r.t("command.project.open")}),E={plan:"Plan",track:"Track",project:"Track",data:"Data",ship:"Ship",review:"Review"},T=Z(()=>{const G=c.view,Y=Array.isArray(G)?G[0]:G;if(Y)return E[Y]}),R=()=>{const G=UZt(S);G&&(I(G.state),o(G.to))},H=()=>{const G=WZt(S);G&&(I(G.state),o(G.to))};n.register(()=>[{id:"common.goBack",title:r.t("common.goBack"),category:r.t("command.category.view"),keybind:"mod+[",onSelect:R},{id:"common.goForward",title:r.t("common.goForward"),category:r.t("command.category.view"),keybind:"mod+]",onSelect:H}]);const J=()=>{if(t.platform==="desktop")return nKt()};fe(()=>{if(t.platform!=="desktop")return;const G=i.colorScheme(),Y=G==="system"?null:G,oe=rKt();oe?.setTheme&&oe.setTheme(Y).catch(()=>{})});const j=G=>G instanceof Element?!!G.closest("button, a, input, textarea, select, option, [role='button'], [role='menuitem'], [contenteditable='true'], [contenteditable='']"):!1,X=G=>{if(t.platform!=="desktop"||G.buttons!==1||j(G.target))return;const Y=J();Y?.startDragging&&(G.preventDefault(),Y.startDragging().catch(()=>{}))},W=G=>{if(t.platform!=="desktop"||j(G.target)||G.target instanceof Element&&G.target.closest("[data-tauri-decorum-tb]"))return;const Y=J();Y?.toggleMaximize&&(G.preventDefault(),Y.toggleMaximize().catch(()=>{}))};return(()=>{var G=eKt(),Y=G.firstChild,oe=Y.firstChild,ue=Y.nextSibling,ye=ue.nextSibling;return ye.firstChild,G.$$dblclick=W,G.$$mousedown=X,K(Y,d(ve,{get when(){return M()},get children(){return[(()=>{var de=GZt();return Qe(le=>Rr(de,"width",`${72/C()}px`)),de})(),(()=>{var de=ZZt();return K(de,d(Sr,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return e.mobileSidebar.toggle},get"aria-label"(){return r.t("sidebar.menu.toggle")},get"aria-expanded"(){return e.mobileSidebar.opened()}})),de})()]}}),oe),K(Y,d(ve,{get when(){return!M()},get children(){var de=KZt();return K(de,d(Sr,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return e.mobileSidebar.toggle},get"aria-label"(){return r.t("sidebar.menu.toggle")},get"aria-expanded"(){return e.mobileSidebar.opened()}})),de}}),oe),K(Y,d(ve,{get when(){return D()},get children(){return[XZt(),d(Mt,{placement:"bottom-start",gutter:4,modal:!1,get children(){return[d(Mt.Trigger,{as:Mn,variant:"ghost",size:"small",class:"flex items-center gap-1 h-6 px-2 text-12-regular text-text-base max-w-[180px]",get children(){return[(()=>{var de=JZt();return K(de,O),de})(),d(Kt,{name:"chevron-down",size:"small",class:"shrink-0 text-icon-weak"})]}}),d(Mt.Portal,{get children(){return d(Mt.Content,{class:"min-w-[180px]",get children(){return[d(Qt,{get each(){return e.projects.list()},children:de=>d(Mt.Item,{onSelect:()=>o(`/${St(de.worktree)}/session`),get children(){return d(Mt.ItemLabel,{get children(){return de.name||Gn(de.worktree)}})}})}),d(Mt.Separator,{}),d(Mt.Item,{onSelect:()=>n.trigger("project.open"),get children(){return d(Mt.ItemLabel,{get children(){return r.t("command.project.open")}})}}),d(Mt.Separator,{}),d(Mt.Sub,{get children(){return[d(Mt.SubTrigger,{get children(){return r.t("command.project.new")}}),d(Mt.SubContent,{get children(){return[d(Mt.Item,{onSelect:x,get children(){return d(Mt.ItemLabel,{get children(){return r.t("command.project.newBlank")}})}}),d(Mt.Item,{onSelect:w,get children(){return d(Mt.ItemLabel,{get children(){return r.t("command.project.importGitHub")}})}})]}})]}})]}})}})]}})]}}),oe),K(Y,d(ve,{get when(){return T()},get children(){var de=YZt(),le=de.firstChild;return K(de,d(Kt,{name:"chevron-right",size:"small",class:"text-icon-weaker shrink-0"}),le),K(le,T),de}}),oe),ye.$$mousedown=X,K(ye,d(J2e,{placement:"bottom",get title(){return r.t("sidebar.settings")},get keybind(){return n.keybind("settings.open")??""},get children(){return d(Mn,{variant:"ghost",class:"titlebar-icon w-8 h-6 p-0 box-border shrink-0",onClick:()=>n.trigger("settings.open"),get"aria-label"(){return r.t("sidebar.settings")},get children(){return d(Kt,{size:"small",name:"settings-gear"})}})}}),null),K(ye,d(ve,{get when(){return _()},get children(){return[kt(()=>kt(()=>!XK())()&&tKt()),QZt()]}}),null),Qe(de=>{var le=L(),Se={"flex items-center min-w-0":!0,"pl-2":!M()},Ee={"flex items-center min-w-0 justify-end":!0,"pr-2":!_()};return le!==de.e&&Rr(G,"min-height",de.e=le),de.t=hr(Y,Se,de.t),de.a=hr(ye,Ee,de.a),de},{e:void 0,t:void 0,a:void 0}),G})()}li(["mousedown","dblclick"]);const tt=e=>{const t=e.replaceAll("\\","/"),n=t.match(/^([A-Za-z]:)\/+$/);return n?`${n[1]}/`:/^\/+$/i.test(t)?"/":t.replace(/\/+$/,"")};function $me(e){const t=e-6e4;return(n,r)=>{const i=n.time.updated??n.time.created,a=r.time.updated??r.time.created,o=i>t,s=a>t;return o&&s?n.id<r.id?-1:n.id>r.id?1:0:o&&!s?-1:!o&&s?1:a-i}}const aKt=(e,t)=>tt(e.directory)===tt(t)&&!e.parentID&&!e.time?.archived,Tme=e=>(e.session??[]).filter(t=>aKt(t,e.path.directory)),H2=(e,t)=>Tme(e).sort($me(t)),$ne=(e,t)=>e.flatMap(Tme).sort($me(t))[0];function oKt(e,t=()=>!0){return Object.values(e??{}).some(n=>n?.some(t))}const tq=e=>{const t=new Map;for(const n of e??[]){if(!n.parentID)continue;const r=t.get(n.parentID);if(r){r.push(n.id);continue}t.set(n.parentID,[n.id])}return t},JK=e=>e.name||Gn(e.worktree),rV=(e,t)=>{if(e&&typeof e=="object"&&"data"in e){const n=e.data;if(n?.message)return n.message}return e instanceof Error?e.message:t},Yg=(e,t,n)=>{const r=tt(e),i=new Map;for(const o of t){const s=tt(o);s!==r&&(i.has(s)||i.set(s,o))}if(!n?.length)return[e,...i.values()];const a=[e];for(const o of n){const s=tt(o);if(s===r)continue;const l=i.get(s);l&&(a.push(l),i.delete(s))}return[...a,...i.values()]},Tne="opencode:deep-link",Eme=e=>{if(e.startsWith("opencode://")&&!(typeof URL.canParse=="function"&&!URL.canParse(e)))try{return new URL(e)}catch{return}},sKt=e=>{const t=Eme(e);if(!t||t.hostname!=="open-project")return;const n=t.searchParams.get("directory");if(n)return n},lKt=e=>{const t=Eme(e);if(!t||t.hostname!=="new-session")return;const n=t.searchParams.get("directory");if(!n)return;const r=t.searchParams.get("prompt")||void 0;return r?{directory:n,prompt:r}:{directory:n}},cKt=e=>e.map(sKt).filter(t=>!!t),dKt=e=>e.map(lKt).filter(t=>!!t),uKt=e=>{const t=e.__OPENCODE__?.deepLinks??[];return t.length===0?[]:(e.__OPENCODE__&&(e.__OPENCODE__.deepLinks=[]),t)};var hKt=ie("<span>");function fKt(){const[e,t]=nt({active:"",value:""}),n=c=>e.active===c,r=()=>e.value,i=(c,u)=>{c&&t({active:c,value:u})},a=()=>t({active:"",value:""}),o=c=>{const u=e.value.trim();if(!u){a();return}a(),c(u)},s=(c,u)=>{if(c.key==="Enter"){c.preventDefault(),o(u);return}c.key==="Escape"&&(c.preventDefault(),a())};return{editor:e,editorOpen:n,editorValue:r,openEditor:i,closeEditor:a,saveEditor:o,editorKeyDown:s,setEditor:t,InlineEditor:c=>{let u;me(()=>{u!==void 0&&cancelAnimationFrame(u)});const h=()=>c.editing??n(c.id),m=()=>c.stopPropagation??!1,g=()=>c.openOnDblClick??!0,y=k=>{m()&&k.stopPropagation()},v=k=>{g()&&(y(k),i(c.id,c.value()))};return d(ve,{get when(){return h()},get fallback(){return(()=>{var k=hKt();return k.$$touchstart=y,k.$$click=y,k.$$mousedown=y,k.$$pointerdown=y,k.$$dblclick=v,K(k,()=>c.value()),Qe(()=>U2(k,c.displayClass??c.class)),k})()},get children(){return d(CR,{ref:k=>{u!==void 0&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=void 0,k.isConnected&&k.focus()})},get value(){return r()},get class(){return c.class},onInput:k=>t("value",k.currentTarget.value),onKeyDown:k=>{k.stopPropagation(),s(k,c.onSave)},onBlur:a,onPointerDown:y,onClick:y,onDblClick:y,onMouseDown:y,onMouseUp:y,onTouchStart:y})}})}}}li(["dblclick","pointerdown","mousedown","click","touchstart"]);var pKt={};Ga(pKt,{Collapsible:()=>Yj,Content:()=>Dme,Root:()=>Ome,Trigger:()=>Rme,useCollapsibleContext:()=>YK});var Pme=Tt();function YK(){const e=Lt(Pme);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function Dme(e){const[t,n]=Ce(),r=YK(),i=ft({id:r.generateId("content")},e),[a,o]=Me(i,["ref","id","style"]),{present:s}=i0({show:r.shouldMount,element:()=>t()??null}),[l,c]=Ce(0),[u,h]=Ce(0);let g=r.isOpen()||s();return dn(()=>{const y=requestAnimationFrame(()=>{g=!1});me(()=>{cancelAnimationFrame(y)})}),fe(vn(s,()=>{if(!t())return;t().style.transitionDuration="0s",t().style.animationName="none";const y=t().getBoundingClientRect();c(y.height),h(y.width),g||(t().style.transitionDuration="",t().style.animationName="")})),fe(vn(r.isOpen,y=>{!y&&t()&&(t().style.transitionDuration="",t().style.animationName="")},{defer:!0})),fe(()=>me(r.registerContentId(a.id))),d(ve,{get when(){return s()},get children(){return d(zt,f({as:"div",ref(y){var v=hn(n,a.ref);typeof v=="function"&&v(y)},get id(){return a.id},get style(){return Wa({"--kb-collapsible-content-height":l()?`${l()}px`:void 0,"--kb-collapsible-content-width":u()?`${u()}px`:void 0},a.style)}},()=>r.dataset(),o))}})}function Ome(e){const t=`collapsible-${wr()}`,n=ft({id:t},e),[r,i]=Me(n,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[a,o]=Ce(),s=x0({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:u=>r.onOpenChange?.(u)}),l=Z(()=>({"data-expanded":s.isOpen()?"":void 0,"data-closed":s.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),c={dataset:l,isOpen:s.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||s.isOpen(),contentId:a,toggle:s.toggle,generateId:Io(()=>i.id),registerContentId:zr(o)};return d(Pme.Provider,{value:c,get children(){return d(zt,f({as:"div"},l,i))}})}function Rme(e){const t=YK(),[n,r]=Me(e,["onClick"]);return d(_0,f({get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return kt(()=>!!t.isOpen())()?t.contentId():void 0},get disabled(){return t.disabled()},onClick:a=>{dt(a,n.onClick),t.toggle()}},()=>t.dataset(),r))}var Yj=Object.assign(Ome,{Content:Dme,Trigger:Rme}),mKt=ie("<div data-slot=collapsible-arrow><span data-slot=collapsible-arrow-icon>");function gKt(e){const[t,n]=Me(e,["class","classList","variant"]);return d(Yj,f({"data-component":"collapsible",get"data-variant"(){return t.variant||"normal"},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}},n))}function yKt(e){return d(Yj.Trigger,f({"data-slot":"collapsible-trigger"},e))}function vKt(e){return d(Yj.Content,f({"data-slot":"collapsible-content"},e))}function kKt(e){return(()=>{var t=mKt(),n=t.firstChild;return ki(t,e||{},!1,!0),K(n,d(Kt,{name:"chevron-down",size:"small"})),t})()}const iV=Object.assign(gKt,{Arrow:kKt,Trigger:yKt,Content:vKt});var bKt=ie("<div>"),wKt=ie("<img data-slot=avatar-image>");const Ene=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function xKt(e){return e?Ene?Ene.segment(e)[Symbol.iterator]().next().value?.segment??Array.from(e)[0]??"":Array.from(e)[0]??"":""}function _Kt(e){const[t,n]=Me(e,["fallback","src","background","foreground","size","class","classList","style"]),r=t.src;return(()=>{var i=bKt();return ki(i,f(n,{"data-component":"avatar",get"data-size"(){return t.size||"normal"},"data-has-image":r?"":void 0,get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get style(){return{...typeof t.style=="object"?t.style:{},...!r&&t.background?{"--avatar-bg":t.background}:{},...!r&&t.foreground?{"--avatar-fg":t.foreground}:{}}}}),!1,!0),K(i,d(ve,{when:r,get fallback(){return xKt(t.fallback)},children:a=>(()=>{var o=wKt();return wt(o,"draggable",!1),Qe(()=>wt(o,"src",a())),o})()})),i})()}var MKt={};Ga(MKt,{Link:()=>SKt,Root:()=>QK});function QK(e){let t;const[n,r]=Me(e,["ref","href","disabled"]),i=G2(()=>t,()=>"a");return d(zt,f({as:"a",ref(a){var o=hn(s=>t=s,n.ref);typeof o=="function"&&o(a)},get role(){return i()!=="a"||n.disabled?"link":void 0},get tabIndex(){return i()!=="a"&&!n.disabled?0:void 0},get href(){return kt(()=>!n.disabled)()?n.href:void 0},get"aria-disabled"(){return n.disabled?!0:void 0},get"data-disabled"(){return n.disabled?"":void 0}},r))}var SKt=QK,CKt={};Ga(CKt,{Arrow:()=>vs,Content:()=>qme,HoverCard:()=>qp,Portal:()=>jme,Root:()=>Hme,Trigger:()=>Fme,useHoverCardContext:()=>Qj});var zme=Tt();function Qj(){const e=Lt(zme);if(e===void 0)throw new Error("[kobalte]: `useHoverCardContext` must be used within a `HoverCard` component");return e}function qme(e){const t=Qj(),[n,r]=Me(e,["ref","style"]);return d(ve,{get when(){return t.contentPresent()},get children(){return d(Hf.Positioner,{get children(){return d(sq,f({ref(i){var a=hn(o=>{t.setContentRef(o)},n.ref);typeof a=="function"&&a(i)},disableOutsidePointerEvents:!1,get style(){return Wa({"--kb-hovercard-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},n.style)},onFocusOutside:i=>i.preventDefault(),get onDismiss(){return t.close}},()=>t.dataset(),r))}})}})}function jme(e){const t=Qj();return d(ve,{get when(){return t.contentPresent()},get children(){return d(w0,e)}})}function LKt(e,t,n){const r=e.split("-")[0],i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=[],s=i.left+i.width/2,l=i.top+i.height/2;switch(r){case"top":o.push([i.left,l]),o.push([a.left,a.bottom]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([i.right,l]);break;case"right":o.push([s,i.top]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([a.left,a.bottom]),o.push([s,i.bottom]);break;case"bottom":o.push([i.left,l]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([a.right,a.top]),o.push([i.right,l]);break;case"left":o.push([s,i.top]),o.push([a.right,a.top]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([s,i.bottom]);break}return o}function Hme(e){const t=`hovercard-${wr()}`,n=ft({id:t,openDelay:700,closeDelay:300},e),[r,i]=Me(n,["id","open","defaultOpen","onOpenChange","openDelay","closeDelay","ignoreSafeArea","forceMount"]);let a,o;const[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(i.placement),g=x0({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:A=>r.onOpenChange?.(A)}),{present:y}=i0({show:()=>r.forceMount||g.isOpen(),element:()=>c()??null}),{addGlobalListener:v,removeGlobalListener:k}=Iye(),b=()=>{a=window.setTimeout(()=>{a=void 0,g.open()},r.openDelay)},x=()=>{o=window.setTimeout(()=>{o=void 0,g.close()},r.closeDelay)},w=()=>{window.clearTimeout(a),a=void 0},M=()=>{window.clearTimeout(o),o=void 0},_=A=>Jn(s(),A)||Jn(c(),A),C=A=>{const D=s(),P=c();if(!(!D||!P))return LKt(A,D,P)},L=A=>{const D=A.target;if(_(D)){M();return}if(!r.ignoreSafeArea){const P=C(h());if(P&&HU(sre(A),P)){M();return}}o||x()};fe(()=>{g.isOpen()&&(v(document,"pointermove",L,!0),me(()=>{k(document,"pointermove",L,!0)}))}),me(()=>{w(),M()});const I={dataset:Z(()=>({"data-expanded":g.isOpen()?"":void 0,"data-closed":g.isOpen()?void 0:""})),isOpen:g.isOpen,contentPresent:y,openWithDelay:b,closeWithDelay:x,cancelOpening:w,cancelClosing:M,close:g.close,isTargetOnHoverCard:_,setTriggerRef:l,setContentRef:u};return d(zme.Provider,{value:I,get children(){return d(Hf,f({anchorRef:s,contentRef:c,onCurrentPlacementChange:m},i))}})}function Fme(e){const t=Qj(),[n,r]=Me(e,["ref","onPointerEnter","onPointerLeave","onFocus","onBlur"]),i=l=>{dt(l,n.onPointerEnter),!(l.pointerType==="touch"||r.disabled||l.defaultPrevented)&&(t.cancelClosing(),t.isOpen()||t.openWithDelay())},a=l=>{dt(l,n.onPointerLeave),l.pointerType!=="touch"&&t.cancelOpening()},o=l=>{dt(l,n.onFocus),!(r.disabled||l.defaultPrevented)&&(t.cancelClosing(),t.isOpen()||t.openWithDelay())},s=l=>{dt(l,n.onBlur),t.cancelOpening();const c=l.relatedTarget;t.isTargetOnHoverCard(c)||t.closeWithDelay()};return me(t.cancelOpening),d(QK,f({ref(l){var c=hn(t.setTriggerRef,n.ref);typeof c=="function"&&c(l)},onPointerEnter:i,onPointerLeave:a,onFocus:o,onBlur:s},()=>t.dataset(),r))}var qp=Object.assign(Hme,{Arrow:vs,Content:qme,Portal:jme,Trigger:Fme}),IKt=ie("<div data-slot=hover-card-body>");function Vme(e){const[t,n]=Me(e,["trigger","mount","class","classList","children"]);return d(qp,f({gutter:4},n,{get children(){return[d(qp.Trigger,{as:"div","data-slot":"hover-card-trigger",tabIndex:-1,get children(){return t.trigger}}),d(qp.Portal,{get mount(){return t.mount},get children(){return d(qp.Content,{"data-component":"hover-card-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){var r=IKt();return K(r,()=>t.children),r}})}})]}}))}var NKt=ie('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 14"fill=none><g>'),AKt=ie("<span data-slot=diff-changes-additions>"),$Kt=ie("<span data-slot=diff-changes-deletions>"),TKt=ie("<div data-component=diff-changes>"),EKt=ie("<svg><rect width=2 height=14 rx=1></svg>",!1,!0,!1);function PKt(e){const t=()=>e.variant??"default",n=Z(()=>Array.isArray(e.changes)?e.changes.reduce((u,h)=>u+(h.additions??0),0):e.changes.additions),r=Z(()=>Array.isArray(e.changes)?e.changes.reduce((u,h)=>u+(h.deletions??0),0):e.changes.deletions),i=Z(()=>(n()??0)+(r()??0)),a=Z(()=>{const h=n()??0,m=r()??0;if(h===0&&m===0)return{added:0,deleted:0,neutral:5};const g=h+m;if(g<5){const S=h>0?1:0,I=m>0?1:0,A=5-S-I;return{added:S,deleted:I,neutral:A}}const y=h>m?h/m:m/h;let v=5;(g<20||y<4)&&(v=4);const k=h/g,b=m/g,x=k*v,w=b*v;let M=h>0?Math.max(1,Math.round(x)):0,_=m>0?Math.max(1,Math.round(w)):0;h>0&&h<=5&&(M=Math.min(M,1)),h>5&&h<=10&&(M=Math.min(M,2)),m>0&&m<=5&&(_=Math.min(_,1)),m>5&&m<=10&&(_=Math.min(_,2));let C=M+_;C>v&&(x>w?M=v-_:_=v-M,C=M+_);const L=Math.max(0,5-C);return{added:M,deleted:_,neutral:L}}),o="var(--icon-diff-add-base)",s="var(--icon-diff-delete-base)",l="var(--icon-weak-base)",c=Z(()=>{const u=a();return[...Array(u.added).fill(o),...Array(u.deleted).fill(s),...Array(u.neutral).fill(l)].slice(0,5)});return d(ve,{get when(){return kt(()=>t()==="default")()?i()>0:!0},get children(){var u=TKt();return K(u,d(r0,{get children(){return[d(Zn,{get when(){return t()==="bars"},get children(){var h=NKt(),m=h.firstChild;return K(m,d(Qt,{get each(){return c()},children:(g,y)=>(()=>{var v=EKt();return wt(v,"fill",g),Qe(()=>wt(v,"x",y()*4)),v})()})),h}}),d(Zn,{get when(){return t()==="default"},get children(){return[(()=>{var h=AKt();return K(h,()=>`+${n()}`),h})(),(()=>{var h=$Kt();return K(h,()=>`-${r()}`),h})()]}})]}})),Qe(h=>{var m=t(),g={[e.class??""]:!0};return m!==h.e&&wt(u,"data-variant",h.e=m),h.t=hr(u,g,h.t),h},{e:void 0,t:void 0}),u}})}var DKt=ie("<ul role=list data-component=message-nav>"),OKt=ie("<div data-slot=message-nav-tick-button role=button tabindex=0><div data-slot=message-nav-tick-line>"),RKt=ie("<button data-slot=message-nav-message-button><div data-slot=message-nav-title-preview>"),zKt=ie("<li data-slot=message-nav-item>"),qKt=ie("<div data-slot=message-nav-tooltip-content>");function Bme(e){const t=M0(),[n,r]=Me(e,["messages","current","size","onMessageSelect","getLabel"]),i=()=>(()=>{var a=DKt();return ki(a,f({get"data-size"(){return n.size}},r),!1,!0),K(a,d(Qt,{get each(){return n.messages},children:o=>{const s=()=>n.onMessageSelect(o),l=c=>{c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),n.onMessageSelect(o))};return(()=>{var c=zKt();return K(c,d(r0,{get children(){return[d(Zn,{get when(){return n.size==="compact"},get children(){var u=OKt();return u.$$keydown=l,u.$$click=s,Qe(()=>wt(u,"data-active",o.id===n.current?.id||void 0)),u}}),d(Zn,{get when(){return n.size==="normal"},get children(){var u=RKt(),h=u.firstChild;return u.$$keydown=l,u.$$click=s,K(u,d(PKt,{get changes(){return o.summary?.diffs??[]},variant:"bars"}),h),K(h,d(ve,{get when(){return n.getLabel?.(o)??o.summary?.title},get fallback(){return t.t("ui.messageNav.newMessage")},get children(){return n.getLabel?.(o)??o.summary?.title}})),Qe(()=>wt(h,"data-active",o.id===n.current?.id||void 0)),u}})]}})),c})()}})),a})();return d(r0,{get children(){return[d(Zn,{get when(){return n.size==="compact"},get children(){return d(Ua,{openDelay:0,placement:"right-start",gutter:-40,shift:-10,overlap:!0,contentClass:"message-nav-tooltip",get value(){return(()=>{var a=qKt();return K(a,d(Bme,f(e,{size:"normal",class:""}))),a})()},get children(){return i()}})}}),d(Zn,{get when(){return n.size==="normal"},get children(){return i()}})]}})}li(["click","keydown"]);const Pne={ask:"var(--icon-agent-ask-base)",build:"var(--icon-agent-build-base)",docs:"var(--icon-agent-docs-base)",plan:"var(--icon-agent-plan-base)"};function jKt(e,t){return t||(Pne[e]??Pne[e.toLowerCase()])}function HKt(e,t){if(e)for(let n=e.length-1;n>=0;n--){const r=e[n];if(!(r.role!=="user"||!r.agent))return jKt(r.agent,t.find(i=>i.name===r.agent)?.color)}}function Ume(e,t,n,r=()=>!0){if(!n)return;const i=e.reduce((l,c)=>{if(!c.parentID)return l;const u=l.get(c.parentID);return u&&u.push(c.id),u||l.set(c.parentID,[c.id]),l},new Map),a=new Set([n]),o=[n];for(const l of o){const c=i.get(l);if(c)for(const u of c)a.has(u)||(a.add(u),o.push(u))}const s=o.find(l=>t[l]?.some(r));if(s)return t[s]?.find(r)}function FKt(e,t,n,r){return Ume(e,t,n,r)}function vQt(e,t,n,r){return Ume(e,t,n,r)}var VKt=ie("<div>"),BKt=ie('<div><div class="size-full rounded overflow-clip">'),UKt=ie('<div class="size-1.5 rounded-full bg-surface-warning-strong">'),WKt=ie('<div class="size-1.5 rounded-full bg-text-diff-delete-base">'),GKt=ie('<div class="size-1.5 rounded-full bg-text-interactive-base">'),Wme=ie('<div class="shrink-0 size-6 flex items-center justify-center">'),Gme=ie('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">'),ZKt=ie('<div class="overflow-y-auto overflow-x-hidden max-h-72 h-full">'),KKt=ie('<div class="min-w-0 w-full">'),XKt=ie('<div class="text-12-regular text-text-weak">'),JKt=ie('<div class="group/session relative w-full min-w-0 rounded-md cursor-default pl-2 pr-3 transition-colors hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[[data-expanded]]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active"><div class="flex min-w-0 items-center gap-1"><div class="min-w-0 flex-1"></div><div class="shrink-0 overflow-hidden transition-[width,opacity]">'),YKt=ie('<div class="group/session relative w-full min-w-0 rounded-md cursor-default transition-colors pl-2 pr-3 hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active">'),QKt=ie('<div class="flex flex-col gap-1">'),eXt=ie('<div class="h-8 w-full rounded-md bg-surface-raised-base opacity-60 animate-pulse">');const tXt="4b0ea68d7af9a6031a7ffda7ad66e0cb83315750",eX=e=>{const t=ha(),n=Lj(),r=gK(),i=Z(()=>[e.project.worktree,...e.project.sandboxes??[]]),a=Z(()=>i().reduce((u,h)=>u+n.project.unseenCount(h),0)),o=Z(()=>i().some(u=>n.project.unseenHasError(u))),s=Z(()=>i().some(u=>{const[h]=t.child(u,{bootstrap:!1});return oKt(h.permission,m=>!r.autoResponds(m,u))})),l=Z(()=>e.notify&&(s()||a()>0)),c=Z(()=>e.project.name||Gn(e.project.worktree));return(()=>{var u=BKt(),h=u.firstChild;return K(h,d(_Kt,f({get fallback(){return c()},get src(){return kt(()=>e.project.id===tXt)()?"https://opencode.ai/favicon.svg":e.project.icon?.override}},()=>oDt(e.project.icon?.color),{class:"size-full rounded",get classList(){return{"badge-mask":l()}}}))),K(u,d(ve,{get when(){return l()},get children(){var m=VKt();return Qe(g=>hr(m,{"absolute top-px right-px size-1.5 rounded-full z-10":!0,"bg-surface-warning-strong":s(),"bg-icon-critical-base":!s()&&o(),"bg-text-interactive-base":!s()&&!o()},g)),m}}),null),Qe(()=>U2(u,`relative size-8 shrink-0 rounded ${e.class??""}`)),u})()},nXt=e=>d(oG,{get href(){return`/${e.slug}/session/${e.session.id}`},get class(){return`flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${e.dense?"py-0.5":"py-1"}`},get onPointerDown(){return e.warmPress},get onPointerEnter(){return e.warmHover},get onPointerLeave(){return e.cancelHoverPrefetch},get onFocus(){return e.warmFocus},onClick:()=>{e.setHoverSession(void 0),!e.sidebarOpened()&&e.clearHoverProjectSoon()},get children(){return[(()=>{var t=Wme();return K(t,d(r0,{get fallback(){return d(Kt,{name:"dash",size:"small",class:"text-icon-weak"})},get children(){return[d(Zn,{get when(){return e.isWorking()},get children(){return d(P2,{class:"size-[15px]"})}}),d(Zn,{get when(){return e.hasPermissions()},get children(){return UKt()}}),d(Zn,{get when(){return e.hasError()},get children(){return WKt()}}),d(Zn,{get when(){return e.unseenCount()>0},get children(){return GKt()}})]}})),Qe(n=>Rr(t,"color",e.tint()??"var(--icon-interactive-base)")),t})(),(()=>{var t=Gme();return K(t,()=>e.session.title),t})()]}}),rXt=e=>{let t;return d(Vme,{openDelay:1e3,get closeDelay(){return e.sidebarHovering()?600:0},placement:"right-start",gutter:16,shift:-2,get trigger(){return(()=>{var n=KKt(),r=t;return typeof r=="function"?Hr(r,n):t=n,K(n,()=>e.trigger),n})()},get open(){return e.hoverSession()===e.session.id},onOpenChange:n=>{if(!n){e.setHoverSession(void 0);return}t?.matches(":hover")&&e.setHoverSession(e.session.id)},get children(){return d(ve,{get when(){return e.hoverReady()},get fallback(){return(()=>{var n=XKt();return K(n,()=>e.language.t("session.messages.loading")),n})()},get children(){var n=ZKt();return K(n,d(Bme,{get messages(){return e.hoverMessages()??[]},current:void 0,get getLabel(){return e.messageLabel},get onMessageSelect(){return e.onMessageSelect},size:"normal",class:"w-60"})),n}})}})},PU=e=>{const t=di(),n=ll(),r=If(),i=xr(),a=Lj(),o=gK(),s=ha(),l=Z(()=>a.session.unseenCount(e.session.id)),c=Z(()=>a.session.unseenHasError(e.session.id)),[u]=s.child(e.session.directory),h=Z(()=>!!FKt(u.session,u.permission,e.session.id,I=>!o.autoResponds(I,e.session.directory))),m=Z(()=>{if(h())return!1;const I=(u.message[e.session.id]??[]).findLast(D=>D.role==="assistant"&&typeof D.time?.completed!="number"),A=u.session_status[e.session.id];return I!==void 0||A?.type==="busy"||A?.type==="retry"||A!==void 0&&A.type!=="idle"}),g=Z(()=>HKt(u.message[e.session.id],u.agent)),y=Z(()=>u.message[e.session.id]?.filter(I=>I.role==="user")),v=Z(()=>y()!==void 0),k=Z(()=>!e.mobile&&e.sidebarExpanded()),b=Z(()=>(e.popover??!0)&&k()),x=Z(()=>e.session.id===t.id),w=(I,A)=>{const D=e.navList?.(),P=D?.some(E=>E.id===e.session.id&&E.directory===e.session.directory)?D:e.list;e.prefetchSession(e.session,A);const O=P.findIndex(E=>E.id===e.session.id&&E.directory===e.session.directory);if(O!==-1)for(let E=1;E<=I;E++){const T=P[O+E];T&&e.prefetchSession(T,E===1?"high":A);const R=P[O-E];R&&e.prefetchSession(R,E===1?"high":A)}},M={current:void 0},_=()=>{M.current!==void 0&&(clearTimeout(M.current),M.current=void 0)},C=()=>{w(1,"high"),M.current===void 0&&(M.current=setTimeout(()=>{M.current=void 0,w(2,"low")},80))};me(_);const L=I=>(u.part[I.id]??[]).find(P=>P?.type==="text"&&!P.synthetic&&!P.ignored)?.text,S=d(nXt,{get session(){return e.session},get slug(){return e.slug},get mobile(){return e.mobile},get dense(){return e.dense},tint:g,isWorking:m,hasPermissions:h,hasError:c,unseenCount:l,get setHoverSession(){return e.setHoverSession},get clearHoverProjectSoon(){return e.clearHoverProjectSoon},get sidebarOpened(){return r.sidebar.opened},warmHover:C,warmPress:()=>w(2,"high"),warmFocus:()=>w(2,"high"),cancelHoverPrefetch:_});return(()=>{var I=JKt(),A=I.firstChild,D=A.firstChild,P=D.nextSibling;return K(D,d(ve,{get when(){return b()},get fallback(){return d(Ua,{get placement(){return e.mobile?"bottom":"right"},get value(){return e.session.title},gutter:10,class:"min-w-0 w-full",children:S})},get children(){return d(rXt,{get mobile(){return e.mobile},get nav(){return e.nav},get hoverSession(){return e.hoverSession},get session(){return e.session},get sidebarHovering(){return e.sidebarHovering},hoverReady:v,hoverMessages:y,language:i,isActive:x,get slug(){return e.slug},get setHoverSession(){return e.setHoverSession},messageLabel:L,onMessageSelect:O=>{x()||r.pendingMessage.set(`${St(e.session.directory)}/${e.session.id}`,O.id),n(`${e.slug}/session/${e.session.id}#message-${O.id}`)},trigger:S})}})),K(P,d(Ua,{get value(){return i.t("common.archive")},placement:"top",get children(){return d(Sr,{icon:"archive",variant:"ghost",class:"size-6 rounded-md",get"aria-label"(){return i.t("common.archive")},onClick:O=>{O.preventDefault(),O.stopPropagation(),e.archiveSession(e.session)}})}})),Qe(O=>{var E=e.session.id,T={"w-6 opacity-100 pointer-events-auto":!!e.mobile,"w-0 opacity-0 pointer-events-none":!e.mobile,"group-hover/session:w-6 group-hover/session:opacity-100 group-hover/session:pointer-events-auto":!0,"group-focus-within/session:w-6 group-focus-within/session:opacity-100 group-focus-within/session:pointer-events-auto":!0};return E!==O.e&&wt(I,"data-session-id",O.e=E),O.t=hr(P,T,O.t),O},{e:void 0,t:void 0}),I})()},iXt=e=>{const t=If(),r=xr().t("command.session.new"),i=()=>e.mobile||!e.sidebarExpanded(),a=d(oG,{get href(){return`/${e.slug}/session`},end:!0,get class(){return`flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${e.dense?"py-0.5":"py-1"}`},onClick:()=>{e.setHoverSession(void 0),!t.sidebar.opened()&&e.clearHoverProjectSoon()},get children(){return[(()=>{var o=Wme();return K(o,d(Kt,{name:"new-session",size:"small",class:"text-icon-weak"})),o})(),(()=>{var o=Gme();return K(o,r),o})()]}});return(()=>{var o=YKt();return K(o,d(ve,{get when(){return!i()},get fallback(){return d(Ua,{get placement(){return e.mobile?"bottom":"right"},value:r,gutter:10,class:"min-w-0 w-full",children:a})},children:a})),o})()},aXt=e=>{const t=Array.from({length:e.count??4},(n,r)=>r);return(()=>{var n=QKt();return K(n,d(Qt,{each:t,children:()=>eXt()})),n})()};var oXt=ie('<div class="bg-background-base rounded-md px-2 py-1 text-14-medium text-text-strong">'),sXt=ie('<div class="flex items-center gap-1 min-w-0 flex-1"><div class="flex items-center justify-center shrink-0 size-6"></div><span class="text-14-medium text-text-base shrink-0"> :</span><div class="flex items-center justify-center shrink-0 overflow-hidden w-0 opacity-0 transition-all duration-200 group-hover/workspace:w-3.5 group-hover/workspace:opacity-100 group-focus-within/workspace:w-3.5 group-focus-within/workspace:opacity-100">'),lXt=ie('<span class="text-14-medium text-text-base min-w-0 truncate">'),cXt=ie('<div class="absolute right-1 top-1/2 -translate-y-1/2 flex items-center gap-0.5 transition-opacity">'),dXt=ie('<div class="shrink-0 size-6 flex items-center justify-center">'),uXt=ie('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">Trellis Board'),hXt=ie('<div class="relative w-full py-1">'),fXt=ie('<nav class="flex flex-col gap-1">'),Dne=ie("<div>"),pXt=ie('<div class=py-1><div class="group/workspace relative"data-component=workspace-item><div class="flex items-center gap-1">'),mXt=ie('<div class="size-full flex flex-col py-2 overflow-y-auto no-scrollbar [overflow-anchor:none]">');const gXt=e=>{const t=ha(),n=xr(),r=Z(()=>{const i=e.sidebarProject();if(!i)return;const a=e.activeWorkspace();if(!a)return;const[o]=t.child(a,{bootstrap:!1}),s=a===i.worktree?n.t("workspace.type.local"):n.t("workspace.type.sandbox"),l=e.workspaceLabel(a,o.vcs?.branch,i.id);return`${s} : ${l}`});return d(ve,{get when(){return r()},children:i=>(()=>{var a=oXt();return K(a,i),a})()})},yXt=e=>(()=>{var t=sXt(),n=t.firstChild,r=n.nextSibling,i=r.firstChild,a=r.nextSibling;return K(n,d(ve,{get when(){return e.busy()},get fallback(){return d(Kt,{name:"branch",size:"small"})},get children(){return d(P2,{class:"size-[15px]"})}})),K(r,(()=>{var o=kt(()=>!!e.local());return()=>o()?e.language.t("workspace.type.local"):e.language.t("workspace.type.sandbox")})(),i),K(t,d(ve,{get when(){return!e.local()},get fallback(){return(()=>{var o=lXt();return K(o,()=>e.branch()??Gn(e.directory)),o})()},get children(){return d(e.InlineEditor,{get id(){return`workspace:${e.directory}`},get value(){return e.workspaceValue},onSave:o=>{const s=o.trim();s&&(e.renameWorkspace(e.directory,s,e.projectId,e.branch()),e.setEditor("value",e.workspaceValue()))},class:"text-14-medium text-text-base min-w-0 truncate",displayClass:"text-14-medium text-text-base min-w-0 truncate",get editing(){return e.workspaceEditActive()},stopPropagation:!1,openOnDblClick:!1})}}),a),K(a,d(Kt,{get name(){return e.open()?"chevron-down":"chevron-right"},size:"small",class:"text-icon-base"})),t})(),vXt=e=>(()=>{var t=cXt();return K(t,d(Mt,{get modal(){return!e.sidebarHovering()},get open(){return e.menuOpen()},onOpenChange:n=>e.setMenuOpen(n),get children(){return[d(Ua,{get value(){return e.language.t("common.moreOptions")},placement:"top",get children(){return d(Mt.Trigger,{as:Sr,icon:"dot-grid",variant:"ghost",class:"size-6 rounded-md","data-action":"workspace-menu",get"data-workspace"(){return St(e.directory)},get"aria-label"(){return e.language.t("common.moreOptions")}})}}),d(Mt.Portal,{get children(){return d(Mt.Content,{onCloseAutoFocus:n=>{e.pendingRename()&&(n.preventDefault(),e.setPendingRename(!1),e.openEditor(`workspace:${e.directory}`,e.workspaceValue()))},get children(){return[d(Mt.Item,{get disabled(){return e.local()},onSelect:()=>{e.setPendingRename(!0),e.setMenuOpen(!1)},get children(){return d(Mt.ItemLabel,{get children(){return e.language.t("common.rename")}})}}),d(Mt.Item,{get disabled(){return e.local()||e.busy()},onSelect:()=>e.showResetWorkspaceDialog(e.root,e.directory),get children(){return d(Mt.ItemLabel,{get children(){return e.language.t("common.reset")}})}}),d(Mt.Item,{get disabled(){return e.local()||e.busy()},onSelect:()=>e.showDeleteWorkspaceDialog(e.root,e.directory),get children(){return d(Mt.ItemLabel,{get children(){return e.language.t("common.delete")}})}})]}})}})]}}),null),K(t,d(ve,{get when(){return!e.touch()},get children(){return d(Ua,{get value(){return e.language.t("command.session.new")},placement:"top",get children(){return d(Sr,{icon:"new-session",variant:"ghost",class:"size-6 rounded-md opacity-0 pointer-events-none group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto","data-action":"workspace-new-session",get"data-workspace"(){return St(e.directory)},get"aria-label"(){return e.language.t("command.session.new")},onClick:n=>{n.preventDefault(),n.stopPropagation(),e.setHoverSession(void 0),e.clearHoverProjectSoon(),e.navigateToNewSession()}})}})}}),null),Qe(n=>hr(t,{"opacity-100 pointer-events-auto":e.menuOpen(),"opacity-0 pointer-events-none":!e.menuOpen(),"group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto":!0,"group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto":!0},n)),t})(),Zme=e=>(()=>{var t=fXt();return K(t,d(oG,{get href(){return`/${e.slug()}/trellis`},class:"flex items-center gap-1 min-w-0 w-full text-left py-1 rounded-md px-2 pr-3 hover:bg-surface-raised-base-hover [&.active]:bg-surface-base-active",onClick:()=>{e.ctx.setHoverSession(void 0),e.ctx.clearHoverProjectSoon()},get children(){return[(()=>{var n=dXt();return K(n,d(Kt,{name:"checklist",size:"small",class:"text-icon-weak"})),n})(),uXt()]}}),null),K(t,d(ve,{get when(){return e.showNew()},get children(){return d(iXt,{get slug(){return e.slug()},get mobile(){return e.mobile},get sidebarExpanded(){return e.ctx.sidebarExpanded},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},get setHoverSession(){return e.ctx.setHoverSession}})}}),null),K(t,d(ve,{get when(){return e.loading()},get children(){return d(aXt,{})}}),null),K(t,d(Qt,{get each(){return e.sessions()},children:n=>d(PU,{session:n,get list(){return e.sessions()},get navList(){return e.ctx.navList},get slug(){return e.slug()},get mobile(){return e.mobile},get popover(){return e.popover},get children(){return e.children()},get sidebarExpanded(){return e.ctx.sidebarExpanded},get sidebarHovering(){return e.ctx.sidebarHovering},get nav(){return e.ctx.nav},get hoverSession(){return e.ctx.hoverSession},get setHoverSession(){return e.ctx.setHoverSession},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},get prefetchSession(){return e.ctx.prefetchSession},get archiveSession(){return e.ctx.archiveSession}})}),null),K(t,d(ve,{get when(){return e.hasMore()},get children(){var n=hXt();return K(n,d(Mn,{variant:"ghost",class:"flex w-full text-left justify-start text-14-regular text-text-weak pl-9 pr-10",size:"large",onClick:r=>{e.loadMore(),r.currentTarget.blur()},get children(){return e.language.t("common.loadMore")}})),n}}),null),t})(),kXt=e=>{const t=ll(),n=di(),r=ha(),i=xr(),a=Lme(e.directory),[o,s]=r.child(e.directory,{bootstrap:!1}),[l,c]=nt({open:!1,pendingRename:!1}),u=Z(()=>St(e.directory)),h=Z(()=>H2(o,e.sortNow())),m=Z(()=>tq(o.session)),g=Z(()=>e.directory===e.project.worktree),y=Z(()=>tt(e.ctx.currentDir())===tt(e.directory)),v=Z(()=>{const E=o.vcs?.branch,T=E??Gn(e.directory);return e.ctx.workspaceName(e.directory,e.project.id,E)??T}),k=Z(()=>e.ctx.workspaceExpanded(e.directory,g())),b=Z(()=>k()||y()),x=Z(E=>E||o.status==="complete",!1),w=Z(()=>h()?.length??0),M=Z(()=>o.sessionTotal>w()),_=Z(()=>e.ctx.isBusy(e.directory)),C=Z(E=>E||_(),!1),L=Z(()=>k()&&!x()&&w()===0&&!C()),S=OU("(hover: none)"),I=Z(()=>!L()&&(S()||w()===0||y()&&!n.id)),A=async()=>{s("limit",E=>(E??0)+5),await r.project.loadSessions(e.directory)},D=Z(()=>e.ctx.editorOpen(`workspace:${e.directory}`)),P=()=>d(yXt,{local:g,busy:_,open:k,get directory(){return e.directory},language:i,branch:()=>o.vcs?.branch,workspaceValue:v,workspaceEditActive:D,get InlineEditor(){return e.ctx.InlineEditor},get renameWorkspace(){return e.ctx.renameWorkspace},get setEditor(){return e.ctx.setEditor},get projectId(){return e.project.id}}),O=E=>{e.ctx.setWorkspaceExpanded(e.directory,E),!E&&e.ctx.editorOpen(`workspace:${e.directory}`)&&e.ctx.closeEditor()};return fe(()=>{b()&&r.child(e.directory,{bootstrap:!0})}),(()=>{var E=Dne();return Hr(a,E,()=>!0),K(E,d(iV,{variant:"ghost",get open(){return k()},class:"shrink-0",onOpenChange:O,get children(){return[(()=>{var T=pXt(),R=T.firstChild,H=R.firstChild;return K(H,d(ve,{get when(){return D()},get fallback(){return d(iV.Trigger,{get class(){return`flex items-center justify-between w-full pl-2 py-1.5 rounded-md hover:bg-surface-raised-base-hover transition-[padding] duration-200 ${l.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`},"data-action":"workspace-toggle",get"data-workspace"(){return St(e.directory)},get children(){return P()}})},get children(){var J=Dne();return K(J,P),Qe(()=>U2(J,`flex items-center justify-between w-full pl-2 py-1.5 rounded-md transition-[padding] duration-200 ${l.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`)),J}}),null),K(H,d(vXt,{get directory(){return e.directory},local:g,busy:_,menuOpen:()=>l.open,pendingRename:()=>l.pendingRename,setMenuOpen:J=>c("open",J),setPendingRename:J=>c("pendingRename",J),get sidebarHovering(){return e.ctx.sidebarHovering},touch:S,language:i,workspaceValue:v,get openEditor(){return e.ctx.openEditor},get showResetWorkspaceDialog(){return e.ctx.showResetWorkspaceDialog},get showDeleteWorkspaceDialog(){return e.ctx.showDeleteWorkspaceDialog},get root(){return e.project.worktree},get setHoverSession(){return e.ctx.setHoverSession},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},navigateToNewSession:()=>t(`/${u()}/session?new=1`)}),null),Qe(()=>wt(R,"data-workspace",St(e.directory))),T})(),d(iV.Content,{get children(){return d(Zme,{slug:u,get mobile(){return e.mobile},get popover(){return e.popover},get ctx(){return e.ctx},showNew:I,loading:L,sessions:h,children:m,hasMore:M,loadMore:A,language:i})}})]}})),Qe(T=>hr(E,{"opacity-30":a.isActiveDraggable,"opacity-50 pointer-events-none":_()},T)),E})()},bXt=e=>{const t=ha(),n=xr(),r=Z(()=>{const[m,g]=t.child(e.project.worktree);return{store:m,setStore:g}}),i=Z(()=>St(e.project.worktree)),a=Z(()=>H2(r().store,e.sortNow())),o=Z(()=>tq(r().store.session)),s=Z(m=>m||r().store.status==="complete",!1),l=Z(()=>a()?.length??0),c=Z(()=>!s()&&l()===0),u=Z(()=>r().store.sessionTotal>l()),h=async()=>{r().setStore("limit",m=>(m??0)+5),await t.project.loadSessions(e.project.worktree)};return(()=>{var m=mXt();return Hr(g=>e.ctx.setScrollContainerRef(g,e.mobile),m),K(m,d(Zme,{slug:i,get mobile(){return e.mobile},get popover(){return e.popover},get ctx(){return e.ctx},showNew:()=>!1,loading:c,sessions:a,children:o,hasMore:u,loadMore:h,language:n})),m})()};var wXt={};Ga(wXt,{Arrow:()=>vs,CheckboxItem:()=>Rj,Content:()=>Kme,ContextMenu:()=>tr,Group:()=>Im,GroupLabel:()=>zj,Icon:()=>qj,Item:()=>jj,ItemDescription:()=>Hj,ItemIndicator:()=>Fj,ItemLabel:()=>Vj,Portal:()=>Bj,RadioGroup:()=>Uj,RadioItem:()=>Wj,Root:()=>Yme,Separator:()=>Ff,Sub:()=>Gj,SubContent:()=>Zj,SubTrigger:()=>Kj,Trigger:()=>Qme,useContextMenuContext:()=>Jme});function Kme(e){const t=fa(),[n,r]=Me(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return d(fme,f({onCloseAutoFocus:s=>{n.onCloseAutoFocus?.(s),!s.defaultPrevented&&i&&s.preventDefault(),i=!1},onInteractOutside:s=>{n.onInteractOutside?.(s),!s.defaultPrevented&&!t.isModal()&&(i=!0)}},r))}var Xme=Tt();function xXt(){return Lt(Xme)}function Jme(){const e=xXt();if(e===void 0)throw new Error("[kobalte]: `useContextMenuContext` must be used within a `ContextMenu` component");return e}function Yme(e){const t=`contextmenu-${wr()}`,{direction:n}=gs(),r=ft({id:t,placement:n()==="rtl"?"left-start":"right-start",gutter:2,shift:2},e),[i,a]=Me(r,["onOpenChange"]),[o,s]=Ce({x:0,y:0}),l=x0({defaultOpen:!1,onOpenChange:u=>i.onOpenChange?.(u)}),c={setAnchorRect:s};return d(Xme.Provider,{value:c,get children(){return d(yme,f({get open(){return l.isOpen()},get onOpenChange(){return l.setIsOpen},getAnchorRect:o},a))}})}function Qme(e){const t=fa(),n=Po(),r=Jme(),i=ft({id:t.generateId("trigger")},e),[a,o]=Me(i,["ref","style","disabled","onContextMenu","onPointerDown","onPointerMove","onPointerCancel","onPointerUp"]);let s=0;const l=()=>{window.clearTimeout(s)};me(()=>{l()});const c=v=>{if(a.disabled){dt(v,a.onContextMenu);return}l(),v.preventDefault(),v.stopPropagation(),r.setAnchorRect({x:v.clientX,y:v.clientY}),n.isOpen()?n.focusContent():n.open(!0)},u=v=>v.pointerType==="touch"||v.pointerType==="pen";return d(zt,f({as:"div",ref(v){var k=hn(n.setTriggerRef,a.ref);typeof k=="function"&&k(v)},get style(){return Wa({"-webkit-touch-callout":"none"},a.style)},get"data-disabled"(){return a.disabled?"":void 0},onContextMenu:c,onPointerDown:v=>{dt(v,a.onPointerDown),!a.disabled&&u(v)&&(l(),r.setAnchorRect({x:v.clientX,y:v.clientY}),s=window.setTimeout(()=>n.open(!1),700))},onPointerMove:v=>{dt(v,a.onPointerMove),!a.disabled&&u(v)&&l()},onPointerCancel:v=>{dt(v,a.onPointerCancel),!a.disabled&&u(v)&&l()},onPointerUp:v=>{dt(v,a.onPointerUp),!a.disabled&&u(v)&&l()}},()=>n.dataset(),o))}var tr=Object.assign(Yme,{Arrow:vs,CheckboxItem:Rj,Content:Kme,Group:Im,GroupLabel:zj,Icon:qj,Item:jj,ItemDescription:Hj,ItemIndicator:Fj,ItemLabel:Vj,Portal:Bj,RadioGroup:Uj,RadioItem:Wj,Separator:Ff,Sub:Gj,SubContent:Zj,SubTrigger:Kj,Trigger:Qme});function _Xt(e){return d(tr,f(e,{"data-component":"context-menu"}))}function MXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.Trigger,f(n,{"data-slot":"context-menu-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function SXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.Icon,f(n,{"data-slot":"context-menu-icon",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function CXt(e){return d(tr.Portal,e)}function LXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.Content,f(n,{"data-component":"context-menu-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function IXt(e){const[t,n]=Me(e,["class","classList"]);return d(tr.Arrow,f(n,{"data-slot":"context-menu-arrow",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function NXt(e){const[t,n]=Me(e,["class","classList"]);return d(tr.Separator,f(n,{"data-slot":"context-menu-separator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function AXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.Group,f(n,{"data-slot":"context-menu-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function $Xt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.GroupLabel,f(n,{"data-slot":"context-menu-group-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function TXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.Item,f(n,{"data-slot":"context-menu-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function EXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.ItemLabel,f(n,{"data-slot":"context-menu-item-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function PXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.ItemDescription,f(n,{"data-slot":"context-menu-item-description",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function DXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.ItemIndicator,f(n,{"data-slot":"context-menu-item-indicator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function OXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.RadioGroup,f(n,{"data-slot":"context-menu-radio-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function RXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.RadioItem,f(n,{"data-slot":"context-menu-radio-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function zXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.CheckboxItem,f(n,{"data-slot":"context-menu-checkbox-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function qXt(e){return d(tr.Sub,e)}function jXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.SubTrigger,f(n,{"data-slot":"context-menu-sub-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function HXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.SubContent,f(n,{"data-component":"context-menu-sub-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}const Li=Object.assign(_Xt,{Trigger:MXt,Icon:SXt,Portal:CXt,Content:LXt,Arrow:IXt,Separator:NXt,Group:AXt,GroupLabel:$Xt,Item:TXt,ItemLabel:EXt,ItemDescription:PXt,ItemIndicator:DXt,RadioGroup:OXt,RadioItem:RXt,CheckboxItem:zXt,Sub:qXt,SubTrigger:jXt,SubContent:HXt});var FXt=ie('<div class="bg-background-base rounded-xl p-1">'),VXt=ie('<div class="-m-3 p-2 flex flex-col w-72"><div class="px-4 pt-2 pb-1 flex items-center gap-2"><div class="text-14-medium text-text-strong truncate grow"></div></div><div class="px-4 pb-2 text-12-medium text-text-weak"></div><div class="px-2 pb-2 flex flex-col gap-2"></div><div class="px-2 py-2 border-t border-border-weak-base">'),BXt=ie('<div class="flex flex-col gap-1"><div class="px-2 py-0.5 flex items-center gap-1 min-w-0"><div class="shrink-0 size-6 flex items-center justify-center"></div><span class="truncate text-14-medium text-text-base">'),UXt=ie("<div>");const WXt=e=>{const t=Z(()=>e.projects().find(n=>n.worktree===e.activeProject()));return d(ve,{get when(){return t()},children:n=>(()=>{var r=FXt();return K(r,d(eX,{get project(){return n()}})),r})()})},GXt=e=>{const t=Lj(),n=If(),r=Z(()=>e.dirs().reduce((a,o)=>a+t.project.unseenCount(o),0)),i=()=>e.dirs().filter(a=>t.project.unseenCount(a)>0).forEach(a=>t.project.markViewed(a));return d(Li,{get modal(){return!e.sidebarHovering()},onOpenChange:a=>{e.setMenu(a),e.setSuppressHover(a),a&&e.setOpen(!1)},get children(){return[d(Li.Trigger,{as:"button",type:"button",get"aria-label"(){return JK(e.project)},"data-action":"project-switch",get"data-project"(){return St(e.project.worktree)},get classList(){return{"flex items-center justify-center size-10 p-1 rounded-lg overflow-hidden transition-colors cursor-default":!0,"bg-transparent border-2 border-icon-strong-base hover:bg-surface-base-hover":e.selected(),"bg-transparent border border-transparent hover:bg-surface-base-hover hover:border-border-weak-base":!e.selected()&&!e.active(),"bg-surface-base-hover border border-border-weak-base":!e.selected()&&e.active()}},onPointerDown:a=>{if(a.button===0&&!a.ctrlKey){e.setOpen(!1),e.setSuppressHover(!0);return}e.overlay()&&(a.button!==2&&!(a.button===0&&a.ctrlKey)||(e.setOpen(!1),e.setSuppressHover(!0),a.preventDefault()))},onMouseEnter:a=>{e.overlay()&&(e.suppressHover()||e.onProjectMouseEnter(e.project.worktree,a))},onMouseLeave:()=>{e.suppressHover()&&e.setSuppressHover(!1),e.overlay()&&e.onProjectMouseLeave(e.project.worktree)},onFocus:()=>{e.overlay()&&(e.suppressHover()||e.onProjectFocus(e.project.worktree))},onClick:()=>{if(e.setOpen(!1),e.selected()){n.sidebar.toggle();return}e.navigateToProject(e.project.worktree)},onBlur:()=>e.setOpen(!1),get children(){return d(eX,{get project(){return e.project},notify:!0})}}),d(Li.Portal,{get children(){return d(Li.Content,{get children(){return[d(Li.Item,{onSelect:()=>e.showEditProjectDialog(e.project),get children(){return d(Li.ItemLabel,{get children(){return e.language.t("common.edit")}})}}),d(Li.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return St(e.project.worktree)},get disabled(){return kt(()=>e.project.vcs!=="git")()&&!e.workspacesEnabled(e.project)},onSelect:()=>e.toggleProjectWorkspaces(e.project),get children(){return d(Li.ItemLabel,{get children(){return kt(()=>!!e.workspacesEnabled(e.project))()?e.language.t("sidebar.workspaces.disable"):e.language.t("sidebar.workspaces.enable")}})}}),d(Li.Item,{"data-action":"project-clear-notifications",get"data-project"(){return St(e.project.worktree)},get disabled(){return r()===0},onSelect:i,get children(){return d(Li.ItemLabel,{get children(){return e.language.t("sidebar.project.clearNotifications")}})}}),d(Li.Separator,{}),d(Li.Item,{"data-action":"project-close-menu",get"data-project"(){return St(e.project.worktree)},onSelect:()=>e.closeProject(e.project.worktree),get children(){return d(Li.ItemLabel,{get children(){return e.language.t("common.close")}})}})]}})}})]}})},ZXt=e=>(()=>{var t=VXt(),n=t.firstChild,r=n.firstChild,i=n.nextSibling,a=i.nextSibling,o=a.nextSibling;return K(r,()=>JK(e.project)),K(i,()=>e.language.t("sidebar.project.recentSessions")),K(a,d(ve,{get when(){return e.workspaceEnabled()},get fallback(){return d(Qt,{get each(){return e.projectSessions().slice(0,2)},children:s=>d(PU,f(()=>e.ctx.sessionProps,{session:s,get list(){return e.projectSessions()},get slug(){return St(e.project.worktree)},dense:!0,get mobile(){return e.mobile},popover:!1,get children(){return e.projectChildren()}}))})},get children(){return d(Qt,{get each(){return e.workspaces()},children:s=>{const l=Z(()=>e.workspaceSessions(s)),c=Z(()=>e.workspaceChildren(s));return(()=>{var u=BXt(),h=u.firstChild,m=h.firstChild,g=m.nextSibling;return K(m,d(Kt,{name:"branch",size:"small",class:"text-icon-base"})),K(g,()=>e.label(s)),K(u,d(Qt,{get each(){return l().slice(0,2)},children:y=>d(PU,f(()=>e.ctx.sessionProps,{session:y,get list(){return l()},get slug(){return St(s)},dense:!0,get mobile(){return e.mobile},popover:!1,get children(){return c()}}))}),null),u})()}})}})),K(o,d(Mn,{variant:"ghost",class:"flex w-full text-left justify-start text-text-base px-2 hover:bg-transparent active:bg-transparent",onClick:()=>{e.ctx.openSidebar(),e.ctx.onHoverOpenChanged(e.project.worktree,!1),!e.selected()&&e.ctx.navigateToProject(e.project.worktree)},get children(){return e.language.t("sidebar.project.viewAllSessions")}})),t})(),KXt=e=>{const t=ha(),n=xr(),r=Lme(e.project.worktree),i=Z(()=>e.ctx.currentProject()?.worktree===e.project.worktree),a=Z(()=>e.ctx.workspaceIds(e.project).slice(0,2)),o=Z(()=>e.ctx.workspacesEnabled(e.project)),s=Z(()=>e.ctx.workspaceIds(e.project)),[l,c]=nt({menu:!1,suppressHover:!1}),u=()=>e.ctx.hoverProject()===e.project.worktree,h=Z(()=>!e.mobile&&e.ctx.sidebarOpened()),m=Z(()=>!e.mobile&&!e.ctx.sidebarOpened()),g=Z(()=>l.menu||(h()||m())&&u()),y=()=>u()&&h()&&!i()&&!l.menu,v=C=>{const[L]=t.child(C,{bootstrap:!1}),S=C===e.project.worktree?n.t("workspace.type.local"):n.t("workspace.type.sandbox"),I=e.ctx.workspaceLabel(C,L.vcs?.branch,e.project.id);return`${S} : ${I}`},k=Z(()=>t.child(e.project.worktree,{bootstrap:!1})[0]),b=Z(()=>H2(k(),e.sortNow())),x=Z(()=>tq(k().session)),w=C=>{const[L]=t.child(C,{bootstrap:!1});return H2(L,e.sortNow())},M=C=>{const[L]=t.child(C,{bootstrap:!1});return tq(L.session)},_=()=>d(GXt,{get project(){return e.project},get mobile(){return e.mobile},get nav(){return e.ctx.nav},get sidebarHovering(){return e.ctx.sidebarHovering},selected:i,active:g,overlay:m,suppressHover:()=>l.suppressHover,dirs:s,get onProjectMouseEnter(){return e.ctx.onProjectMouseEnter},get onProjectMouseLeave(){return e.ctx.onProjectMouseLeave},get onProjectFocus(){return e.ctx.onProjectFocus},get navigateToProject(){return e.ctx.navigateToProject},get showEditProjectDialog(){return e.ctx.showEditProjectDialog},get toggleProjectWorkspaces(){return e.ctx.toggleProjectWorkspaces},get workspacesEnabled(){return e.ctx.workspacesEnabled},get closeProject(){return e.ctx.closeProject},setMenu:C=>c("menu",C),setOpen:C=>e.ctx.onHoverOpenChanged(e.project.worktree,C),setSuppressHover:C=>c("suppressHover",C),language:n});return(()=>{var C=UXt();return Hr(r,C,()=>!0),K(C,d(ve,{get when(){return kt(()=>!!h())()&&!i()},get fallback(){return _()},get children(){return d(Vme,{get open(){return kt(()=>!!(!l.suppressHover&&y()))()&&!l.menu},openDelay:0,closeDelay:0,placement:"right-start",gutter:6,get trigger(){return _()},onOpenChange:L=>{l.menu||L&&l.suppressHover||(e.ctx.onHoverOpenChanged(e.project.worktree,L),L&&e.ctx.setHoverSession(void 0))},get children(){return d(ZXt,{get project(){return e.project},get mobile(){return e.mobile},selected:i,workspaceEnabled:o,workspaces:a,label:v,projectSessions:b,projectChildren:x,workspaceSessions:w,workspaceChildren:M,get ctx(){return e.ctx},language:n})}})}})),Qe(()=>C.classList.toggle("opacity-30",!!r.isActiveDraggable)),C})()};var XXt=ie('<div class="h-full w-full flex flex-col items-center gap-3 px-3 py-3 overflow-y-auto no-scrollbar">'),JXt=ie('<div class="flex h-full w-full min-w-0 overflow-hidden"><div data-component=sidebar-rail class="w-16 shrink-0 bg-background-base flex flex-col items-center overflow-hidden"><div class="flex-1 min-h-0 w-full"></div><div class="shrink-0 w-full pt-3 pb-6 flex flex-col items-center gap-2"></div></div><div>'),YXt=ie('<span class="text-icon-base text-12-medium">'),QXt=ie('<div class="flex items-center gap-2"><span>');const eJt=e=>{const t=Z(()=>!!e.mobile||e.opened()),n=()=>e.mobile?"bottom":"right";let r;return fe(()=>{const i=r;if(i){if(t()){i.removeAttribute("inert");return}i.setAttribute("inert","")}}),(()=>{var i=JXt(),a=i.firstChild,o=a.firstChild,s=o.nextSibling,l=a.nextSibling;return J1(a,"mousemove",e.aimMove,!0),K(o,d(xme,{get onDragStart(){return e.handleDragStart},get onDragEnd(){return e.handleDragEnd},get onDragOver(){return e.handleDragOver},collisionDetector:bme,get children(){return[d(_me,{}),d(Ame,{}),(()=>{var c=XXt();return K(c,d(Cme,{get ids(){return e.projects().map(u=>u.worktree)},get children(){return d(Qt,{get each(){return e.projects()},children:u=>e.renderProject(u)})}}),null),K(c,d(Ua,{get placement(){return n()},get value(){return(()=>{var u=QXt(),h=u.firstChild;return K(h,()=>e.openProjectLabel),K(u,d(ve,{get when(){return kt(()=>!e.mobile)()&&!!e.openProjectKeybind()},get children(){var m=YXt();return K(m,()=>e.openProjectKeybind()),m}}),null),u})()},get children(){return d(Sr,{icon:"plus",variant:"ghost",size:"large",get onClick(){return e.onOpenProject},get"aria-label"(){return kt(()=>typeof e.openProjectLabel=="string")()?e.openProjectLabel:void 0}})}}),null),c})(),d(Mme,{get children(){return e.renderProjectOverlay()}})]}})),K(s,d(J2e,{get placement(){return n()},get title(){return e.settingsLabel()},get keybind(){return e.settingsKeybind()??""},get children(){return d(Sr,{icon:"settings-gear",variant:"ghost",size:"large",get onClick(){return e.onOpenSettings},get"aria-label"(){return e.settingsLabel()}})}}),null),K(s,d(Ua,{get placement(){return n()},get value(){return e.helpLabel()},get children(){return d(Sr,{icon:"help",variant:"ghost",size:"large",get onClick(){return e.onOpenHelp},get"aria-label"(){return e.helpLabel()}})}}),null),Hr(c=>{r=c},l),K(l,()=>e.renderPanel()),Qe(c=>{var u={"flex-1 flex h-full min-h-0 min-w-0 overflow-hidden":!0,"pointer-events-none":!t()},h=!t();return c.e=hr(l,u,c.e),h!==c.t&&wt(l,"aria-hidden",c.t=h),c},{e:void 0,t:void 0}),i})()};li(["mousemove"]);var tJt=ie('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div><div class="flex justify-end gap-2">'),nJt=ie('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"> <!> </span></div><div class="flex justify-end gap-2">'),rJt=ie('<span class="text-12-regular text-text-base truncate select-text">'),iJt=ie('<div class="shrink-0 pl-1 py-1"><div class="group/project flex items-start justify-between gap-2 py-2 pl-2 pr-0"><div class="flex flex-col min-w-0">'),One=ie('<div class="shrink-0 py-4">'),aJt=ie('<div class="relative flex-1 min-h-0"><div class="size-full flex flex-col py-2 gap-4 overflow-y-auto no-scrollbar [overflow-anchor:none]">'),oJt=ie('<div class="flex-1 min-h-0 flex flex-col">'),sJt=ie('<div><div class="shrink-0 px-3 py-3"><div class="rounded-xl bg-background-base shadow-xs-border-base"data-component=getting-started><div class="p-3 flex flex-col gap-6"><div class="flex flex-col gap-2"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div></div><div data-component=getting-started-actions>'),lJt=ie('<div class="flex-1 min-h-0 -mt-4 flex items-center justify-center px-6 pb-64 text-center"><div class="mt-8 flex max-w-60 flex-col items-center gap-6 text-center"><div class="flex flex-col gap-3"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)>'),cJt=ie('<div class="flex-1 min-h-0">'),dJt=ie('<div class=" hidden w-12 shrink-0 bg-background-base flex flex-col items-center py-2 gap-2 z-20"><div class="flex-1 w-full flex flex-col items-center gap-1 overflow-y-auto no-scrollbar"><button type=button class="flex items-center justify-center size-9 p-1 rounded-md transition-colors hover:bg-surface-base-hover"></button></div><div class="shrink-0 w-full flex flex-col items-center gap-1 pb-2"><button type=button class="flex items-center justify-center size-9 p-1 rounded-md transition-colors hover:bg-surface-base-hover">'),Rne=ie("<div class=size-full>"),uJt=ie('<div class="relative bg-background-base flex-1 min-h-0 min-w-0 flex flex-col select-none [&_input]:select-text [&_textarea]:select-text [&_[contenteditable]]:select-text"><div class="flex-1 min-h-0 min-w-0 flex overflow-hidden"><div class="flex-1 min-h-0 relative"><div class="size-full relative overflow-x-hidden"><div class=xl:hidden><div></div><nav data-component=sidebar-nav-mobile></nav></div><div><main>'),hJt=ie('<button type=button class="flex items-center justify-center size-9 p-0.5 rounded-md transition-colors">');function fJt(e){const[t,n,,r]=Yn(In.global("layout.page",["layout.page.v1"]),nt({lastProjectSession:{},activeProject:void 0,activeWorkspace:void 0,workspaceOrder:{},workspaceName:{},workspaceBranchName:{},workspaceExpanded:{},gettingStartedDismissed:!1,activityBarVisible:!0,statusBarVisible:!0,minimapVisible:!1,panelMaximized:!1,panelPosition:"bottom",panelAlignment:"center"})),i=Z(()=>r());let a,o=0,s=!1;const l=di(),c=E0(),u=ha(),h=If(),m=Z(()=>h.ready()),g=ms(),y=om(),v=T0(),k=Lj(),b=gK(),x=ll();DZt(x);const w=mK(),M=lf(),_=Cce(),C=cle(),L=xr(),S=xo(l.dir),I=Z(()=>{const B=l.dir;if(!B)return{slug:B,dir:""};const F=xo(B);return F?{slug:B,dir:u.peek(F,{bootstrap:!1})[0].path.directory||F}:{slug:B,dir:""}}),A=Z(()=>C.ids().map(B=>[B,C.themes()[B]])),D=["system","light","dark"],P={system:"theme.scheme.system",light:"theme.scheme.light",dark:"theme.scheme.dark"},O=B=>L.t(P[B]),E=Z(()=>I().dir),[T,R]=nt({autoselect:!S,busyWorkspaces:{},hoverSession:void 0,hoverProject:void 0,scrollSessionKey:void 0,nav:void 0,sortNow:Date.now(),sizing:!1,peek:void 0,peeked:!1}),H=fKt(),J=(B,F)=>{const re=tt(B);if(F){R("busyWorkspaces",re,!0);return}R("busyWorkspaces",Ye(pe=>{delete pe[re]}))},j=B=>!!T.busyWorkspaces[tt(B)],X=()=>T.sortNow;let W;const G=setTimeout(()=>{R("sortNow",Date.now()),W=setInterval(()=>R("sortNow",Date.now()),6e4)},6e4-Date.now()%6e4),Y=PZt({enabled:()=>!h.sidebar.opened(),active:()=>T.hoverProject,el:()=>T.nav?.querySelector("[data-component='sidebar-rail']")??T.nav,onActivate:B=>{u.child(B),R("hoverProject",B),R("hoverSession",void 0)}});me(()=>{s=!0,o+=1,clearTimeout(G),W&&clearInterval(W),Ee!==void 0&&clearTimeout(Ee),Y.reset()}),dn(()=>{const B=()=>R("sizing",!1),F=()=>Se(),re=()=>{document.visibilityState==="hidden"&&Se()};window.addEventListener("pointerup",B),window.addEventListener("pointercancel",B),window.addEventListener("blur",B),window.addEventListener("blur",F),document.addEventListener("visibilitychange",re),me(()=>{window.removeEventListener("pointerup",B),window.removeEventListener("pointercancel",B),window.removeEventListener("blur",B),window.removeEventListener("blur",F),document.removeEventListener("visibilitychange",re)})});const oe=Z(()=>!h.sidebar.opened()&&T.hoverProject!==void 0),ue=Z(()=>h.sidebar.opened()||oe()),ye=B=>{R("hoverProject",B),Y.reset()},de=()=>queueMicrotask(()=>ye(void 0)),le=B=>R("hoverSession",B),Se=()=>{R("hoverSession",void 0),ye(void 0)};let Ee;const He=Z(()=>{const B=T.hoverProject;if(B)return h.projects.list().find(F=>F.worktree===B)});Z(()=>{const B=T.peek;if(B)return h.projects.list().find(F=>F.worktree===B)}),fe(()=>{const B=He();if(B){Ee!==void 0&&(clearTimeout(Ee),Ee=void 0),R("peek",B.worktree),R("peeked",!0);return}R("peeked",!1),T.peek!==void 0&&(Ee!==void 0&&clearTimeout(Ee),Ee=window.setTimeout(()=>{Ee=void 0,R("peek",void 0)},180))}),fe(()=>{h.sidebar.opened()&&ye(void 0)}),fe(()=>{if(!T.autoselect)return;const B=l.dir;!B||!xo(B)||R("autoselect",!1)});const _t=H.editorOpen,Ue=H.openEditor,V=H.closeEditor,Fe=H.setEditor,Re=H.InlineEditor,At=()=>{h.sidebar.opened()||Se()},De=B=>{At(),x(B),h.mobileSidebar.hide()};function Nt(B=1){const F=A().map(([ge])=>ge);if(F.length===0)return;const re=F.indexOf(C.themeId()),pe=re===-1?0:(re+B+F.length)%F.length,xe=F[pe];C.setTheme(xe),lr({title:L.t("toast.theme.title"),description:C.name(xe)})}function jn(B=1){const F=C.colorScheme(),re=D.indexOf(F),pe=re===-1?0:(re+B+D.length)%D.length,xe=D[pe];C.setColorScheme(xe),lr({title:L.t("toast.scheme.title"),description:O(xe)})}function ui(B){B!==L.locale()&&(L.setLocale(B),lr({title:L.t("toast.language.title"),description:L.t("toast.language.description",{language:L.label(B)})}))}function _r(B=1){const F=L.locales,re=F.indexOf(L.locale()),pe=re===-1?0:(re+B+F.length)%F.length,xe=F[pe];xe&&ui(xe)}function hi(B){const F=y.appearance.fontSize();y.appearance.setFontSize(Math.max(8,Math.min(72,F+B)))}function yn(){y.appearance.setFontSize(14)}const Hn=()=>dn(()=>{if(!g.checkUpdate||!g.update||!g.restart)return;let B,F;const re=()=>g.checkUpdate().then(({updateAvailable:pe,version:xe})=>{pe&&B===void 0&&(B=lr({persistent:!0,icon:"download",title:L.t("toast.update.title"),description:L.t("toast.update.description",{version:xe??""}),actions:[{label:L.t("toast.update.action.installRestart"),onClick:async()=>{await g.update(),await g.restart()}},{label:L.t("toast.update.action.notYet"),onClick:"dismiss"}]}))});fe(()=>{if(y.ready()){if(!y.updates.startup()){if(F===void 0)return;clearInterval(F),F=void 0;return}F===void 0&&(re(),F=setInterval(re,600*1e3))}}),me(()=>{F!==void 0&&clearInterval(F)})}),en=()=>dn(()=>{const B=new Map,F=new Map,re=5e3,pe=ge=>{const qe=B.get(ge);qe!==void 0&&(Kh.dismiss(qe),B.delete(ge),F.delete(ge))},xe=c.event.listen(ge=>{if(ge.details?.type==="worktree.ready"){J(ge.name,!1),Jg.ready(ge.name);return}if(ge.details?.type==="worktree.failed"){J(ge.name,!1),Jg.failed(ge.name,ge.details.properties?.message??L.t("common.requestFailed"));return}if(ge.details?.type==="question.replied"||ge.details?.type==="question.rejected"||ge.details?.type==="permission.replied"){const q0=ge.details.properties,qm=`${ge.name}:${q0.sessionID}`;pe(qm);return}if(ge.details?.type!=="permission.asked"&&ge.details?.type!=="question.asked")return;const qe=ge.details.type==="permission.asked"?L.t("notification.permission.title"):L.t("notification.question.title"),Be=ge.details.type==="permission.asked"?"checklist":"bubble-5",Je=ge.name,je=ge.details.properties;if(ge.details.type==="permission.asked"&&b.autoResponds(ge.details.properties,Je))return;const[Ke]=u.child(Je,{bootstrap:!1}),qt=Ke.session.find(q0=>q0.id===je.sessionID),nn=`${Je}:${je.sessionID}`,Xt=qt?.title??L.t("command.session.new"),on=Gn(Je),Rt=ge.details.type==="permission.asked"?L.t("notification.permission.description",{sessionTitle:Xt,projectName:on}):L.t("notification.question.description",{sessionTitle:Xt,projectName:on}),mt=`/${St(Je)}/session/${je.sessionID}`,Lr=Date.now(),Do=F.get(nn)??0;if(Lr-Do<re)return;F.set(nn,Lr),ge.details.type==="permission.asked"&&(y.sounds.permissionsEnabled()&&nU(y.sounds.permissions()),y.notifications.permissions()&&g.notify(qe,Rt,mt)),ge.details.type==="question.asked"&&y.notifications.agent()&&g.notify(qe,Rt,mt);const yl=l.id;if(tt(Je)===tt(E())&&je.sessionID===yl||tt(Je)===tt(E())&&qt?.parentID===yl)return;pe(nn);const zm=lr({persistent:!0,icon:Be,title:qe,description:Rt,actions:[{label:L.t("notification.action.goToSession"),onClick:()=>x(mt)},{label:L.t("common.dismiss"),onClick:"dismiss"}]});B.set(nn,zm)});me(xe),fe(()=>{const ge=l.id;if(!E()||!ge)return;const qe=`${E()}:${ge}`;pe(qe);const[Be]=u.child(E(),{bootstrap:!1}),Je=Be.session.filter(je=>je.parentID===ge);for(const je of Je)pe(`${E()}:${je.id}`)})});Hn(),en();function tn(B,F){if(!a||T.scrollSessionKey===F)return;const re=a.querySelector(`[data-session-id="${B}"]`);if(!re)return;const pe=a.getBoundingClientRect(),xe=re.getBoundingClientRect();if(xe.top>=pe.top&&xe.bottom<=pe.bottom){R("scrollSessionKey",F);return}R("scrollSessionKey",F),re.scrollIntoView({block:"nearest",behavior:"smooth"})}const Vt=Z(()=>{const B=E();if(!B)return;const F=tt(B),re=h.projects.list(),pe=re.find(je=>je.sandboxes?.some(Ke=>tt(Ke)===F));if(pe)return pe;const xe=re.find(je=>tt(je.worktree)===F);if(xe)return xe;const[ge]=u.child(B,{bootstrap:!1}),qe=ge.project;if(!qe)return;const Je=u.data.project.find(je=>je.id===qe)?.worktree;if(Je)return re.find(je=>je.worktree===Je)}),[Ya]=Jr(async()=>{if(await r.promise,await h.ready.promise,!lt(()=>T.autoselect))return;const B=h.projects.list(),F=v.projects.last();if(B.length===0){if(!F)return;await We(F,!0)}else{const re=B.find(pe=>pe.worktree===F)??B[0];if(!re)return;await We(re.worktree,!0)}}),pa=(B,F,re)=>{const pe=tt(B),xe=t.workspaceName[pe]??t.workspaceName[B];if(xe)return xe;if(F&&re)return t.workspaceBranchName[F]?.[re]},Br=(B,F,re,pe)=>{const xe=tt(B);n("workspaceName",xe,F),re&&pe&&(t.workspaceBranchName[re]||n("workspaceBranchName",re,{}),n("workspaceBranchName",re,pe,F))},mr=(B,F,re)=>pa(B,re,F)??F??Gn(B),Ur=Z(()=>{const B=Vt();return!B||B.vcs!=="git"?!1:h.sidebar.workspaces(B.worktree)()}),fi=Z(()=>{const B=Vt();if(!B)return[];if(!Ur())return[B.worktree];const F=E();return Om(B).filter(re=>{const pe=t.workspaceExpanded[re]??re===B.worktree,xe=tt(re)===tt(F);return pe||xe})});fe(()=>{if(!i()||!m())return;const B=h.projects.list();for(const[F,re]of Object.entries(t.workspaceExpanded)){if(!re)continue;const pe=tt(F),xe=B.find(ge=>tt(ge.worktree)===pe||ge.sandboxes?.some(qe=>tt(qe)===pe));xe&&(xe.vcs==="git"&&h.sidebar.workspaces(xe.worktree)()||n("workspaceExpanded",F,!1))}});const An=Z(()=>{const B=Date.now(),F=fi();if(F.length===0)return[];const re=[];for(const pe of F){const[xe]=u.child(pe,{bootstrap:!0}),ge=H2(xe,B);re.push(...ge)}return re}),ma=200,hl=2,he=10,we=4,et={value:0},Dt=new Map,Mr=10,xi=new Map,fl=B=>{const F=xi.get(B);if(F)return F;const re=new Set;return xi.set(B,re),re},Vf=(B,F)=>{const re=fl(B);return Rhe({seen:re,keep:F,limit:Mr,preserve:l.id&&tt(B)===tt(E())?[l.id]:void 0})};fe(()=>{const B=new Set(fi());for(const F of[...xi.keys()])B.has(F)||xi.delete(F)}),fe(()=>{I(),c.url,et.value+=1,gPt(),Dt.clear()}),fe(()=>{const B=new Set(fi());for(const[F,re]of Dt)B.has(F)||(re.pending.length=0,re.pendingSet.clear(),re.running===0&&Dt.delete(F))});const mn=B=>{const F=Dt.get(B);if(F)return F;const re={inflight:new Set,pending:[],pendingSet:new Set,running:0};return Dt.set(B,re),re},_i=(B,F)=>{if(B.length===0)return F.slice().sort((pe,xe)=>pe.id<xe.id?-1:pe.id>xe.id?1:0);const re=new Map;for(const pe of B)re.set(pe.id,pe);for(const pe of F)re.set(pe.id,pe);return[...re.values()].sort((pe,xe)=>pe.id<xe.id?-1:pe.id>xe.id?1:0)};async function Bf(B,F,re){const[pe,xe]=u.child(B,{bootstrap:!1});return yPt({directory:B,sessionID:F,task:ge=>zn(()=>c.client.session.messages({directory:B,sessionID:F,limit:ma})).then(qe=>{if(et.value!==re||!oee(B,F,ge))return;const Be=(qe.data??[]).filter(Rt=>!!Rt?.info?.id),Je=Be.map(Rt=>Rt.info).filter(Rt=>!!Rt?.id),je=_i([],Je),Ke=Vf(B,F),qt=qe.response.headers.get("x-next-cursor")??void 0,nn={limit:je.length,cursor:qt,complete:!qt,at:Date.now()};if(Ke.length>0){Phe(B,Ke);for(const Rt of Ke)u.todo.set(Rt,void 0)}const Xt=pe.message[F]??[],on=_i(Xt.filter(Rt=>!!Rt?.id),je);if(oee(B,F,ge))return ct(()=>{Ke.length>0&&xe(Ye(Rt=>{bj(Rt,Ke)})),xe("message",F,Ct(on,{key:"id"})),Ehe({directory:B,sessionID:F,...nn});for(const Rt of Be){const mt=pe.part[Rt.info.id]??[],Lr=_i(mt.filter(Do=>!!Do?.id),Rt.parts.filter(Do=>!!Do?.id));xe("part",Rt.info.id,Ct(Lr,{key:"id"}))}}),nn}).catch(()=>{})})}const Uf=B=>{const F=mn(B);if(F.running>=hl)return;const re=F.pending.shift();if(!re)return;F.pendingSet.delete(re),F.inflight.add(re),F.running+=1;const pe=et.value;Bf(B,re,pe).finally(()=>{F.running-=1,F.inflight.delete(re),Uf(B)})},ga=(B,F="low")=>{const re=B.directory;if(!re)return;const[pe]=u.child(re,{bootstrap:!1});if(lt(()=>{const Je=HB(re,B.id);return pPt({message:pe.message[B.id]!==void 0,info:Je,chunk:ma})}))return;const ge=mn(re);if(ge.inflight.has(B.id))return;if(ge.pendingSet.has(B.id)){if(F!=="high")return;const Je=ge.pending.indexOf(B.id);Je>0&&(ge.pending.splice(Je,1),ge.pending.unshift(B.id));return}const qe=fl(re);if(!(!qe.has(B.id)&&qe.size>=Mr&&F!=="high")){for(F==="high"&&ge.pending.unshift(B.id),F!=="high"&&ge.pending.push(B.id),ge.pendingSet.add(B.id);ge.pending.length>he;){const Je=ge.pending.pop();Je&&ge.pendingSet.delete(Je)}Uf(re)}},z0=(B,F)=>{for(let re=1;re<=we;re++){const pe=B[F+re];pe&&ga(pe,re===1?"high":"low");const xe=B[F-re];xe&&ga(xe,re===1?"high":"low")}};fe(()=>{const B=An();if(B.length===0)return;const F=l.id?B.findIndex(re=>re.id===l.id):0;if(F!==-1){if(!l.id){const re=B[F];re&&ga(re,"high")}z0(B,F)}});function Wf(B){const F=An();if(F.length===0)return;const re=l.id?F.findIndex(ge=>ge.id===l.id):-1;let pe;re===-1?pe=B>0?0:F.length-1:pe=(re+B+F.length)%F.length;const xe=F[pe];xe&&(ga(xe,"high"),z0(F,pe),Em(xe))}function Am(B){const F=h.projects.list();if(F.length===0)return;const re=Vt()?.worktree,pe=E()?ml(E()):void 0,xe=re??pe,ge=xe?F.findIndex(Be=>Be.worktree===xe):-1,qe=ge===-1?B>0?F[0]:F[F.length-1]:F[(ge+B+F.length)%F.length];qe&&(u.child(qe.worktree),We(qe.worktree))}function Mi(B){const F=An();if(F.length===0||!F.some(ge=>k.session.unseenCount(ge.id)>0))return;const pe=l.id?F.findIndex(ge=>ge.id===l.id):-1,xe=pe===-1?B>0?-1:0:pe;for(let ge=1;ge<=F.length;ge++){const qe=B>0?(xe+ge)%F.length:(xe-ge+F.length)%F.length,Be=F[qe];if(Be&&k.session.unseenCount(Be.id)!==0){ga(Be,"high"),z0(F,qe),Em(Be);return}}}async function ya(B){const[F,re]=u.child(B.directory),pe=F.session??[],xe=pe.findIndex(qe=>qe.id===B.id),ge=pe[xe+1]??pe[xe-1];await c.client.session.update({directory:B.directory,sessionID:B.id,time:{archived:Date.now()}}),re(Ye(qe=>{const Be=rn.search(qe.session,B.id,Je=>Je.id);Be.found&&qe.session.splice(Be.index,1)})),B.id===l.id&&x(ge?`/${l.dir}/session/${ge.id}`:`/${l.dir}/session`)}_.register("layout",()=>{const B=[{id:"sidebar.toggle",title:L.t("command.sidebar.toggle"),category:L.t("command.category.view"),keybind:"mod+b",onSelect:()=>h.sidebar.toggle()},{id:"project.open",title:L.t("command.project.open"),category:L.t("command.category.project"),keybind:"mod+o",onSelect:()=>rr()},{id:"project.previous",title:L.t("command.project.previous"),category:L.t("command.category.project"),keybind:"mod+alt+arrowup",onSelect:()=>Am(-1)},{id:"project.next",title:L.t("command.project.next"),category:L.t("command.category.project"),keybind:"mod+alt+arrowdown",onSelect:()=>Am(1)},{id:"provider.connect",title:L.t("command.provider.connect"),category:L.t("command.category.provider"),onSelect:()=>Gf()},{id:"server.switch",title:L.t("command.server.switch"),category:L.t("command.category.server"),onSelect:()=>$m()},{id:"settings.open",title:L.t("command.settings.open"),category:L.t("command.category.settings"),keybind:"mod+shift+,",onSelect:()=>pl()},{id:"settings.shortcuts",title:L.t("command.settings.shortcuts"),category:L.t("command.category.settings"),keybind:"mod+shift+k",onSelect:()=>{const F=++o;z(()=>import("./dialog-settings-BoOPbXZp.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107])).then(re=>{s||o!==F||M.show(()=>d(re.DialogSettings,{tab:"shortcuts"}))})}},{id:"session.previous",title:L.t("command.session.previous"),category:L.t("command.category.session"),keybind:"mod+,",onSelect:()=>Wf(-1)},{id:"session.next",title:L.t("command.session.next"),category:L.t("command.category.session"),keybind:"mod+.",onSelect:()=>Wf(1)},{id:"view.toggleMinimap",title:L.t("command.view.toggleMinimap"),category:L.t("command.category.view"),keybind:"mod+shift+m,mod+alt+m",onSelect:()=>n("minimapVisible",F=>!F)},{id:"view.toggleMaximizedPanel",title:L.t("command.view.toggleMaximizedPanel"),category:L.t("command.category.view"),keybind:"ctrl+tab",onSelect:()=>n("panelMaximized",F=>!F)},{id:"view.toggleActivityBar",title:L.t("command.view.toggleActivityBar"),category:L.t("command.category.view"),keybind:"mod+shift+b",onSelect:()=>n("activityBarVisible",F=>!F)},{id:"view.toggleStatusBar",title:L.t("command.view.toggleStatusBar"),category:L.t("command.category.view"),keybind:"ctrl+mod+s",onSelect:()=>n("statusBarVisible",F=>!F)},{id:"view.moveSidebarLeft",title:L.t("command.view.moveSidebarLeft"),category:L.t("command.category.view"),keybind:"ctrl+shift+alt+left",onSelect:()=>{}},{id:"view.moveSidebarRight",title:L.t("command.view.moveSidebarRight"),category:L.t("command.category.view"),keybind:"ctrl+shift+alt+right",onSelect:()=>{}},{id:"view.alignPanelCenter",title:L.t("command.view.alignPanelCenter"),category:L.t("command.category.view"),keybind:"ctrl+shift+down",onSelect:()=>n("panelAlignment","center")},{id:"view.positionPanelBottom",title:L.t("command.view.positionPanelBottom"),category:L.t("command.category.view"),keybind:"ctrl+shift+down",onSelect:()=>n("panelPosition","bottom")},{id:"view.positionPanelRight",title:L.t("command.view.positionPanelRight"),category:L.t("command.category.view"),keybind:"ctrl+shift+right",onSelect:()=>n("panelPosition","right")},{id:"view.positionPanelLeft",title:L.t("command.view.positionPanelLeft"),category:L.t("command.category.view"),keybind:"ctrl+shift+left",onSelect:()=>n("panelPosition","left")},{id:"app.quit",title:L.t("command.app.quit"),category:L.t("command.category.app"),keybind:"mod+alt+q",onSelect:()=>{}},{id:"app.reload",title:L.t("command.app.reload"),category:L.t("command.category.app"),keybind:"mod+shift+alt+r",onSelect:()=>window.location.reload()},{id:"app.restart",title:L.t("command.app.restart"),category:L.t("command.category.app"),keybind:"mod+shift+r",onSelect:()=>{g.restart?.()}},{id:"theme.select",title:L.t("command.theme.select"),category:L.t("command.category.theme"),keybind:"alt+t",onSelect:()=>{}},{id:"theme.toggleLightDark",title:L.t("command.theme.toggleLightDark"),category:L.t("command.category.theme"),keybind:"mod+shift+alt+t",onSelect:()=>jn(1)},{id:"editor.fontZoomIn",title:L.t("command.editor.fontZoomIn"),category:L.t("command.category.editor"),keybind:"mod+alt+=",onSelect:()=>hi(1)},{id:"editor.fontZoomOut",title:L.t("command.editor.fontZoomOut"),category:L.t("command.category.editor"),keybind:"mod+alt+-",onSelect:()=>hi(-1)},{id:"editor.fontZoomReset",title:L.t("command.editor.fontZoomReset"),category:L.t("command.category.editor"),keybind:"alt+0",onSelect:()=>yn()},{id:"terminal.fontZoomIn",title:L.t("command.terminal.fontZoomIn"),category:L.t("command.category.terminal"),keybind:"mod+ctrl+alt+=",onSelect:()=>hi(1)},{id:"terminal.fontZoomOut",title:L.t("command.terminal.fontZoomOut"),category:L.t("command.category.terminal"),keybind:"mod+ctrl+alt+-",onSelect:()=>hi(-1)},{id:"session.previous.unseen",title:L.t("command.session.previous.unseen"),category:L.t("command.category.session"),keybind:"shift+alt+arrowup",onSelect:()=>Mi(-1)},{id:"session.next.unseen",title:L.t("command.session.next.unseen"),category:L.t("command.category.session"),keybind:"shift+alt+arrowdown",onSelect:()=>Mi(1)},{id:"session.archive",title:L.t("command.session.archive"),category:L.t("command.category.session"),keybind:"mod+shift+backspace",disabled:!l.dir||!l.id,onSelect:()=>{const F=An().find(re=>re.id===l.id);F&&ya(F)}},{id:"workspace.new",title:L.t("workspace.new"),category:L.t("command.category.workspace"),keybind:"mod+shift+w",disabled:!Ur(),onSelect:()=>{const F=Vt();if(F)return rX(F)}},{id:"workspace.toggle",title:L.t("command.workspace.toggle"),description:L.t("command.workspace.toggle.description"),category:L.t("command.category.workspace"),slash:"workspace",disabled:!Vt()||Vt()?.vcs!=="git",onSelect:()=>{const F=Vt();if(!F||F.vcs!=="git")return;const re=h.sidebar.workspaces(F.worktree)();h.sidebar.toggleWorkspaces(F.worktree),lr({title:re?L.t("toast.workspace.disabled.title"):L.t("toast.workspace.enabled.title"),description:re?L.t("toast.workspace.disabled.description"):L.t("toast.workspace.enabled.description")})}},{id:"theme.cycle",title:L.t("command.theme.cycle"),category:L.t("command.category.theme"),keybind:"mod+shift+t",onSelect:()=>Nt(1)}];for(const[F]of A())B.push({id:`theme.set.${F}`,title:L.t("command.theme.set",{theme:C.name(F)}),category:L.t("command.category.theme"),onSelect:()=>C.commitPreview(),onHighlight:()=>(C.previewTheme(F),()=>C.cancelPreview())});B.push({id:"theme.scheme.cycle",title:L.t("command.theme.scheme.cycle"),category:L.t("command.category.theme"),keybind:"mod+shift+s",onSelect:()=>jn(1)});for(const F of D)B.push({id:`theme.scheme.${F}`,title:L.t("command.theme.scheme.set",{scheme:O(F)}),category:L.t("command.category.theme"),onSelect:()=>C.commitPreview(),onHighlight:()=>(C.previewColorScheme(F),()=>C.cancelPreview())});B.push({id:"language.cycle",title:L.t("command.language.cycle"),category:L.t("command.category.language"),onSelect:()=>_r(1)});for(const F of L.locales)B.push({id:`language.set.${F}`,title:L.t("command.language.set",{language:L.label(F)}),category:L.t("command.category.language"),onSelect:()=>ui(F)});return B});function Gf(){const B=++o;z(()=>import("./dialog-select-provider-CBq6hNDx.js").then(F=>F.d),__vite__mapDeps([107,105,102,106,104])).then(F=>{s||o!==B||M.show(()=>d(F.DialogSelectProvider,{}))})}function $m(){const B=++o;z(()=>import("./dialog-select-server-DA5hATxx.js"),__vite__mapDeps([108,105,102,109])).then(F=>{s||o!==B||M.show(()=>d(F.DialogSelectServer,{}))})}function pl(){const B=++o;z(()=>import("./dialog-settings-BoOPbXZp.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107])).then(F=>{s||o!==B||M.show(()=>d(F.DialogSettings,{}))})}function ml(B){const F=tt(B),re=h.projects.list().find(Be=>tt(Be.worktree)===F||Be.sandboxes?.some(Je=>tt(Je)===F));if(re)return re.worktree;const pe=Object.entries(t.workspaceOrder).find(([Be,Je])=>tt(Be)===F||Je.some(je=>tt(je)===F));if(pe)return pe[0];const[xe]=u.child(B,{bootstrap:!1}),ge=xe.project;return ge?u.data.project.find(Be=>Be.id===ge)?.worktree??B:B}function Bi(B){return Vt()?.worktree??ml(B)}function Zf(B,F,re=Bi(B)){return n("lastProjectSession",re,{directory:B,id:F,at:Date.now()}),re}function Kf(B){t.lastProjectSession[B]&&n("lastProjectSession",Ye(F=>{delete F[B]}))}function Tm(B,F,re=Bi(B)){return Zf(B,F,re),k.session.markViewed(F),lt(()=>t.workspaceExpanded[B])===!1&&n("workspaceExpanded",B,!0),requestAnimationFrame(()=>tn(F,`${B}:${F}`)),re}async function gl(B){if(!B)return;const F=ml(B);v.projects.touch(F);const re=h.projects.list().find(Ke=>Ke.worktree===F);let pe=re?Yg(F,[F,...re.sandboxes??[]],t.workspaceOrder[F]):[F];const xe=Ke=>Ke?pe.some(qt=>tt(qt)===tt(Ke)):!1,ge=async Ke=>{if(!Ke||Ke===F||xe(Ke))return xe(Ke);const qt=await c.client.worktree.list({directory:F}).then(nn=>nn.data??[]).catch(()=>[]);return pe=Yg(F,[F,...qt],t.workspaceOrder[F]),xe(Ke)},qe=async Ke=>{if(!xe(Ke.directory))return!1;const[qt]=u.child(Ke.directory,{bootstrap:!1});if(qt.session.some(Xt=>Xt.id===Ke.id))return n("lastProjectSession",F,{directory:Ke.directory,id:Ke.id,at:Date.now()}),De(`/${St(Ke.directory)}/session/${Ke.id}`),!0;const nn=await c.client.session.get({sessionID:Ke.id}).then(Xt=>Xt.data).catch(()=>{});return!nn?.directory||!xe(nn.directory)?!1:(n("lastProjectSession",F,{directory:nn.directory,id:nn.id,at:Date.now()}),De(`/${St(nn.directory)}/session/${nn.id}`),!0)},Be=t.lastProjectSession[F];if(Be?.id){if(await ge(Be.directory),await qe(Be))return;Kf(F)}const Je=$ne(pe.map(Ke=>u.child(Ke,{bootstrap:!1})[0]),Date.now());if(Je&&await qe(Je))return;const je=$ne(await Promise.all(pe.map(async Ke=>({path:{directory:Ke},session:await c.client.session.list({directory:Ke}).then(qt=>qt.data??[]).catch(()=>[])}))),Date.now());je&&await qe(je)||De(`/${St(F)}/session`)}function Em(B){B&&De(`/${St(B.directory)}/session/${B.id}`)}function We(B,F=!0){if(h.projects.open(B),F)return gl(B)}const te=B=>{if(v.isLocal()){for(const F of cKt(B))We(F);for(const F of dKt(B)){We(F.directory,!1);const re=St(F.directory);F.prompt&&qZt(re,{prompt:F.prompt});const pe=F.prompt?`/${re}/session?prompt=${encodeURIComponent(F.prompt)}`:`/${re}/session`;De(pe)}}};dn(()=>{const B=F=>{const pe=F.detail?.urls??[];pe.length!==0&&te(pe)};te(uKt(window)),window.addEventListener(Tne,B),me(()=>window.removeEventListener(Tne,B))});async function Ne(B,F){const re=JK(B);if(F===re)return;const pe=F===Gn(B.worktree)?"":F;if(B.id&&B.id!=="global"){await c.client.project.update({projectID:B.id,directory:B.worktree,name:pe});return}u.project.meta(B.worktree,{name:pe})}const Ge=(B,F,re,pe)=>{(pa(B,re,pe)??pe??Gn(B))!==F&&Br(B,F,re,pe)};function an(B){const F=h.projects.list(),re=tt(B),pe=F.findIndex(qe=>tt(qe.worktree)===re),xe=tt(Vt()?.worktree??"")===re;if(pe===-1)return;const ge=F[pe+1];if(!xe){h.projects.close(B);return}if(!ge){h.projects.close(B),x("/");return}De(`/${St(ge.worktree)}/session`),h.projects.close(B),queueMicrotask(()=>{gl(ge.worktree)})}function nr(B){if(h.sidebar.workspaces(B.worktree)()){h.sidebar.toggleWorkspaces(B.worktree);return}B.vcs==="git"&&h.sidebar.toggleWorkspaces(B.worktree)}const wn=B=>{const F=++o;z(()=>import("./dialog-edit-project-BrkjzrGe.js"),[]).then(re=>{s||o!==F||M.show(()=>d(re.DialogEditProject,{project:B}))})};async function rr(){function B(F){if(Array.isArray(F)){for(const re of F)We(re,!1);gl(F[0])}else F&&We(F)}if(g.openDirectoryPickerDialog&&v.isLocal()){const F=await g.openDirectoryPickerDialog?.({title:L.t("command.project.open"),multiple:!0});B(F)}else{const F=++o;z(()=>import("./dialog-select-directory-K0nOY5Ky.js"),__vite__mapDeps([110,111,105,102])).then(re=>{s||o!==F||M.show(()=>d(re.DialogSelectDirectory,{multiple:!0,onSelect:B}),()=>B(null))})}}const va=async(B,F,re=!1)=>{if(F===B)return;const pe=E(),xe=tt(pe),ge=tt(F),qe=re||!!l.dir&&xe===ge;!re&&qe&&De(`/${St(B)}/session`),J(F,!0);const Be=await c.client.worktree.remove({directory:B,worktreeRemoveInput:{directory:F}}).then(Xt=>Xt.data).catch(Xt=>(lr({title:L.t("workspace.delete.failed.title"),description:rV(Xt,L.t("common.requestFailed"))}),!1));if(J(F,!1),!Be||(tt(t.lastProjectSession[B]?.directory??"")===tt(F)&&Kf(B),u.set("project",Ye(Xt=>{const on=Xt.find(Rt=>Rt.worktree===B);on&&(on.sandboxes=(on.sandboxes??[]).filter(Rt=>Rt!==F))})),n("workspaceOrder",B,Xt=>(Xt??[]).filter(on=>on!==F)),h.projects.close(F),h.projects.open(B),qe))return;const Je=E(),je=tt(Je),Ke=h.projects.list().find(Xt=>Xt.worktree===B),nn=(Ke?Yg(B,[B,...Ke.sandboxes??[]],t.workspaceOrder[B]):[B]).some(Xt=>tt(Xt)===je);l.dir&&ml(Je)===B&&!nn&&De(`/${St(B)}/session`)},ks=async(B,F)=>{if(F===B)return;J(F,!0);const re=lr({persistent:!0,title:L.t("workspace.resetting.title"),description:L.t("workspace.resetting.description")}),pe=()=>Kh.dismiss(re),xe=await c.client.session.list({directory:F}).then(Be=>Be.data??[]).catch(()=>[]);if(Gzt(F,xe.map(Be=>Be.id),g),await c.client.instance.dispose({directory:F}).catch(()=>{}),!await c.client.worktree.reset({directory:B,worktreeResetInput:{directory:F}}).then(Be=>Be.data).catch(Be=>(lr({title:L.t("workspace.reset.failed.title"),description:rV(Be,L.t("common.requestFailed"))}),!1))){J(F,!1),pe();return}const qe=Date.now();await Promise.all(xe.filter(Be=>Be.time.archived===void 0).map(Be=>c.client.session.update({sessionID:Be.id,directory:Be.directory,time:{archived:qe}}).catch(()=>{}))),J(F,!1),pe(),lr({title:L.t("workspace.reset.success.title"),description:L.t("workspace.reset.success.description"),actions:[{label:L.t("command.session.new"),onClick:()=>{const Be=`/${St(F)}/session?new=1`;x(Be),h.mobileSidebar.hide()}},{label:L.t("common.dismiss"),onClick:"dismiss"}]})};function Xf(B){const F=Z(()=>Gn(B.directory)),[re,pe]=nt({status:"loading",dirty:!1});dn(()=>{c.client.file.status({directory:B.directory}).then(qe=>{const Je=(qe.data??[]).length>0;pe({status:"ready",dirty:Je})}).catch(()=>{pe({status:"error",dirty:!1})})});const xe=()=>{const qe=!!l.dir&&tt(E())===tt(B.directory);qe&&De(`/${St(B.root)}/session`),M.close(),va(B.root,B.directory,qe)},ge=()=>re.status==="loading"?L.t("workspace.status.checking"):re.status==="error"?L.t("workspace.status.error"):re.dirty?L.t("workspace.status.dirty"):L.t("workspace.status.clean");return d(qz,{get title(){return L.t("workspace.delete.title")},fit:!0,get children(){var qe=tJt(),Be=qe.firstChild,Je=Be.firstChild,je=Je.nextSibling,Ke=Be.nextSibling;return K(Je,()=>L.t("workspace.delete.confirm",{name:F()})),K(je,ge),K(Ke,d(Mn,{variant:"ghost",size:"large",onClick:()=>M.close(),get children(){return L.t("common.cancel")}}),null),K(Ke,d(Mn,{variant:"primary",size:"large",get disabled(){return re.status==="loading"},onClick:xe,get children(){return L.t("workspace.delete.button")}}),null),qe}})}function ir(B){const F=Z(()=>Gn(B.directory)),[re,pe]=nt({status:"loading",dirty:!1,sessions:[]}),xe=async()=>{const Ke=(await c.client.session.list({directory:B.directory}).then(qt=>qt.data??[]).catch(()=>[])).filter(qt=>qt.time.archived===void 0);pe({sessions:Ke})};dn(()=>{c.client.file.status({directory:B.directory}).then(je=>{const qt=(je.data??[]).length>0;pe({status:"ready",dirty:qt}),xe()}).catch(()=>{pe({status:"error",dirty:!1})})});const ge=()=>{M.close(),ks(B.root,B.directory)},qe=()=>re.sessions.length,Be=()=>re.status==="loading"?L.t("workspace.status.checking"):re.status==="error"?L.t("workspace.status.error"):re.dirty?L.t("workspace.status.dirty"):L.t("workspace.status.clean"),Je=()=>{const je=qe();return je===0?L.t("workspace.reset.archived.none"):je===1?L.t("workspace.reset.archived.one"):L.t("workspace.reset.archived.many",{count:je})};return d(qz,{get title(){return L.t("workspace.reset.title")},fit:!0,get children(){var je=nJt(),Ke=je.firstChild,qt=Ke.firstChild,nn=qt.nextSibling,Xt=nn.firstChild,on=Xt.nextSibling;on.nextSibling;var Rt=Ke.nextSibling;return K(qt,()=>L.t("workspace.reset.confirm",{name:F()})),K(nn,Be,Xt),K(nn,Je,on),K(nn,()=>L.t("workspace.reset.note"),null),K(Rt,d(Mn,{variant:"ghost",size:"large",onClick:()=>M.close(),get children(){return L.t("common.cancel")}}),null),K(Rt,d(Mn,{variant:"primary",size:"large",get disabled(){return re.status==="loading"},onClick:ge,get children(){return L.t("workspace.reset.button")}}),null),je}})}const Fn={session:"",sessionProject:"",directory:""};fe(vn(()=>[i(),I().slug,l.id,Vt()?.worktree,E()],([B,F,re,pe,xe])=>{if(!B||!F||!xe){Fn.session="",Fn.sessionProject="",Fn.directory="";return}if(!re){Fn.session="",Fn.sessionProject="",Fn.directory="";return}const ge=`${F}/${re}`;if(!pe){Fn.session=ge,Fn.directory=xe,Fn.sessionProject="";return}if(v.projects.last()!==pe&&v.projects.touch(pe),ge!==Fn.session||xe!==Fn.directory){Fn.session=ge,Fn.directory=xe,Fn.sessionProject=Tm(xe,re,pe);return}pe!==Fn.sessionProject&&(Fn.directory=xe,Fn.sessionProject=Zf(xe,re,pe))})),fe(()=>{const B=h.sidebar.opened()?h.sidebar.width():48;document.documentElement.style.setProperty("--dialog-left-margin",`${B}px`)});const Pm=Z(()=>Math.max(h.sidebar.width(),244)),mge=Z(()=>Math.max(Pm()-64,0)),Dm=new Set;fe(vn(fi,B=>{if(B.length===0){Dm.clear();return}const F=new Set(B);for(const re of F)Dm.has(re)||u.project.loadSessions(re);Dm.clear();for(const re of F)Dm.add(re)},{defer:!0}));function gge(B){const F=eq(B);F&&(ye(void 0),n("activeProject",F))}function yge(B){const{draggable:F,droppable:re}=B;if(F&&re){const pe=h.projects.list(),xe=pe.findIndex(qe=>qe.worktree===F.id.toString()),ge=pe.findIndex(qe=>qe.worktree===re.id.toString());xe!==ge&&ge!==-1&&h.projects.move(F.id.toString(),ge)}}function vge(){n("activeProject",void 0)}function Om(B){if(!B)return[];const F=B.worktree,re=[F,...B.sandboxes??[]],pe=Vt(),xe=tt(pe?.worktree??"")===tt(B.worktree)?E():void 0,ge=xe&&tt(xe)!==tt(F)&&!re.some(Je=>tt(Je)===tt(xe))?xe:void 0,qe=ge?Jg.get(ge)?.status==="pending":!1,Be=Yg(F,re,t.workspaceOrder[B.worktree]);return qe&&ge?[F,ge,...Be.filter(Je=>Je!==F)]:!ge||qe?Be:[...Be,ge]}const nX=Z(()=>{if(h.sidebar.opened())return Vt();const B=He();return B||Vt()});function kge(B){const F=eq(B);F&&n("activeWorkspace",F)}function bge(B){const{draggable:F,droppable:re}=B;if(!F||!re)return;const pe=nX();if(!pe)return;const xe=Om(pe),ge=xe.findIndex(je=>je===F.id.toString()),qe=xe.findIndex(je=>je===re.id.toString());if(ge===-1||qe===-1||ge===qe)return;const Be=xe.slice(),[Je]=Be.splice(ge,1);Je&&(Be.splice(qe,0,Je),n("workspaceOrder",pe.worktree,Be.filter(je=>tt(je)!==tt(pe.worktree))))}function wge(){n("activeWorkspace",void 0)}const rX=async B=>{At();const F=await c.client.worktree.create({directory:B.worktree}).then(ge=>ge.data).catch(ge=>{lr({title:L.t("workspace.create.failed.title"),description:rV(ge,L.t("common.requestFailed"))})});if(!F?.directory)return;Br(F.directory,F.branch,B.id,F.branch);const re=B.worktree,pe=tt(F.directory),xe=tt(re);J(F.directory,!0),Jg.pending(F.directory),n("workspaceExpanded",pe,!0),pe!==F.directory&&n("workspaceExpanded",F.directory,!0),n("workspaceOrder",B.worktree,ge=>{const Be=(ge??[]).filter(Je=>{const je=tt(Je);return je!==xe&&je!==pe});return[F.directory,...Be]}),u.child(F.directory),De(`/${St(F.directory)}/session`)},iX={currentDir:E,navList:An,sidebarExpanded:ue,sidebarHovering:oe,nav:()=>T.nav,hoverSession:()=>T.hoverSession,setHoverSession:le,clearHoverProjectSoon:de,prefetchSession:ga,archiveSession:ya,workspaceName:pa,renameWorkspace:Ge,editorOpen:_t,openEditor:Ue,closeEditor:V,setEditor:Fe,InlineEditor:Re,isBusy:j,workspaceExpanded:(B,F)=>t.workspaceExpanded[B]??F,setWorkspaceExpanded:(B,F)=>n("workspaceExpanded",B,F),showResetWorkspaceDialog:(B,F)=>M.show(()=>d(ir,{root:B,directory:F})),showDeleteWorkspaceDialog:(B,F)=>M.show(()=>d(Xf,{root:B,directory:F})),setScrollContainerRef:(B,F)=>{F||(a=B)}},xge={currentDir:E,currentProject:Vt,sidebarOpened:()=>h.sidebar.opened(),sidebarHovering:oe,hoverProject:()=>T.hoverProject,nav:()=>T.nav,onProjectMouseEnter:(B,F)=>Y.enter(B,F),onProjectMouseLeave:B=>Y.leave(B),onProjectFocus:B=>Y.activate(B),onHoverOpenChanged:(B,F)=>{!F&&T.hoverProject&&T.hoverProject!==B||R("hoverProject",F?B:void 0)},navigateToProject:gl,openSidebar:()=>h.sidebar.open(),closeProject:an,showEditProjectDialog:wn,toggleProjectWorkspaces:nr,workspacesEnabled:B=>B.vcs==="git"&&h.sidebar.workspaces(B.worktree)(),workspaceIds:Om,workspaceLabel:mr,sessionProps:{navList:An,sidebarExpanded:ue,sidebarHovering:oe,nav:()=>T.nav,hoverSession:()=>T.hoverSession,setHoverSession:le,clearHoverProjectSoon:de,prefetchSession:ga,archiveSession:ya},setHoverSession:le},_ge=B=>{const F=B.project,re=Z(()=>B.mobile||(B.merged??h.sidebar.opened())),pe=Z(()=>!B.mobile&&B.merged===!1&&!h.sidebar.opened()),xe=Z(()=>!!B.mobile||B.merged===!1||h.sidebar.opened()),ge=Z(()=>!l.dir&&h.projects.list().length===0),qe=Z(()=>{const mt=F();return mt?mt.name||Gn(mt.worktree):""}),Be=Z(()=>F()?.id??""),Je=Z(()=>F()?.worktree??""),je=Z(()=>{const mt=Je();return mt?St(mt):""}),Ke=Z(()=>{const mt=F();return mt?Om(mt):[]}),qt=Z(()=>Ke().reduce((mt,Lr)=>mt+k.project.unseenCount(Lr),0)),nn=()=>Ke().filter(mt=>k.project.unseenCount(mt)>0).forEach(mt=>k.project.markViewed(mt)),Xt=Z(()=>{const mt=F();return!mt||mt.vcs!=="git"?!1:h.sidebar.workspaces(mt.worktree)()}),on=Z(()=>{const mt=F();return mt?mt.vcs==="git"||h.sidebar.workspaces(mt.worktree)():!1}),Rt=Z(()=>u.data.path.home);return(()=>{var mt=sJt(),Lr=mt.firstChild,Do=Lr.firstChild,yl=Do.firstChild,zm=yl.firstChild,q0=zm.firstChild,qm=q0.nextSibling,Lge=qm.nextSibling,oX=zm.nextSibling;return K(mt,d(ve,{get when(){return F()},get fallback(){return d(ve,{get when(){return ge()},get children(){var Ir=lJt(),ar=Ir.firstChild,Nr=ar.firstChild,xn=Nr.firstChild,jm=xn.nextSibling;return K(xn,()=>L.t("sidebar.empty.title")),K(jm,()=>L.t("sidebar.empty.description")),K(ar,d(Mn,{size:"large",icon:"folder-add-left",onClick:rr,get children(){return L.t("command.project.open")}}),null),Ir}})},get children(){return[(()=>{var Ir=iJt(),ar=Ir.firstChild,Nr=ar.firstChild;return K(Nr,d(Re,{get id(){return`project:${Be()}`},value:qe,onSave:xn=>{const jm=F();jm&&Ne(jm,xn)},class:"text-14-medium text-text-strong truncate",displayClass:"text-14-medium text-text-strong truncate",stopPropagation:!0}),null),K(Nr,d(Ua,{placement:"bottom",gutter:2,get value(){return Je()},class:"shrink-0",contentStyle:{"max-width":"640px",transform:"translate3d(52px, 0, 0)"},get children(){var xn=rJt();return K(xn,()=>Je().replace(Rt(),"~")),xn}}),null),K(ar,d(Mt,{get modal(){return!oe()},get children(){return[d(Mt.Trigger,{as:Sr,icon:"dot-grid",variant:"ghost","data-action":"project-menu",get"data-project"(){return je()},class:"shrink-0 size-6 rounded-md transition-opacity data-[expanded]:bg-surface-base-active",get classList(){return{"opacity-100":B.mobile||re(),"opacity-0 group-hover/project:opacity-100 group-focus-within/project:opacity-100 data-[expanded]:opacity-100":!B.mobile&&!re()}},get"aria-label"(){return L.t("common.moreOptions")}}),d(Mt.Portal,{get children(){return d(Mt.Content,{class:"mt-1",get children(){return[d(Mt.Item,{onSelect:()=>{const xn=F();xn&&wn(xn)},get children(){return d(Mt.ItemLabel,{get children(){return L.t("common.edit")}})}}),d(Mt.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return je()},get disabled(){return!on()},onSelect:()=>{const xn=F();xn&&nr(xn)},get children(){return d(Mt.ItemLabel,{get children(){return kt(()=>!!Xt())()?L.t("sidebar.workspaces.disable"):L.t("sidebar.workspaces.enable")}})}}),d(Mt.Item,{"data-action":"project-clear-notifications",get"data-project"(){return je()},get disabled(){return qt()===0},onSelect:nn,get children(){return d(Mt.ItemLabel,{get children(){return L.t("sidebar.project.clearNotifications")}})}}),d(Mt.Separator,{}),d(Mt.Item,{"data-action":"project-close-menu",get"data-project"(){return je()},onSelect:()=>{const xn=Je();xn&&an(xn)},get children(){return d(Mt.ItemLabel,{get children(){return L.t("common.close")}})}})]}})}})]}}),null),Ir})(),d(xme,{onDragStart:kge,onDragEnd:wge,onDragOver:bge,collisionDetector:bme,get children(){return[d(_me,{}),d(Ame,{}),(()=>{var Ir=oJt();return K(Ir,d(ve,{get when(){return Xt()},get fallback(){return[(()=>{var ar=One();return K(ar,d(Mn,{variant:"secondary",size:"large",icon:"new-session",class:"w-full",onClick:()=>{const Nr=Je();Nr&&De(`/${St(Nr)}/session?new=1`)},get children(){return L.t("command.session.new")}})),ar})(),(()=>{var ar=cJt();return K(ar,d(bXt,{ctx:iX,get project(){return F()},sortNow:X,get mobile(){return B.mobile},get popover(){return xe()}})),ar})()]},get children(){return[(()=>{var ar=One();return K(ar,d(Mn,{size:"large",icon:"plus-small",class:"w-full",onClick:()=>{const Nr=F();Nr&&rX(Nr)},get children(){return L.t("workspace.new")}})),ar})(),(()=>{var ar=aJt(),Nr=ar.firstChild;return Hr(xn=>{B.mobile||(a=xn)},Nr),K(Nr,d(Cme,{get ids(){return Ke()},get children(){return d(Qt,{get each(){return Ke()},children:xn=>d(kXt,{ctx:iX,directory:xn,get project(){return F()},sortNow:X,get mobile(){return B.mobile},get popover(){return xe()}})})}})),ar})()]}})),Ir})(),d(Mme,{get children(){return d(gXt,{sidebarProject:nX,activeWorkspace:()=>t.activeWorkspace,workspaceLabel:mr})}})]}})]}}),Lr),K(q0,()=>L.t("sidebar.gettingStarted.title")),K(qm,()=>L.t("sidebar.gettingStarted.line1")),K(Lge,()=>L.t("sidebar.gettingStarted.line2")),K(oX,d(Mn,{size:"large",icon:"plus-small",onClick:Gf,get children(){return L.t("command.provider.connect")}}),null),K(oX,d(Mn,{size:"large",variant:"ghost",onClick:()=>n("gettingStartedDismissed",!0),get children(){return L.t("toast.update.action.notYet")}}),null),Qe(Ir=>{var ar={"flex flex-col min-h-0 min-w-0 box-border rounded-tl-[12px] px-3":!0,"border border-b-0 border-border-weak-base":!re(),"border-l border-t border-border-weaker-base":re(),"bg-background-base":re()||pe(),"bg-background-stronger":!re()&&!pe(),"flex-1 min-w-0":B.mobile,"max-w-full overflow-hidden":B.mobile},Nr=B.mobile?void 0:`${mge()}px`,xn=!!(t.gettingStartedDismissed||!(w.all().length>0&&w.paid().length===0));return Ir.e=hr(mt,ar,Ir.e),Nr!==Ir.t&&Rr(mt,"width",Ir.t=Nr),xn!==Ir.a&&Lr.classList.toggle("hidden",Ir.a=xn),Ir},{e:void 0,t:void 0,a:void 0}),mt})()},aX=()=>h.projects.list(),Mge=()=>d(WXt,{projects:aX,activeProject:()=>t.activeProject}),Sge=B=>d(eJt,{mobile:B,opened:()=>h.sidebar.opened(),get aimMove(){return Y.move},projects:aX,renderProject:F=>d(KXt,{ctx:xge,project:F,sortNow:X,mobile:B}),handleDragStart:gge,handleDragEnd:vge,handleDragOver:yge,get openProjectLabel(){return L.t("command.project.open")},openProjectKeybind:()=>_.keybind("project.open"),onOpenProject:rr,renderProjectOverlay:Mge,settingsLabel:()=>L.t("sidebar.settings"),settingsKeybind:()=>_.keybind("settings.open"),onOpenSettings:pl,helpLabel:()=>L.t("sidebar.help"),onOpenHelp:()=>g.openLink("https://opencode.ai/desktop-feedback"),renderPanel:()=>d(_ge,{project:Vt,mobile:!0})});let Rm;const Cge=bf();return fe(()=>{Cge.pathname,Rm&&requestAnimationFrame(()=>{E2e(Rm,{opacity:[0,1],y:[4,0]},{type:"spring",stiffness:400,damping:30})})}),d(aqt,{get children(){var B=uJt(),F=B.firstChild,re=F.firstChild,pe=re.firstChild,xe=pe.firstChild,ge=xe.firstChild,qe=ge.nextSibling,Be=xe.nextSibling,Je=Be.firstChild;return K(B,d(iKt,{}),F),K(F,d(ve,{get when(){return t.activityBarVisible},get children(){var je=dJt(),Ke=je.firstChild,qt=Ke.firstChild,nn=Ke.nextSibling,Xt=nn.firstChild;return K(Ke,d(Qt,{get each(){return h.projects.list()},children:on=>{const Rt=Z(()=>Vt()?.worktree===on.worktree);return(()=>{var mt=hJt();return mt.$$click=()=>x(`/${St(on.worktree)}/session`),K(mt,d(eX,{project:on,notify:!0})),Qe(Lr=>{var Do={"bg-transparent hover:bg-surface-base-hover":!Rt(),"bg-surface-base-hover border border-border-weak-base":Rt()},yl=on.name||Gn(on.worktree);return Lr.e=hr(mt,Do,Lr.e),yl!==Lr.t&&wt(mt,"aria-label",Lr.t=yl),Lr},{e:void 0,t:void 0}),mt})()}}),qt),qt.$$click=rr,K(qt,d(Kt,{name:"plus",size:"small",class:"text-icon-weak"})),Xt.$$click=pl,K(Xt,d(Kt,{name:"settings-gear",size:"small",class:"text-icon-weak"})),Qe(on=>{var Rt=L.t("command.project.open"),mt=L.t("sidebar.settings");return Rt!==on.e&&wt(qt,"aria-label",on.e=Rt),mt!==on.t&&wt(Xt,"aria-label",on.t=mt),on},{e:void 0,t:void 0}),je}}),re),ge.$$click=je=>{je.target===je.currentTarget&&h.mobileSidebar.hide()},qe.$$click=je=>je.stopPropagation(),K(qe,()=>Sge(!0)),hr(Be,{"absolute p-3 pt-0 inset-0":!0,"xl:inset-y-0 xl:right-0 xl:left-0":!0,"z-20":!0}),hr(Je,{"size-full overflow-x-hidden flex flex-col items-start contain-strict rounded-xl":!0}),K(Je,d(ve,{get when(){return!Ya.loading},get fallback(){return Rne()},get children(){var je=Rne(),Ke=Rm;return typeof Ke=="function"?Hr(Ke,je):Rm=je,K(je,()=>e.children),je}})),K(B,d(As.Region,{}),null),Qe(je=>{var Ke={"fixed inset-x-0 top-10 bottom-0 z-40 transition-opacity duration-200":!0,"opacity-100 pointer-events-auto":h.mobileSidebar.opened(),"opacity-0 pointer-events-none":!h.mobileSidebar.opened()},qt=L.t("sidebar.nav.projectsAndSessions"),nn={"@container fixed top-10 bottom-0 left-0 z-50 w-full max-w-[400px] overflow-hidden border-r border-border-weaker-base bg-background-base transition-transform duration-200 ease-out":!0,"translate-x-0":h.mobileSidebar.opened(),"-translate-x-full":!h.mobileSidebar.opened()};return je.e=hr(ge,Ke,je.e),qt!==je.t&&wt(qe,"aria-label",je.t=qt),je.a=hr(qe,nn,je.a),je},{e:void 0,t:void 0,a:void 0}),B}})}li(["click"]);var pJt=["id","name","validationState","required","disabled","readOnly"];function mJt(e){const t=`form-control-${wr()}`,n=ft({id:t},e),[r,i]=Ce(),[a,o]=Ce(),[s,l]=Ce(),[c,u]=Ce(),h=(v,k,b)=>{const x=b!=null||r()!=null;return[b,r(),x&&k!=null?v:void 0].filter(Boolean).join(" ")||void 0},m=v=>[s(),c(),v].filter(Boolean).join(" ")||void 0,g=Z(()=>({"data-valid":ke(n.validationState)==="valid"?"":void 0,"data-invalid":ke(n.validationState)==="invalid"?"":void 0,"data-required":ke(n.required)?"":void 0,"data-disabled":ke(n.disabled)?"":void 0,"data-readonly":ke(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>ke(n.name)??ke(n.id),dataset:g,validationState:()=>ke(n.validationState),isRequired:()=>ke(n.required),isDisabled:()=>ke(n.disabled),isReadOnly:()=>ke(n.readOnly),labelId:r,fieldId:a,descriptionId:s,errorMessageId:c,getAriaLabelledBy:h,getAriaDescribedBy:m,generateId:Io(()=>ke(n.id)),registerLabel:zr(i),registerField:zr(o),registerDescription:zr(l),registerErrorMessage:zr(u)}}}var ege=Tt();function Nm(){const e=Lt(ege);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function tge(e){const t=Nm(),n=ft({id:t.generateId("description")},e);return fe(()=>me(t.registerDescription(n.id))),d(zt,f({as:"div"},()=>t.dataset(),n))}var gJt=["id","aria-label","aria-labelledby","aria-describedby"];function yJt(e){const t=Nm(),n=ft({id:t.generateId("field")},e);return fe(()=>me(t.registerField(ke(n.id)))),{fieldProps:{id:()=>ke(n.id),ariaLabel:()=>ke(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy(ke(n.id),ke(n["aria-label"]),ke(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy(ke(n["aria-describedby"]))}}}function nge(e){let t;const n=Nm(),r=ft({id:n.generateId("label")},e),[i,a]=Me(r,["ref"]),o=G2(()=>t,()=>"label");return fe(()=>me(n.registerLabel(a.id))),d(zt,f({as:"label",ref(s){var l=hn(c=>t=c,i.ref);typeof l=="function"&&l(s)},get for(){return kt(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),a))}function vJt(e,t){fe(vn(e,n=>{if(n==null)return;const r=kJt(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),me(()=>{r.removeEventListener("reset",t)}))}))}function kJt(e){return bJt(e)?e.form:e.closest("form")}function bJt(e){return e.matches("textarea, input, select, button")}function rge(e){const t=Nm(),n=ft({id:t.generateId("error-message")},e),[r,i]=Me(n,["forceMount"]),a=()=>t.validationState()==="invalid";return fe(()=>{a()&&me(t.registerErrorMessage(i.id))}),d(ve,{get when(){return r.forceMount||a()},get children(){return d(zt,f({as:"div"},()=>t.dataset(),i))}})}var wJt={};Ga(wJt,{Description:()=>tge,ErrorMessage:()=>rge,Input:()=>age,Label:()=>nge,Root:()=>sge,TextArea:()=>lge,TextField:()=>R1,useTextFieldContext:()=>tX});var ige=Tt();function tX(){const e=Lt(ige);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function age(e){return d(oge,f({type:"text"},e))}function oge(e){const t=Nm(),n=tX(),r=ft({id:n.generateId("input")},e),[i,a,o]=Me(r,["onInput"],gJt),{fieldProps:s}=yJt(a);return d(zt,f({as:"input",get id(){return s.id()},get name(){return t.name()},get value(){return n.value()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get"aria-label"(){return s.ariaLabel()},get"aria-labelledby"(){return s.ariaLabelledBy()},get"aria-describedby"(){return s.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},get onInput(){return Kn([i.onInput,n.onInput])}},()=>t.dataset(),o))}function sge(e){let t;const n=`textfield-${wr()}`,r=ft({id:n},e),[i,a,o]=Me(r,["ref","value","defaultValue","onChange"],pJt),s=i.value,[l,c]=W2({value:()=>s===void 0?void 0:i.value??"",defaultValue:()=>i.defaultValue,onChange:g=>i.onChange?.(g)}),{formControlContext:u}=mJt(a);vJt(()=>t,()=>c(i.defaultValue??""));const h=g=>{if(u.isReadOnly()||u.isDisabled())return;const y=g.target;c(y.value),y.value=l()??""},m={value:l,generateId:Io(()=>ke(a.id)),onInput:h};return d(ege.Provider,{value:u,get children(){return d(ige.Provider,{value:m,get children(){return d(zt,f({as:"div",ref(g){var y=hn(v=>t=v,i.ref);typeof y=="function"&&y(g)},role:"group",get id(){return ke(a.id)}},()=>u.dataset(),o))}})}})}function lge(e){let t;const n=tX(),r=ft({id:n.generateId("textarea")},e),[i,a]=Me(r,["ref","autoResize","submitOnEnter","onKeyPress"]);fe(vn([()=>t,()=>i.autoResize,()=>n.value()],([s,l])=>{!s||!l||xJt(s)}));const o=s=>{t&&i.submitOnEnter&&s.key==="Enter"&&!s.shiftKey&&t.form&&(t.form.requestSubmit(),s.preventDefault())};return d(oge,f({as:"textarea",get"aria-multiline"(){return i.submitOnEnter?"false":void 0},get onKeyPress(){return Kn([i.onKeyPress,o])},ref(s){var l=hn(c=>t=c,i.ref);typeof l=="function"&&l(s)}},a))}function xJt(e){const t=e.style.alignSelf,n=e.style.overflow;"MozAppearance"in e.style||(e.style.overflow="hidden"),e.style.alignSelf="start",e.style.height="auto",e.style.height=`${e.scrollHeight+(e.offsetHeight-e.clientHeight)}px`,e.style.overflow=n,e.style.alignSelf=t}var R1=Object.assign(sge,{Description:tge,ErrorMessage:rge,Input:age,Label:nge,TextArea:lge}),_Jt=ie("<div data-slot=input-wrapper>");function MJt(e){const t=M0(),[n,r]=Me(e,["name","defaultValue","value","onChange","onKeyDown","validationState","required","disabled","readOnly","class","label","hideLabel","description","error","variant","copyable","copyKind","multiline"]),[i,a]=Ce(!1),o=()=>i()?t.t("ui.textField.copied"):n.copyKind==="link"?t.t("ui.textField.copyLink"):t.t("ui.textField.copyToClipboard"),s=()=>i()?"check":n.copyKind==="link"?"link":"copy";async function l(){const u=n.value??n.defaultValue??"";await navigator.clipboard.writeText(u),a(!0),setTimeout(()=>a(!1),2e3)}function c(){n.copyable&&l()}return d(R1,{"data-component":"input",get"data-variant"(){return n.variant||"normal"},get name(){return n.name},get defaultValue(){return n.defaultValue},get value(){return n.value},get onChange(){return n.onChange},get onKeyDown(){return n.onKeyDown},onClick:c,get required(){return n.required},get disabled(){return n.disabled},get readOnly(){return n.readOnly},get validationState(){return n.validationState},get children(){return[d(ve,{get when(){return n.label},get children(){return d(R1.Label,{"data-slot":"input-label",get classList(){return{"sr-only":n.hideLabel}},get children(){return n.label}})}}),(()=>{var u=_Jt();return K(u,d(ve,{get when(){return n.multiline},get fallback(){return d(R1.Input,f(r,{"data-slot":"input-input",get class(){return n.class}}))},get children(){return d(R1.TextArea,f(r,{autoResize:!0,"data-slot":"input-input",get class(){return n.class}}))}}),null),K(u,d(ve,{get when(){return n.copyable},get children(){return d(Ua,{get value(){return o()},placement:"top",gutter:4,get forceOpen(){return i()},skipDelayDuration:0,get children(){return d(Sr,{type:"button",get icon(){return s()},variant:"ghost",onClick:l,tabIndex:-1,"data-slot":"input-copy-button",get"aria-label"(){return o()}})}})}}),null),u})(),d(ve,{get when(){return n.description},get children(){return d(R1.Description,{"data-slot":"input-description",get children(){return n.description}})}}),d(R1.ErrorMessage,{"data-slot":"input-error",get children(){return n.error}})]}})}var SJt=ie('<div class="relative flex-1 h-screen w-screen min-h-0 flex flex-col items-center justify-center bg-background-base font-sans"><div class="w-2/3 max-w-3xl flex flex-col items-center justify-center gap-8"><div class="flex flex-col items-center gap-2 text-center"><h1 class="text-lg font-medium text-text-strong"></h1><p class="text-sm text-text-weak"></p></div><div class="flex items-center gap-3"></div><div class="flex flex-col items-center gap-2"><div class="flex items-center justify-center gap-1"><button type=button class="flex items-center text-text-interactive-base gap-1"><div>'),CJt=ie('<p class="text-xs text-text-danger-base text-center max-w-2xl">'),LJt=ie('<p class="text-xs text-text-weak">');const Qg=`
|
|
2564
|
+
...`:s,e.appendChild(g);const v=document.createElement("div");v.className="mention-preview-footer",v.style.cursor="pointer",v.innerHTML="<span>Click to open</span>",v.addEventListener("click",()=>{l?.(),i()}),e.appendChild(v),e.style.position="fixed";const k=8,b=360,x=Math.min(a.left,window.innerWidth-b-16);e.style.left=`${x}px`,e.style.width=`${b}px`,window.innerHeight-a.bottom-k>200?e.style.top=`${a.bottom+k}px`:e.style.bottom=`${window.innerHeight-a.top+k}px`,e.addEventListener("mouseenter",()=>{t=!0,n&&(clearTimeout(n),n=null)}),e.addEventListener("mouseleave",()=>{t=!1,n=setTimeout(()=>{t||i()},400)}),document.body.appendChild(e),requestAnimationFrame(()=>{e?.classList.add("is-visible")})}function i(){n&&(clearTimeout(n),n=null),t=!1,e&&(e.classList.remove("is-visible"),setTimeout(()=>{e?.remove(),e=null},150))}return{show:r,hide:i,isActive:()=>t||!!n}}const AHt='<svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M10 4.5C5.5 4.5 2.5 10 2.5 10s3 5.5 7.5 5.5 7.5-5.5 7.5-5.5-3-5.5-7.5-5.5z"/><circle cx="10" cy="10" r="2.5"/></svg>',Dte='<svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M6.5 6.5L2 10l4.5 3.5M13.5 6.5L18 10l-4.5 3.5M11.5 4.5l-3 11"/></svg>';function $Ht(e,t){const n=Array.from(e.querySelectorAll("pre")).filter(r=>bpe(r)==="mermaid");for(const r of n){const i=r.querySelector("code")?.textContent??"";if(!i.trim())continue;const a=r.closest('[data-component="markdown-code"]')??r;a.getAttribute("data-mermaid")||(a.setAttribute("data-mermaid","pending"),cHt(i,t).then(o=>{const s=document.createElement("div");s.setAttribute("data-component","mermaid-block");const l=document.createElement("div");l.setAttribute("data-component","mermaid-block-header");const c=document.createElement("span");c.setAttribute("data-component","code-block-lang"),c.textContent="mermaid";const u=document.createElement("button");u.type="button",u.setAttribute("data-component","mermaid-toggle"),u.setAttribute("aria-label","Show code"),u.innerHTML=Dte,l.appendChild(c),l.appendChild(u),s.appendChild(l);const h=document.createElement("div");h.setAttribute("data-component","mermaid-diagram"),h.innerHTML=o,s.appendChild(h);const m=a.cloneNode(!0);m.removeAttribute("data-mermaid"),m.style.display="none",s.appendChild(m);let g=!0;u.addEventListener("click",()=>{g=!g,h.style.display=g?"":"none",m.style.display=g?"none":"",u.innerHTML=g?Dte:AHt,u.setAttribute("aria-label",g?"Show code":"Show diagram")}),a.replaceWith(s)}).catch(()=>{a.removeAttribute("data-mermaid")}))}}function THt(e){const t=Array.from(e.querySelectorAll("pre")).filter(n=>bpe(n)==="csv");for(const n of t){const r=n.querySelector("code")?.textContent??"";if(!r.trim())continue;const i=kpe(r);if(!i)continue;const a=n.closest('[data-component="markdown-code"]')??n,o=document.createElement("div");o.innerHTML=pHt(i);const s=o.firstElementChild;s&&a.replaceWith(s)}}function EHt(e,t){const n=new Map,r=o=>{const s=t(),l=o.getAttribute("data-copied")==="true";NR(o,s,l)},i=async o=>{const s=o.target;if(!(s instanceof Element))return;const l=s.closest('[data-slot="markdown-copy-button"]');if(!(l instanceof HTMLButtonElement))return;const u=l.closest('[data-component="markdown-code"]')?.querySelector("code")?.textContent??"";if(!u)return;const h=navigator?.clipboard;if(!h)return;await h.writeText(u);const m=t();NR(l,m,!0);const g=n.get(l);g&&clearTimeout(g);const y=setTimeout(()=>NR(l,m,!1),2e3);n.set(l,y)},a=Array.from(e.querySelectorAll('[data-slot="markdown-copy-button"]'));for(const o of a)o instanceof HTMLButtonElement&&r(o);return e.addEventListener("click",i),()=>{e.removeEventListener("click",i);for(const o of n.values())clearTimeout(o)}}function Ote(e,t){if(ph.delete(e),ph.set(e,t),ph.size<=yHt)return;const n=ph.keys().next().value;n&&ph.delete(n)}function PHt(e){const[t,n]=Me(e,["text","cacheKey","streaming","class","classList","onLinkClick","fileFetch"]),r=Z9e(),i=M0(),[a,o]=Ce(),[s]=Jr(()=>({text:t.text,key:t.cacheKey,streaming:t.streaming??!1}),async v=>{if(!v.text)return"";const k=v.key??Wh(v.text);return Promise.all(iHt(v.text,v.streaming).map(async(b,x)=>{const w=Wh(b.raw),M=k?`${k}:${x}:${b.mode}`:w;if(M&&w){const L=ph.get(M);if(L&&L.hash===w)return Ote(M,L),L.html}const _=await Promise.resolve(r.parse(b.src)),C=kHt(_);return M&&w&&Ote(M,{hash:w,html:C}),C})).then(b=>b.join("")).catch(()=>Tte(v.text))},{initialValue:Tte(t.text)});let l;const c=NHt(),u=new Map,h=v=>{const k=v.target;if(!(k instanceof Element))return;const b=k.closest("a[href]");if(!(b instanceof HTMLAnchorElement))return;const x=b.getAttribute("href");x&&(/^(?:https?|mailto|tel|blob|data):/.test(x)||v.preventDefault(),t.onLinkClick?.(x,v))},m=v=>{if(!t.fileFetch)return;const k=v.target;if(!(k instanceof Element))return;const b=k.closest("a.file-link");if(!b){c.isActive()||c.hide();return}const x=b.getAttribute("data-file-path");if(!x)return;const w=()=>{const C=b.getAttribute("href")||x;t.onLinkClick?.(C,new MouseEvent("click"))},M=C=>{const L=b.getAttribute("href")||x,S=C.startsWith("http")||C.startsWith("/")||C.startsWith("./")||C.startsWith("#")?C:`./${C}`;b.setAttribute("href",S),b.setAttribute("data-file-path",C);const I=a();if(!I)return;b.textContent?.replace(/^\s*\S+\s*/,"");const A=u.get(x);A&&(u.delete(x),u.set(C,A)),I.dispatchEvent(new CustomEvent("fileLinkUpdated",{bubbles:!0,detail:{oldHref:L,newHref:S,oldPath:x,newPath:C}}))},_=u.get(x);if(_){c.show(b.getBoundingClientRect(),x,_,w,M);return}t.fileFetch(x).then(C=>{C&&(u.set(x,C),b.matches(":hover")&&c.show(b.getBoundingClientRect(),x,C,w,M))})},g=v=>{const k=v.relatedTarget;k?.closest?.(".mention-preview")||k?.closest?.("a.file-link")},y=v=>{if(v.type==="mousedown"&&!c.isActive()){c.hide();return}if(v.type==="scroll"){if(c.isActive())return;c.hide()}};return fe(()=>{const v=mye(),k=a(),b=t.text?s.latest??s()??"":"";if(!k)return;if(!b){k.innerHTML="";return}const x={copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")},w=document.createElement("div");w.innerHTML=b,IHt(w,x,v.mediaUrl),Bqt(k,w,{childrenOnly:!0,onBeforeElUpdated:(M,_)=>(M instanceof HTMLButtonElement&&_ instanceof HTMLButtonElement&&M.getAttribute("data-slot")==="markdown-copy-button"&&_.getAttribute("data-slot")==="markdown-copy-button"&&M.getAttribute("data-copied")==="true"&&NR(_,x,!0),!M.isEqualNode(_))}),THt(k),$Ht(k,mHt()),l||(l=EHt(k,()=>({copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")}))),t.onLinkClick&&k.addEventListener("click",h),t.fileFetch&&(k.addEventListener("mouseover",m),k.addEventListener("mouseout",g),document.addEventListener("scroll",y,{passive:!0,capture:!0}),document.addEventListener("mousedown",y,{capture:!0}))}),me(()=>{l&&l(),c.hide();const v=a();v&&(t.onLinkClick&&v.removeEventListener("click",h),t.fileFetch&&(v.removeEventListener("mouseover",m),v.removeEventListener("mouseout",g),document.removeEventListener("scroll",y,{capture:!0}),document.removeEventListener("mousedown",y,{capture:!0})))}),(()=>{var v=gHt();return Hr(o,v),ki(v,f({get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}},n),!1,!1),v})()}var DHt=ie("<svg>"),OHt=ie("<svg><rect width=3 height=3 rx=1></svg>",!1,!0,!1);const RHt=new Set([1,2,4,7,8,11,13,14]),zHt=new Set([0,3,12,15]),qHt=Array.from({length:16},(e,t)=>({id:t,x:t%4*4,y:Math.floor(t/4)*4,delay:Math.random()*1.5,duration:1+Math.random()*1,outer:RHt.has(t),corner:zHt.has(t)}));function P2(e){return(()=>{var t=DHt();return ki(t,f(e,{viewBox:"0 0 15 15","data-component":"spinner",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},fill:"currentColor"}),!0,!0),K(t,d(Qt,{each:qHt,children:n=>(()=>{var r=OHt();return Qe(i=>{var a=n.x,o=n.y,s=n.corner?0:void 0,l=n.corner?void 0:`${n.outer?"pulse-opacity-dim":"pulse-opacity"} ${n.duration}s ease-in-out infinite`,c=n.corner?void 0:"both",u=n.corner?void 0:`${n.delay}s`;return a!==i.e&&wt(r,"x",i.e=a),o!==i.t&&wt(r,"y",i.t=o),s!==i.a&&Rr(r,"opacity",i.a=s),l!==i.o&&Rr(r,"animation",i.o=l),c!==i.i&&Rr(r,"animation-fill-mode",i.i=c),u!==i.n&&Rr(r,"animation-delay",i.n=u),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),r})()})),t})()}var jHt=ie('<div class="h-full flex items-center justify-center text-text-weak">Unable to parse CSV'),HHt=ie('<div data-component=csv-table-editor class="h-full overflow-auto"><table data-slot=csv-table-inner class="w-full border-collapse text-13-regular"><thead class="sticky top-0 z-10"><tr></tr></thead><tbody>'),FHt=ie("<span class=text-text-weak>"),VHt=ie('<th data-slot=csv-th class="px-3 py-2 text-left font-medium text-text-base border-b border-border-weaker-base cursor-pointer select-none hover:bg-surface-raised-base/20 transition-colors"><span class="inline-flex items-center gap-1">'),BHt=ie("<tr class=bg-transparent>"),UHt=ie('<input type=text class="bg-transparent border border-border-weak-base rounded px-1.5 py-0.5 text-13-regular text-text-base outline-none focus:border-border-base w-full min-w-[60px]"autofocus>'),WHt=ie('<td data-slot=csv-td class="px-3 py-1.5 text-text-base border-b border-border-weaker-base whitespace-nowrap bg-transparent">');function GHt(e){const t=()=>!!e.onChange,[n,r]=Ce(void 0),[i,a]=Ce(!0),[o,s]=Ce(null),[l,c]=Ce(""),u=Z(()=>kpe(e.value)),h=Z(()=>{const v=u();if(!v)return;const k=n();if(k==null)return v;const b=[...v.rows].sort((x,w)=>{const M=x[k]??"",_=w[k]??"",C=Number(M),L=Number(_);return!isNaN(C)&&!isNaN(L)?i()?C-L:L-C:i()?M.localeCompare(_):_.localeCompare(M)});return{headers:v.headers,rows:b}}),m=(v,k,b)=>{if(!e.onChange)return;const x=u();if(!x)return;const w=x.rows.map((M,_)=>_===v?M.map((C,L)=>L===k?b:C):M);e.onChange(fHt({headers:x.headers,rows:w})),s(null)},g=(v,k,b)=>{t()&&(s({row:v,col:k}),c(b))},y=v=>{n()===v?a(!i()):(r(v),a(!0))};return d(ve,{get when(){return h()},get fallback(){return jHt()},children:v=>(()=>{var k=HHt(),b=k.firstChild,x=b.firstChild,w=x.firstChild,M=x.nextSibling;return K(w,d(Qt,{get each(){return v().headers},children:(_,C)=>(()=>{var L=VHt(),S=L.firstChild;return L.$$click=()=>y(C()),K(S,_,null),K(S,d(ve,{get when(){return n()===C()},get children(){var I=FHt();return K(I,()=>i()?"↑":"↓"),I}}),null),L})()})),K(M,d(Qt,{get each(){return v().rows},children:(_,C)=>(()=>{var L=BHt();return K(L,d(Qt,{each:_,children:(S,I)=>{const A=()=>o()?.row===C()&&o()?.col===I();return(()=>{var D=WHt();return D.$$dblclick=()=>g(C(),I(),S),K(D,d(ve,{get when(){return A()},fallback:S,get children(){var P=UHt();return P.$$keydown=O=>{O.key==="Enter"&&m(C(),I(),l()),O.key==="Escape"&&s(null)},P.addEventListener("blur",()=>m(C(),I(),l())),P.$$input=O=>c(O.currentTarget.value),Qe(()=>P.value=l()),P}})),D})()}})),L})()})),k})()})}li(["click","dblclick","input","keydown"]);var ZHt=ie('<div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-12-regular text-text-weak">Preview unavailable'),KHt=ie('<div class="rounded-md border border-border-base bg-background-base overflow-hidden">'),XHt=ie('<div class="max-h-[420px] overflow-auto p-3">'),JHt=ie('<div class="max-h-[420px] overflow-auto">'),YHt=ie('<div class="max-h-[420px] overflow-auto p-4">'),QHt=ie('<div class="relative h-full w-full overflow-visible">'),eFt=ie('<button class="inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-xs text-text-weak hover:text-text-base hover:bg-surface-raised-base/60 transition-colors"><span class="truncate max-w-40">'),tFt=ie('<div class="absolute inset-0 rounded-xl border border-border-weaker-base bg-surface-base shadow-xl flex flex-col overflow-hidden"style="transform-origin:center center;transition:transform 200ms ease, filter 200ms ease"><div class="shrink-0 border-b border-border-weaker-base px-4 py-3 flex items-center gap-3"><div class="flex-1 min-w-0 flex items-center gap-2"><span class="rounded-full bg-surface-raised-base px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-text-weak"></span><span class="truncate text-12-medium text-text-strong font-mono"></span></div></div><div class="min-h-0 flex-1 overflow-hidden">'),nFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">Attributes</div><div class="flex flex-col gap-1.5">'),rFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">Links</div><div class="flex flex-col gap-1">'),iFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">References</div><div class="flex flex-col gap-1">'),aFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">Backlinks</div><div class="flex flex-col gap-1">'),oFt=ie('<div class="w-72 shrink-0 border-l border-border-weaker-base bg-surface-raised-base/30 flex flex-col"><div class="flex-1 overflow-y-auto p-3 flex flex-col gap-4">'),sFt=ie('<div class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5"><div class="text-10-medium uppercase tracking-wide text-text-weaker"></div><div class="mt-0.5 text-11-regular text-text-strong truncate">'),lFt=ie('<button class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 text-left hover:bg-surface-raised-base/60 transition-colors"><div class="text-10-medium uppercase tracking-wide text-text-weaker"></div><div class="mt-0.5 text-11-medium text-text-strong font-mono truncate">'),cFt=ie('<div class="text-10-regular text-text-warning capitalize">'),dFt=ie('<button class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 text-left transition-colors flex items-start gap-1.5"><div class="flex-1 min-w-0"><div class="text-11-medium text-text-strong font-mono truncate">'),uFt=ie('<div class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 flex items-start gap-1.5"><div class="flex-1 min-w-0"><div class="text-11-medium text-text-strong font-mono truncate"></div><div class="text-10-regular text-text-weak truncate">Line '),hFt=ie('<div class="flex h-full"><div class="flex-1 min-h-0 overflow-auto p-4">'),fFt=ie('<div class="flex flex-col items-center gap-2 py-8 text-text-weak"><div class=text-12-regular>Loading details...'),pFt=ie('<div class="text-13-regular text-text-base whitespace-pre-wrap">'),mFt=ie('<div class="flex flex-wrap gap-1.5">'),gFt=ie('<div class="flex items-center gap-2 flex-wrap">'),yFt=ie('<div class="flex items-center gap-2 p-2 rounded-md bg-background-base border border-border-base">'),vFt=ie('<div class="p-3 rounded-md bg-background-base border border-border-base flex flex-col gap-2"><div class="flex items-center gap-2">'),kFt=ie('<div class="flex flex-col gap-3"><div class="text-12-medium uppercase tracking-wide text-text-weak">Decision Traces</div><div class="flex flex-col gap-2 max-h-[200px] overflow-y-auto">'),bFt=ie('<div class="flex justify-between"><span>Assignee</span><span>'),wFt=ie('<div class="flex justify-between"><span>Branch</span><span class=text-11-mono>'),xFt=ie('<div class="flex flex-col gap-4"><div class="flex items-center gap-2"><span class="text-12-medium text-text-info"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span></div><h1 class="text-16-semibold text-text-strong leading-tight"></h1><div class="flex flex-col gap-3"><div class="flex items-center justify-between"><div class="text-12-medium uppercase tracking-wide text-text-weak">Acceptance Criteria</div><div class="flex items-center gap-1"></div></div><div class="flex flex-col gap-2 max-h-[300px] overflow-y-auto"></div></div><div class="pt-4 border-t border-border-weaker-base flex flex-col gap-3 text-12-regular text-text-weak"><div class="flex justify-between"><span>Created</span><span>'),_Ft=ie('<span class="rounded-full bg-surface-raised-base px-2.5 py-0.5 text-11-medium text-text-weak">'),MFt=ie('<div class="text-12-regular text-text-weaker italic">No criteria defined'),SFt=ie('<code class="text-11-mono text-text-weak block mt-1 p-1 rounded bg-surface-raised-base truncate">'),CFt=ie('<pre class="mt-1 p-2 rounded bg-background-stronger text-11-mono text-text-weak overflow-x-auto max-h-24">'),LFt=ie('<div class="p-3 rounded-md bg-background-base border border-border-base flex flex-col gap-2"><div class="flex items-start gap-3"><button class="mt-1 shrink-0 cursor-pointer hover:opacity-70 transition-opacity"title="Click to toggle status"></button><div class="flex-1 min-w-0"><div class="text-13-medium text-text-strong leading-normal">'),IFt=ie('<div class="size-3 rounded-full border-2 border-border-strong-base">'),NFt=ie('<div class="text-11-regular text-text-weak truncate">'),AFt=ie('<div class="p-2 rounded-md bg-background-base border border-border-base flex items-start gap-2"><div class="flex-1 min-w-0"><div class="text-12-medium text-text-strong"></div></div><div class="shrink-0 text-11-regular text-text-weaker whitespace-nowrap">'),$Ft=ie('<div class="flex flex-col gap-2"><div class="text-12-medium uppercase tracking-wide text-text-weak">Preview'),TFt=ie('<div class="flex flex-col gap-1.5 max-h-[220px] overflow-y-auto">'),EFt=ie('<div class="flex flex-col gap-2"><div class="text-12-medium uppercase tracking-wide text-text-weak">Contents'),PFt=ie('<div class="flex flex-col gap-2"><div class="text-11-medium uppercase tracking-wide text-text-weak">Recent Ops</div><div class="flex flex-col gap-1 max-h-[180px] overflow-y-auto">'),DFt=ie('<div class="flex h-full"><div class="flex-1 min-h-0 overflow-auto p-4 flex flex-col gap-4">'),OFt=ie('<div class="flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>Loading file...'),RFt=ie('<div class="flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>Loading directory...'),zFt=ie('<div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-12-regular text-text-weak">Empty directory'),qFt=ie('<button class="rounded-md border border-border-base bg-background-base px-3 py-2 text-left hover:bg-surface-raised-base/60 transition-colors"><div class="flex items-center gap-2"><span class="rounded-full bg-surface-raised-base px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-text-weak"></span><span class="truncate text-12-medium text-text-strong"></span></div><div class="mt-1 truncate text-11-regular text-text-weak font-mono">'),jFt=ie('<div class="rounded-md border border-border-base bg-background-base px-2 py-1.5 text-11-regular text-text-weak"><div class="truncate font-mono"></div><div class=text-text-weaker>'),HFt=ie('<span class="w-2 h-2 rounded-full bg-text-success shrink-0 mt-1">');const Rte={w:760,h:620},dU=Tt();function zte(e,t,n){return Math.max(t,Math.min(e,n))}function FFt(e,t){return t||e.includes(":")&&e.split(":")[0]||"entity"}function VFt(e,t){return e.includes(":")?e:t==="issue"?`issue:${e}`:e}function Wz(e){return e.includes(":")?e.split(":").slice(1).join(":"):e}function wpe(e){const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.round(t/6e4)}m ago`:t<864e5?`${Math.round(t/36e5)}h ago`:`${Math.round(t/864e5)}d ago`}const BFt=new Set(["title","name","message","description","purpose","summary","type","kind"]);function qte(e){return e.split("/").pop()||e}function uU(e){return typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e,null,2)??""}function jte(e,t){const n=t.flatMap(r=>e?.facts.filter(i=>i.a===r)??[])[0];return n?uU(n.v):void 0}function UFt(e){return/\.(md|markdown|mdx|note)$/i.test(e)}function WFt(e){return/\.csv$/i.test(e)}function Hte(e){return e.replaceAll("\\","/").replace(/\/+/g,"/")}function Fte(e,t){const n=t.split("#")[0]?.split("?")[0]?.trim();if(!n||/^(?:[a-z]+:|\/\/)/i.test(n))return;const r=Hte(n);if(r.startsWith("/"))return r.replace(/^\/+/,"");const i=Hte(e).split("/").slice(0,-1);for(const a of r.split("/"))if(!(!a||a===".")){if(a===".."){i.pop();continue}i.push(a)}return i.join("/")}function GFt(e){const t=Ef(),n=Z(()=>{if(!(!e.file||e.file.type!=="text"||e.file.encoding==="base64"))return e.file.content}),r=Z(()=>{const l=n();if(!(!l||!UFt(e.path)))return l}),i=Z(()=>{const l=n();if(!(!l||!WFt(e.path)))return l}),a=Z(()=>oB(e.file?.content??"")),o=l=>t.sdk.client.file.read({path:l}).then(c=>c.data).catch(()=>{}),s=async l=>{const c=await o(l);if(!(!c||c.type!=="text"||c.encoding==="base64"))return c.content};return d(ve,{get when(){return e.file},get fallback(){return ZHt()},children:l=>(()=>{var c=KHt();return K(c,d(ve,{get when(){return r()},get fallback(){return d(ve,{get when(){return i()},get fallback(){return(()=>{var u=XHt();return K(u,d(Jse,{mode:"text",get file(){return{name:e.path,contents:l().content,cacheKey:a()}},class:"text-11-mono",get media(){return{mode:"auto",path:e.path,current:l(),readFile:o}}})),u})()},children:u=>(()=>{var h=JHt();return K(h,d(GHt,{get value(){return u()}})),h})()})},children:u=>d(Jne,{data:ZFt,get directory(){return t.sdk.directory},get mediaUrl(){return t.sdk.url},get children(){var h=YHt();return K(h,d(PHt,{get text(){return u()},get cacheKey(){return a()},onLinkClick:m=>{const g=Fte(e.path,m);g&&t.push(`file:${g}`,"file")},fileFetch:m=>{const g=Fte(e.path,m);return g?s(g):Promise.resolve(void 0)}})),h}})})),c})()})}const ZFt={session:[],session_status:{},session_diff:{},message:{},part:{}};function KFt(e){const t=lf(),n=rpe(),r=Cf(),[i,a]=nt({stack:[],size:Rte,open:!1,closing:!1}),o={stack:()=>i.stack,size:()=>i.size,trellis:n,sdk:r,push(s,l){const c=VFt(s,l);a("stack",Ye(u=>{u[u.length-1]?.id!==c&&u.push({key:`${c}:${Date.now()}`,id:c,type:FFt(c,l)})}))},pop(){if(i.stack.length<=1){a("stack",[]);return}a("stack",i.stack.slice(0,-1))},clear(){a("stack",[])},setSize(s,l){a("size",{w:zte(s,560,Math.min(920,window.innerWidth-96)),h:zte(l,420,Math.min(760,window.innerHeight-120))})},getTransform(s){const l=i.stack.length-1-s;return l<=0?{scale:1,offsetY:16,brightness:1,interactive:!0}:{scale:Math.max(.82,1-l*.04),offsetY:l*-28,brightness:Math.max(.5,1-l*.14),interactive:!1}}};return fe(()=>{if(i.stack.length>0){!i.open&&!i.closing&&(a("open",!0),t.show(()=>d(dU.Provider,{value:o,get children(){return d(XFt,{})}}),()=>{ct(()=>{a("open",!1),a("closing",!1),a("stack",[]),a("size",Rte)})}));return}i.open&&!i.closing&&(a("closing",!0),t.close())}),d(dU.Provider,{value:o,get children(){return e.children}})}function Ef(){const e=Lt(dU);if(!e)throw new Error("useEntityDialog must be used within EntityDialogProvider");return e}function XFt(){const e=Ef();return d(qz,{size:"x-large",transition:!0,class:"!h-full !bg-transparent !shadow-none !overflow-visible",get children(){var t=QHt();return K(t,d(Qt,{get each(){return e.stack()},children:(n,r)=>d(JFt,{entry:n,get index(){return r()}})})),t}})}function JFt(e){const t=Ef(),n=Z(()=>t.getTransform(e.index)),r=Z(()=>e.index===t.stack().length-1),i=Z(()=>t.stack()[e.index-1]);return(()=>{var a=tFt(),o=a.firstChild,s=o.firstChild,l=s.firstChild,c=l.nextSibling,u=o.nextSibling;return K(o,d(ve,{get when(){return e.index>0},get children(){var h=eFt(),m=h.firstChild;return h.$$click=()=>t.pop(),K(h,d(Kt,{name:"arrow-left",size:"small"}),m),K(m,(()=>{var g=kt(()=>!!i());return()=>g()?Wz(i().id):"Back"})()),h}}),s),K(l,()=>e.entry.type),K(c,()=>Wz(e.entry.id)),K(o,d(ve,{get when(){return r()},get children(){return d(Sr,{icon:"close-small",variant:"ghost",onClick:()=>t.clear()})}}),null),K(u,d(ve,{get when(){return e.entry.type==="issue"},get fallback(){return d(_pe,{get id(){return e.entry.id},get type(){return e.entry.type}})},get children(){return d(YFt,{get id(){return e.entry.id}})}})),Qe(h=>{var m=`translateY(${n().offsetY}px) scale(${n().scale})`,g=`brightness(${n().brightness})`,y=n().interactive?"auto":"none",v=`${100+e.index}`;return m!==h.e&&Rr(a,"transform",h.e=m),g!==h.t&&Rr(a,"filter",h.t=g),y!==h.a&&Rr(a,"pointer-events",h.a=y),v!==h.o&&Rr(a,"z-index",h.o=v),h},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()}function xpe(e){const t=Ef(),[n]=Jr(()=>e.entityId,t.trellis.fetchEntity),[r]=Jr(()=>e.entityId,t.trellis.fetchRefs),i=Z(()=>(n()?.facts??[]).filter(s=>!BFt.has(s.a))),a=Z(()=>n()?.links??[]),o=Z(()=>i().length>0||a().length>0||(r()?.outgoing.length??0)>0||(r()?.incoming.length??0)>0);return d(ve,{get when(){return o()},get children(){var s=oFt(),l=s.firstChild;return K(l,d(ve,{get when(){return i().length>0},get children(){var c=nFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"tag",size:"small"}),h),K(m,d(Qt,{get each(){return i().slice(0,24)},children:g=>(()=>{var y=sFt(),v=y.firstChild,k=v.nextSibling;return K(v,()=>g.a),K(k,()=>uU(g.v)),Qe(()=>wt(k,"title",uU(g.v))),y})()})),c}}),null),K(l,d(ve,{get when(){return a().length>0},get children(){var c=rFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"arrow-right",size:"small"}),h),K(m,d(Qt,{get each(){return a().slice(0,16)},children:g=>(()=>{var y=lFt(),v=y.firstChild,k=v.nextSibling;return y.$$click=()=>t.push(g.e2),K(v,()=>g.a),K(k,()=>Wz(g.e2)),y})()})),c}}),null),K(l,d(ve,{get when(){return(r()?.outgoing.length??0)>0},get children(){var c=iFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"link",size:"small"}),h),K(m,d(Qt,{get each(){return r()?.outgoing},children:g=>{const y=`${g.namespace}:${g.target}`,v=g.state==="resolved"&&!!g.namespace&&!!g.target;return(()=>{var k=dFt(),b=k.firstChild,x=b.firstChild;return k.$$click=()=>v&&t.push(y,g.namespace),K(k,d(QFt,{get state(){return g.state}}),b),K(x,()=>g.title??y),K(b,d(ve,{get when(){return g.state!=="resolved"},get children(){var w=cFt();return K(w,()=>g.state,null),K(w,(()=>{var M=kt(()=>!!g.staleReason);return()=>M()?` (${g.staleReason})`:""})(),null),w}}),null),Qe(w=>hr(k,{"hover:bg-surface-raised-base/60 cursor-pointer":v,"cursor-default":!v},w)),k})()}})),c}}),null),K(l,d(ve,{get when(){return(r()?.incoming.length??0)>0},get children(){var c=aFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"arrow-left",size:"small"}),h),K(m,d(Qt,{get each(){return r()?.incoming},children:g=>(()=>{var y=uFt(),v=y.firstChild,k=v.firstChild,b=k.nextSibling;return b.firstChild,K(y,d(Kt,{name:"link",size:"small",class:"mt-0.5 shrink-0 text-icon-weak"}),v),K(k,()=>g.filePath),K(b,()=>g.line,null),y})()})),c}}),null),s}})}function YFt(e){const n=Ef().trellis,[r,i]=nt({busy:!1,adding:!1,newAcDesc:"",newAcCmd:"",assigning:!1,assignee:""}),a=Z(()=>e.id.replace(/^issue:/,"")),[o,s]=Jr(a,g=>n.getIssue(g)),[l]=Jr(a,g=>n.fetchDecisionChain(`issue:${g}`)),c=async g=>{i("busy",!0);try{await g(),await n.refresh(),s.refetch()}catch(y){console.error("[entity-dialog] action failed:",y)}finally{i("busy",!1)}},u=Z(()=>{const g=o();if(!g)return[];const y=[];return g.status==="backlog"&&y.push({label:"Triage",run:()=>void c(()=>n.triageIssue(a()))}),(g.status==="backlog"||g.status==="queue")&&y.push({label:"Start",run:()=>void c(()=>n.startIssue(a()))}),g.status==="in_progress"&&y.push({label:"Pause",run:()=>void c(()=>n.pauseIssue(a()))}),g.status==="paused"&&y.push({label:"Resume",run:()=>void c(()=>n.resumeIssue(a()))}),(g.status==="in_progress"||g.status==="paused")&&y.push({label:"Close",run:()=>void c(()=>n.closeIssue(a(),!0))}),g.status==="closed"&&y.push({label:"Reopen",run:()=>void c(()=>n.reopenIssue(a()))}),y}),h=async()=>{const g=r.newAcDesc.trim();g&&(await c(()=>n.addCriterion(a(),g,r.newAcCmd.trim()||void 0)),ct(()=>{i("newAcDesc",""),i("newAcCmd",""),i("adding",!1)}))},m=async()=>{const g=r.assignee.trim();g&&(await c(()=>n.assignIssue(a(),g)),ct(()=>{i("assignee",""),i("assigning",!1)}))};return(()=>{var g=hFt(),y=g.firstChild;return K(y,d(ve,{get when(){return!o.loading},get fallback(){return(()=>{var v=fFt(),k=v.firstChild;return K(v,d(P2,{}),k),v})()},get children(){return d(ve,{get when(){return o()},get fallback(){return d(_pe,{get id(){return e.id},type:"issue"})},children:v=>(()=>{var k=xFt(),b=k.firstChild,x=b.firstChild,w=x.nextSibling,M=w.nextSibling,_=b.nextSibling,C=_.nextSibling,L=C.firstChild,S=L.firstChild,I=S.nextSibling,A=L.nextSibling,D=C.nextSibling,P=D.firstChild,O=P.firstChild,E=O.nextSibling;return K(x,()=>v().id),K(w,()=>v().priority),K(M,()=>v().status),K(_,()=>v().title),K(k,d(ve,{get when(){return v().description},get children(){var T=pFt();return K(T,()=>v().description),T}}),C),K(k,d(ve,{get when(){return v().labels.length>0},get children(){var T=mFt();return K(T,d(Qt,{get each(){return v().labels},children:R=>(()=>{var H=_Ft();return K(H,R),H})()})),T}}),C),K(k,d(ve,{get when(){return u().length>0},get children(){var T=gFt();return K(T,d(Qt,{get each(){return u()},children:R=>d(Mn,{size:"small",variant:"ghost",get onClick(){return R.run},get disabled(){return r.busy},get children(){return R.label}})}),null),K(T,d(ve,{get when(){return!r.assigning},get children(){return d(Mn,{size:"small",variant:"ghost",onClick:()=>i("assigning",!0),get disabled(){return r.busy},children:"Assign"})}}),null),T}}),C),K(k,d(ve,{get when(){return r.assigning},get children(){var T=yFt();return K(T,d(CR,{placeholder:"Agent ID...",get value(){return r.assignee},onInput:R=>i("assignee",R.target.value),onKeyDown:R=>R.key==="Enter"&&void m(),class:"flex-1",autofocus:!0}),null),K(T,d(Sr,{icon:"check-small",variant:"ghost",onClick:()=>void m(),get disabled(){return!r.assignee.trim()}}),null),K(T,d(Sr,{icon:"close-small",variant:"ghost",onClick:()=>i("assigning",!1)}),null),T}}),C),K(I,d(Mn,{size:"small",variant:"ghost",onClick:()=>i("adding",!0),get disabled(){return r.adding},children:"Add"}),null),K(I,d(Mn,{size:"small",variant:"ghost",onClick:()=>void c(async()=>{await n.runCriteria(a())}),get disabled(){return r.busy},children:"Run All"}),null),K(A,d(Qt,{get each(){return v().criteria},get fallback(){return MFt()},children:(T,R)=>(()=>{var H=LFt(),J=H.firstChild,j=J.firstChild,X=j.nextSibling,W=X.firstChild;return j.$$click=()=>{const G=T.status==="passed"?"failed":T.status==="failed"?"pending":"passed";c(()=>n.setCriterionStatus(a(),R(),G))},K(j,d(ve,{get when(){return T.status==="passed"},get fallback(){return d(ve,{get when(){return T.status==="failed"},get fallback(){return IFt()},get children(){return d(Kt,{name:"close-small",size:"small",class:"text-icon-error"})}})},get children(){return d(Kt,{name:"checklist",size:"small",class:"text-icon-success"})}})),K(W,()=>T.description),K(X,d(ve,{get when(){return T.command},get children(){var G=SFt();return K(G,()=>T.command),G}}),null),K(H,d(ve,{get when(){return T.lastOutput},get children(){var G=CFt();return K(G,()=>T.lastOutput),G}}),null),Qe(()=>j.disabled=r.busy),H})()}),null),K(A,d(ve,{get when(){return r.adding},get children(){var T=vFt(),R=T.firstChild;return K(T,d(CR,{placeholder:"Criterion description...",get value(){return r.newAcDesc},onInput:H=>i("newAcDesc",H.target.value),onKeyDown:H=>H.key==="Enter"&&void h(),class:"w-full",autofocus:!0}),R),K(R,d(CR,{placeholder:"Command (optional)...",get value(){return r.newAcCmd},onInput:H=>i("newAcCmd",H.target.value),onKeyDown:H=>H.key==="Enter"&&void h(),class:"flex-1"}),null),K(R,d(Sr,{icon:"check-small",variant:"ghost",onClick:()=>void h(),get disabled(){return!r.newAcDesc.trim()}}),null),K(R,d(Sr,{icon:"close-small",variant:"ghost",onClick:()=>{ct(()=>{i("adding",!1),i("newAcDesc",""),i("newAcCmd","")})}}),null),T}}),null),K(k,d(ve,{get when(){return kt(()=>!!l())()&&l().length>0},get children(){var T=kFt(),R=T.firstChild,H=R.nextSibling;return K(H,d(Qt,{get each(){return l()},children:J=>(()=>{var j=AFt(),X=j.firstChild,W=X.firstChild,G=X.nextSibling;return K(j,d(Kt,{name:"brain",size:"small",class:"mt-0.5 shrink-0 text-icon-weak"}),X),K(W,()=>J.toolName),K(X,d(ve,{get when(){return J.outputSummary},get children(){var Y=NFt();return K(Y,()=>J.outputSummary),Y}}),null),K(G,()=>wpe(J.timestamp)),j})()})),T}}),D),K(E,()=>v().createdAt),K(D,d(ve,{get when(){return v().assignee},get children(){var T=bFt(),R=T.firstChild,H=R.nextSibling;return K(H,()=>v().assignee),T}}),null),K(D,d(ve,{get when(){return v().branch},get children(){var T=wFt(),R=T.firstChild,H=R.nextSibling;return K(H,()=>v().branch),T}}),null),k})()})}})),K(g,d(xpe,{get entityId(){return`issue:${a()}`},type:"issue"}),null),g})()}function _pe(e){const t=Ef(),[n]=Jr(()=>e.id,t.trellis.fetchEntity),[r]=Jr(()=>e.id,t.trellis.fetchDecisionChain),i=Z(()=>Wz(e.id)),[a]=Jr(()=>e.type==="file"?i():void 0,async s=>(await t.sdk.client.file.read({path:s})).data),[o]=Jr(()=>e.type==="directory"?i():void 0,async s=>(await t.sdk.client.file.list({path:s})).data??[]);return Z(()=>jte(n(),["title","name","message","estimatedIntent","url"])??qte(i())),Z(()=>jte(n(),["description","purpose","summary"])),(()=>{var s=DFt(),l=s.firstChild;return K(l,d(ve,{get when(){return e.type==="file"},get children(){var c=$Ft();return c.firstChild,K(c,d(ve,{get when(){return!a.loading},get fallback(){return(()=>{var u=OFt(),h=u.firstChild;return K(u,d(P2,{}),h),u})()},get children(){return d(GFt,{get path(){return i()},get file(){return a()}})}}),null),c}}),null),K(l,d(ve,{get when(){return e.type==="directory"},get children(){var c=EFt();return c.firstChild,K(c,d(ve,{get when(){return!o.loading},get fallback(){return(()=>{var u=RFt(),h=u.firstChild;return K(u,d(P2,{}),h),u})()},get children(){return d(ve,{get when(){return(o()?.length??0)>0},get fallback(){return zFt()},get children(){var u=TFt();return K(u,d(Qt,{get each(){return o()?.slice(0,40)},children:h=>(()=>{var m=qFt(),g=m.firstChild,y=g.firstChild,v=y.nextSibling,k=g.nextSibling;return m.$$click=()=>t.push(h.type==="directory"?`dir:${h.path}`:`file:${h.path}`,h.type),K(y,()=>h.type),K(v,()=>qte(h.path)),K(k,()=>h.path),m})()})),u}})}}),null),c}}),null),K(l,d(ve,{get when(){return kt(()=>!!r())()&&r().length>0},get children(){var c=PFt(),u=c.firstChild,h=u.nextSibling;return K(h,d(Qt,{get each(){return r().slice(0,8)},children:m=>(()=>{var g=jFt(),y=g.firstChild,v=y.nextSibling;return K(y,()=>m.toolName),K(v,()=>wpe(m.timestamp)),g})()})),c}}),null),K(s,d(xpe,{get entityId(){return e.id},get type(){return e.type}}),null),s})()}function QFt(e){return e.state==="resolved"?HFt():e.state==="stale"?d(Kt,{name:"alert-triangle",size:"small",class:"shrink-0 text-text-warning mt-0.5"}):d(Kt,{name:"x-circle",size:"small",class:"shrink-0 text-text-danger mt-0.5"})}li(["click"]);function eVt(){const e=wj(),t=oqt(),n=di();let r,i;return fe(()=>{const a=n.id;if(!a){r&&(t.removeJob(r),r=void 0);return}(e.data.session_status[a]?.type??"idle")!=="idle"?r||(r=t.addJob({type:"generate",label:"Generating...",status:"running"})):r&&(t.removeJob(r),r=void 0)}),fe(()=>{const a=e.data.status;a==="loading"||a==="partial"?i||(i=t.addJob({type:"sync",label:"Syncing project...",status:"running"})):i&&(t.removeJob(i),i=void 0)}),me(()=>{r&&t.removeJob(r),i&&t.removeJob(i),r=void 0,i=void 0}),null}const Mpe=Tt(),Vte=50;function tVt(e){const t=ipe(),[n,r]=nt({items:[],seen:new Set}),i=(h,m)=>{const g={id:crypto.randomUUID(),title:h,type:m,timestamp:Date.now(),read:!1};r(Ye(y=>{y.items.unshift(g),y.items.length>Vte&&(y.items.length=Vte)}))};fe(vn(()=>t?.issues?.map(h=>h.id).join(",")??"",(h,m)=>{if(m===void 0)return;const g=new Set(m.split(",").filter(Boolean));for(const y of t?.issues??[])g.has(y.id)||i(`Issue created: ${y.title}`,"issue")})),fe(vn(()=>t?.workUnits?.map(h=>h.id).join(",")??"",(h,m)=>{if(m===void 0)return;const g=new Set(m.split(",").filter(Boolean));for(const y of t?.workUnits??[])g.has(y.id)||i(`Work unit: ${y.title}`,"op")}));const a=()=>n.items,o=Z(()=>n.items.filter(h=>!h.read).length),s=Z(()=>n.items[0]),u={items:a,unread:o,latest:s,markRead:h=>{r("items",m=>m.id===h,"read",!0)},markAllRead:()=>{r("items",()=>!0,"read",!0)},push:i};return d(Mpe.Provider,{value:u,get children(){return e.children}})}function hQt(){return Lt(Mpe)}function nVt(e,t){e.indexOf(t)===-1&&e.push(t)}function wK(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const el=(e,t,n)=>n>t?t:n<e?e:n;let xK=()=>{};const tl={},Spe=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function rVt(e){return typeof e=="object"&&e!==null}const Cpe=e=>/^0[^.\s]+$/u.test(e);function Lpe(e){let t;return()=>(t===void 0&&(t=e()),t)}const Pf=e=>e,iVt=(e,t)=>n=>t(e(n)),_K=(...e)=>e.reduce(iVt),MK=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Ipe{constructor(){this.subscriptions=[]}add(t){return nVt(this.subscriptions,t),()=>wK(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ia=e=>e*1e3,Ta=e=>e/1e3;function Npe(e,t){return t?e*(1e3/t):0}const aVt=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},Ape=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,oVt=1e-7,sVt=12;function lVt(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Ape(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>oVt&&++s<sVt);return o}function Sm(e,t,n,r){if(e===t&&n===r)return Pf;const i=a=>lVt(a,0,1,e,n);return a=>a===0||a===1?a:Ape(i(a),t,r)}const $pe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Tpe=e=>t=>1-e(1-t),Epe=Sm(.33,1.53,.69,.99),SK=Tpe(Epe),Ppe=$pe(SK),Dpe=e=>e>=1?1:(e*=2)<1?.5*SK(e):.5*(2-Math.pow(2,-10*(e-1))),CK=e=>1-Math.sin(Math.acos(e)),cVt=Tpe(CK),Ope=$pe(CK),dVt=Sm(.42,0,1,1),uVt=Sm(0,0,.58,1),Rpe=Sm(.42,0,.58,1),zpe=e=>Array.isArray(e)&&typeof e[0]!="number";function qpe(e,t){return zpe(e)?e[aVt(0,e.length,t)]:e}const jpe=e=>Array.isArray(e)&&typeof e[0]=="number",hVt={linear:Pf,easeIn:dVt,easeInOut:Rpe,easeOut:uVt,circIn:CK,circInOut:Ope,circOut:cVt,backIn:SK,backInOut:Ppe,backOut:Epe,anticipate:Dpe},fVt=e=>typeof e=="string",Bte=e=>{if(jpe(e)){xK(e.length===4);const[t,n,r,i]=e;return Sm(t,n,r,i)}else if(fVt(e))return hVt[e];return e},Zg=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function pVt(e,t){let n=new Set,r=new Set,i=!1,a=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),e()),u(s)}const c={schedule:(u,h=!1,m=!1)=>{const y=m&&i?n:r;return h&&o.add(u),y.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(s=u,i){a=!0;return}i=!0;const h=n;n=r,r=h,n.forEach(l),n.clear(),i=!1,a&&(a=!1,c.process(u))}};return c}const mVt=40;function Hpe(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Zg.reduce((w,M)=>(w[M]=pVt(a),w),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:m,render:g,postRender:y}=o,v=()=>{const w=tl.useManualTiming,M=w?i.timestamp:performance.now();n=!1,w||(i.delta=r?1e3/60:Math.max(Math.min(M-i.timestamp,mVt),1)),i.timestamp=M,i.isProcessing=!0,s.process(i),l.process(i),c.process(i),u.process(i),h.process(i),m.process(i),g.process(i),y.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(v))},k=()=>{n=!0,r=!0,i.isProcessing||e(v)};return{schedule:Zg.reduce((w,M)=>{const _=o[M];return w[M]=(C,L=!1,S=!1)=>(n||k(),_.schedule(C,L,S)),w},{}),cancel:w=>{for(let M=0;M<Zg.length;M++)o[Zg[M]].cancel(w)},state:i,steps:o}}const{schedule:_o,cancel:hU,state:Gz}=Hpe(typeof requestAnimationFrame<"u"?requestAnimationFrame:Pf,!0);let AR;function gVt(){AR=void 0}const Di={now:()=>(AR===void 0&&Di.set(Gz.isProcessing||tl.useManualTiming?Gz.timestamp:performance.now()),AR),set:e=>{AR=e,queueMicrotask(gVt)}},Fpe=e=>t=>typeof t=="string"&&t.startsWith(e),Vpe=Fpe("--"),yVt=Fpe("var(--"),LK=e=>yVt(e)?vVt.test(e.split("/*")[0].trim()):!1,vVt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ute(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Df={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},D2={...Df,transform:e=>el(0,1,e)},Kg={...Df,default:1},Qp=e=>Math.round(e*1e5)/1e5,IK=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function kVt(e){return e==null}const bVt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,NK=(e,t)=>n=>!!(typeof n=="string"&&bVt.test(n)&&n.startsWith(e)||t&&!kVt(n)&&Object.prototype.hasOwnProperty.call(n,t)),Bpe=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,o,s]=r.match(IK);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},wVt=e=>el(0,255,e),GF={...Df,transform:e=>Math.round(wVt(e))},K1={test:NK("rgb","red"),parse:Bpe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+GF.transform(e)+", "+GF.transform(t)+", "+GF.transform(n)+", "+Qp(D2.transform(r))+")"};function xVt(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const fU={test:NK("#"),parse:xVt,transform:K1.transform},Cm=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),$s=Cm("deg"),zh=Cm("%"),Ze=Cm("px"),_Vt=Cm("vh"),MVt=Cm("vw"),Wte={...zh,parse:e=>zh.parse(e)/100,transform:e=>zh.transform(e*100)},Mh={test:NK("hsl","hue"),parse:Bpe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+zh.transform(Qp(t))+", "+zh.transform(Qp(n))+", "+Qp(D2.transform(r))+")"},Un={test:e=>K1.test(e)||fU.test(e)||Mh.test(e),parse:e=>K1.test(e)?K1.parse(e):Mh.test(e)?Mh.parse(e):fU.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?K1.transform(e):Mh.transform(e),getAnimatableNone:e=>{const t=Un.parse(e);return t.alpha=0,Un.transform(t)}},SVt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function CVt(e){return isNaN(e)&&typeof e=="string"&&(e.match(IK)?.length||0)+(e.match(SVt)?.length||0)>0}const Upe="number",Wpe="color",LVt="var",IVt="var(",Gte="${}",NVt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function rf(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(NVt,l=>(Un.test(l)?(r.color.push(a),i.push(Wpe),n.push(Un.parse(l))):l.startsWith(IVt)?(r.var.push(a),i.push(LVt),n.push(l)):(r.number.push(a),i.push(Upe),n.push(parseFloat(l))),++a,Gte)).split(Gte);return{values:n,split:s,indexes:r,types:i}}function AVt(e){return rf(e).values}function Gpe({split:e,types:t}){const n=e.length;return r=>{let i="";for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){const o=t[a];o===Upe?i+=Qp(r[a]):o===Wpe?i+=Un.transform(r[a]):i+=r[a]}return i}}function $Vt(e){return Gpe(rf(e))}const TVt=e=>typeof e=="number"?0:Un.test(e)?Un.getAnimatableNone(e):e,EVt=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:TVt(e);function PVt(e){const t=rf(e);return Gpe(t)(t.values.map((r,i)=>EVt(r,t.split[i])))}const Ra={test:CVt,parse:AVt,createTransformer:$Vt,getAnimatableNone:PVt};function ZF(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function DVt({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=ZF(l,s,e+1/3),a=ZF(l,s,e),o=ZF(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Zz(e,t){return n=>n>0?t:e}const Of=(e,t,n)=>e+(t-e)*n,KF=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},OVt=[fU,K1,Mh],RVt=e=>OVt.find(t=>t.test(e));function Zte(e){const t=RVt(e);if(!t)return!1;let n=t.parse(e);return t===Mh&&(n=DVt(n)),n}const Kte=(e,t)=>{const n=Zte(e),r=Zte(t);if(!n||!r)return Zz(e,t);const i={...n};return a=>(i.red=KF(n.red,r.red,a),i.green=KF(n.green,r.green,a),i.blue=KF(n.blue,r.blue,a),i.alpha=Of(n.alpha,r.alpha,a),K1.transform(i))},pU=new Set(["none","hidden"]);function zVt(e,t){return pU.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function qVt(e,t){return n=>Of(e,t,n)}function AK(e){return typeof e=="number"?qVt:typeof e=="string"?LK(e)?Zz:Un.test(e)?Kte:FVt:Array.isArray(e)?Zpe:typeof e=="object"?Un.test(e)?Kte:jVt:Zz}function Zpe(e,t){const n=[...e],r=n.length,i=e.map((a,o)=>AK(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=i[o](a);return n}}function jVt(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=AK(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function HVt(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const FVt=(e,t)=>{const n=Ra.createTransformer(t),r=rf(e),i=rf(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?pU.has(e)&&!i.values.length||pU.has(t)&&!r.values.length?zVt(e,t):_K(Zpe(HVt(r,i),i.values),n):Zz(e,t)};function Kpe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Of(e,t,n):AK(e)(e,t)}const VVt=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>_o.update(t,n),stop:()=>hU(t),now:()=>Gz.isProcessing?Gz.timestamp:Di.now()}},Xpe=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=Math.round(e(a/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Kz=2e4;function $K(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Kz;)t+=n,r=e.next(t);return t>=Kz?1/0:t}function Jpe(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min($K(r),Kz);return{type:"keyframes",ease:a=>r.next(i*a).value/t,duration:Ta(i)}}const Dn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function mU(e,t){return e*Math.sqrt(1-t*t)}const BVt=12;function UVt(e,t,n){let r=n;for(let i=1;i<BVt;i++)r=r-e(r)/t(r);return r}const XF=.001;function WVt({duration:e=Dn.duration,bounce:t=Dn.bounce,velocity:n=Dn.velocity,mass:r=Dn.mass}){let i,a,o=1-t;o=el(Dn.minDamping,Dn.maxDamping,o),e=el(Dn.minDuration,Dn.maxDuration,Ta(e)),o<1?(i=c=>{const u=c*o,h=u*e,m=u-n,g=mU(c,o),y=Math.exp(-h);return XF-m/g*y},a=c=>{const h=c*o*e,m=h*n+n,g=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-h),v=mU(Math.pow(c,2),o);return(-i(c)+XF>0?-1:1)*((m-g)*y)/v}):(i=c=>{const u=Math.exp(-c*e),h=(c-n)*e+1;return-XF+u*h},a=c=>{const u=Math.exp(-c*e),h=(n-c)*(e*e);return u*h});const s=5/e,l=UVt(i,a,s);if(e=ia(e),isNaN(l))return{stiffness:Dn.stiffness,damping:Dn.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const GVt=["duration","bounce"],ZVt=["stiffness","damping","mass"];function Xte(e,t){return t.some(n=>e[n]!==void 0)}function KVt(e){let t={velocity:Dn.velocity,stiffness:Dn.stiffness,damping:Dn.damping,mass:Dn.mass,isResolvedFromDuration:!1,...e};if(!Xte(e,ZVt)&&Xte(e,GVt))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*el(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Dn.mass,stiffness:i,damping:a}}else{const n=WVt({...e,velocity:0});t={...t,...n,mass:Dn.mass},t.isResolvedFromDuration=!0}return t}function O2(e=Dn.visualDuration,t=Dn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:h,velocity:m,isResolvedFromDuration:g}=KVt({...n,velocity:-Ta(n.velocity||0)}),y=m||0,v=c/(2*Math.sqrt(l*u)),k=o-a,b=Ta(Math.sqrt(l/u)),x=Math.abs(k)<5;r||(r=x?Dn.restSpeed.granular:Dn.restSpeed.default),i||(i=x?Dn.restDelta.granular:Dn.restDelta.default);let w,M,_,C,L,S;if(v<1)_=mU(b,v),C=(y+v*b*k)/_,w=A=>{const D=Math.exp(-v*b*A);return o-D*(C*Math.sin(_*A)+k*Math.cos(_*A))},L=v*b*C+k*_,S=v*b*k-C*_,M=A=>Math.exp(-v*b*A)*(L*Math.sin(_*A)+S*Math.cos(_*A));else if(v===1){w=D=>o-Math.exp(-b*D)*(k+(y+b*k)*D);const A=y+b*k;M=D=>Math.exp(-b*D)*(b*A*D-y)}else{const A=b*Math.sqrt(v*v-1);w=E=>{const T=Math.exp(-v*b*E),R=Math.min(A*E,300);return o-T*((y+v*b*k)*Math.sinh(R)+A*k*Math.cosh(R))/A};const D=(y+v*b*k)/A,P=v*b*D-k*A,O=v*b*k-D*A;M=E=>{const T=Math.exp(-v*b*E),R=Math.min(A*E,300);return T*(P*Math.sinh(R)+O*Math.cosh(R))}}const I={calculatedDuration:g&&h||null,velocity:A=>ia(M(A)),next:A=>{if(!g&&v<1){const P=Math.exp(-v*b*A),O=Math.sin(_*A),E=Math.cos(_*A),T=o-P*(C*O+k*E),R=ia(P*(L*O+S*E));return s.done=Math.abs(R)<=r&&Math.abs(o-T)<=i,s.value=s.done?o:T,s}const D=w(A);if(g)s.done=A>=h;else{const P=ia(M(A));s.done=Math.abs(P)<=r&&Math.abs(o-D)<=i}return s.value=s.done?o:D,s},toString:()=>{const A=Math.min($K(I),Kz),D=Xpe(P=>I.next(A*P).value,A,30);return A+"ms "+D},toTransition:()=>{}};return I}O2.applyToOptions=e=>{const t=Jpe(e,100,O2);return e.ease=t.ease,e.duration=ia(t.duration),e.type="keyframes",e};const XVt=5;function Ype(e,t,n){const r=Math.max(t-XVt,0);return Npe(n-e(r),t-r)}function gU({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:c=.5,restSpeed:u}){const h=e[0],m={done:!1,value:h},g=S=>s!==void 0&&S<s||l!==void 0&&S>l,y=S=>s===void 0?l:l===void 0||Math.abs(s-S)<Math.abs(l-S)?s:l;let v=n*t;const k=h+v,b=o===void 0?k:o(k);b!==k&&(v=b-h);const x=S=>-v*Math.exp(-S/r),w=S=>b+x(S),M=S=>{const I=x(S),A=w(S);m.done=Math.abs(I)<=c,m.value=m.done?b:A};let _,C;const L=S=>{g(m.value)&&(_=S,C=O2({keyframes:[m.value,y(m.value)],velocity:Ype(w,S,m.value),damping:i,stiffness:a,restDelta:c,restSpeed:u}))};return L(0),{calculatedDuration:null,next:S=>{let I=!1;return!C&&_===void 0&&(I=!0,M(S),L(S)),_!==void 0&&S>=_?C.next(S-_):(!I&&M(S),m)}}}function JVt(e,t,n){const r=[],i=n||tl.mix||Kpe,a=e.length-1;for(let o=0;o<a;o++){let s=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Pf:t;s=_K(l,s)}r.push(s)}return r}function YVt(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(xK(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=JVt(t,r,i),l=s.length,c=u=>{if(o&&u<e[0])return t[0];let h=0;if(l>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const m=MK(e[h],e[h+1],u);return s[h](m)};return n?u=>c(el(e[0],e[a-1],u)):c}function Qpe(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=MK(0,t,r);e.push(Of(n,1,i))}}function e2e(e){const t=[0];return Qpe(t,e.length-1),t}function QVt(e,t){return e.map(n=>n*t)}function eBt(e,t){return e.map(()=>t||Rpe).splice(0,e.length-1)}function e2({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=zpe(r)?r.map(Bte):Bte(r),a={done:!1,value:t[0]},o=QVt(n&&n.length===t.length?n:e2e(t),e),s=YVt(o,t,{ease:Array.isArray(i)?i:eBt(t,i)});return{calculatedDuration:e,next:l=>(a.value=s(l),a.done=l>=e,a)}}const tBt=e=>e!==null;function Aj(e,{repeat:t,repeatType:n="loop"},r,i=1){const a=e.filter(tBt),s=i<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!s||r===void 0?a[s]:r}const nBt={decay:gU,inertia:gU,tween:e2,keyframes:e2,spring:O2};function t2e(e){typeof e.type=="string"&&(e.type=nBt[e.type])}class TK{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const rBt=e=>e/100;class Xz extends TK{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Di.now()&&this.tick(Di.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;t2e(t);const{type:n=e2,repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=t;let{keyframes:s}=t;const l=n||e2;l!==e2&&typeof s[0]!="number"&&(this.mixKeyframes=_K(rBt,Kpe(s[0],s[1])),s=[0,100]);const c=l({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...s].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=$K(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:s,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:m,repeatDelay:g,type:y,onUpdate:v,finalKeyframe:k}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const b=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?b<0:b>i;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,M=r;if(h){const S=Math.min(this.currentTime,i)/s;let I=Math.floor(S),A=S%1;!A&&S>=1&&(A=1),A===1&&I--,I=Math.min(I,h+1),!!(I%2)&&(m==="reverse"?(A=1-A,g&&(A-=g/s)):m==="mirror"&&(M=o)),w=el(0,1,A)*s}let _;x?(this.delayState.value=u[0],_=this.delayState):_=M.next(w),a&&!x&&(_.value=a(_.value));let{done:C}=_;!x&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return L&&y!==gU&&(_.value=Aj(u,this.options,k,this.speed)),v&&v(_.value),L&&this.finish(),_}then(t,n){return this.finished.then(t,n)}get duration(){return Ta(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ta(t)}get time(){return Ta(this.currentTime)}set time(t){t=ia(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Ype(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Di.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Ta(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=VVt,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Di.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function iBt(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const X1=e=>e*180/Math.PI,yU=e=>{const t=X1(Math.atan2(e[1],e[0]));return vU(t)},aBt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:yU,rotateZ:yU,skewX:e=>X1(Math.atan(e[1])),skewY:e=>X1(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vU=e=>(e=e%360,e<0&&(e+=360),e),Jte=yU,Yte=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Qte=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),oBt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Yte,scaleY:Qte,scale:e=>(Yte(e)+Qte(e))/2,rotateX:e=>vU(X1(Math.atan2(e[6],e[5]))),rotateY:e=>vU(X1(Math.atan2(-e[2],e[0]))),rotateZ:Jte,rotate:Jte,skewX:e=>X1(Math.atan(e[4])),skewY:e=>X1(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function kU(e){return e.includes("scale")?1:0}function bU(e,t){if(!e||e==="none")return kU(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=oBt,i=n;else{const s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=aBt,i=s}if(!i)return kU(t);const a=r[t],o=i[1].split(",").map(lBt);return typeof a=="function"?a(o):o[a]}const sBt=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return bU(n,t)};function lBt(e){return parseFloat(e.trim())}const Rf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zf=new Set(Rf),ene=e=>e===Df||e===Ze,cBt=new Set(["x","y","z"]),dBt=Rf.filter(e=>!cBt.has(e));function uBt(e){const t=[];return dBt.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const zs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>bU(t,"x"),y:(e,{transform:t})=>bU(t,"y")};zs.translateX=zs.x;zs.translateY=zs.y;const t0=new Set;let wU=!1,xU=!1,_U=!1;function n2e(){if(xU){const e=Array.from(t0).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=uBt(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,o])=>{r.getValue(a)?.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}xU=!1,wU=!1,t0.forEach(e=>e.complete(_U)),t0.clear()}function r2e(){t0.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xU=!0)})}function hBt(){_U=!0,r2e(),n2e(),_U=!1}class EK{constructor(t,n,r,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(t0.add(this),wU||(wU=!0,_o.read(r2e),_o.resolveKeyframes(n2e))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const a=i?.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const s=r.readValue(n,o);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=o),i&&a===void 0&&i.set(t[0])}iBt(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),t0.delete(this)}cancel(){this.state==="scheduled"&&(t0.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const fBt=e=>e.startsWith("--");function i2e(e,t,n){fBt(t)?e.style.setProperty(t,n):e.style[t]=n}const pBt={};function a2e(e,t){const n=Lpe(e);return()=>pBt[t]??n()}const mBt=a2e(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),o2e=a2e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Op=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,tne={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Op([0,.65,.55,1]),circOut:Op([.55,0,1,.45]),backIn:Op([.31,.01,.66,-.59]),backOut:Op([.33,1.53,.69,.99])};function s2e(e,t){if(e)return typeof e=="function"?o2e()?Xpe(e,t):"ease-out":jpe(e)?Op(e):Array.isArray(e)?e.map(n=>s2e(n,t)||tne.easeOut):tne[e]}function gBt(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const h=s2e(s,i);Array.isArray(h)&&(u.easing=h);const m={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(u,m)}function PK(e){return typeof e=="function"&&"applyToOptions"in e}function yBt({type:e,...t}){return PK(e)&&o2e()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class l2e extends TK{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:s,onComplete:l}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,xK(typeof t.type!="string");const c=yBt(t);this.animation=gBt(n,r,i,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const u=Aj(i,this.options,s,this.speed);this.updateMotionValue&&this.updateMotionValue(u),i2e(n,r,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Ta(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ta(t)}get time(){return Ta(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ia(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&mBt()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Pf):i(this)}}const c2e={anticipate:Dpe,backInOut:Ppe,circInOut:Ope};function vBt(e){return e in c2e}function kBt(e){typeof e.ease=="string"&&vBt(e.ease)&&(e.ease=c2e[e.ease])}const JF=10;class bBt extends l2e{constructor(t){kBt(t),t2e(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:a,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const s=new Xz({...o,autoplay:!1}),l=Math.max(JF,Di.now()-this.startTime),c=el(0,JF,l-JF),u=s.sample(l).value,{name:h}=this.options;a&&h&&i2e(a,h,u),n.setWithVelocity(s.sample(Math.max(0,l-c)).value,u,c),s.stop()}}const nne=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ra.test(e)||e==="0")&&!e.startsWith("url("));function wBt(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function xBt(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=nne(i,t),s=nne(a,t);return!o||!s?!1:wBt(e)||(n==="spring"||PK(n))&&r}function MU(e){e.duration=0,e.type="keyframes"}const d2e=new Set(["opacity","clipPath","filter","transform"]),_Bt=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function MBt(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&_Bt.test(e[t]))return!0;return!1}const SBt=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),CBt=Lpe(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function LBt(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return CBt()&&n&&(d2e.has(n)||SBt.has(n)&&MBt(s))&&(n!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&a!==0&&o!=="inertia"}const IBt=40;class NBt extends TK{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:s,name:l,motionValue:c,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Di.now();const m={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:o,name:l,motionValue:c,element:u,...h},g=u?.KeyframeResolver||EK;this.keyframeResolver=new g(s,(y,v,k)=>this.onKeyframesResolved(y,v,m,!k),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:s,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Di.now();let h=!0;xBt(t,a,o,s)||(h=!1,(tl.instantAnimations||!l)&&u?.(Aj(t,r,n)),t[0]=t[t.length-1],MU(r),r.repeat=0);const g={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>IBt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},y=h&&!c&&LBt(g),v=g.motionValue?.owner?.current;let k;if(y)try{k=new bBt({...g,element:v})}catch{k=new Xz(g)}else k=new Xz(g);k.finished.then(()=>{this.notifyFinished()}).catch(Pf),this.pendingTimeline&&(this.stopTimeline=k.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=k}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),hBt()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class ABt{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t){const n=this.animations.map(r=>r.attachTimeline(t));return()=>{n.forEach((r,i)=>{r&&r(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return rne(this.animations,"duration")}get iterationDuration(){return rne(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function rne(e,t){let n=0;for(let r=0;r<e.length;r++){const i=e[r][t];i!==null&&i>n&&(n=i)}return n}class $Bt extends ABt{then(t,n){return this.finished.finally(t).then(()=>{})}}const TBt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function EBt(e){const t=TBt.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function u2e(e,t,n=1){const[r,i]=EBt(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return Spe(o)?parseFloat(o):o}return LK(i)?u2e(i,t,n+1):i}const PBt={type:"spring",stiffness:500,damping:25,restSpeed:10},DBt=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),OBt={type:"keyframes",duration:.8},RBt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},zBt=(e,{keyframes:t})=>t.length>2?OBt:zf.has(e)?e.startsWith("scale")?DBt(t[1]):PBt:RBt;function h2e(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function f2e(e,t){const n=e?.[t]??e?.default??e;return n!==e?h2e(n,e):n}const qBt=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function jBt(e){for(const t in e)if(!qBt.has(t))return!0;return!1}const p2e=(e,t,n,r={},i,a)=>o=>{const s=f2e(r,e)||{},l=s.delay||r.delay||0;let{elapsed:c=0}=r;c=c-ia(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:m=>{t.set(m),s.onUpdate&&s.onUpdate(m)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};jBt(s)||Object.assign(u,zBt(e,u)),u.duration&&(u.duration=ia(u.duration)),u.repeatDelay&&(u.repeatDelay=ia(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(MU(u),u.delay===0&&(h=!0)),(tl.instantAnimations||tl.skipAnimations||i?.shouldSkipAnimations)&&(h=!0,MU(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,h&&!a&&t.get()!==void 0){const m=Aj(u.keyframes,s);if(m!==void 0){_o.update(()=>{u.onUpdate(m),u.onComplete()});return}}return s.isSync?new Xz(u):new NBt(u)};function ine(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function m2e(e,t,n,r){if(typeof t=="function"){const[i,a]=ine(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=ine(r);t=t(n!==void 0?n:e.custom,i,a)}return t}function HBt(e,t,n){const r=e.getProps();return m2e(r,t,r.custom,e)}const g2e=new Set(["width","height","top","left","right","bottom",...Rf]),ane=30,FBt=e=>!isNaN(parseFloat(e));class VBt{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const i=Di.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Di.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=FBt(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ipe);const r=this.events[t].add(n);return t==="change"?()=>{r(),_o.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Di.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ane)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ane);return Npe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function af(e,t){return new VBt(e,t)}const BBt=e=>Array.isArray(e);function UBt(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,af(n))}function WBt(e){return BBt(e)?e[e.length-1]||0:e}function GBt(e,t){const n=HBt(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a){const s=WBt(a[o]);UBt(e,o,s)}}const ni=e=>!!(e&&e.getVelocity);function ZBt(e){return!!(ni(e)&&e.add)}function KBt(e,t){const n=e.getValue("willChange");if(ZBt(n))return n.add(t);if(!n&&tl.WillChange){const r=new tl.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function DK(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const XBt="framerAppearId",JBt="data-"+DK(XBt);function YBt(e){return e.props[JBt]}function QBt({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function eUt(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t;const l=e.getDefaultTransition();a=a?h2e(a,l):l;const c=a?.reduceMotion;r&&(a=r);const u=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const m in s){const g=e.getValue(m,e.latestValues[m]??null),y=s[m];if(y===void 0||h&&QBt(h,m))continue;const v={delay:n,...f2e(a||{},m)},k=g.get();if(k!==void 0&&!g.isAnimating()&&!Array.isArray(y)&&y===k&&!v.velocity){_o.update(()=>g.set(y));continue}let b=!1;if(window.MotionHandoffAnimation){const M=YBt(e);if(M){const _=window.MotionHandoffAnimation(M,m,_o);_!==null&&(v.startTime=_,b=!0)}}KBt(e,m);const x=c??e.shouldReduceMotion;g.start(p2e(m,g,y,x&&g2e.has(m)?{type:!1}:v,e,b));const w=g.animation;w&&u.push(w)}if(o){const m=()=>_o.update(()=>{o&&GBt(e,o)});u.length?Promise.all(u).then(m):m()}return u}const tUt={test:e=>e==="auto",parse:e=>e},y2e=e=>t=>t.test(e),v2e=[Df,Ze,zh,$s,MVt,_Vt,tUt],one=e=>v2e.find(y2e(e));function nUt(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Cpe(e):!0}const rUt=new Set(["brightness","contrast","saturate","opacity"]);function iUt(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(IK)||[];if(!r)return e;const i=n.replace(r,"");let a=rUt.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const aUt=/\b([a-z-]*)\(.*?\)/gu,SU={...Ra,getAnimatableNone:e=>{const t=e.match(aUt);return t?t.map(iUt).join(" "):e}},CU={...Ra,getAnimatableNone:e=>{const t=Ra.parse(e);return Ra.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},sne={...Df,transform:Math.round},oUt={rotate:$s,rotateX:$s,rotateY:$s,rotateZ:$s,scale:Kg,scaleX:Kg,scaleY:Kg,scaleZ:Kg,skew:$s,skewX:$s,skewY:$s,distance:Ze,translateX:Ze,translateY:Ze,translateZ:Ze,x:Ze,y:Ze,z:Ze,perspective:Ze,transformPerspective:Ze,opacity:D2,originX:Wte,originY:Wte,originZ:Ze},OK={borderWidth:Ze,borderTopWidth:Ze,borderRightWidth:Ze,borderBottomWidth:Ze,borderLeftWidth:Ze,borderRadius:Ze,borderTopLeftRadius:Ze,borderTopRightRadius:Ze,borderBottomRightRadius:Ze,borderBottomLeftRadius:Ze,width:Ze,maxWidth:Ze,height:Ze,maxHeight:Ze,top:Ze,right:Ze,bottom:Ze,left:Ze,inset:Ze,insetBlock:Ze,insetBlockStart:Ze,insetBlockEnd:Ze,insetInline:Ze,insetInlineStart:Ze,insetInlineEnd:Ze,padding:Ze,paddingTop:Ze,paddingRight:Ze,paddingBottom:Ze,paddingLeft:Ze,paddingBlock:Ze,paddingBlockStart:Ze,paddingBlockEnd:Ze,paddingInline:Ze,paddingInlineStart:Ze,paddingInlineEnd:Ze,margin:Ze,marginTop:Ze,marginRight:Ze,marginBottom:Ze,marginLeft:Ze,marginBlock:Ze,marginBlockStart:Ze,marginBlockEnd:Ze,marginInline:Ze,marginInlineStart:Ze,marginInlineEnd:Ze,fontSize:Ze,backgroundPositionX:Ze,backgroundPositionY:Ze,...oUt,zIndex:sne,fillOpacity:D2,strokeOpacity:D2,numOctaves:sne},sUt={...OK,color:Un,backgroundColor:Un,outlineColor:Un,fill:Un,stroke:Un,borderColor:Un,borderTopColor:Un,borderRightColor:Un,borderBottomColor:Un,borderLeftColor:Un,filter:SU,WebkitFilter:SU,mask:CU,WebkitMask:CU},k2e=e=>sUt[e],lUt=new Set([SU,CU]);function b2e(e,t){let n=k2e(e);return lUt.has(n)||(n=Ra),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const cUt=new Set(["auto","none","0"]);function dUt(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!cUt.has(a)&&rf(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=b2e(n,i)}class uUt extends EK{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let h=t[u];if(typeof h=="string"&&(h=h.trim(),LK(h))){const m=u2e(h,n.current);m!==void 0&&(t[u]=m),u===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!g2e.has(r)||t.length!==2)return;const[i,a]=t,o=one(i),s=one(a),l=Ute(i),c=Ute(a);if(l!==c&&zs[r]){this.needsMeasurement=!0;return}if(o!==s)if(ene(o)&&ene(s))for(let u=0;u<t.length;u++){const h=t[u];typeof h=="string"&&(t[u]=parseFloat(h))}else zs[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||nUt(t[i]))&&r.push(i);r.length&&dUt(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=zs[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=zs[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,l])=>{t.getValue(s).set(l)}),this.resolveNoneKeyframes()}}function hUt(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const w2e=(e,t)=>t&&typeof e=="number"?t.transform(e):e,{schedule:fUt}=Hpe(queueMicrotask,!1);function x2e(e){return rVt(e)&&"ownerSVGElement"in e}function pUt(e){return x2e(e)&&e.tagName==="svg"}const mUt=[...v2e,Un,Ra],gUt=e=>mUt.find(y2e(e)),lne=()=>({min:0,max:0}),RK=()=>({x:lne(),y:lne()}),R2=new WeakMap;function yUt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function vUt(e){return typeof e=="string"||Array.isArray(e)}const kUt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bUt=["initial",...kUt];function _2e(e){return yUt(e.animate)||bUt.some(t=>vUt(e[t]))}function wUt(e){return!!(_2e(e)||e.variants)}function xUt(e,t,n){for(const r in t){const i=t[r],a=n[r];if(ni(i))e.addValue(r,i);else if(ni(a))e.addValue(r,af(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,af(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const LU={current:null},M2e={current:!1},_Ut=typeof window<"u";function MUt(){if(M2e.current=!0,!!_Ut)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>LU.current=e.matches;e.addEventListener("change",t),t()}else LU.current=!1}const cne=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let dne={};class S2e{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=EK,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const g=Di.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,_o.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=s;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=_2e(n),this.isVariantNode=wUt(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in m){const y=m[g];c[g]!==void 0&&ni(y)&&y.set(c[g])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,R2.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(M2e.current||MUt(),this.shouldReduceMotion=LU.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),hU(this.notifyUpdate),hU(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&d2e.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:s,times:l,ease:c,duration:u}=n.accelerate,h=new l2e({element:this.current,name:t,keyframes:s,times:l,ease:c,duration:ia(u)}),m=o(h);this.valueSubscriptions.set(t,()=>{m(),h.cancel()});return}const r=zf.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&_o.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in dne){const n=dne[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):RK()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<cne.length;r++){const i=cne[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=xUt(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=af(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Spe(r)||Cpe(r))?r=parseFloat(r):!gUt(r)&&Ra.test(n)&&(r=b2e(t,n)),this.setBaseTarget(t,ni(r)?r.get():r)),ni(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=m2e(this.props,n,this.presenceContext?.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ni(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ipe),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){fUt.render(this.render)}}class C2e extends S2e{constructor(){super(...arguments),this.KeyframeResolver=uUt}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ni(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function SUt({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function CUt(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function LUt(e,t){return SUt(CUt(e.getBoundingClientRect(),t))}const IUt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},NUt=Rf.length;function AUt(e,t,n){let r="",i=!0;for(let a=0;a<NUt;a++){const o=Rf[a],s=e[o];if(s===void 0)continue;let l=!0;if(typeof s=="number")l=s===(o.startsWith("scale")?1:0);else{const c=parseFloat(s);l=o.startsWith("scale")?c===1:c===0}if(!l||n){const c=w2e(s,OK[o]);if(!l){i=!1;const u=IUt[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function L2e(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,s=!1;for(const l in t){const c=t[l];if(zf.has(l)){o=!0;continue}else if(Vpe(l)){i[l]=c;continue}else{const u=w2e(c,OK[l]);l.startsWith("origin")?(s=!0,a[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=AUt(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:l="50%",originY:c="50%",originZ:u=0}=a;r.transformOrigin=`${l} ${c} ${u}`}}function I2e(e,{style:t,vars:n},r,i){const a=e.style;let o;for(o in t)a[o]=t[o];i?.applyProjectionStyles(a,r);for(o in n)a.setProperty(o,n[o])}function une(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const bp={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ze.test(e))e=parseFloat(e);else return e;const n=une(e,t.target.x),r=une(e,t.target.y);return`${n}% ${r}%`}},$Ut={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Ra.parse(e);if(i.length>5)return r;const a=Ra.createTransformer(e),o=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=l;const c=Of(s,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),a(i)}},TUt={borderRadius:{...bp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bp,borderTopRightRadius:bp,borderBottomLeftRadius:bp,borderBottomRightRadius:bp,boxShadow:$Ut};function EUt(e,{layout:t,layoutId:n}){return zf.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!TUt[e]||e==="opacity")}function N2e(e,t,n){const r=e.style,i=t?.style,a={};if(!r)return a;for(const o in r)(ni(r[o])||i&&ni(i[o])||EUt(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(a[o]=r[o]);return a}function PUt(e){return window.getComputedStyle(e)}class DUt extends C2e{constructor(){super(...arguments),this.type="html",this.renderInstance=I2e}readValueFromInstance(t,n){if(zf.has(n))return this.projection?.isProjecting?kU(n):sBt(t,n);{const r=PUt(t),i=(Vpe(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return LUt(t,n)}build(t,n,r){L2e(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return N2e(t,n,r)}}function OUt(e,t){return e in t}class RUt extends S2e{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(OUt(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return RK()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}const zUt={offset:"stroke-dashoffset",array:"stroke-dasharray"},qUt={offset:"strokeDashoffset",array:"strokeDasharray"};function jUt(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?zUt:qUt;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const HUt=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function FUt(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},l,c,u){if(L2e(e,s,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m}=e;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const g of HUt)h[g]!==void 0&&(m[g]=h[g],delete h[g]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&jUt(h,i,a,o,!1)}const A2e=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),VUt=e=>typeof e=="string"&&e.toLowerCase()==="svg";function BUt(e,t,n,r){I2e(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(A2e.has(i)?i:DK(i),t.attrs[i])}function UUt(e,t,n){const r=N2e(e,t,n);for(const i in e)if(ni(e[i])||ni(t[i])){const a=Rf.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}class WUt extends C2e{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=RK}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(zf.has(n)){const r=k2e(n);return r&&r.default||0}return n=A2e.has(n)?n:DK(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return UUt(t,n,r)}build(t,n,r){FUt(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){BUt(t,n,r,i)}mount(t){this.isSVGTag=VUt(t.tagName),super.mount(t)}}function GUt(e,t,n){const r=ni(e)?e:af(e);return r.start(p2e("",r,t,n)),r.animation}function zK(e){return typeof e=="object"&&!Array.isArray(e)}function $2e(e,t,n,r){return e==null?[]:typeof e=="string"&&zK(t)?hUt(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(i=>i!=null):[e]}function ZUt(e,t,n){return e*(t+1)}function hne(e,t,n,r){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function KUt(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];i.at>t&&i.at<n&&(wK(e,i),r--)}}function XUt(e,t,n,r,i,a){KUt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Of(i,a,r[o]),easing:qpe(n,o)})}function JUt(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function YUt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const QUt="easeInOut";function eWt(e,{defaultTransition:t={},...n}={},r,i){const a=t.duration||.3,o=new Map,s=new Map,l={},c=new Map;let u=0,h=0,m=0;for(let g=0;g<e.length;g++){const y=e[g];if(typeof y=="string"){c.set(y,h);continue}else if(!Array.isArray(y)){c.set(y.name,hne(h,y.at,u,c));continue}let[v,k,b={}]=y;b.at!==void 0&&(h=hne(h,b.at,u,c));let x=0;const w=(M,_,C,L=0,S=0)=>{const I=tWt(M),{delay:A=0,times:D=e2e(I),type:P=t.type||"keyframes",repeat:O,repeatType:E,repeatDelay:T=0,...R}=_;let{ease:H=t.ease||"easeOut",duration:J}=_;const j=typeof A=="function"?A(L,S):A,X=I.length,W=PK(P)?P:i?.[P||"keyframes"];if(X<=2&&W){let ue=100;if(X===2&&iWt(I)){const le=I[1]-I[0];ue=Math.abs(le)}const ye={...t,...R};J!==void 0&&(ye.duration=ia(J));const de=Jpe(ye,ue,W);H=de.ease,J=de.duration}J??(J=a);const G=h+j;D.length===1&&D[0]===0&&(D[1]=1);const Y=D.length-I.length;if(Y>0&&Qpe(D,Y),I.length===1&&I.unshift(null),O){J=ZUt(J,O);const ue=[...I],ye=[...D];H=Array.isArray(H)?[...H]:[H];const de=[...H];for(let le=0;le<O;le++){I.push(...ue);for(let Se=0;Se<ue.length;Se++)D.push(ye[Se]+(le+1)),H.push(Se===0?"linear":qpe(de,Se-1))}JUt(D,O)}const oe=G+J;XUt(C,I,H,D,G,oe),x=Math.max(j+J,x),m=Math.max(oe,m)};if(ni(v)){const M=fne(v,s);w(k,b,pne("default",M))}else{const M=$2e(v,k,r,l),_=M.length;for(let C=0;C<_;C++){k=k,b=b;const L=M[C],S=fne(L,s);for(const I in k)w(k[I],nWt(b,I),pne(I,S),C,_)}}u=h,h+=x}return s.forEach((g,y)=>{for(const v in g){const k=g[v];k.sort(YUt);const b=[],x=[],w=[];for(let L=0;L<k.length;L++){const{at:S,value:I,easing:A}=k[L];b.push(I),x.push(MK(0,m,S)),w.push(A||"easeOut")}x[0]!==0&&(x.unshift(0),b.unshift(b[0]),w.unshift(QUt)),x[x.length-1]!==1&&(x.push(1),b.push(null)),o.has(y)||o.set(y,{keyframes:{},transition:{}});const M=o.get(y);M.keyframes[v]=b;const{type:_,...C}=t;M.transition[v]={...C,duration:m,ease:w,times:x,...n}}}),o}function fne(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function pne(e,t){return t[e]||(t[e]=[]),t[e]}function tWt(e){return Array.isArray(e)?e:[e]}function nWt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const rWt=e=>typeof e=="number",iWt=e=>e.every(rWt);function aWt(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=x2e(e)&&!pUt(e)?new WUt(t):new DUt(t);n.mount(e),R2.set(e,n)}function oWt(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new RUt(t);n.mount(e),R2.set(e,n)}function sWt(e,t){return ni(e)||typeof e=="number"||typeof e=="string"&&!zK(t)}function T2e(e,t,n,r){const i=[];if(sWt(e,t))i.push(GUt(e,zK(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;const a=$2e(e,t,r),o=a.length;for(let s=0;s<o;s++){const l=a[s],c=l instanceof Element?aWt:oWt;R2.has(l)||c(l);const u=R2.get(l),h={...n};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(s,o)),i.push(...eUt(u,{...t,transition:h},{}))}}return i}function lWt(e,t,n){const r=[],i=e.map(o=>{if(Array.isArray(o)&&typeof o[0]=="function"){const s=o[0],l=af(0);return l.on("change",s),o.length===1?[l,[0,1]]:o.length===2?[l,[0,1],o[1]]:[l,o[1],o[2]]}return o});return eWt(i,t,n,{spring:O2}).forEach(({keyframes:o,transition:s},l)=>{r.push(...T2e(l,o,s))}),r}function cWt(e){return Array.isArray(e)&&e.some(Array.isArray)}function dWt(e={}){const{scope:t,reduceMotion:n}=e;function r(i,a,o){let s=[],l;if(cWt(i)){const{onComplete:u,...h}=a||{};typeof u=="function"&&(l=u),s=lWt(i,n!==void 0?{reduceMotion:n,...h}:h,t)}else{const{onComplete:u,...h}=o||{};typeof u=="function"&&(l=u),s=T2e(i,a,n!==void 0?{reduceMotion:n,...h}:h,t)}const c=new $Bt(s);return l&&c.finished.then(l),t&&(t.animations.push(c),c.finished.then(()=>{wK(t.animations,c)})),c}return r}const E2e=dWt();var uWt=ie("<div class=size-full>");function hWt(e){const t=bf(),n=ll(),r=di(),i=wj(),a=E0(),o=Z(()=>St(e.directory));return fe(()=>{const s=i.data.path.directory;if(!s||s===e.directory)return;const l=t.pathname.slice(o().length+1);n(`/${St(s)}${l}${t.search}${t.hash}`,{replace:!0})}),fe(()=>{const s=r.id;s&&i.session.sync(s)}),d(Jne,{get data(){return i.data},get directory(){return e.directory},get mediaUrl(){return a.url},onNavigateToSession:s=>n(`/${o()}/session/${s}`),onSessionHref:s=>`/${o()}/session/${s}`,get children(){return d(iqt,{get children(){return e.children}})}})}function fWt(e){const t=di(),n=xr(),r=ll();let i="";const a=Z(()=>t.dir?xo(t.dir)??"":"");return fe(()=>{const o=t.dir;if(o){if(a()){i="";return}i!==o&&(i=o,lr({variant:"error",title:n.t("common.requestFailed"),description:n.t("directory.error.invalidUrl")}),r("/",{replace:!0}))}}),d(ve,{get when(){return a()},keyed:!0,children:o=>d(dPt,{directory:()=>o,get children(){return d(cqt,{get children(){return d(KFt,{get children(){return d(tVt,{get children(){return d(YPt,{get children(){return[d(eVt,{}),(()=>{var s=uWt();return Hr(l=>requestAnimationFrame(()=>E2e(l,{opacity:[0,1],y:[4,0]},{type:"spring",stiffness:400,damping:30})),s),K(s,d(hWt,{directory:o,get children(){return e.children}})),s})()]}})}})}})}})}})})}var pWt=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),mWt=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function gWt(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return pWt.has(n)}const t=e.split("-")[0];return mWt.has(t)}function yWt(e){return gWt(e)?"rtl":"ltr"}function P2e(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:yWt(e)}}var IU=P2e(),Rp=new Set;function mne(){IU=P2e();for(const e of Rp)e(IU)}function vWt(){const[e,t]=Ce(IU),n=Z(()=>e());return dn(()=>{Rp.size===0&&window.addEventListener("languagechange",mne),Rp.add(t),me(()=>{Rp.delete(t),Rp.size===0&&window.removeEventListener("languagechange",mne)})}),{locale:()=>n().locale,direction:()=>n().direction}}var kWt=Tt();function gs(){const e=vWt();return Lt(kWt)||e}var YF=new Map;function bWt(e){const{locale:t}=gs(),n=Z(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return Z(()=>{const r=n();let i;return YF.has(r)&&(i=YF.get(r)),i||(i=new Intl.Collator(t(),e),YF.set(r,i)),i})}const wWt=["top","right","bottom","left"],nl=Math.min,$i=Math.max,Jz=Math.round,Xg=Math.floor,Mo=e=>({x:e,y:e}),xWt={left:"right",right:"left",bottom:"top",top:"bottom"};function NU(e,t,n){return $i(e,nl(t,n))}function O0(e,t){return typeof e=="function"?e(t):e}function rl(e){return e.split("-")[0]}function qf(e){return e.split("-")[1]}function D2e(e){return e==="x"?"y":"x"}function qK(e){return e==="y"?"height":"width"}function Yo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function jK(e){return D2e(Yo(e))}function _Wt(e,t,n){n===void 0&&(n=!1);const r=qf(e),i=jK(e),a=qK(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Yz(o)),[o,Yz(o)]}function MWt(e){const t=Yz(e);return[AU(e),t,AU(t)]}function AU(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const gne=["left","right"],yne=["right","left"],SWt=["top","bottom"],CWt=["bottom","top"];function LWt(e,t,n){switch(e){case"top":case"bottom":return n?t?yne:gne:t?gne:yne;case"left":case"right":return t?SWt:CWt;default:return[]}}function IWt(e,t,n,r){const i=qf(e);let a=LWt(rl(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(AU)))),a}function Yz(e){const t=rl(e);return xWt[t]+e.slice(t.length)}function NWt(e){return{top:0,right:0,bottom:0,left:0,...e}}function O2e(e){return typeof e!="number"?NWt(e):{top:e,right:e,bottom:e,left:e}}function Qz(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function vne(e,t,n){let{reference:r,floating:i}=e;const a=Yo(t),o=jK(t),s=qK(o),l=rl(t),c=a==="y",u=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,m=r[s]/2-i[s]/2;let g;switch(l){case"top":g={x:u,y:r.y-i.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-i.width,y:h};break;default:g={x:r.x,y:r.y}}switch(qf(t)){case"start":g[o]-=m*(n&&c?-1:1);break;case"end":g[o]+=m*(n&&c?-1:1);break}return g}async function AWt(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=O0(t,e),y=O2e(g),k=s[m?h==="floating"?"reference":"floating":h],b=Qz(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(k)))==null||n?k:k.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),x=h==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),M=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},_=Qz(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:w,strategy:l}):x);return{top:(b.top-_.top+y.top)/M.y,bottom:(_.bottom-b.bottom+y.bottom)/M.y,left:(b.left-_.left+y.left)/M.x,right:(_.right-b.right+y.right)/M.x}}const $Wt=50,TWt=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:AWt},l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:h}=vne(c,r,l),m=r,g=0;const y={};for(let v=0;v<a.length;v++){const k=a[v];if(!k)continue;const{name:b,fn:x}=k,{x:w,y:M,data:_,reset:C}=await x({x:u,y:h,initialPlacement:r,placement:m,strategy:i,middlewareData:y,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,h=M??h,y[b]={...y[b],..._},C&&g<$Wt&&(g++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(c=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:u,y:h}=vne(c,m,l)),v=-1)}return{x:u,y:h,placement:m,strategy:i,middlewareData:y}},EWt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=O0(e,t)||{};if(c==null)return{};const h=O2e(u),m={x:n,y:r},g=jK(i),y=qK(g),v=await o.getDimensions(c),k=g==="y",b=k?"top":"left",x=k?"bottom":"right",w=k?"clientHeight":"clientWidth",M=a.reference[y]+a.reference[g]-m[g]-a.floating[y],_=m[g]-a.reference[g],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let L=C?C[w]:0;(!L||!await(o.isElement==null?void 0:o.isElement(C)))&&(L=s.floating[w]||a.floating[y]);const S=M/2-_/2,I=L/2-v[y]/2-1,A=nl(h[b],I),D=nl(h[x],I),P=A,O=L-v[y]-D,E=L/2-v[y]/2+S,T=NU(P,E,O),R=!l.arrow&&qf(i)!=null&&E!==T&&a.reference[y]/2-(E<P?A:D)-v[y]/2<0,H=R?E<P?E-P:E-O:0;return{[g]:m[g]+H,data:{[g]:T,centerOffset:E-T-H,...R&&{alignmentOffset:H}},reset:R}}}),PWt=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...k}=O0(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=rl(i),x=Yo(s),w=rl(s)===s,M=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=m||(w||!v?[Yz(s)]:MWt(s)),C=y!=="none";!m&&C&&_.push(...IWt(s,v,y,M));const L=[s,..._],S=await l.detectOverflow(t,k),I=[];let A=((r=a.flip)==null?void 0:r.overflows)||[];if(u&&I.push(S[b]),h){const E=_Wt(i,o,M);I.push(S[E[0]],S[E[1]])}if(A=[...A,{placement:i,overflows:I}],!I.every(E=>E<=0)){var D,P;const E=(((D=a.flip)==null?void 0:D.index)||0)+1,T=L[E];if(T&&(!(h==="alignment"?x!==Yo(T):!1)||A.every(J=>Yo(J.placement)===x?J.overflows[0]>0:!0)))return{data:{index:E,overflows:A},reset:{placement:T}};let R=(P=A.filter(H=>H.overflows[0]<=0).sort((H,J)=>H.overflows[1]-J.overflows[1])[0])==null?void 0:P.placement;if(!R)switch(g){case"bestFit":{var O;const H=(O=A.filter(J=>{if(C){const j=Yo(J.placement);return j===x||j==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(j=>j>0).reduce((j,X)=>j+X,0)]).sort((J,j)=>J[1]-j[1])[0])==null?void 0:O[0];H&&(R=H);break}case"initialPlacement":R=s;break}if(i!==R)return{reset:{placement:R}}}return{}}}};function kne(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bne(e){return wWt.some(t=>e[t]>=0)}const DWt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=O0(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),s=kne(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:bne(s)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),s=kne(o,n.floating);return{data:{escapedOffsets:s,escaped:bne(s)}}}default:return{}}}}},OWt=new Set(["left","top"]);async function RWt(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rl(n),s=qf(n),l=Yo(n)==="y",c=OWt.has(o)?-1:1,u=a&&l?-1:1,h=O0(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&typeof y=="number"&&(g=s==="end"?y*-1:y),l?{x:g*u,y:m*c}:{x:m*c,y:g*u}}const zWt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await RWt(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},qWt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y:w}=b;return{x,y:w}}},...c}=O0(e,t),u={x:n,y:r},h=await a.detectOverflow(t,c),m=Yo(rl(i)),g=D2e(m);let y=u[g],v=u[m];if(o){const b=g==="y"?"top":"left",x=g==="y"?"bottom":"right",w=y+h[b],M=y-h[x];y=NU(w,y,M)}if(s){const b=m==="y"?"top":"left",x=m==="y"?"bottom":"right",w=v+h[b],M=v-h[x];v=NU(w,v,M)}const k=l.fn({...t,[g]:y,[m]:v});return{...k,data:{x:k.x-n,y:k.y-r,enabled:{[g]:o,[m]:s}}}}}},jWt=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:l=()=>{},...c}=O0(e,t),u=await o.detectOverflow(t,c),h=rl(i),m=qf(i),g=Yo(i)==="y",{width:y,height:v}=a.floating;let k,b;h==="top"||h==="bottom"?(k=h,b=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=h,k=m==="end"?"top":"bottom");const x=v-u.top-u.bottom,w=y-u.left-u.right,M=nl(v-u[k],x),_=nl(y-u[b],w),C=!t.middlewareData.shift;let L=M,S=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=x),C&&!m){const A=$i(u.left,0),D=$i(u.right,0),P=$i(u.top,0),O=$i(u.bottom,0);g?S=y-2*(A!==0||D!==0?A+D:$i(u.left,u.right)):L=v-2*(P!==0||O!==0?P+O:$i(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:L});const I=await o.getDimensions(s.floating);return y!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function $j(){return typeof window<"u"}function jf(e){return R2e(e)?(e.nodeName||"").toLowerCase():"#document"}function qi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Eo(e){var t;return(t=(R2e(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function R2e(e){return $j()?e instanceof Node||e instanceof qi(e).Node:!1}function Va(e){return $j()?e instanceof Element||e instanceof qi(e).Element:!1}function ys(e){return $j()?e instanceof HTMLElement||e instanceof qi(e).HTMLElement:!1}function wne(e){return!$j()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qi(e).ShadowRoot}function Lm(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ba(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function HWt(e){return/^(table|td|th)$/.test(jf(e))}function Tj(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const FWt=/transform|translate|scale|rotate|perspective|filter/,VWt=/paint|layout|strict|content/,Cl=e=>!!e&&e!=="none";let QF;function HK(e){const t=Va(e)?Ba(e):e;return Cl(t.transform)||Cl(t.translate)||Cl(t.scale)||Cl(t.rotate)||Cl(t.perspective)||!FK()&&(Cl(t.backdropFilter)||Cl(t.filter))||FWt.test(t.willChange||"")||VWt.test(t.contain||"")}function BWt(e){let t=il(e);for(;ys(t)&&!of(t);){if(HK(t))return t;if(Tj(t))return null;t=il(t)}return null}function FK(){return QF==null&&(QF=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),QF}function of(e){return/^(html|body|#document)$/.test(jf(e))}function Ba(e){return qi(e).getComputedStyle(e)}function Ej(e){return Va(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function il(e){if(jf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wne(e)&&e.host||Eo(e);return wne(t)?t.host:t}function z2e(e){const t=il(e);return of(t)?e.ownerDocument?e.ownerDocument.body:e.body:ys(t)&&Lm(t)?t:z2e(t)}function z2(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=z2e(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=qi(i);if(a){const s=$U(o);return t.concat(o,o.visualViewport||[],Lm(i)?i:[],s&&n?z2(s):[])}else return t.concat(i,z2(i,[],n))}function $U(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function q2e(e){const t=Ba(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ys(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Jz(n)!==a||Jz(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function VK(e){return Va(e)?e:e.contextElement}function qh(e){const t=VK(e);if(!ys(t))return Mo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=q2e(t);let o=(a?Jz(n.width):n.width)/r,s=(a?Jz(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const UWt=Mo(0);function j2e(e){const t=qi(e);return!FK()||!t.visualViewport?UWt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function WWt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qi(e)?!1:t}function k0(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=VK(e);let o=Mo(1);t&&(r?Va(r)&&(o=qh(r)):o=qh(e));const s=WWt(a,n,r)?j2e(a):Mo(0);let l=(i.left+s.x)/o.x,c=(i.top+s.y)/o.y,u=i.width/o.x,h=i.height/o.y;if(a){const m=qi(a),g=r&&Va(r)?qi(r):r;let y=m,v=$U(y);for(;v&&r&&g!==y;){const k=qh(v),b=v.getBoundingClientRect(),x=Ba(v),w=b.left+(v.clientLeft+parseFloat(x.paddingLeft))*k.x,M=b.top+(v.clientTop+parseFloat(x.paddingTop))*k.y;l*=k.x,c*=k.y,u*=k.x,h*=k.y,l+=w,c+=M,y=qi(v),v=$U(y)}}return Qz({width:u,height:h,x:l,y:c})}function Pj(e,t){const n=Ej(e).scrollLeft;return t?t.left+n:k0(Eo(e)).left+n}function H2e(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Pj(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function GWt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Eo(r),s=t?Tj(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Mo(1);const u=Mo(0),h=ys(r);if((h||!h&&!a)&&((jf(r)!=="body"||Lm(o))&&(l=Ej(r)),h)){const g=k0(r);c=qh(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const m=o&&!h&&!a?H2e(o,l):Mo(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+m.x,y:n.y*c.y-l.scrollTop*c.y+u.y+m.y}}function ZWt(e){return Array.from(e.getClientRects())}function KWt(e){const t=Eo(e),n=Ej(e),r=e.ownerDocument.body,i=$i(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=$i(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Pj(e);const s=-n.scrollTop;return Ba(r).direction==="rtl"&&(o+=$i(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}const xne=25;function XWt(e,t){const n=qi(e),r=Eo(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=FK();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=Pj(r);if(c<=0){const u=r.ownerDocument,h=u.body,m=getComputedStyle(h),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,y=Math.abs(r.clientWidth-h.clientWidth-g);y<=xne&&(a-=y)}else c<=xne&&(a+=c);return{width:a,height:o,x:s,y:l}}function JWt(e,t){const n=k0(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ys(e)?qh(e):Mo(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,c=r*a.y;return{width:o,height:s,x:l,y:c}}function _ne(e,t,n){let r;if(t==="viewport")r=XWt(e,n);else if(t==="document")r=KWt(Eo(e));else if(Va(t))r=JWt(t,n);else{const i=j2e(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Qz(r)}function F2e(e,t){const n=il(e);return n===t||!Va(n)||of(n)?!1:Ba(n).position==="fixed"||F2e(n,t)}function YWt(e,t){const n=t.get(e);if(n)return n;let r=z2(e,[],!1).filter(s=>Va(s)&&jf(s)!=="body"),i=null;const a=Ba(e).position==="fixed";let o=a?il(e):e;for(;Va(o)&&!of(o);){const s=Ba(o),l=HK(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Lm(o)&&!l&&F2e(e,o))?r=r.filter(u=>u!==o):i=s,o=il(o)}return t.set(e,r),r}function QWt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Tj(t)?[]:YWt(t,this._c):[].concat(n),r],s=_ne(t,o[0],i);let l=s.top,c=s.right,u=s.bottom,h=s.left;for(let m=1;m<o.length;m++){const g=_ne(t,o[m],i);l=$i(g.top,l),c=nl(g.right,c),u=nl(g.bottom,u),h=$i(g.left,h)}return{width:c-h,height:u-l,x:h,y:l}}function eGt(e){const{width:t,height:n}=q2e(e);return{width:t,height:n}}function tGt(e,t,n){const r=ys(t),i=Eo(t),a=n==="fixed",o=k0(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Mo(0);function c(){l.x=Pj(i)}if(r||!r&&!a)if((jf(t)!=="body"||Lm(i))&&(s=Ej(t)),r){const g=k0(t,!0,a,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else i&&c();a&&!r&&i&&c();const u=i&&!r&&!a?H2e(i,s):Mo(0),h=o.left+s.scrollLeft-l.x-u.x,m=o.top+s.scrollTop-l.y-u.y;return{x:h,y:m,width:o.width,height:o.height}}function eV(e){return Ba(e).position==="static"}function Mne(e,t){if(!ys(e)||Ba(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Eo(e)===n&&(n=n.ownerDocument.body),n}function V2e(e,t){const n=qi(e);if(Tj(e))return n;if(!ys(e)){let i=il(e);for(;i&&!of(i);){if(Va(i)&&!eV(i))return i;i=il(i)}return n}let r=Mne(e,t);for(;r&&HWt(r)&&eV(r);)r=Mne(r,t);return r&&of(r)&&eV(r)&&!HK(r)?n:r||BWt(e)||n}const nGt=async function(e){const t=this.getOffsetParent||V2e,n=this.getDimensions,r=await n(e.floating);return{reference:tGt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rGt(e){return Ba(e).direction==="rtl"}const B2e={convertOffsetParentRelativeRectToViewportRelativeRect:GWt,getDocumentElement:Eo,getClippingRect:QWt,getOffsetParent:V2e,getElementRects:nGt,getClientRects:ZWt,getDimensions:eGt,getScale:qh,isElement:Va,isRTL:rGt};function U2e(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function iGt(e,t){let n=null,r;const i=Eo(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:h,width:m,height:g}=c;if(s||t(),!m||!g)return;const y=Xg(h),v=Xg(i.clientWidth-(u+m)),k=Xg(i.clientHeight-(h+g)),b=Xg(u),w={rootMargin:-y+"px "+-v+"px "+-k+"px "+-b+"px",threshold:$i(0,nl(1,l))||1};let M=!0;function _(C){const L=C[0].intersectionRatio;if(L!==l){if(!M)return o();L?o(!1,L):r=setTimeout(()=>{o(!1,1e-7)},1e3)}L===1&&!U2e(c,e.getBoundingClientRect())&&o(),M=!1}try{n=new IntersectionObserver(_,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,w)}n.observe(e)}return o(!0),a}function aGt(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=VK(e),u=i||a?[...c?z2(c):[],...t?z2(t):[]]:[];u.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const h=c&&s?iGt(c,n):null;let m=-1,g=null;o&&(g=new ResizeObserver(b=>{let[x]=b;x&&x.target===c&&g&&t&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),n()}),c&&!l&&g.observe(c),t&&g.observe(t));let y,v=l?k0(e):null;l&&k();function k(){const b=k0(e);v&&!U2e(v,b)&&n(),v=b,y=requestAnimationFrame(k)}return n(),()=>{var b;u.forEach(x=>{i&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),h?.(),(b=g)==null||b.disconnect(),g=null,l&&cancelAnimationFrame(y)}}const oGt=zWt,sGt=qWt,lGt=PWt,cGt=jWt,dGt=DWt,uGt=EWt,hGt=(e,t,n)=>{const r=new Map,i={platform:B2e,...n},a={...i.platform,_c:r};return TWt(e,t,{...i,platform:a})};var fGt=ie('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),BK=Tt();function UK(){const e=Lt(BK);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var TU=30,Sne=TU/2,pGt={top:180,right:-90,bottom:0,left:90};function vs(e){const t=UK(),n=ft({size:TU},e),[r,i]=Me(n,["ref","style","size"]),a=()=>t.currentPlacement().split("-")[0],o=mGt(t.contentRef),s=()=>o()?.getPropertyValue("background-color")||"none",l=()=>o()?.getPropertyValue(`border-${a()}-color`)||"none",c=()=>o()?.getPropertyValue(`border-${a()}-width`)||"0px",u=()=>Number.parseInt(c())*2*(TU/r.size),h=()=>`rotate(${pGt[a()]} ${Sne} ${Sne}) translate(0 2)`;return d(zt,f({as:"div",ref(m){var g=hn(t.setArrowRef,r.ref);typeof g=="function"&&g(m)},"aria-hidden":"true",get style(){return Wa({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:s(),stroke:l(),"stroke-width":u()},r.style)}},i,{get children(){var m=fGt(),g=m.firstChild,y=g.firstChild;return y.nextSibling,Qe(()=>wt(g,"transform",h())),m}}))}function mGt(e){const[t,n]=Ce();return fe(()=>{const r=e();r&&n(RU(r).getComputedStyle(r))}),t}function gGt(e){const t=UK(),[n,r]=Me(e,["ref","style"]);return d(zt,f({as:"div",ref(i){var a=hn(t.setPositionerRef,n.ref);typeof a=="function"&&a(i)},"data-popper-positioner":"",get style(){return Wa({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Cne(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const a={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...a,toJSON:()=>a}}function yGt(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Cne(r):e?e.getBoundingClientRect():Cne()}}}function vGt(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var kGt={top:"bottom",right:"left",bottom:"top",left:"right"};function bGt(e,t){const[n,r]=e.split("-"),i=kGt[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function wGt(e){const t=ft({getAnchorRect:m=>m?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=Ce(),[i,a]=Ce(),[o,s]=Ce(t.placement),l=()=>yGt(t.anchorRef?.(),t.getAnchorRect),{direction:c}=gs();async function u(){const m=l(),g=n(),y=i();if(!m||!g)return;const v=(y?.clientHeight||0)/2,k=typeof t.gutter=="number"?t.gutter+v:t.gutter??v;g.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),m.getBoundingClientRect();const b=[oGt(({placement:C})=>{const L=!!C.split("-")[1];return{mainAxis:k,crossAxis:L?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const C=typeof t.flip=="string"?t.flip.split(" "):void 0;if(C!==void 0&&!C.every(vGt))throw new Error("`flip` expects a spaced-delimited list of placements");b.push(lGt({padding:t.overflowPadding,fallbackPlacements:C}))}(t.slide||t.overlap)&&b.push(sGt({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(cGt({padding:t.overflowPadding,apply({availableWidth:C,availableHeight:L,rects:S}){const I=Math.round(S.reference.width);C=Math.floor(C),L=Math.floor(L),g.style.setProperty("--kb-popper-anchor-width",`${I}px`),g.style.setProperty("--kb-popper-content-available-width",`${C}px`),g.style.setProperty("--kb-popper-content-available-height",`${L}px`),t.sameWidth&&(g.style.width=`${I}px`),t.fitViewport&&(g.style.maxWidth=`${C}px`,g.style.maxHeight=`${L}px`)}})),t.hideWhenDetached&&b.push(dGt({padding:t.detachedPadding})),y&&b.push(uGt({element:y,padding:t.arrowPadding}));const x=await hGt(m,g,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...B2e,isRTL:()=>c()==="rtl"}});if(s(x.placement),t.onCurrentPlacementChange?.(x.placement),!g)return;g.style.setProperty("--kb-popper-content-transform-origin",bGt(x.placement,c()));const w=Math.round(x.x),M=Math.round(x.y);let _;if(t.hideWhenDetached&&(_=x.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(g.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${M}px, 0)`,visibility:_}),y&&x.middlewareData.arrow){const{x:C,y:L}=x.middlewareData.arrow,S=x.placement.split("-")[0];Object.assign(y.style,{left:C!=null?`${C}px`:"",top:L!=null?`${L}px`:"",[S]:"100%"})}}fe(()=>{const m=l(),g=n();if(!m||!g)return;const y=aGt(m,g,u,{elementResize:typeof ResizeObserver=="function"});me(y)}),fe(()=>{const m=n(),g=t.contentRef?.();!m||!g||queueMicrotask(()=>{m.style.zIndex=getComputedStyle(g).zIndex})});const h={currentPlacement:o,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:a};return d(BK.Provider,{value:h,get children(){return t.children}})}var Hf=Object.assign(wGt,{Arrow:vs,Context:BK,usePopperContext:UK,Positioner:gGt}),xGt={};Ga(xGt,{Arrow:()=>vs,Content:()=>G2e,Portal:()=>Z2e,Root:()=>K2e,Tooltip:()=>zp,Trigger:()=>X2e,useTooltipContext:()=>Dj});var W2e=Tt();function Dj(){const e=Lt(W2e);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function G2e(e){const t=Dj(),n=ft({id:t.generateId("content")},e),[r,i]=Me(n,["ref","style"]);return fe(()=>me(t.registerContentId(i.id))),d(ve,{get when(){return t.contentPresent()},get children(){return d(Hf.Positioner,{get children(){return d(sq,f({ref(a){var o=hn(s=>{t.setContentRef(s)},r.ref);typeof o=="function"&&o(a)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return Wa({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:a=>a.preventDefault(),onDismiss:()=>t.hideTooltip(!0)},()=>t.dataset(),i))}})}})}function Z2e(e){const t=Dj();return d(ve,{get when(){return t.contentPresent()},get children(){return d(w0,e)}})}function _Gt(e,t,n){const r=e.split("-")[0],i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=[],s=i.left+i.width/2,l=i.top+i.height/2;switch(r){case"top":o.push([i.left,l]),o.push([a.left,a.bottom]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([i.right,l]);break;case"right":o.push([s,i.top]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([a.left,a.bottom]),o.push([s,i.bottom]);break;case"bottom":o.push([i.left,l]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([a.right,a.top]),o.push([i.right,l]);break;case"left":o.push([s,i.top]),o.push([a.right,a.top]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([s,i.bottom]);break}return o}var Ll={},MGt=0,ih=!1,Ho,wp,ah;function K2e(e){const t=`tooltip-${wr()}`,n=`${++MGt}`,r=ft({id:t,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[i,a]=Me(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let o;const[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(),[g,y]=Ce(a.placement),v=x0({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:E=>i.onOpenChange?.(E)}),{present:k}=i0({show:()=>i.forceMount||v.isOpen(),element:()=>h()??null}),b=()=>{Ll[n]=w},x=()=>{for(const E in Ll)E!==n&&(Ll[E](!0),delete Ll[E])},w=(E=!1)=>{E||i.closeDelay&&i.closeDelay<=0?(window.clearTimeout(o),o=void 0,v.close()):o||(o=window.setTimeout(()=>{o=void 0,v.close()},i.closeDelay)),window.clearTimeout(Ho),Ho=void 0,i.skipDelayDuration&&i.skipDelayDuration>=0&&(ah=window.setTimeout(()=>{window.clearTimeout(ah),ah=void 0},i.skipDelayDuration)),ih&&(window.clearTimeout(wp),wp=window.setTimeout(()=>{delete Ll[n],wp=void 0,ih=!1},i.closeDelay))},M=()=>{clearTimeout(o),o=void 0,x(),b(),ih=!0,v.open(),window.clearTimeout(Ho),Ho=void 0,window.clearTimeout(wp),wp=void 0,window.clearTimeout(ah),ah=void 0},_=()=>{x(),b(),!v.isOpen()&&!Ho&&!ih?Ho=window.setTimeout(()=>{Ho=void 0,ih=!0,M()},i.openDelay):v.isOpen()||M()},C=(E=!1)=>{!E&&i.openDelay&&i.openDelay>0&&!o&&!ah?_():M()},L=()=>{window.clearTimeout(Ho),Ho=void 0,ih=!1},S=()=>{window.clearTimeout(o),o=void 0},I=E=>Jn(c(),E)||Jn(h(),E),A=E=>{const T=c(),R=h();if(!(!T||!R))return _Gt(E,T,R)},D=E=>{const T=E.target;if(I(T)){S();return}if(!i.ignoreSafeArea){const R=A(g());if(R&&HU(sre(E),R)){S();return}}o||w()};fe(()=>{if(!v.isOpen())return;const E=ri();E.addEventListener("pointermove",D,!0),me(()=>{E.removeEventListener("pointermove",D,!0)})}),fe(()=>{const E=c();if(!E||!v.isOpen())return;const T=H=>{const J=H.target;Jn(J,E)&&w(!0)},R=RU();R.addEventListener("scroll",T,{capture:!0}),me(()=>{R.removeEventListener("scroll",T,{capture:!0})})}),me(()=>{clearTimeout(o),Ll[n]&&delete Ll[n]});const O={dataset:Z(()=>({"data-expanded":v.isOpen()?"":void 0,"data-closed":v.isOpen()?void 0:""})),isOpen:v.isOpen,isDisabled:()=>i.disabled??!1,triggerOnFocusOnly:()=>i.triggerOnFocusOnly??!1,contentId:s,contentPresent:k,openTooltip:C,hideTooltip:w,cancelOpening:L,generateId:Io(()=>r.id),registerContentId:zr(l),isTargetOnTooltip:I,setTriggerRef:u,setContentRef:m};return d(W2e.Provider,{value:O,get children(){return d(Hf,f({anchorRef:c,contentRef:h,onCurrentPlacementChange:y},a))}})}function X2e(e){let t;const n=Dj(),[r,i]=Me(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let a=!1,o=!1,s=!1;const l=()=>{a=!1},c=()=>{!n.isOpen()&&(o||s)&&n.openTooltip(s)},u=b=>{n.isOpen()&&!o&&!s&&n.hideTooltip(b)},h=b=>{dt(b,r.onPointerEnter),!(b.pointerType==="touch"||n.triggerOnFocusOnly()||n.isDisabled()||b.defaultPrevented)&&(o=!0,c())},m=b=>{dt(b,r.onPointerLeave),b.pointerType!=="touch"&&(o=!1,s=!1,n.isOpen()?u():n.cancelOpening())},g=b=>{dt(b,r.onPointerDown),a=!0,ri(t).addEventListener("pointerup",l,{once:!0})},y=b=>{dt(b,r.onClick),o=!1,s=!1,u(!0)},v=b=>{dt(b,r.onFocus),!(n.isDisabled()||b.defaultPrevented||a)&&(s=!0,c())},k=b=>{dt(b,r.onBlur);const x=b.relatedTarget;n.isTargetOnTooltip(x)||(o=!1,s=!1,u(!0))};return me(()=>{ri(t).removeEventListener("pointerup",l)}),d(zt,f({as:"button",ref(b){var x=hn(w=>{n.setTriggerRef(w),t=w},r.ref);typeof x=="function"&&x(b)},get"aria-describedby"(){return kt(()=>!!n.isOpen())()?n.contentId():void 0},onPointerEnter:h,onPointerLeave:m,onPointerDown:g,onClick:y,onFocus:v,onBlur:k},()=>n.dataset(),i))}var zp=Object.assign(K2e,{Arrow:vs,Content:G2e,Portal:Z2e,Trigger:X2e}),SGt=ie("<div data-slot=tooltip-keybind><span></span><span data-slot=tooltip-keybind-key>");function J2e(e){const[t,n]=Me(e,["title","keybind"]);return d(Ua,f(n,{get value(){return(()=>{var r=SGt(),i=r.firstChild,a=i.nextSibling;return K(i,()=>t.title),K(a,()=>t.keybind),r})()}}))}function Ua(e){let t;const[n,r]=nt({open:!1,block:!1,expand:!1}),[i,a]=Me(e,["children","class","contentClass","contentStyle","inactive","forceOpen","ignoreSafeArea","value"]),o=()=>r("open",!1),s=()=>{const m=document.activeElement;return!t||!m?!1:t.contains(m)},l=(m=n.expand)=>{m||t?.matches(":hover")||s()||r("block",!1)},c=()=>{const m=!!t?.querySelector('[aria-expanded="true"], [data-expanded]');if(r("expand",m),m){r("block",!0),o();return}l(m)},u=()=>{r("block",!0),o()},h=()=>{s()||o(),l()};return fe(()=>{if(!t)return;c();const m=new MutationObserver(c);m.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-expanded","data-expanded"]}),me(()=>m.disconnect())}),d(r0,{get children(){return[d(Zn,{get when(){return i.inactive},get children(){return i.children}}),d(Zn,{when:!0,get children(){return d(zp,f({gutter:4},a,{closeDelay:0,get ignoreSafeArea(){return i.ignoreSafeArea??!0},get open(){return i.forceOpen||n.open},onOpenChange:m=>{i.forceOpen||n.block&&m||r("open",m)},get children(){return[d(zp.Trigger,{ref(m){var g=t;typeof g=="function"?g(m):t=m},as:"div","data-component":"tooltip-trigger",get class(){return i.class},onPointerDownCapture:u,onKeyDownCapture:m=>{m.key!=="Enter"&&m.key!==" "||u()},onPointerLeave:h,onFocusOut:()=>requestAnimationFrame(()=>l()),get children(){return i.children}}),d(zp.Portal,{get children(){return d(zp.Content,{"data-component":"tooltip",get"data-placement"(){return e.placement},get"data-force-open"(){return i.forceOpen},get class(){return i.contentClass},get style(){return i.contentStyle},get children(){return i.value}})}})]}}))}})]}})}function Y2e(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],i=l=>{if(l==null)return"";const c=e.getKey??"key",u=lh(c)?l[c]:c(l);return u!=null?String(u):""},a=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=lh(c)?l[c]:c(l);return u!=null?String(u):""},o=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(lh(c)?l[c]:c(l))??!1},s=l=>{if(l!=null)return lh(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(lh(l)||Lye(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:o(l),level:n,index:t}),t++;continue}if(s(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=s(l)??[];if(c.length>0){const u=Y2e({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:i(l),textValue:a(l),disabled:o(l),level:n,index:t}),t++}return r}function CGt(e,t=[]){return Z(()=>{const n=Y2e({dataSource:ke(e.dataSource),getKey:ke(e.getKey),getTextValue:ke(e.getTextValue),getDisabled:ke(e.getDisabled),getSectionChildren:ke(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var Uo=class Q2e extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof Q2e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function LGt(e){const[t,n]=W2(e);return[()=>t()??new Uo,n]}function eme(e){return Tye()?e.altKey:e.ctrlKey}function mh(e){return oq()?e.metaKey:e.ctrlKey}function Lne(e){return new Uo(e)}function IGt(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function NGt(e){const t=ft({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=Ce(!1),[i,a]=Ce(),o=Z(()=>{const v=ke(t.selectedKeys);return v!=null?Lne(v):v}),s=Z(()=>{const v=ke(t.defaultSelectedKeys);return v!=null?Lne(v):new Uo}),[l,c]=LGt({value:o,defaultValue:s,onChange:v=>t.onSelectionChange?.(v)}),[u,h]=Ce(ke(t.selectionBehavior)),m=()=>ke(t.selectionMode),g=()=>ke(t.disallowEmptySelection)??!1,y=v=>{(ke(t.allowDuplicateSelectionEvents)||!IGt(v,l()))&&c(v)};return fe(()=>{const v=l();ke(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof v=="object"&&v.size===0&&h("replace")}),fe(()=>{h(ke(t.selectionBehavior)??"toggle")}),{selectionMode:m,disallowEmptySelection:g,selectionBehavior:u,setSelectionBehavior:h,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:a,selectedKeys:l,setSelectedKeys:y}}function AGt(e){const[t,n]=Ce(""),[r,i]=Ce(-1);return{typeSelectHandlers:{onKeyDown:o=>{if(ke(e.isDisabled))return;const s=ke(e.keyboardDelegate),l=ke(e.selectionManager);if(!s.getKeyForSearch)return;const c=$Gt(o.key);if(!c||o.ctrlKey||o.metaKey)return;c===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let u=n(m=>m+c),h=s.getKeyForSearch(u,l.focusedKey())??s.getKeyForSearch(u);h==null&&TGt(u)&&(u=u[0],h=s.getKeyForSearch(u,l.focusedKey())??s.getKeyForSearch(u)),h!=null&&(l.setFocusedKey(h),e.onTypeSelect?.(h)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function $Gt(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function TGt(e){return e.split("").every(t=>t===e[0])}function EGt(e,t,n){const i=f({selectOnFocus:()=>ke(e.selectionManager).selectionBehavior()==="replace"},e),a=()=>n?.()??t(),{direction:o}=gs();let s={top:0,left:0};wye(()=>ke(i.isVirtualized)?void 0:a(),"scroll",()=>{const k=a();k&&(s={top:k.scrollTop,left:k.scrollLeft})});const{typeSelectHandlers:l}=AGt({isDisabled:()=>ke(i.disallowTypeAhead),keyboardDelegate:()=>ke(i.keyboardDelegate),selectionManager:()=>ke(i.selectionManager)}),c=()=>ke(i.orientation)??"vertical",u=k=>{dt(k,l.onKeyDown),k.altKey&&k.key==="Tab"&&k.preventDefault();const b=t();if(!b?.contains(k.target))return;const x=ke(i.selectionManager),w=ke(i.selectOnFocus),M=S=>{S!=null&&(x.setFocusedKey(S),k.shiftKey&&x.selectionMode()==="multiple"?x.extendSelection(S):w&&!eme(k)&&x.replaceSelection(S))},_=ke(i.keyboardDelegate),C=ke(i.shouldFocusWrap),L=x.focusedKey();switch(k.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(_.getKeyBelow){k.preventDefault();let S;L!=null?S=_.getKeyBelow(L):S=_.getFirstKey?.(),S==null&&C&&(S=_.getFirstKey?.(L)),M(S)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(_.getKeyAbove){k.preventDefault();let S;L!=null?S=_.getKeyAbove(L):S=_.getLastKey?.(),S==null&&C&&(S=_.getLastKey?.(L)),M(S)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(_.getKeyLeftOf){k.preventDefault();const S=o()==="rtl";let I;L!=null?I=_.getKeyLeftOf(L):I=S?_.getFirstKey?.():_.getLastKey?.(),M(I)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(_.getKeyRightOf){k.preventDefault();const S=o()==="rtl";let I;L!=null?I=_.getKeyRightOf(L):I=S?_.getLastKey?.():_.getFirstKey?.(),M(I)}break}case"Home":if(_.getFirstKey){k.preventDefault();const S=_.getFirstKey(L,mh(k));S!=null&&(x.setFocusedKey(S),mh(k)&&k.shiftKey&&x.selectionMode()==="multiple"?x.extendSelection(S):w&&x.replaceSelection(S))}break;case"End":if(_.getLastKey){k.preventDefault();const S=_.getLastKey(L,mh(k));S!=null&&(x.setFocusedKey(S),mh(k)&&k.shiftKey&&x.selectionMode()==="multiple"?x.extendSelection(S):w&&x.replaceSelection(S))}break;case"PageDown":if(_.getKeyPageBelow&&L!=null){k.preventDefault();const S=_.getKeyPageBelow(L);M(S)}break;case"PageUp":if(_.getKeyPageAbove&&L!=null){k.preventDefault();const S=_.getKeyPageAbove(L);M(S)}break;case"a":mh(k)&&x.selectionMode()==="multiple"&&ke(i.disallowSelectAll)!==!0&&(k.preventDefault(),x.selectAll());break;case"Escape":k.defaultPrevented||(k.preventDefault(),ke(i.disallowEmptySelection)||x.clearSelection());break;case"Tab":if(!ke(i.allowsTabNavigation)){if(k.shiftKey)b.focus();else{const S=Vye(b,{tabbable:!0});let I,A;do A=S.lastChild(),A&&(I=A);while(A);I&&!I.contains(document.activeElement)&&ur(I)}break}}},h=k=>{const b=ke(i.selectionManager),x=ke(i.keyboardDelegate),w=ke(i.selectOnFocus);if(b.isFocused()){k.currentTarget.contains(k.target)||b.setFocused(!1);return}if(k.currentTarget.contains(k.target)){if(b.setFocused(!0),b.focusedKey()==null){const M=C=>{C!=null&&(b.setFocusedKey(C),w&&b.replaceSelection(C))},_=k.relatedTarget;_&&k.currentTarget.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_FOLLOWING?M(b.lastSelectedKey()??x.getLastKey?.()):M(b.firstSelectedKey()??x.getFirstKey?.())}else if(!ke(i.isVirtualized)){const M=a();if(M){M.scrollTop=s.top,M.scrollLeft=s.left;const _=M.querySelector(`[data-key="${b.focusedKey()}"]`);_&&(ur(_),uV(M,_))}}}},m=k=>{const b=ke(i.selectionManager);k.currentTarget.contains(k.relatedTarget)||b.setFocused(!1)},g=k=>{a()===k.target&&k.preventDefault()},y=()=>{const k=ke(i.autoFocus);if(!k)return;const b=ke(i.selectionManager),x=ke(i.keyboardDelegate);let w;k==="first"&&(w=x.getFirstKey?.()),k==="last"&&(w=x.getLastKey?.());const M=b.selectedKeys();M.size&&(w=M.values().next().value),b.setFocused(!0),b.setFocusedKey(w);const _=t();_&&w==null&&!ke(i.shouldUseVirtualFocus)&&ur(_)};return dn(()=>{i.deferAutoFocus?setTimeout(y,0):y()}),fe(vn([a,()=>ke(i.isVirtualized),()=>ke(i.selectionManager).focusedKey()],k=>{const[b,x,w]=k;if(x)w&&i.scrollToKey?.(w);else if(w&&b){const M=b.querySelector(`[data-key="${w}"]`);M&&uV(b,M)}})),{tabIndex:Z(()=>{if(!ke(i.shouldUseVirtualFocus))return ke(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:g,onFocusIn:h,onFocusOut:m}}function tme(e,t){const n=()=>ke(e.selectionManager),r=()=>ke(e.key),i=()=>ke(e.shouldUseVirtualFocus),a=x=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):x?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||mh(x)||"pointerType"in x&&x.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),s=()=>ke(e.disabled)||n().isDisabled(r()),l=()=>!s()&&n().canSelectItem(r());let c=null;const u=x=>{l()&&(c=x.pointerType,x.pointerType==="mouse"&&x.button===0&&!ke(e.shouldSelectOnPressUp)&&a(x))},h=x=>{l()&&x.pointerType==="mouse"&&x.button===0&&ke(e.shouldSelectOnPressUp)&&ke(e.allowsDifferentPressOrigin)&&a(x)},m=x=>{l()&&(ke(e.shouldSelectOnPressUp)&&!ke(e.allowsDifferentPressOrigin)||c!=="mouse")&&a(x)},g=x=>{!l()||!["Enter"," "].includes(x.key)||(eme(x)?n().toggleSelection(r()):a(x))},y=x=>{s()&&x.preventDefault()},v=x=>{const w=t();i()||s()||!w||x.target===w&&n().setFocusedKey(r())},k=Z(()=>{if(!(i()||s()))return r()===n().focusedKey()?0:-1}),b=Z(()=>ke(e.virtualized)?void 0:r());return fe(vn([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([x,w,M,_,C])=>{x&&w===_&&C&&!M&&document.activeElement!==x&&(e.focus?e.focus():ur(x))})),{isSelected:o,isDisabled:s,allowsSelection:l,tabIndex:k,dataKey:b,onPointerDown:u,onPointerUp:h,onClick:m,onKeyDown:g,onMouseDown:y,onFocus:v}}var PGt=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index<e.index;(!e||r)&&(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index>e.index;(!e||r)&&(e=n)}return e?.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new Uo(n,r,t);for(const a of this.getKeyRange(r,n.currentKey||t))i.delete(a);for(const a of this.getKeyRange(t,r))this.canSelectItem(a)&&i.add(a);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new Uo(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new Uo([t],t,t):new Uo;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Uo;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Uo)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},Ine=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function DGt(e){const t=NGt(e),r=CGt({dataSource:()=>ke(e.dataSource),getKey:()=>ke(e.getKey),getTextValue:()=>ke(e.getTextValue),getDisabled:()=>ke(e.getDisabled),getSectionChildren:()=>ke(e.getSectionChildren),factory:a=>e.filter?new Ine(e.filter(a)):new Ine(a)},[()=>e.filter]),i=new PGt(r,t);return n2(()=>{const a=t.focusedKey();a!=null&&!r().getItem(a)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var OGt=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const i=this.collection().getItem(r);if(i){const a=i.textValue.slice(0,e.length);if(i.textValue&&n.compare(a,e)===0)return r}r=this.getKeyBelow(r)}}};function RGt(e,t,n){const r=bWt({usage:"search",sensitivity:"base"}),i=Z(()=>{const a=ke(e.keyboardDelegate);return a||new OGt(e.collection,t,r)});return EGt({selectionManager:()=>ke(e.selectionManager),keyboardDelegate:i,autoFocus:()=>ke(e.autoFocus),deferAutoFocus:()=>ke(e.deferAutoFocus),shouldFocusWrap:()=>ke(e.shouldFocusWrap),disallowEmptySelection:()=>ke(e.disallowEmptySelection),selectOnFocus:()=>ke(e.selectOnFocus),disallowTypeAhead:()=>ke(e.disallowTypeAhead),shouldUseVirtualFocus:()=>ke(e.shouldUseVirtualFocus),allowsTabNavigation:()=>ke(e.allowsTabNavigation),isVirtualized:()=>ke(e.isVirtualized),scrollToKey:a=>ke(e.scrollToKey)?.(a),orientation:()=>ke(e.orientation)},t,n)}var nme=Tt();function rme(){return Lt(nme)}function zGt(){const e=rme();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function ime(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function qGt(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const i=e[r]?.ref();if(i&&ime(i,n))return r+1}return 0}function jGt(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[a,o])=>{const s=i.ref(),l=o.ref();return s===l||!s||!l?0:ime(s,l)?(r>a&&(n=!0),-1):(r<a&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function ame(e,t){const n=jGt(e);e!==n&&t(n)}function HGt(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return ri(r).body}function FGt(e,t){fe(()=>{const n=setTimeout(()=>{ame(e(),t)});me(()=>clearTimeout(n))})}function VGt(e,t){if(typeof IntersectionObserver!="function"){FGt(e,t);return}let n=[];fe(()=>{const r=()=>{const o=!!n.length;n=e(),o&&ame(e(),t)},i=HGt(e()),a=new IntersectionObserver(r,{root:i});for(const o of e()){const s=o.ref();s&&a.observe(s)}me(()=>a.disconnect())})}function BGt(e={}){const[t,n]=sve({value:()=>ke(e.items),onChange:a=>e.onItemsChange?.(a)});VGt(t,n);const r=a=>(n(o=>{const s=qGt(o,a);return Cye(o,a,s)}),()=>{n(o=>{const s=o.filter(l=>l.ref()!==a.ref());return o.length===s.length?o:s})});return{DomCollectionProvider:a=>d(nme.Provider,{value:{registerItem:r},get children(){return a.children}})}}function UGt(e){const t=zGt(),n=ft({shouldRegisterItem:!0},e);fe(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());me(r)})}function WGt(e={}){const[t,n]=pre({value:()=>ke(e.isSelected),defaultValue:()=>!!ke(e.defaultIsSelected),onChange:a=>e.onSelectedChange?.(a)});return{isSelected:t,setIsSelected:a=>{!ke(e.isReadOnly)&&!ke(e.isDisabled)&&n(a)},toggle:()=>{!ke(e.isReadOnly)&&!ke(e.isDisabled)&&n(!t())}}}var GGt=Tt();function Oj(){return Lt(GGt)}var ZGt=Tt();function ome(){return Lt(ZGt)}var sme=Tt();function lme(){return Lt(sme)}function Po(){const e=lme();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var cme=Tt();function WK(){const e=Lt(cme);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var dme=Tt();function fa(){const e=Lt(dme);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function GK(e){let t;const n=fa(),r=Po(),i=ft({id:n.generateId(`item-${wr()}`)},e),[a,o]=Me(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(),g=()=>r.listState().selectionManager(),y=()=>o.id,v=()=>g().focusedKey()===y(),k=()=>{a.onSelect?.(),a.closeOnSelect&&setTimeout(()=>{r.close(!0)})};UGt({getItem:()=>({ref:()=>t,type:"item",key:y(),textValue:a.textValue??h()?.textContent??t?.textContent??"",disabled:a.disabled??!1})});const b=tme({key:y,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>a.disabled},()=>t),x=I=>{dt(I,a.onPointerMove),I.pointerType==="mouse"&&(a.disabled?r.onItemLeave(I):(r.onItemEnter(I),I.defaultPrevented||(ur(I.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(y()))))},w=I=>{dt(I,a.onPointerLeave),I.pointerType==="mouse"&&r.onItemLeave(I)},M=I=>{dt(I,a.onPointerUp),!a.disabled&&I.button===0&&k()},_=I=>{if(dt(I,a.onKeyDown),!I.repeat&&!a.disabled)switch(I.key){case"Enter":case" ":k();break}},C=Z(()=>{if(a.indeterminate)return"mixed";if(a.checked!=null)return a.checked}),L=Z(()=>({"data-indeterminate":a.indeterminate?"":void 0,"data-checked":a.checked&&!a.indeterminate?"":void 0,"data-disabled":a.disabled?"":void 0,"data-highlighted":v()?"":void 0})),S={isChecked:()=>a.checked,dataset:L,setLabelRef:m,generateId:Io(()=>o.id),registerLabel:zr(l),registerDescription:zr(u)};return d(cme.Provider,{value:S,get children(){return d(zt,f({as:"div",ref(I){var A=hn(D=>t=D,a.ref);typeof A=="function"&&A(I)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return C()},get"aria-disabled"(){return a.disabled},get"aria-labelledby"(){return s()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return Kn([a.onPointerDown,b.onPointerDown])},get onPointerUp(){return Kn([M,b.onPointerUp])},get onClick(){return Kn([a.onClick,b.onClick])},get onKeyDown(){return Kn([_,b.onKeyDown])},get onMouseDown(){return Kn([a.onMouseDown,b.onMouseDown])},get onFocus(){return Kn([a.onFocus,b.onFocus])},onPointerMove:x,onPointerLeave:w},L,o))}})}function Rj(e){const t=ft({closeOnSelect:!1},e),[n,r]=Me(t,["checked","defaultChecked","onChange","onSelect"]),i=WGt({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>n.onChange?.(o),isDisabled:()=>r.disabled});return d(GK,f({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{n.onSelect?.(),i.toggle()}},r))}var q2={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>q2.next(e==="ltr"?"rtl":"ltr",t)},Nne={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function ume(e){const t=fa(),n=Po(),r=Oj(),{direction:i}=gs(),a=ft({id:t.generateId("trigger")},e),[o,s]=Me(a,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>t.value()??o.id,r.lastValue()===void 0&&r.setLastValue(l));const c=G2(()=>n.triggerRef(),()=>"button"),u=Z(()=>c()==="a"&&n.triggerRef()?.getAttribute("href")!=null);fe(vn(()=>r?.value(),b=>{u()&&b===l()&&n.triggerRef()?.focus()}));const h=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},m=b=>{dt(b,o.onPointerDown),b.currentTarget.dataset.pointerType=b.pointerType,!o.disabled&&b.pointerType!=="touch"&&b.button===0&&h()},g=b=>{dt(b,o.onClick),o.disabled||b.currentTarget.dataset.pointerType==="touch"&&h()},y=b=>{if(dt(b,o.onKeyDown),!o.disabled){if(u())switch(b.key){case"Enter":case" ":return}switch(b.key){case"Enter":case" ":case Nne.first(t.orientation()):b.stopPropagation(),b.preventDefault(),Wye(b.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case Nne.last(t.orientation()):b.stopPropagation(),b.preventDefault(),n.open("last");break;case q2.next(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.nextMenu();break;case q2.previous(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.previousMenu();break}}},v=b=>{dt(b,o.onMouseOver),n.triggerRef()?.dataset.pointerType!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},k=b=>{dt(b,o.onFocus),r!==void 0&&b.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return fe(()=>me(n.registerTriggerId(o.id))),d(_0,f({ref(b){var x=hn(n.setTriggerRef,o.ref);typeof x=="function"&&x(b)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return kt(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&r?.value()===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:m,onMouseOver:v,onClick:g,onKeyDown:y,onFocus:k,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function hme(e){let t;const n=fa(),r=Po(),i=Oj(),a=ome(),{direction:o}=gs(),s=ft({id:n.generateId(`content-${wr()}`)},e),[l,c]=Me(s,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const h=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),m=RGt({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);ure({trapFocus:()=>h()&&r.isOpen(),onMountAutoFocus:w=>{i===void 0&&l.onOpenAutoFocus?.(w)},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const g=w=>{if(Jn(w.currentTarget,w.target)&&(w.key==="Tab"&&r.isOpen()&&w.preventDefault(),i!==void 0&&w.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(w.key){case q2.next(o(),n.orientation()):w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case q2.previous(o(),n.orientation()):if(w.currentTarget.hasAttribute("data-closed"))break;w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},y=w=>{l.onEscapeKeyDown?.(w),i?.setAutoFocusMenu(!1),r.close(!0)},v=w=>{l.onFocusOutside?.(w),n.isModal()&&w.preventDefault()},k=w=>{dt(w,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},b=w=>{if(dt(w,l.onPointerMove),w.pointerType!=="mouse")return;const M=w.target,_=u!==w.clientX;Jn(w.currentTarget,M)&&_&&(r.setPointerDir(w.clientX>u?"right":"left"),u=w.clientX)};fe(()=>me(r.registerContentId(l.id))),me(()=>r.setContentRef(void 0));const x={ref:hn(w=>{r.setContentRef(w),t=w},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return m.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:Kn([l.onKeyDown,m.onKeyDown,g]),onMouseDown:Kn([l.onMouseDown,m.onMouseDown]),onFocusIn:Kn([l.onFocusIn,m.onFocusIn]),onFocusOut:Kn([l.onFocusOut,m.onFocusOut]),onPointerEnter:k,onPointerMove:b,get"data-orientation"(){return n.orientation()}};return d(ve,{get when(){return r.contentPresent()},get children(){return d(ve,{get when(){return a===void 0||r.parentMenuContext()!=null},get fallback(){return d(zt,f({as:"div"},()=>r.dataset(),x,c))},get children(){return d(Hf.Positioner,{get children(){return d(sq,f({get disableOutsidePointerEvents(){return kt(()=>!!h())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Wa({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:y,onFocusOutside:v,get onDismiss(){return r.close}},()=>r.dataset(),x,c))}})}})}})}function fme(e){let t;const n=fa(),r=Po(),[i,a]=Me(e,["ref"]);return mre({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),d(hme,f({ref(o){var s=hn(l=>{t=l},i.ref);typeof s=="function"&&s(o)}},a))}var pme=Tt();function KGt(){const e=Lt(pme);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function Im(e){const t=fa(),n=ft({id:t.generateId(`group-${wr()}`)},e),[r,i]=Ce(),a={generateId:Io(()=>n.id),registerLabelId:zr(i)};return d(pme.Provider,{value:a,get children(){return d(zt,f({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function zj(e){const t=KGt(),n=ft({id:t.generateId("label")},e),[r,i]=Me(n,["id"]);return fe(()=>me(t.registerLabelId(r.id))),d(zt,f({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function qj(e){const t=Po(),n=ft({children:"▼"},e);return d(zt,f({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function jj(e){return d(GK,f({role:"menuitem",closeOnSelect:!0},e))}function Hj(e){const t=WK(),n=ft({id:t.generateId("description")},e),[r,i]=Me(n,["id"]);return fe(()=>me(t.registerDescription(r.id))),d(zt,f({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function Fj(e){const t=WK(),n=ft({id:t.generateId("indicator")},e),[r,i]=Me(n,["forceMount"]);return d(ve,{get when(){return r.forceMount||t.isChecked()},get children(){return d(zt,f({as:"div"},()=>t.dataset(),i))}})}function Vj(e){const t=WK(),n=ft({id:t.generateId("label")},e),[r,i]=Me(n,["ref","id"]);return fe(()=>me(t.registerLabel(r.id))),d(zt,f({as:"div",ref(a){var o=hn(t.setLabelRef,r.ref);typeof o=="function"&&o(a)},get id(){return r.id}},()=>t.dataset(),i))}function Bj(e){const t=Po();return d(ve,{get when(){return t.contentPresent()},get children(){return d(w0,e)}})}var mme=Tt();function XGt(){const e=Lt(mme);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function Uj(e){const n=fa().generateId(`radiogroup-${wr()}`),r=ft({id:n},e),[i,a]=Me(r,["value","defaultValue","onChange","disabled"]),[o,s]=W2({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:c=>i.onChange?.(c)}),l={isDisabled:()=>i.disabled,isSelectedValue:c=>c===o(),setSelectedValue:c=>s(c)};return d(mme.Provider,{value:l,get children(){return d(Im,a)}})}function Wj(e){const t=XGt(),n=ft({closeOnSelect:!1},e),[r,i]=Me(n,["value","onSelect"]);return d(GK,f({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},i))}function JGt(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),a=[],o=t.clientX,s=t.clientY;switch(r){case"top":a.push([o,s+5]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]);break;case"right":a.push([o-5,s]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]);break;case"bottom":a.push([o,s-5]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]);break;case"left":a.push([o+5,s]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top]);break}return a}function YGt(e,t){return t?HU([e.clientX,e.clientY],t):!1}function gme(e){const t=fa(),n=rme(),r=lme(),i=Oj(),a=ome(),o=ft({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[s,l]=Me(o,["open","defaultOpen","onOpenChange"]);let c=0,u=null,h="right";const[m,g]=Ce(),[y,v]=Ce(),[k,b]=Ce(),[x,w]=Ce(),[M,_]=Ce(!0),[C,L]=Ce(l.placement),[S,I]=Ce([]),[A,D]=Ce([]),{DomCollectionProvider:P}=BGt({items:A,onItemsChange:D}),O=x0({open:()=>s.open,defaultOpen:()=>s.defaultOpen,onOpenChange:le=>s.onOpenChange?.(le)}),{present:E}=i0({show:()=>t.forceMount()||O.isOpen(),element:()=>x()??null}),T=DGt({selectionMode:"none",dataSource:A}),R=le=>{_(le),O.open()},H=(le=!1)=>{O.close(),le&&r&&r.close(!0)},J=le=>{_(le),O.toggle()},j=()=>{const le=x();le&&(ur(le),T.selectionManager().setFocused(!0),T.selectionManager().setFocusedKey(void 0))},X=()=>{a!=null?setTimeout(()=>j()):j()},W=le=>{I(Ee=>[...Ee,le]);const Se=r?.registerNestedMenu(le);return()=>{I(Ee=>dV(Ee,le)),Se?.()}},G=le=>h===u?.side&&YGt(le,u?.area),Y=le=>{G(le)&&le.preventDefault()},oe=le=>{G(le)||X()},ue=le=>{G(le)&&le.preventDefault()};hre({isDisabled:()=>!(r==null&&O.isOpen()&&t.isModal()),targets:()=>[x(),...S()].filter(Boolean)}),fe(()=>{const le=x();if(!le||!r)return;const Se=r.registerNestedMenu(le);me(()=>{Se()})}),fe(()=>{r===void 0&&i?.registerMenu(t.value(),[x(),...S()])}),fe(()=>{r!==void 0||i===void 0||(i.value()===t.value()?(k()?.focus(),i.autoFocusMenu()&&R(!0)):H())}),fe(()=>{r!==void 0||i===void 0||O.isOpen()&&i.setValue(t.value())}),me(()=>{r===void 0&&i?.unregisterMenu(t.value())});const de={dataset:Z(()=>({"data-expanded":O.isOpen()?"":void 0,"data-closed":O.isOpen()?void 0:""})),isOpen:O.isOpen,contentPresent:E,nestedMenus:S,currentPlacement:C,pointerGraceTimeoutId:()=>c,autoFocus:M,listState:()=>T,parentMenuContext:()=>r,triggerRef:k,contentRef:x,triggerId:m,contentId:y,setTriggerRef:b,setContentRef:w,open:R,close:H,toggle:J,focusContent:X,onItemEnter:Y,onItemLeave:oe,onTriggerLeave:ue,setPointerDir:le=>h=le,setPointerGraceTimeoutId:le=>c=le,setPointerGraceIntent:le=>u=le,registerNestedMenu:W,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:zr(g),registerContentId:zr(v)};return d(P,{get children(){return d(sme.Provider,{value:de,get children(){return d(ve,{when:a===void 0,get fallback(){return l.children},get children(){return d(Hf,f({anchorRef:k,contentRef:x,onCurrentPlacementChange:L},l))}})}})}})}function Gj(e){const{direction:t}=gs();return d(gme,f({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var QGt={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Zj(e){const t=Po(),n=fa(),[r,i]=Me(e,["onFocusOutside","onKeyDown"]),{direction:a}=gs();return d(hme,f({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{r.onFocusOutside?.(u);const h=u.target;Jn(t.triggerRef(),h)||t.close()},onKeyDown:u=>{dt(u,r.onKeyDown);const h=Jn(u.currentTarget,u.target),m=QGt.close(a(),n.orientation()).includes(u.key),g=t.parentMenuContext()!=null;h&&m&&g&&(t.close(),ur(t.triggerRef()))}},i))}var Ane=["Enter"," "],eZt={open:(e,t)=>e==="ltr"?[...Ane,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Ane,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Kj(e){let t;const n=fa(),r=Po(),i=ft({id:n.generateId(`sub-trigger-${wr()}`)},e),[a,o]=Me(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let s=null;const l=()=>{s&&window.clearTimeout(s),s=null},{direction:c}=gs(),u=()=>a.id,h=()=>{const w=r.parentMenuContext();if(w==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return w.listState().selectionManager()},m=()=>r.listState().collection(),g=()=>h().focusedKey()===u(),y=tme({key:u,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>a.disabled},()=>t),v=w=>{dt(w,a.onClick),!r.isOpen()&&!a.disabled&&r.open(!0)},k=w=>{if(dt(w,a.onPointerMove),w.pointerType!=="mouse")return;const M=r.parentMenuContext();if(M?.onItemEnter(w),!w.defaultPrevented){if(a.disabled){M?.onItemLeave(w);return}!r.isOpen()&&!s&&(r.parentMenuContext()?.setPointerGraceIntent(null),s=window.setTimeout(()=>{r.open(!1),l()},100)),M?.onItemEnter(w),w.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),ur(w.currentTarget),M?.listState().selectionManager().setFocused(!0),M?.listState().selectionManager().setFocusedKey(u()))}},b=w=>{if(dt(w,a.onPointerLeave),w.pointerType!=="mouse")return;l();const M=r.parentMenuContext(),_=r.contentRef();if(_){M?.setPointerGraceIntent({area:JGt(r.currentPlacement(),w,_),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(M?.pointerGraceTimeoutId());const C=window.setTimeout(()=>{M?.setPointerGraceIntent(null)},300);M?.setPointerGraceTimeoutId(C)}else{if(M?.onTriggerLeave(w),w.defaultPrevented)return;M?.setPointerGraceIntent(null)}M?.onItemLeave(w)},x=w=>{dt(w,a.onKeyDown),!w.repeat&&(a.disabled||eZt.open(c(),n.orientation()).includes(w.key)&&(w.stopPropagation(),w.preventDefault(),h().setFocused(!1),h().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(m().getFirstKey())))};return fe(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const w=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:a.textValue??t?.textContent??"",disabled:a.disabled??!1});me(w)}),fe(vn(()=>r.parentMenuContext()?.pointerGraceTimeoutId(),w=>{me(()=>{window.clearTimeout(w),r.parentMenuContext()?.setPointerGraceIntent(null)})})),fe(()=>me(r.registerTriggerId(a.id))),me(()=>{l()}),d(zt,f({as:"div",ref(w){var M=hn(_=>{r.setTriggerRef(_),t=_},a.ref);typeof M=="function"&&M(w)},get id(){return a.id},role:"menuitem",get tabIndex(){return y.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return kt(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return a.disabled},get"data-key"(){return y.dataKey()},get"data-highlighted"(){return g()?"":void 0},get"data-disabled"(){return a.disabled?"":void 0},get onPointerDown(){return Kn([a.onPointerDown,y.onPointerDown])},get onPointerUp(){return Kn([a.onPointerUp,y.onPointerUp])},get onClick(){return Kn([v,y.onClick])},get onKeyDown(){return Kn([x,y.onKeyDown])},get onMouseDown(){return Kn([a.onMouseDown,y.onMouseDown])},get onFocus(){return Kn([a.onFocus,y.onFocus])},onPointerMove:k,onPointerLeave:b},()=>r.dataset(),o))}function yme(e){const t=Oj(),n=`menu-${wr()}`,r=ft({id:n,modal:!0},e),[i,a]=Me(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=x0({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>i.onOpenChange?.(l)}),s={isModal:()=>i.modal??!0,preventScroll:()=>i.preventScroll??s.isModal(),forceMount:()=>i.forceMount??!1,generateId:Io(()=>i.id),value:()=>i.value,orientation:()=>i.orientation??t?.orientation()??"horizontal"};return d(dme.Provider,{value:s,get children(){return d(gme,f({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},a))}})}var tZt={};Ga(tZt,{Root:()=>Ff,Separator:()=>nZt});function Ff(e){let t;const n=ft({orientation:"horizontal"},e),[r,i]=Me(n,["ref","orientation"]),a=G2(()=>t,()=>"hr");return d(zt,f({as:"hr",ref(o){var s=hn(l=>t=l,r.ref);typeof s=="function"&&s(o)},get role(){return a()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var nZt=Ff,rZt={};Ga(rZt,{Arrow:()=>vs,CheckboxItem:()=>Rj,Content:()=>vme,DropdownMenu:()=>er,Group:()=>Im,GroupLabel:()=>zj,Icon:()=>qj,Item:()=>jj,ItemDescription:()=>Hj,ItemIndicator:()=>Fj,ItemLabel:()=>Vj,Portal:()=>Bj,RadioGroup:()=>Uj,RadioItem:()=>Wj,Root:()=>kme,Separator:()=>Ff,Sub:()=>Gj,SubContent:()=>Zj,SubTrigger:()=>Kj,Trigger:()=>ume});function vme(e){const t=fa(),n=Po(),[r,i]=Me(e,["onCloseAutoFocus","onInteractOutside"]);let a=!1;return d(fme,f({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),a||ur(n.triggerRef()),a=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(a=!0)}},i))}function kme(e){const t=`dropdownmenu-${wr()}`,n=ft({id:t},e);return d(yme,n)}var er=Object.assign(kme,{Arrow:vs,CheckboxItem:Rj,Content:vme,Group:Im,GroupLabel:zj,Icon:qj,Item:jj,ItemDescription:Hj,ItemIndicator:Fj,ItemLabel:Vj,Portal:Bj,RadioGroup:Uj,RadioItem:Wj,Separator:Ff,Sub:Gj,SubContent:Zj,SubTrigger:Kj,Trigger:ume});function iZt(e){return d(er,f(e,{"data-component":"dropdown-menu"}))}function aZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.Trigger,f(n,{"data-slot":"dropdown-menu-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function oZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.Icon,f(n,{"data-slot":"dropdown-menu-icon",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function sZt(e){return d(er.Portal,e)}function lZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.Content,f(n,{"data-component":"dropdown-menu-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function cZt(e){const[t,n]=Me(e,["class","classList"]);return d(er.Arrow,f(n,{"data-slot":"dropdown-menu-arrow",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function dZt(e){const[t,n]=Me(e,["class","classList"]);return d(er.Separator,f(n,{"data-slot":"dropdown-menu-separator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function uZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.Group,f(n,{"data-slot":"dropdown-menu-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function hZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.GroupLabel,f(n,{"data-slot":"dropdown-menu-group-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function fZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.Item,f(n,{"data-slot":"dropdown-menu-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function pZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.ItemLabel,f(n,{"data-slot":"dropdown-menu-item-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function mZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.ItemDescription,f(n,{"data-slot":"dropdown-menu-item-description",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function gZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.ItemIndicator,f(n,{"data-slot":"dropdown-menu-item-indicator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function yZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.RadioGroup,f(n,{"data-slot":"dropdown-menu-radio-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function vZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.RadioItem,f(n,{"data-slot":"dropdown-menu-radio-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function kZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.CheckboxItem,f(n,{"data-slot":"dropdown-menu-checkbox-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function bZt(e){return d(er.Sub,e)}function wZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.SubTrigger,f(n,{"data-slot":"dropdown-menu-sub-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function xZt(e){const[t,n]=Me(e,["class","classList","children"]);return d(er.SubContent,f(n,{"data-component":"dropdown-menu-sub-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}const Mt=Object.assign(iZt,{Trigger:aZt,Icon:oZt,Portal:sZt,Content:lZt,Arrow:cZt,Separator:dZt,Group:uZt,GroupLabel:hZt,Item:fZt,ItemLabel:pZt,ItemDescription:mZt,ItemIndicator:gZt,RadioGroup:yZt,RadioItem:vZt,CheckboxItem:kZt,Sub:bZt,SubTrigger:wZt,SubContent:xZt});var _Zt=ie("<div>"),Xj=class{x;y;width;height;constructor(t){this.x=Math.floor(t.x),this.y=Math.floor(t.y),this.width=Math.floor(t.width),this.height=Math.floor(t.height)}get rect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get center(){return{x:this.x+this.width*.5,y:this.y+this.height*.5}}get corners(){return{topLeft:{x:this.left,y:this.top},topRight:{x:this.right,y:this.top},bottomRight:{x:this.left,y:this.bottom},bottomLeft:{x:this.right,y:this.bottom}}}},jh=e=>{let t=new Xj(e.getBoundingClientRect());const{transform:n}=getComputedStyle(e);return n&&(t=MZt(t,n)),t},MZt=(e,t)=>{let n,r;if(t.startsWith("matrix3d(")){const i=t.slice(9,-1).split(/, /);n=+i[12],r=+i[13]}else if(t.startsWith("matrix(")){const i=t.slice(7,-1).split(/, /);n=+i[4],r=+i[5]}else n=0,r=0;return new Xj({...e,x:e.x-n,y:e.y-r})},Ea=()=>({x:0,y:0}),ZK=(e,t)=>e.x===t.x&&e.y===t.y,tV=(e,t)=>new Xj({...e,x:e.x+t.x,y:e.y+t.y}),SZt=(e,t)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),CZt=(e,t)=>{const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom),o=i-r,s=a-n;if(r<i&&n<a){const l=e.width*e.height,c=t.width*t.height,u=o*s;return u/(l+c-u)}return 0},nV=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,bme=(e,t,n)=>{const r=e.transformed.center,i={distance:1/0,droppable:null};for(const a of t){const o=SZt(r,a.layout.center);o<i.distance?(i.distance=o,i.droppable=a):o===i.distance&&a.id===n.activeDroppableId&&(i.droppable=a)}return i.droppable},LZt=(e,t,n)=>{const r=e.transformed,i={ratio:0,droppable:null};for(const a of t){const o=CZt(r,a.layout);o>i.ratio?(i.ratio=o,i.droppable=a):o>0&&o===i.ratio&&a.id===n.activeDroppableId&&(i.droppable=a)}return i.droppable},wme=Tt(),xme=e=>{const t=f({collisionDetector:LZt},e),[n,r]=nt({draggables:{},droppables:{},sensors:{},active:{draggableId:null,get draggable(){return n.active.draggableId!==null?n.draggables[n.active.draggableId]:null},droppableId:null,get droppable(){return n.active.droppableId!==null?n.droppables[n.active.droppableId]:null},sensorId:null,get sensor(){return n.active.sensorId!==null?n.sensors[n.active.sensorId]:null},overlay:null}}),i=(E,T,R)=>{E.substring(0,E.length-1),lt(()=>n[E][T])&&r(E,T,"transformers",R.id,R)},a=(E,T,R)=>{E.substring(0,E.length-1),lt(()=>n[E][T])&<(()=>n[E][T].transformers[R])&&r(E,T,"transformers",R,void 0)},o=({id:E,node:T,layout:R,data:H})=>{const J=n.draggables[E],j={id:E,node:T,layout:R,data:H,_pendingCleanup:!1};let X;if(!J)Object.defineProperties(j,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{if(n.active.overlay)return Ea();const W=Object.values(n.draggables[E].transformers);return W.sort((G,Y)=>G.order-Y.order),W.reduce((G,Y)=>Y.callback(G),Ea())}},transformed:{enumerable:!0,configurable:!0,get:()=>tV(n.draggables[E].layout,n.draggables[E].transform)}});else if(n.active.draggableId===E&&!n.active.overlay){const W={x:J.layout.x-R.x,y:J.layout.y-R.y},G="addDraggable-existing-offset",Y=J.transformers[G],oe=Y?Y.callback(W):W;X={id:G,order:100,callback:ue=>({x:ue.x+oe.x,y:ue.y+oe.y})},D(()=>a("draggables",E,G))}ct(()=>{r("draggables",E,j),X&&i("draggables",E,X)}),n.active.draggable&&M()},s=E=>{lt(()=>n.draggables[E])&&(r("draggables",E,"_pendingCleanup",!0),queueMicrotask(()=>l(E)))},l=E=>{if(n.draggables[E]?._pendingCleanup){const T=n.active.draggableId===E;ct(()=>{T&&r("active","draggableId",null),r("draggables",E,void 0)})}},c=({id:E,node:T,layout:R,data:H})=>{const J=n.droppables[E],j={id:E,node:T,layout:R,data:H,_pendingCleanup:!1};J||Object.defineProperties(j,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{const X=Object.values(n.droppables[E].transformers);return X.sort((W,G)=>W.order-G.order),X.reduce((W,G)=>G.callback(W),Ea())}},transformed:{enumerable:!0,configurable:!0,get:()=>tV(n.droppables[E].layout,n.droppables[E].transform)}}),r("droppables",E,j),n.active.draggable&&M()},u=E=>{lt(()=>n.droppables[E])&&(r("droppables",E,"_pendingCleanup",!0),queueMicrotask(()=>h(E)))},h=E=>{if(n.droppables[E]?._pendingCleanup){const T=n.active.droppableId===E;ct(()=>{T&&r("active","droppableId",null),r("droppables",E,void 0)})}},m=({id:E,activators:T})=>{r("sensors",E,{id:E,activators:T,coordinates:{origin:{x:0,y:0},current:{x:0,y:0},get delta(){return{x:n.sensors[E].coordinates.current.x-n.sensors[E].coordinates.origin.x,y:n.sensors[E].coordinates.current.y-n.sensors[E].coordinates.origin.y}}}})},g=E=>{if(!lt(()=>n.sensors[E]))return;const T=n.active.sensorId===E;ct(()=>{T&&r("active","sensorId",null),r("sensors",E,void 0)})},y=({node:E,layout:T})=>{const R=n.active.overlay,H={node:E,layout:T};R||Object.defineProperties(H,{id:{enumerable:!0,configurable:!0,get:()=>n.active.draggable?.id},data:{enumerable:!0,configurable:!0,get:()=>n.active.draggable?.data},transformers:{enumerable:!0,configurable:!0,get:()=>Object.fromEntries(Object.entries(n.active.draggable?n.active.draggable.transformers:{}).filter(([J])=>J!=="addDraggable-existing-offset"))},transform:{enumerable:!0,configurable:!0,get:()=>{const J=Object.values(n.active.overlay?n.active.overlay.transformers:[]);return J.sort((j,X)=>j.order-X.order),J.reduce((j,X)=>X.callback(j),Ea())}},transformed:{enumerable:!0,configurable:!0,get:()=>n.active.overlay?tV(n.active.overlay.layout,n.active.overlay.transform):new Xj({x:0,y:0,width:0,height:0})}}),r("active","overlay",H)},v=()=>r("active","overlay",null),k=(E,T)=>{ct(()=>{r("sensors",E,"coordinates",{origin:{...T},current:{...T}}),r("active","sensorId",E)})},b=E=>{const T=n.active.sensorId;T&&r("sensors",T,"coordinates","current",{...E})},x=()=>r("active","sensorId",null),w=(E,T)=>{const R={};for(const J of Object.values(n.sensors))if(J)for(const[j,X]of Object.entries(J.activators))R[j]??=[],R[j].push({sensor:J,activator:X});const H={};for(const J in R){let j=J;T&&(j=`on${J}`),H[j]=X=>{for(const{activator:W}of R[J]){if(n.active.sensor)break;W(X,E)}}}return H},M=()=>{let E=!1;const T=Object.values(n.draggables),R=Object.values(n.droppables),H=n.active.overlay;return ct(()=>{const J=new WeakMap;for(const j of T)if(j){const X=j.layout;J.has(j.node)||J.set(j.node,jh(j.node));const W=J.get(j.node);nV(X,W)||(r("draggables",j.id,"layout",W),E=!0)}for(const j of R)if(j){const X=j.layout;J.has(j.node)||J.set(j.node,jh(j.node));const W=J.get(j.node);nV(X,W)||(r("droppables",j.id,"layout",W),E=!0)}if(H){const j=H.layout,X=jh(H.node);nV(j,X)||(r("active","overlay","layout",X),E=!0)}}),E},_=()=>{const E=n.active.overlay??n.active.draggable;if(E){const T=t.collisionDetector(E,Object.values(n.droppables),{activeDroppableId:n.active.droppableId}),R=T?T.id:null;n.active.droppableId!==R&&r("active","droppableId",R)}},C=E=>{const T={id:"sensorMove",order:0,callback:R=>n.active.sensor?{x:R.x+n.active.sensor.coordinates.delta.x,y:R.y+n.active.sensor.coordinates.delta.y}:R};M(),ct(()=>{r("active","draggableId",E),i("draggables",E,T)}),_()},L=()=>{const E=lt(()=>n.active.draggableId);ct(()=>{E!==null&&a("draggables",E,"sensorMove"),r("active",["draggableId","droppableId"],null)}),M()},S=E=>{fe(()=>{const T=n.active.draggable;T&<(()=>E({draggable:T}))})},I=E=>{fe(()=>{const T=n.active.draggable;if(T){const R=lt(()=>n.active.overlay);Object.values(R?R.transform:T.transform),lt(()=>E({draggable:T,overlay:R}))}})},A=E=>{fe(()=>{const T=n.active.draggable,R=n.active.droppable;T&<(()=>E({draggable:T,droppable:R,overlay:n.active.overlay}))})},D=E=>{fe(({previousDraggable:T,previousDroppable:R,previousOverlay:H})=>{const J=n.active.draggable,j=J?n.active.droppable:null,X=J?n.active.overlay:null;return!J&&T&<(()=>E({draggable:T,droppable:R,overlay:H})),{previousDraggable:J,previousDroppable:j,previousOverlay:X}},{previousDraggable:null,previousDroppable:null,previousOverlay:null})};I(()=>_()),t.onDragStart&&S(t.onDragStart),t.onDragMove&&I(t.onDragMove),t.onDragOver&&A(t.onDragOver),t.onDragEnd&&D(t.onDragEnd);const O=[n,{addTransformer:i,removeTransformer:a,addDraggable:o,removeDraggable:s,addDroppable:c,removeDroppable:u,addSensor:m,removeSensor:g,setOverlay:y,clearOverlay:v,recomputeLayouts:M,detectCollisions:_,draggableActivators:w,sensorStart:k,sensorMove:b,sensorEnd:x,dragStart:C,dragEnd:L,onDragStart:S,onDragMove:I,onDragOver:A,onDragEnd:D}];return d(wme.Provider,{value:O,get children(){return t.children}})},R0=()=>Lt(wme)||null,IZt=(e="pointer-sensor")=>{const[t,{addSensor:n,removeSensor:r,sensorStart:i,sensorMove:a,sensorEnd:o,dragStart:s,dragEnd:l}]=R0(),c=250,u=10;dn(()=>{n({id:e,activators:{pointerdown:v}})}),me(()=>{r(e)});const h=()=>t.active.sensorId===e,m={x:0,y:0};let g=null,y=null;const v=(_,C)=>{_.button===0&&(document.addEventListener("pointermove",x),document.addEventListener("pointerup",w),y=C,m.x=_.clientX,m.y=_.clientY,g=window.setTimeout(b,c))},k=()=>{g&&(clearTimeout(g),g=null),document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",w),document.removeEventListener("selectionchange",M)},b=()=>{t.active.sensor?h()||k():(i(e,m),s(y),M(),document.addEventListener("selectionchange",M))},x=_=>{const C={x:_.clientX,y:_.clientY};if(!t.active.sensor){const L={x:C.x-m.x,y:C.y-m.y};Math.sqrt(L.x**2+L.y**2)>u&&b()}h()&&(_.preventDefault(),a(C))},w=_=>{k(),h()&&(_.preventDefault(),l(),o())},M=()=>{window.getSelection()?.removeAllRanges()}},_me=e=>(IZt(),kt(()=>e.children)),Jj=e=>({transform:`translate3d(${e.x}px, ${e.y}px, 0)`}),NZt=(e,t={})=>{const[n,{addDraggable:r,removeDraggable:i,draggableActivators:a}]=R0(),[o,s]=Ce(null);dn(()=>{const h=o();h&&r({id:e,node:h,layout:jh(h),data:t})}),me(()=>i(e));const l=()=>n.active.draggableId===e,c=()=>n.draggables[e]?.transform||Ea();return Object.defineProperties((h,m)=>{const g=m?m():{};fe(()=>{const y=o(),v=a(e);if(y)for(const k in v)y.addEventListener(k,v[k]);me(()=>{if(y)for(const k in v)y.removeEventListener(k,v[k])})}),s(h),g.skipTransform||fe(()=>{const y=c();if(ZK(y,Ea()))h.style.removeProperty("transform");else{const v=Jj(c());h.style.setProperty("transform",v.transform??null)}})},{ref:{enumerable:!0,value:s},isActiveDraggable:{enumerable:!0,get:l},dragActivators:{enumerable:!0,get:()=>a(e,!0)},transform:{enumerable:!0,get:c}})},AZt=(e,t={})=>{const[n,{addDroppable:r,removeDroppable:i}]=R0(),[a,o]=Ce(null);dn(()=>{const u=a();u&&r({id:e,node:u,layout:jh(u),data:t})}),me(()=>i(e));const s=()=>n.active.droppableId===e,l=()=>n.droppables[e]?.transform||Ea();return Object.defineProperties((u,h)=>{const m=h?h():{};o(u),m.skipTransform||fe(()=>{const g=l();if(ZK(g,Ea()))u.style.removeProperty("transform");else{const y=Jj(l());u.style.setProperty("transform",y.transform??null)}})},{ref:{enumerable:!0,value:o},isActiveDroppable:{enumerable:!0,get:s},transform:{enumerable:!0,get:l}})},Mme=e=>{const[t,{onDragStart:n,onDragEnd:r,setOverlay:i,clearOverlay:a}]=R0();let o;n(({draggable:l})=>{i({node:l.node,layout:l.layout}),queueMicrotask(()=>{if(o){const c=jh(o),u={x:(l.layout.width-c.width)/2,y:(l.layout.height-c.height)/2};c.x+=u.x,c.y+=u.y,i({node:o,layout:c})}})}),r(()=>queueMicrotask(a));const s=()=>{const l=t.active.overlay,c=t.active.draggable;return!l||!c?{}:{position:"fixed",transition:"transform 0s",top:`${l.layout.top}px`,left:`${l.layout.left}px`,"min-width":`${c.layout.width}px`,"min-height":`${c.layout.height}px`,...Jj(l.transform),...e.style}};return d(w0,{get mount(){return document.body},get children(){return d(ve,{get when(){return t.active.draggable},get children(){var l=_Zt(),c=o;return typeof c=="function"?Hr(c,l):o=l,K(l,(()=>{var u=kt(()=>typeof e.children=="function");return()=>u()?e.children(t.active.draggable):e.children})()),Qe(u=>{var h=e.class,m=s();return h!==u.e&&U2(l,u.e=h),u.t=iq(l,m,u.t),u},{e:void 0,t:void 0}),l}})}})},$Zt=(e,t,n)=>{const r=e.slice();return r.splice(n,0,...r.splice(t,1)),r},Sme=Tt(),Cme=e=>{const[t]=R0(),[n,r]=nt({initialIds:[],sortedIds:[]}),i=s=>s>=0&&s<n.initialIds.length;fe(()=>{r("initialIds",[...e.ids]),r("sortedIds",[...e.ids])}),fe(()=>{t.active.draggableId&&t.active.droppableId?lt(()=>{const s=n.sortedIds.indexOf(t.active.draggableId),l=n.initialIds.indexOf(t.active.droppableId);if(!i(s)||!i(l))r("sortedIds",[...e.ids]);else if(s!==l){const c=$Zt(n.sortedIds,s,l);r("sortedIds",c)}}):r("sortedIds",[...e.ids])});const o=[n,{}];return d(Sme.Provider,{value:o,get children(){return e.children}})},TZt=()=>Lt(Sme)||null,EZt=(e,t)=>n=>{e(n),t(n)},Lme=(e,t={})=>{const[n,{addTransformer:r,removeTransformer:i}]=R0(),[a]=TZt(),o=NZt(e,t),s=AZt(e,t),l=EZt(o.ref,s.ref),c=()=>a.initialIds.indexOf(e),u=()=>a.sortedIds.indexOf(e),h=k=>n.droppables[k]?.layout||null,m=()=>{const k=Ea(),b=c(),x=u();if(x!==b){const w=h(e),M=h(a.initialIds[x]);w&&M&&(k.x=M.x-w.x,k.y=M.y-w.y)}return k},g={id:"sortableOffset",order:100,callback:k=>{const b=m();return{x:k.x+b.x,y:k.y+b.y}}};dn(()=>r("droppables",e,g)),me(()=>i("droppables",e,g.id));const y=()=>(e===n.active.draggableId&&!n.active.overlay?n.draggables[e]?.transform:n.droppables[e]?.transform)||Ea();return Object.defineProperties(k=>{o(k,()=>({skipTransform:!0})),s(k,()=>({skipTransform:!0})),fe(()=>{const b=y();if(ZK(b,Ea()))k.style.removeProperty("transform");else{const x=Jj(y());k.style.setProperty("transform",x.transform??null)}})},{ref:{enumerable:!0,value:l},transform:{enumerable:!0,get:y},isActiveDraggable:{enumerable:!0,get:()=>o.isActiveDraggable},dragActivators:{enumerable:!0,get:()=>o.dragActivators},isActiveDroppable:{enumerable:!0,get:()=>s.isActiveDroppable}})};function PZt(e){const t={locs:[],timer:void 0,pending:void 0,over:void 0,last:void 0},n=e.delay??250,r=e.max??4,i=e.tolerance??80,a=e.edge??18,o=()=>{t.timer!==void 0&&clearTimeout(t.timer),t.timer=void 0,t.pending=void 0},s=()=>{o(),t.over=void 0,t.last=void 0,t.locs.length=0},l=y=>{if(!e.enabled())return;const v=e.el();if(!v)return;const k=v.getBoundingClientRect(),b=y.clientX,x=y.clientY;b<k.left||b>k.right||x<k.top||x>k.bottom||(t.locs.push({x:b,y:x}),t.locs.length>r&&t.locs.shift())},c=()=>{if(!e.enabled()||!e.active())return 0;const y=e.el();if(!y||t.locs.length<2)return 0;const v=y.getBoundingClientRect(),k=t.locs[t.locs.length-1];if(!k)return 0;const b=t.locs[0]??k;if(b.x<v.left||b.x>v.right||b.y<v.top||b.y>v.bottom||t.last&&k.x===t.last.x&&k.y===t.last.y)return 0;if(v.right-k.x<=a)return t.last=k,n;const x={x:v.right,y:v.top-i},w={x:v.right,y:v.bottom+i},M=(I,A)=>(A.y-I.y)/(A.x-I.x),_=M(k,x),C=M(k,w),L=M(b,x),S=M(b,w);return _<L&&C>S?(t.last=k,n):(t.last=void 0,0)},u=y=>{o(),e.onActivate(y)},h=y=>{if(!y||e.active()===y)return;if(!e.active()){u(y);return}const v=c();if(v===0){u(y);return}o(),t.pending=y,t.timer=window.setTimeout(()=>{t.timer=void 0,t.pending===y&&(t.pending=void 0,e.enabled()&&e.active()&&t.over===y&&e.onActivate(y))},v)};return{move:l,enter:(y,v)=>{e.enabled()&&(t.over=y,l(v),h(y))},leave:y=>{t.over===y&&(t.over=void 0),t.pending===y&&o()},activate:u,request:h,cancel:o,reset:s}}let EU;const DZt=e=>{EU=e},OZt=e=>{if(window.focus(),!!e){if(EU)return EU(e);console.warn("notification-click: navigate function not set, falling back to window.location.assign"),window.location.assign(e)}},xp=e=>e.replace(/[\\/]+$/,""),oh=new Map,sh=new Map;function RZt(){const e={resolve:n=>{}};return{promise:new Promise(n=>{e.resolve=n}),resolve:e.resolve}}const Jg={get(e){return oh.get(xp(e))},pending(e){const t=xp(e),n=oh.get(t);n&&n.status!=="pending"||oh.set(t,{status:"pending"})},ready(e){const t=xp(e),n={status:"ready"};oh.set(t,n);const r=sh.get(t);r&&(sh.delete(t),r.resolve(n))},failed(e,t){const n=xp(e),r={status:"failed",message:t};oh.set(n,r);const i=sh.get(n);i&&(sh.delete(n),i.resolve(r))},wait(e){const t=xp(e),n=oh.get(t);if(n&&n.status!=="pending")return Promise.resolve(n);const r=sh.get(t);if(r)return r.promise;const i=RZt();return sh.set(t,i),i.promise}},zZt=40,j2={session:new Map,terminal:new Map},Ime=(e,t,n)=>{for(e.delete(t),e.set(t,n);e.size>zZt;){const r=e.keys().next().value;if(r===void 0)return;e.delete(r)}},qZt=(e,t)=>{const n=j2.session.get(e)??{prompt:"",files:{}};Ime(j2.session,e,{...n,...t})},pQt=e=>j2.session.get(e),mQt=(e,t)=>{Ime(j2.terminal,e,t)},gQt=e=>j2.terminal.get(e),jZt=e=>typeof e!="object"||e===null?!1:"draggable"in e,eq=e=>{if(!jZt(e))return;const t=e.draggable;if(t)return typeof t.id=="string"?t.id:void 0},HZt=(e,t)=>({id:e,order:100,callback:n=>t==="x"?{...n,x:0}:{...n,y:0}}),Nme=(e,t)=>()=>{const n=R0();if(!n)return null;const[,{onDragStart:r,onDragEnd:i,addTransformer:a,removeTransformer:o}]=n,s=HZt(t,e),l=br(c=>(r(u=>{const h=eq(u);h&&a("draggables",h,s)}),i(u=>{const h=eq(u);h&&o("draggables",h,s.id)}),c));return me(l),null},Ame=Nme("x","constrain-x-axis"),yQt=Nme("y","constrain-y-axis"),KK=100;function FZt(e,t,n=KK){if(!e.stack.length){const i=t==="/"?["/"]:["/",t];return{stack:i,index:i.length-1,action:void 0}}const r=e.stack[e.index];return t===r?e.action?{...e,action:void 0}:e:e.action?{...e,action:void 0}:VZt(e,t,n)}function VZt(e,t,n=KK){const r=e.stack.slice(0,e.index+1).concat(t),i=BZt(r,r.length-1,n);return{...e,...i,action:void 0}}function BZt(e,t,n=KK){if(e.length<=n)return{stack:e,index:t};const r=e.length-n;return{stack:e.slice(r),index:Math.max(0,t-r)}}function UZt(e){if(e.index<=0)return;const t=e.index-1,n=e.stack[t];if(n)return{state:{...e,index:t,action:"back"},to:n}}function WZt(e){if(e.index>=e.stack.length-1)return;const t=e.index+1,n=e.stack[t];if(n)return{state:{...e,index:t,action:"forward"},to:n}}var GZt=ie('<div class="h-full shrink-0">'),ZZt=ie('<div class="xl:hidden w-10 shrink-0 flex items-center justify-center">'),KZt=ie('<div class="xl:hidden w-[32px] shrink-0 flex items-center justify-center mr-2">'),XZt=ie('<div class="flex items-center shrink-0 ml-2"><svg width=20 height=20 viewBox="0 0 800 800"fill=none xmlns=http://www.w3.org/2000/svg class=shrink-0><path d="M373.362 226.643C388.087 211.919 411.96 211.919 426.684 226.643L573.37 373.324C588.094 388.047 588.094 411.92 573.37 426.644L426.684 573.324C411.96 588.048 388.087 588.048 373.362 573.324L226.677 426.644C211.952 411.92 211.952 388.047 226.677 373.324L373.362 226.643Z"fill=currentColor class=text-text-base></path><path d="M586.658 513.282C594.02 505.921 605.956 505.921 613.318 513.282L686.659 586.621C694.021 593.983 694.021 605.919 686.659 613.28L613.318 686.619C605.956 693.981 594.02 693.981 586.658 686.619L513.317 613.28C505.955 605.919 505.955 593.983 513.317 586.621L586.658 513.282Z"fill=currentColor class=text-text-base></path><path d="M286.501 586.454C293.957 593.909 293.957 605.997 286.501 613.453L213.5 686.452C206.044 693.907 193.956 693.907 186.5 686.452L113.499 613.453C106.043 605.997 106.043 593.909 113.499 586.454L186.5 513.455C193.956 506 206.044 506 213.5 513.455L286.501 586.454Z"fill=currentColor class=text-text-base></path><path d="M406.524 93.4982C402.934 97.088 397.113 97.088 393.523 93.4982L356.523 56.499C352.933 52.9092 352.933 47.089 356.523 43.4992L393.523 6.50002C397.113 2.91025 402.934 2.91025 406.524 6.50003L443.524 43.4992C447.114 47.089 447.114 52.9092 443.524 56.499L406.524 93.4982Z"fill=currentColor class=text-text-base></path><path d="M186.502 113.498C193.958 106.042 206.046 106.042 213.502 113.498L286.503 186.496C293.959 193.952 293.959 206.04 286.503 213.496L213.502 286.494C206.046 293.95 193.958 293.95 186.502 286.494L113.501 213.496C106.045 206.04 106.045 193.952 113.501 186.496L186.502 113.498Z"fill=currentColor class=text-text-base></path><path d="M686.499 186.483C693.955 193.939 693.955 206.027 686.499 213.482L613.498 286.481C606.042 293.937 593.954 293.937 586.498 286.481L513.497 213.482C506.041 206.027 506.041 193.939 513.497 186.483L586.498 113.484C593.954 106.029 606.042 106.029 613.498 113.484L686.499 186.483Z"fill=currentColor class=text-text-base></path><path d="M356.689 756.666C353.007 752.985 353.007 747.017 356.689 743.336L393.359 706.667C397.04 702.986 403.008 702.986 406.689 706.667L443.359 743.336C447.041 747.017 447.041 752.985 443.359 756.666L406.689 793.335C403.008 797.016 397.04 797.016 393.359 793.335L356.689 756.666Z"fill=currentColor class=text-text-base>'),JZt=ie("<span class=truncate>"),YZt=ie('<div class="flex items-center gap-1.5 text-12-regular text-text-weaker select-none ml-1"><span class=text-text-weak>'),QZt=ie('<div data-tauri-decorum-tb class="flex flex-row">'),eKt=ie('<header class="h-12 shrink-0 bg-transparent relative grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center"data-tauri-drag-region><div><div id=opencode-titlebar-left class="flex items-center gap-3 min-w-0 px-2"></div></div><div class="min-w-0 flex items-center justify-center pointer-events-none"><div id=opencode-titlebar-center class="pointer-events-auto min-w-0 flex justify-center w-fit max-w-full"></div></div><div data-tauri-drag-region><div id=opencode-titlebar-right class="flex items-center gap-2">'),tKt=ie('<div class="w-36 shrink-0">');const XK=()=>window.__TAURI__,nKt=()=>XK()?.window?.getCurrentWindow?.(),rKt=()=>XK()?.webviewWindow?.getCurrentWebviewWindow?.();function iKt(){const e=If(),t=ms(),n=Cce(),r=xr(),i=cle(),a=lf(),o=ll(),s=bf(),l=di();ipe();const[c]=Jxt(),[u,h]=Ce(!1),[m,g]=Ce(""),[y,v]=Ce(""),[k,b]=Ce(!1);function x(){z(async()=>{const{DialogCreateProject:G}=await import("./dialog-create-project-a3Uo_guc.js");return{DialogCreateProject:G}},[]).then(({DialogCreateProject:G})=>{a.show(()=>d(G,{onSelect:Y=>{if(!Y)return;const oe=Array.isArray(Y)?Y[0]:Y;oe&&(e.projects.open(oe),o(`/${St(oe)}/session`))}}))})}function w(){z(async()=>{const{DialogCloneProject:G}=await import("./dialog-clone-project-BRaGZzJN.js");return{DialogCloneProject:G}},[]).then(({DialogCloneProject:G})=>{a.show(()=>d(G,{onSelect:Y=>{Y&&(e.projects.open(Y),o(`/${St(Y)}/session`))}}))})}const M=Z(()=>t.platform==="desktop"&&t.os==="macos"),_=Z(()=>t.platform==="desktop"&&t.os==="windows");Z(()=>t.platform==="web");const C=()=>t.webviewZoom?.()??1,L=()=>M()?`${40/C()}px`:void 0,[S,I]=nt({stack:[],index:0,action:void 0}),A=()=>`${s.pathname}${s.search}${s.hash}`;Z(()=>!l.dir||l.id?!1:s.pathname.replace(/\/+$/,"").split("/").at(-1)==="session"),fe(()=>{const G=A();lt(()=>{const Y=FZt(S,G);Y!==S&&I(Y)})}),Z(()=>S.index>0),Z(()=>S.index<S.stack.length-1);const D=Z(()=>e.projects.list().length>0),P=Z(()=>e.projects.list().find(G=>St(G.worktree)===l.dir)),O=Z(()=>{const G=P();return G?G.name||Gn(G.worktree):r.t("command.project.open")}),E={plan:"Plan",track:"Track",project:"Track",data:"Data",ship:"Ship",review:"Review"},T=Z(()=>{const G=c.view,Y=Array.isArray(G)?G[0]:G;if(Y)return E[Y]}),R=()=>{const G=UZt(S);G&&(I(G.state),o(G.to))},H=()=>{const G=WZt(S);G&&(I(G.state),o(G.to))};n.register(()=>[{id:"common.goBack",title:r.t("common.goBack"),category:r.t("command.category.view"),keybind:"mod+[",onSelect:R},{id:"common.goForward",title:r.t("common.goForward"),category:r.t("command.category.view"),keybind:"mod+]",onSelect:H}]);const J=()=>{if(t.platform==="desktop")return nKt()};fe(()=>{if(t.platform!=="desktop")return;const G=i.colorScheme(),Y=G==="system"?null:G,oe=rKt();oe?.setTheme&&oe.setTheme(Y).catch(()=>{})});const j=G=>G instanceof Element?!!G.closest("button, a, input, textarea, select, option, [role='button'], [role='menuitem'], [contenteditable='true'], [contenteditable='']"):!1,X=G=>{if(t.platform!=="desktop"||G.buttons!==1||j(G.target))return;const Y=J();Y?.startDragging&&(G.preventDefault(),Y.startDragging().catch(()=>{}))},W=G=>{if(t.platform!=="desktop"||j(G.target)||G.target instanceof Element&&G.target.closest("[data-tauri-decorum-tb]"))return;const Y=J();Y?.toggleMaximize&&(G.preventDefault(),Y.toggleMaximize().catch(()=>{}))};return(()=>{var G=eKt(),Y=G.firstChild,oe=Y.firstChild,ue=Y.nextSibling,ye=ue.nextSibling;return ye.firstChild,G.$$dblclick=W,G.$$mousedown=X,K(Y,d(ve,{get when(){return M()},get children(){return[(()=>{var de=GZt();return Qe(le=>Rr(de,"width",`${72/C()}px`)),de})(),(()=>{var de=ZZt();return K(de,d(Sr,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return e.mobileSidebar.toggle},get"aria-label"(){return r.t("sidebar.menu.toggle")},get"aria-expanded"(){return e.mobileSidebar.opened()}})),de})()]}}),oe),K(Y,d(ve,{get when(){return!M()},get children(){var de=KZt();return K(de,d(Sr,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return e.mobileSidebar.toggle},get"aria-label"(){return r.t("sidebar.menu.toggle")},get"aria-expanded"(){return e.mobileSidebar.opened()}})),de}}),oe),K(Y,d(ve,{get when(){return D()},get children(){return[XZt(),d(Mt,{placement:"bottom-start",gutter:4,modal:!1,get children(){return[d(Mt.Trigger,{as:Mn,variant:"ghost",size:"small",class:"flex items-center gap-1 h-6 px-2 text-12-regular text-text-base max-w-[180px]",get children(){return[(()=>{var de=JZt();return K(de,O),de})(),d(Kt,{name:"chevron-down",size:"small",class:"shrink-0 text-icon-weak"})]}}),d(Mt.Portal,{get children(){return d(Mt.Content,{class:"min-w-[180px]",get children(){return[d(Qt,{get each(){return e.projects.list()},children:de=>d(Mt.Item,{onSelect:()=>o(`/${St(de.worktree)}/session`),get children(){return d(Mt.ItemLabel,{get children(){return de.name||Gn(de.worktree)}})}})}),d(Mt.Separator,{}),d(Mt.Item,{onSelect:()=>n.trigger("project.open"),get children(){return d(Mt.ItemLabel,{get children(){return r.t("command.project.open")}})}}),d(Mt.Separator,{}),d(Mt.Sub,{get children(){return[d(Mt.SubTrigger,{get children(){return r.t("command.project.new")}}),d(Mt.SubContent,{get children(){return[d(Mt.Item,{onSelect:x,get children(){return d(Mt.ItemLabel,{get children(){return r.t("command.project.newBlank")}})}}),d(Mt.Item,{onSelect:w,get children(){return d(Mt.ItemLabel,{get children(){return r.t("command.project.importGitHub")}})}})]}})]}})]}})}})]}})]}}),oe),K(Y,d(ve,{get when(){return T()},get children(){var de=YZt(),le=de.firstChild;return K(de,d(Kt,{name:"chevron-right",size:"small",class:"text-icon-weaker shrink-0"}),le),K(le,T),de}}),oe),ye.$$mousedown=X,K(ye,d(J2e,{placement:"bottom",get title(){return r.t("sidebar.settings")},get keybind(){return n.keybind("settings.open")??""},get children(){return d(Mn,{variant:"ghost",class:"titlebar-icon w-8 h-6 p-0 box-border shrink-0",onClick:()=>n.trigger("settings.open"),get"aria-label"(){return r.t("sidebar.settings")},get children(){return d(Kt,{size:"small",name:"settings-gear"})}})}}),null),K(ye,d(ve,{get when(){return _()},get children(){return[kt(()=>kt(()=>!XK())()&&tKt()),QZt()]}}),null),Qe(de=>{var le=L(),Se={"flex items-center min-w-0":!0,"pl-2":!M()},Ee={"flex items-center min-w-0 justify-end":!0,"pr-2":!_()};return le!==de.e&&Rr(G,"min-height",de.e=le),de.t=hr(Y,Se,de.t),de.a=hr(ye,Ee,de.a),de},{e:void 0,t:void 0,a:void 0}),G})()}li(["mousedown","dblclick"]);const tt=e=>{const t=e.replaceAll("\\","/"),n=t.match(/^([A-Za-z]:)\/+$/);return n?`${n[1]}/`:/^\/+$/i.test(t)?"/":t.replace(/\/+$/,"")};function $me(e){const t=e-6e4;return(n,r)=>{const i=n.time.updated??n.time.created,a=r.time.updated??r.time.created,o=i>t,s=a>t;return o&&s?n.id<r.id?-1:n.id>r.id?1:0:o&&!s?-1:!o&&s?1:a-i}}const aKt=(e,t)=>tt(e.directory)===tt(t)&&!e.parentID&&!e.time?.archived,Tme=e=>(e.session??[]).filter(t=>aKt(t,e.path.directory)),H2=(e,t)=>Tme(e).sort($me(t)),$ne=(e,t)=>e.flatMap(Tme).sort($me(t))[0];function oKt(e,t=()=>!0){return Object.values(e??{}).some(n=>n?.some(t))}const tq=e=>{const t=new Map;for(const n of e??[]){if(!n.parentID)continue;const r=t.get(n.parentID);if(r){r.push(n.id);continue}t.set(n.parentID,[n.id])}return t},JK=e=>e.name||Gn(e.worktree),rV=(e,t)=>{if(e&&typeof e=="object"&&"data"in e){const n=e.data;if(n?.message)return n.message}return e instanceof Error?e.message:t},Yg=(e,t,n)=>{const r=tt(e),i=new Map;for(const o of t){const s=tt(o);s!==r&&(i.has(s)||i.set(s,o))}if(!n?.length)return[e,...i.values()];const a=[e];for(const o of n){const s=tt(o);if(s===r)continue;const l=i.get(s);l&&(a.push(l),i.delete(s))}return[...a,...i.values()]},Tne="opencode:deep-link",Eme=e=>{if(e.startsWith("opencode://")&&!(typeof URL.canParse=="function"&&!URL.canParse(e)))try{return new URL(e)}catch{return}},sKt=e=>{const t=Eme(e);if(!t||t.hostname!=="open-project")return;const n=t.searchParams.get("directory");if(n)return n},lKt=e=>{const t=Eme(e);if(!t||t.hostname!=="new-session")return;const n=t.searchParams.get("directory");if(!n)return;const r=t.searchParams.get("prompt")||void 0;return r?{directory:n,prompt:r}:{directory:n}},cKt=e=>e.map(sKt).filter(t=>!!t),dKt=e=>e.map(lKt).filter(t=>!!t),uKt=e=>{const t=e.__OPENCODE__?.deepLinks??[];return t.length===0?[]:(e.__OPENCODE__&&(e.__OPENCODE__.deepLinks=[]),t)};var hKt=ie("<span>");function fKt(){const[e,t]=nt({active:"",value:""}),n=c=>e.active===c,r=()=>e.value,i=(c,u)=>{c&&t({active:c,value:u})},a=()=>t({active:"",value:""}),o=c=>{const u=e.value.trim();if(!u){a();return}a(),c(u)},s=(c,u)=>{if(c.key==="Enter"){c.preventDefault(),o(u);return}c.key==="Escape"&&(c.preventDefault(),a())};return{editor:e,editorOpen:n,editorValue:r,openEditor:i,closeEditor:a,saveEditor:o,editorKeyDown:s,setEditor:t,InlineEditor:c=>{let u;me(()=>{u!==void 0&&cancelAnimationFrame(u)});const h=()=>c.editing??n(c.id),m=()=>c.stopPropagation??!1,g=()=>c.openOnDblClick??!0,y=k=>{m()&&k.stopPropagation()},v=k=>{g()&&(y(k),i(c.id,c.value()))};return d(ve,{get when(){return h()},get fallback(){return(()=>{var k=hKt();return k.$$touchstart=y,k.$$click=y,k.$$mousedown=y,k.$$pointerdown=y,k.$$dblclick=v,K(k,()=>c.value()),Qe(()=>U2(k,c.displayClass??c.class)),k})()},get children(){return d(CR,{ref:k=>{u!==void 0&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=void 0,k.isConnected&&k.focus()})},get value(){return r()},get class(){return c.class},onInput:k=>t("value",k.currentTarget.value),onKeyDown:k=>{k.stopPropagation(),s(k,c.onSave)},onBlur:a,onPointerDown:y,onClick:y,onDblClick:y,onMouseDown:y,onMouseUp:y,onTouchStart:y})}})}}}li(["dblclick","pointerdown","mousedown","click","touchstart"]);var pKt={};Ga(pKt,{Collapsible:()=>Yj,Content:()=>Dme,Root:()=>Ome,Trigger:()=>Rme,useCollapsibleContext:()=>YK});var Pme=Tt();function YK(){const e=Lt(Pme);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function Dme(e){const[t,n]=Ce(),r=YK(),i=ft({id:r.generateId("content")},e),[a,o]=Me(i,["ref","id","style"]),{present:s}=i0({show:r.shouldMount,element:()=>t()??null}),[l,c]=Ce(0),[u,h]=Ce(0);let g=r.isOpen()||s();return dn(()=>{const y=requestAnimationFrame(()=>{g=!1});me(()=>{cancelAnimationFrame(y)})}),fe(vn(s,()=>{if(!t())return;t().style.transitionDuration="0s",t().style.animationName="none";const y=t().getBoundingClientRect();c(y.height),h(y.width),g||(t().style.transitionDuration="",t().style.animationName="")})),fe(vn(r.isOpen,y=>{!y&&t()&&(t().style.transitionDuration="",t().style.animationName="")},{defer:!0})),fe(()=>me(r.registerContentId(a.id))),d(ve,{get when(){return s()},get children(){return d(zt,f({as:"div",ref(y){var v=hn(n,a.ref);typeof v=="function"&&v(y)},get id(){return a.id},get style(){return Wa({"--kb-collapsible-content-height":l()?`${l()}px`:void 0,"--kb-collapsible-content-width":u()?`${u()}px`:void 0},a.style)}},()=>r.dataset(),o))}})}function Ome(e){const t=`collapsible-${wr()}`,n=ft({id:t},e),[r,i]=Me(n,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[a,o]=Ce(),s=x0({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:u=>r.onOpenChange?.(u)}),l=Z(()=>({"data-expanded":s.isOpen()?"":void 0,"data-closed":s.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),c={dataset:l,isOpen:s.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||s.isOpen(),contentId:a,toggle:s.toggle,generateId:Io(()=>i.id),registerContentId:zr(o)};return d(Pme.Provider,{value:c,get children(){return d(zt,f({as:"div"},l,i))}})}function Rme(e){const t=YK(),[n,r]=Me(e,["onClick"]);return d(_0,f({get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return kt(()=>!!t.isOpen())()?t.contentId():void 0},get disabled(){return t.disabled()},onClick:a=>{dt(a,n.onClick),t.toggle()}},()=>t.dataset(),r))}var Yj=Object.assign(Ome,{Content:Dme,Trigger:Rme}),mKt=ie("<div data-slot=collapsible-arrow><span data-slot=collapsible-arrow-icon>");function gKt(e){const[t,n]=Me(e,["class","classList","variant"]);return d(Yj,f({"data-component":"collapsible",get"data-variant"(){return t.variant||"normal"},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}},n))}function yKt(e){return d(Yj.Trigger,f({"data-slot":"collapsible-trigger"},e))}function vKt(e){return d(Yj.Content,f({"data-slot":"collapsible-content"},e))}function kKt(e){return(()=>{var t=mKt(),n=t.firstChild;return ki(t,e||{},!1,!0),K(n,d(Kt,{name:"chevron-down",size:"small"})),t})()}const iV=Object.assign(gKt,{Arrow:kKt,Trigger:yKt,Content:vKt});var bKt=ie("<div>"),wKt=ie("<img data-slot=avatar-image>");const Ene=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function xKt(e){return e?Ene?Ene.segment(e)[Symbol.iterator]().next().value?.segment??Array.from(e)[0]??"":Array.from(e)[0]??"":""}function _Kt(e){const[t,n]=Me(e,["fallback","src","background","foreground","size","class","classList","style"]),r=t.src;return(()=>{var i=bKt();return ki(i,f(n,{"data-component":"avatar",get"data-size"(){return t.size||"normal"},"data-has-image":r?"":void 0,get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get style(){return{...typeof t.style=="object"?t.style:{},...!r&&t.background?{"--avatar-bg":t.background}:{},...!r&&t.foreground?{"--avatar-fg":t.foreground}:{}}}}),!1,!0),K(i,d(ve,{when:r,get fallback(){return xKt(t.fallback)},children:a=>(()=>{var o=wKt();return wt(o,"draggable",!1),Qe(()=>wt(o,"src",a())),o})()})),i})()}var MKt={};Ga(MKt,{Link:()=>SKt,Root:()=>QK});function QK(e){let t;const[n,r]=Me(e,["ref","href","disabled"]),i=G2(()=>t,()=>"a");return d(zt,f({as:"a",ref(a){var o=hn(s=>t=s,n.ref);typeof o=="function"&&o(a)},get role(){return i()!=="a"||n.disabled?"link":void 0},get tabIndex(){return i()!=="a"&&!n.disabled?0:void 0},get href(){return kt(()=>!n.disabled)()?n.href:void 0},get"aria-disabled"(){return n.disabled?!0:void 0},get"data-disabled"(){return n.disabled?"":void 0}},r))}var SKt=QK,CKt={};Ga(CKt,{Arrow:()=>vs,Content:()=>qme,HoverCard:()=>qp,Portal:()=>jme,Root:()=>Hme,Trigger:()=>Fme,useHoverCardContext:()=>Qj});var zme=Tt();function Qj(){const e=Lt(zme);if(e===void 0)throw new Error("[kobalte]: `useHoverCardContext` must be used within a `HoverCard` component");return e}function qme(e){const t=Qj(),[n,r]=Me(e,["ref","style"]);return d(ve,{get when(){return t.contentPresent()},get children(){return d(Hf.Positioner,{get children(){return d(sq,f({ref(i){var a=hn(o=>{t.setContentRef(o)},n.ref);typeof a=="function"&&a(i)},disableOutsidePointerEvents:!1,get style(){return Wa({"--kb-hovercard-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},n.style)},onFocusOutside:i=>i.preventDefault(),get onDismiss(){return t.close}},()=>t.dataset(),r))}})}})}function jme(e){const t=Qj();return d(ve,{get when(){return t.contentPresent()},get children(){return d(w0,e)}})}function LKt(e,t,n){const r=e.split("-")[0],i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=[],s=i.left+i.width/2,l=i.top+i.height/2;switch(r){case"top":o.push([i.left,l]),o.push([a.left,a.bottom]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([i.right,l]);break;case"right":o.push([s,i.top]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([a.left,a.bottom]),o.push([s,i.bottom]);break;case"bottom":o.push([i.left,l]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([a.right,a.top]),o.push([i.right,l]);break;case"left":o.push([s,i.top]),o.push([a.right,a.top]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([s,i.bottom]);break}return o}function Hme(e){const t=`hovercard-${wr()}`,n=ft({id:t,openDelay:700,closeDelay:300},e),[r,i]=Me(n,["id","open","defaultOpen","onOpenChange","openDelay","closeDelay","ignoreSafeArea","forceMount"]);let a,o;const[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(i.placement),g=x0({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:A=>r.onOpenChange?.(A)}),{present:y}=i0({show:()=>r.forceMount||g.isOpen(),element:()=>c()??null}),{addGlobalListener:v,removeGlobalListener:k}=Iye(),b=()=>{a=window.setTimeout(()=>{a=void 0,g.open()},r.openDelay)},x=()=>{o=window.setTimeout(()=>{o=void 0,g.close()},r.closeDelay)},w=()=>{window.clearTimeout(a),a=void 0},M=()=>{window.clearTimeout(o),o=void 0},_=A=>Jn(s(),A)||Jn(c(),A),C=A=>{const D=s(),P=c();if(!(!D||!P))return LKt(A,D,P)},L=A=>{const D=A.target;if(_(D)){M();return}if(!r.ignoreSafeArea){const P=C(h());if(P&&HU(sre(A),P)){M();return}}o||x()};fe(()=>{g.isOpen()&&(v(document,"pointermove",L,!0),me(()=>{k(document,"pointermove",L,!0)}))}),me(()=>{w(),M()});const I={dataset:Z(()=>({"data-expanded":g.isOpen()?"":void 0,"data-closed":g.isOpen()?void 0:""})),isOpen:g.isOpen,contentPresent:y,openWithDelay:b,closeWithDelay:x,cancelOpening:w,cancelClosing:M,close:g.close,isTargetOnHoverCard:_,setTriggerRef:l,setContentRef:u};return d(zme.Provider,{value:I,get children(){return d(Hf,f({anchorRef:s,contentRef:c,onCurrentPlacementChange:m},i))}})}function Fme(e){const t=Qj(),[n,r]=Me(e,["ref","onPointerEnter","onPointerLeave","onFocus","onBlur"]),i=l=>{dt(l,n.onPointerEnter),!(l.pointerType==="touch"||r.disabled||l.defaultPrevented)&&(t.cancelClosing(),t.isOpen()||t.openWithDelay())},a=l=>{dt(l,n.onPointerLeave),l.pointerType!=="touch"&&t.cancelOpening()},o=l=>{dt(l,n.onFocus),!(r.disabled||l.defaultPrevented)&&(t.cancelClosing(),t.isOpen()||t.openWithDelay())},s=l=>{dt(l,n.onBlur),t.cancelOpening();const c=l.relatedTarget;t.isTargetOnHoverCard(c)||t.closeWithDelay()};return me(t.cancelOpening),d(QK,f({ref(l){var c=hn(t.setTriggerRef,n.ref);typeof c=="function"&&c(l)},onPointerEnter:i,onPointerLeave:a,onFocus:o,onBlur:s},()=>t.dataset(),r))}var qp=Object.assign(Hme,{Arrow:vs,Content:qme,Portal:jme,Trigger:Fme}),IKt=ie("<div data-slot=hover-card-body>");function Vme(e){const[t,n]=Me(e,["trigger","mount","class","classList","children"]);return d(qp,f({gutter:4},n,{get children(){return[d(qp.Trigger,{as:"div","data-slot":"hover-card-trigger",tabIndex:-1,get children(){return t.trigger}}),d(qp.Portal,{get mount(){return t.mount},get children(){return d(qp.Content,{"data-component":"hover-card-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){var r=IKt();return K(r,()=>t.children),r}})}})]}}))}var NKt=ie('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 14"fill=none><g>'),AKt=ie("<span data-slot=diff-changes-additions>"),$Kt=ie("<span data-slot=diff-changes-deletions>"),TKt=ie("<div data-component=diff-changes>"),EKt=ie("<svg><rect width=2 height=14 rx=1></svg>",!1,!0,!1);function PKt(e){const t=()=>e.variant??"default",n=Z(()=>Array.isArray(e.changes)?e.changes.reduce((u,h)=>u+(h.additions??0),0):e.changes.additions),r=Z(()=>Array.isArray(e.changes)?e.changes.reduce((u,h)=>u+(h.deletions??0),0):e.changes.deletions),i=Z(()=>(n()??0)+(r()??0)),a=Z(()=>{const h=n()??0,m=r()??0;if(h===0&&m===0)return{added:0,deleted:0,neutral:5};const g=h+m;if(g<5){const S=h>0?1:0,I=m>0?1:0,A=5-S-I;return{added:S,deleted:I,neutral:A}}const y=h>m?h/m:m/h;let v=5;(g<20||y<4)&&(v=4);const k=h/g,b=m/g,x=k*v,w=b*v;let M=h>0?Math.max(1,Math.round(x)):0,_=m>0?Math.max(1,Math.round(w)):0;h>0&&h<=5&&(M=Math.min(M,1)),h>5&&h<=10&&(M=Math.min(M,2)),m>0&&m<=5&&(_=Math.min(_,1)),m>5&&m<=10&&(_=Math.min(_,2));let C=M+_;C>v&&(x>w?M=v-_:_=v-M,C=M+_);const L=Math.max(0,5-C);return{added:M,deleted:_,neutral:L}}),o="var(--icon-diff-add-base)",s="var(--icon-diff-delete-base)",l="var(--icon-weak-base)",c=Z(()=>{const u=a();return[...Array(u.added).fill(o),...Array(u.deleted).fill(s),...Array(u.neutral).fill(l)].slice(0,5)});return d(ve,{get when(){return kt(()=>t()==="default")()?i()>0:!0},get children(){var u=TKt();return K(u,d(r0,{get children(){return[d(Zn,{get when(){return t()==="bars"},get children(){var h=NKt(),m=h.firstChild;return K(m,d(Qt,{get each(){return c()},children:(g,y)=>(()=>{var v=EKt();return wt(v,"fill",g),Qe(()=>wt(v,"x",y()*4)),v})()})),h}}),d(Zn,{get when(){return t()==="default"},get children(){return[(()=>{var h=AKt();return K(h,()=>`+${n()}`),h})(),(()=>{var h=$Kt();return K(h,()=>`-${r()}`),h})()]}})]}})),Qe(h=>{var m=t(),g={[e.class??""]:!0};return m!==h.e&&wt(u,"data-variant",h.e=m),h.t=hr(u,g,h.t),h},{e:void 0,t:void 0}),u}})}var DKt=ie("<ul role=list data-component=message-nav>"),OKt=ie("<div data-slot=message-nav-tick-button role=button tabindex=0><div data-slot=message-nav-tick-line>"),RKt=ie("<button data-slot=message-nav-message-button><div data-slot=message-nav-title-preview>"),zKt=ie("<li data-slot=message-nav-item>"),qKt=ie("<div data-slot=message-nav-tooltip-content>");function Bme(e){const t=M0(),[n,r]=Me(e,["messages","current","size","onMessageSelect","getLabel"]),i=()=>(()=>{var a=DKt();return ki(a,f({get"data-size"(){return n.size}},r),!1,!0),K(a,d(Qt,{get each(){return n.messages},children:o=>{const s=()=>n.onMessageSelect(o),l=c=>{c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),n.onMessageSelect(o))};return(()=>{var c=zKt();return K(c,d(r0,{get children(){return[d(Zn,{get when(){return n.size==="compact"},get children(){var u=OKt();return u.$$keydown=l,u.$$click=s,Qe(()=>wt(u,"data-active",o.id===n.current?.id||void 0)),u}}),d(Zn,{get when(){return n.size==="normal"},get children(){var u=RKt(),h=u.firstChild;return u.$$keydown=l,u.$$click=s,K(u,d(PKt,{get changes(){return o.summary?.diffs??[]},variant:"bars"}),h),K(h,d(ve,{get when(){return n.getLabel?.(o)??o.summary?.title},get fallback(){return t.t("ui.messageNav.newMessage")},get children(){return n.getLabel?.(o)??o.summary?.title}})),Qe(()=>wt(h,"data-active",o.id===n.current?.id||void 0)),u}})]}})),c})()}})),a})();return d(r0,{get children(){return[d(Zn,{get when(){return n.size==="compact"},get children(){return d(Ua,{openDelay:0,placement:"right-start",gutter:-40,shift:-10,overlap:!0,contentClass:"message-nav-tooltip",get value(){return(()=>{var a=qKt();return K(a,d(Bme,f(e,{size:"normal",class:""}))),a})()},get children(){return i()}})}}),d(Zn,{get when(){return n.size==="normal"},get children(){return i()}})]}})}li(["click","keydown"]);const Pne={ask:"var(--icon-agent-ask-base)",build:"var(--icon-agent-build-base)",docs:"var(--icon-agent-docs-base)",plan:"var(--icon-agent-plan-base)"};function jKt(e,t){return t||(Pne[e]??Pne[e.toLowerCase()])}function HKt(e,t){if(e)for(let n=e.length-1;n>=0;n--){const r=e[n];if(!(r.role!=="user"||!r.agent))return jKt(r.agent,t.find(i=>i.name===r.agent)?.color)}}function Ume(e,t,n,r=()=>!0){if(!n)return;const i=e.reduce((l,c)=>{if(!c.parentID)return l;const u=l.get(c.parentID);return u&&u.push(c.id),u||l.set(c.parentID,[c.id]),l},new Map),a=new Set([n]),o=[n];for(const l of o){const c=i.get(l);if(c)for(const u of c)a.has(u)||(a.add(u),o.push(u))}const s=o.find(l=>t[l]?.some(r));if(s)return t[s]?.find(r)}function FKt(e,t,n,r){return Ume(e,t,n,r)}function vQt(e,t,n,r){return Ume(e,t,n,r)}var VKt=ie("<div>"),BKt=ie('<div><div class="size-full rounded overflow-clip">'),UKt=ie('<div class="size-1.5 rounded-full bg-surface-warning-strong">'),WKt=ie('<div class="size-1.5 rounded-full bg-text-diff-delete-base">'),GKt=ie('<div class="size-1.5 rounded-full bg-text-interactive-base">'),Wme=ie('<div class="shrink-0 size-6 flex items-center justify-center">'),Gme=ie('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">'),ZKt=ie('<div class="overflow-y-auto overflow-x-hidden max-h-72 h-full">'),KKt=ie('<div class="min-w-0 w-full">'),XKt=ie('<div class="text-12-regular text-text-weak">'),JKt=ie('<div class="group/session relative w-full min-w-0 rounded-md cursor-default pl-2 pr-3 transition-colors hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[[data-expanded]]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active"><div class="flex min-w-0 items-center gap-1"><div class="min-w-0 flex-1"></div><div class="shrink-0 overflow-hidden transition-[width,opacity]">'),YKt=ie('<div class="group/session relative w-full min-w-0 rounded-md cursor-default transition-colors pl-2 pr-3 hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active">'),QKt=ie('<div class="flex flex-col gap-1">'),eXt=ie('<div class="h-8 w-full rounded-md bg-surface-raised-base opacity-60 animate-pulse">');const tXt="4b0ea68d7af9a6031a7ffda7ad66e0cb83315750",eX=e=>{const t=ha(),n=Lj(),r=gK(),i=Z(()=>[e.project.worktree,...e.project.sandboxes??[]]),a=Z(()=>i().reduce((u,h)=>u+n.project.unseenCount(h),0)),o=Z(()=>i().some(u=>n.project.unseenHasError(u))),s=Z(()=>i().some(u=>{const[h]=t.child(u,{bootstrap:!1});return oKt(h.permission,m=>!r.autoResponds(m,u))})),l=Z(()=>e.notify&&(s()||a()>0)),c=Z(()=>e.project.name||Gn(e.project.worktree));return(()=>{var u=BKt(),h=u.firstChild;return K(h,d(_Kt,f({get fallback(){return c()},get src(){return kt(()=>e.project.id===tXt)()?"https://opencode.ai/favicon.svg":e.project.icon?.override}},()=>oDt(e.project.icon?.color),{class:"size-full rounded",get classList(){return{"badge-mask":l()}}}))),K(u,d(ve,{get when(){return l()},get children(){var m=VKt();return Qe(g=>hr(m,{"absolute top-px right-px size-1.5 rounded-full z-10":!0,"bg-surface-warning-strong":s(),"bg-icon-critical-base":!s()&&o(),"bg-text-interactive-base":!s()&&!o()},g)),m}}),null),Qe(()=>U2(u,`relative size-8 shrink-0 rounded ${e.class??""}`)),u})()},nXt=e=>d(oG,{get href(){return`/${e.slug}/session/${e.session.id}`},get class(){return`flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${e.dense?"py-0.5":"py-1"}`},get onPointerDown(){return e.warmPress},get onPointerEnter(){return e.warmHover},get onPointerLeave(){return e.cancelHoverPrefetch},get onFocus(){return e.warmFocus},onClick:()=>{e.setHoverSession(void 0),!e.sidebarOpened()&&e.clearHoverProjectSoon()},get children(){return[(()=>{var t=Wme();return K(t,d(r0,{get fallback(){return d(Kt,{name:"dash",size:"small",class:"text-icon-weak"})},get children(){return[d(Zn,{get when(){return e.isWorking()},get children(){return d(P2,{class:"size-[15px]"})}}),d(Zn,{get when(){return e.hasPermissions()},get children(){return UKt()}}),d(Zn,{get when(){return e.hasError()},get children(){return WKt()}}),d(Zn,{get when(){return e.unseenCount()>0},get children(){return GKt()}})]}})),Qe(n=>Rr(t,"color",e.tint()??"var(--icon-interactive-base)")),t})(),(()=>{var t=Gme();return K(t,()=>e.session.title),t})()]}}),rXt=e=>{let t;return d(Vme,{openDelay:1e3,get closeDelay(){return e.sidebarHovering()?600:0},placement:"right-start",gutter:16,shift:-2,get trigger(){return(()=>{var n=KKt(),r=t;return typeof r=="function"?Hr(r,n):t=n,K(n,()=>e.trigger),n})()},get open(){return e.hoverSession()===e.session.id},onOpenChange:n=>{if(!n){e.setHoverSession(void 0);return}t?.matches(":hover")&&e.setHoverSession(e.session.id)},get children(){return d(ve,{get when(){return e.hoverReady()},get fallback(){return(()=>{var n=XKt();return K(n,()=>e.language.t("session.messages.loading")),n})()},get children(){var n=ZKt();return K(n,d(Bme,{get messages(){return e.hoverMessages()??[]},current:void 0,get getLabel(){return e.messageLabel},get onMessageSelect(){return e.onMessageSelect},size:"normal",class:"w-60"})),n}})}})},PU=e=>{const t=di(),n=ll(),r=If(),i=xr(),a=Lj(),o=gK(),s=ha(),l=Z(()=>a.session.unseenCount(e.session.id)),c=Z(()=>a.session.unseenHasError(e.session.id)),[u]=s.child(e.session.directory),h=Z(()=>!!FKt(u.session,u.permission,e.session.id,I=>!o.autoResponds(I,e.session.directory))),m=Z(()=>{if(h())return!1;const I=(u.message[e.session.id]??[]).findLast(D=>D.role==="assistant"&&typeof D.time?.completed!="number"),A=u.session_status[e.session.id];return I!==void 0||A?.type==="busy"||A?.type==="retry"||A!==void 0&&A.type!=="idle"}),g=Z(()=>HKt(u.message[e.session.id],u.agent)),y=Z(()=>u.message[e.session.id]?.filter(I=>I.role==="user")),v=Z(()=>y()!==void 0),k=Z(()=>!e.mobile&&e.sidebarExpanded()),b=Z(()=>(e.popover??!0)&&k()),x=Z(()=>e.session.id===t.id),w=(I,A)=>{const D=e.navList?.(),P=D?.some(E=>E.id===e.session.id&&E.directory===e.session.directory)?D:e.list;e.prefetchSession(e.session,A);const O=P.findIndex(E=>E.id===e.session.id&&E.directory===e.session.directory);if(O!==-1)for(let E=1;E<=I;E++){const T=P[O+E];T&&e.prefetchSession(T,E===1?"high":A);const R=P[O-E];R&&e.prefetchSession(R,E===1?"high":A)}},M={current:void 0},_=()=>{M.current!==void 0&&(clearTimeout(M.current),M.current=void 0)},C=()=>{w(1,"high"),M.current===void 0&&(M.current=setTimeout(()=>{M.current=void 0,w(2,"low")},80))};me(_);const L=I=>(u.part[I.id]??[]).find(P=>P?.type==="text"&&!P.synthetic&&!P.ignored)?.text,S=d(nXt,{get session(){return e.session},get slug(){return e.slug},get mobile(){return e.mobile},get dense(){return e.dense},tint:g,isWorking:m,hasPermissions:h,hasError:c,unseenCount:l,get setHoverSession(){return e.setHoverSession},get clearHoverProjectSoon(){return e.clearHoverProjectSoon},get sidebarOpened(){return r.sidebar.opened},warmHover:C,warmPress:()=>w(2,"high"),warmFocus:()=>w(2,"high"),cancelHoverPrefetch:_});return(()=>{var I=JKt(),A=I.firstChild,D=A.firstChild,P=D.nextSibling;return K(D,d(ve,{get when(){return b()},get fallback(){return d(Ua,{get placement(){return e.mobile?"bottom":"right"},get value(){return e.session.title},gutter:10,class:"min-w-0 w-full",children:S})},get children(){return d(rXt,{get mobile(){return e.mobile},get nav(){return e.nav},get hoverSession(){return e.hoverSession},get session(){return e.session},get sidebarHovering(){return e.sidebarHovering},hoverReady:v,hoverMessages:y,language:i,isActive:x,get slug(){return e.slug},get setHoverSession(){return e.setHoverSession},messageLabel:L,onMessageSelect:O=>{x()||r.pendingMessage.set(`${St(e.session.directory)}/${e.session.id}`,O.id),n(`${e.slug}/session/${e.session.id}#message-${O.id}`)},trigger:S})}})),K(P,d(Ua,{get value(){return i.t("common.archive")},placement:"top",get children(){return d(Sr,{icon:"archive",variant:"ghost",class:"size-6 rounded-md",get"aria-label"(){return i.t("common.archive")},onClick:O=>{O.preventDefault(),O.stopPropagation(),e.archiveSession(e.session)}})}})),Qe(O=>{var E=e.session.id,T={"w-6 opacity-100 pointer-events-auto":!!e.mobile,"w-0 opacity-0 pointer-events-none":!e.mobile,"group-hover/session:w-6 group-hover/session:opacity-100 group-hover/session:pointer-events-auto":!0,"group-focus-within/session:w-6 group-focus-within/session:opacity-100 group-focus-within/session:pointer-events-auto":!0};return E!==O.e&&wt(I,"data-session-id",O.e=E),O.t=hr(P,T,O.t),O},{e:void 0,t:void 0}),I})()},iXt=e=>{const t=If(),r=xr().t("command.session.new"),i=()=>e.mobile||!e.sidebarExpanded(),a=d(oG,{get href(){return`/${e.slug}/session`},end:!0,get class(){return`flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${e.dense?"py-0.5":"py-1"}`},onClick:()=>{e.setHoverSession(void 0),!t.sidebar.opened()&&e.clearHoverProjectSoon()},get children(){return[(()=>{var o=Wme();return K(o,d(Kt,{name:"new-session",size:"small",class:"text-icon-weak"})),o})(),(()=>{var o=Gme();return K(o,r),o})()]}});return(()=>{var o=YKt();return K(o,d(ve,{get when(){return!i()},get fallback(){return d(Ua,{get placement(){return e.mobile?"bottom":"right"},value:r,gutter:10,class:"min-w-0 w-full",children:a})},children:a})),o})()},aXt=e=>{const t=Array.from({length:e.count??4},(n,r)=>r);return(()=>{var n=QKt();return K(n,d(Qt,{each:t,children:()=>eXt()})),n})()};var oXt=ie('<div class="bg-background-base rounded-md px-2 py-1 text-14-medium text-text-strong">'),sXt=ie('<div class="flex items-center gap-1 min-w-0 flex-1"><div class="flex items-center justify-center shrink-0 size-6"></div><span class="text-14-medium text-text-base shrink-0"> :</span><div class="flex items-center justify-center shrink-0 overflow-hidden w-0 opacity-0 transition-all duration-200 group-hover/workspace:w-3.5 group-hover/workspace:opacity-100 group-focus-within/workspace:w-3.5 group-focus-within/workspace:opacity-100">'),lXt=ie('<span class="text-14-medium text-text-base min-w-0 truncate">'),cXt=ie('<div class="absolute right-1 top-1/2 -translate-y-1/2 flex items-center gap-0.5 transition-opacity">'),dXt=ie('<div class="shrink-0 size-6 flex items-center justify-center">'),uXt=ie('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">Trellis Board'),hXt=ie('<div class="relative w-full py-1">'),fXt=ie('<nav class="flex flex-col gap-1">'),Dne=ie("<div>"),pXt=ie('<div class=py-1><div class="group/workspace relative"data-component=workspace-item><div class="flex items-center gap-1">'),mXt=ie('<div class="size-full flex flex-col py-2 overflow-y-auto no-scrollbar [overflow-anchor:none]">');const gXt=e=>{const t=ha(),n=xr(),r=Z(()=>{const i=e.sidebarProject();if(!i)return;const a=e.activeWorkspace();if(!a)return;const[o]=t.child(a,{bootstrap:!1}),s=a===i.worktree?n.t("workspace.type.local"):n.t("workspace.type.sandbox"),l=e.workspaceLabel(a,o.vcs?.branch,i.id);return`${s} : ${l}`});return d(ve,{get when(){return r()},children:i=>(()=>{var a=oXt();return K(a,i),a})()})},yXt=e=>(()=>{var t=sXt(),n=t.firstChild,r=n.nextSibling,i=r.firstChild,a=r.nextSibling;return K(n,d(ve,{get when(){return e.busy()},get fallback(){return d(Kt,{name:"branch",size:"small"})},get children(){return d(P2,{class:"size-[15px]"})}})),K(r,(()=>{var o=kt(()=>!!e.local());return()=>o()?e.language.t("workspace.type.local"):e.language.t("workspace.type.sandbox")})(),i),K(t,d(ve,{get when(){return!e.local()},get fallback(){return(()=>{var o=lXt();return K(o,()=>e.branch()??Gn(e.directory)),o})()},get children(){return d(e.InlineEditor,{get id(){return`workspace:${e.directory}`},get value(){return e.workspaceValue},onSave:o=>{const s=o.trim();s&&(e.renameWorkspace(e.directory,s,e.projectId,e.branch()),e.setEditor("value",e.workspaceValue()))},class:"text-14-medium text-text-base min-w-0 truncate",displayClass:"text-14-medium text-text-base min-w-0 truncate",get editing(){return e.workspaceEditActive()},stopPropagation:!1,openOnDblClick:!1})}}),a),K(a,d(Kt,{get name(){return e.open()?"chevron-down":"chevron-right"},size:"small",class:"text-icon-base"})),t})(),vXt=e=>(()=>{var t=cXt();return K(t,d(Mt,{get modal(){return!e.sidebarHovering()},get open(){return e.menuOpen()},onOpenChange:n=>e.setMenuOpen(n),get children(){return[d(Ua,{get value(){return e.language.t("common.moreOptions")},placement:"top",get children(){return d(Mt.Trigger,{as:Sr,icon:"dot-grid",variant:"ghost",class:"size-6 rounded-md","data-action":"workspace-menu",get"data-workspace"(){return St(e.directory)},get"aria-label"(){return e.language.t("common.moreOptions")}})}}),d(Mt.Portal,{get children(){return d(Mt.Content,{onCloseAutoFocus:n=>{e.pendingRename()&&(n.preventDefault(),e.setPendingRename(!1),e.openEditor(`workspace:${e.directory}`,e.workspaceValue()))},get children(){return[d(Mt.Item,{get disabled(){return e.local()},onSelect:()=>{e.setPendingRename(!0),e.setMenuOpen(!1)},get children(){return d(Mt.ItemLabel,{get children(){return e.language.t("common.rename")}})}}),d(Mt.Item,{get disabled(){return e.local()||e.busy()},onSelect:()=>e.showResetWorkspaceDialog(e.root,e.directory),get children(){return d(Mt.ItemLabel,{get children(){return e.language.t("common.reset")}})}}),d(Mt.Item,{get disabled(){return e.local()||e.busy()},onSelect:()=>e.showDeleteWorkspaceDialog(e.root,e.directory),get children(){return d(Mt.ItemLabel,{get children(){return e.language.t("common.delete")}})}})]}})}})]}}),null),K(t,d(ve,{get when(){return!e.touch()},get children(){return d(Ua,{get value(){return e.language.t("command.session.new")},placement:"top",get children(){return d(Sr,{icon:"new-session",variant:"ghost",class:"size-6 rounded-md opacity-0 pointer-events-none group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto","data-action":"workspace-new-session",get"data-workspace"(){return St(e.directory)},get"aria-label"(){return e.language.t("command.session.new")},onClick:n=>{n.preventDefault(),n.stopPropagation(),e.setHoverSession(void 0),e.clearHoverProjectSoon(),e.navigateToNewSession()}})}})}}),null),Qe(n=>hr(t,{"opacity-100 pointer-events-auto":e.menuOpen(),"opacity-0 pointer-events-none":!e.menuOpen(),"group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto":!0,"group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto":!0},n)),t})(),Zme=e=>(()=>{var t=fXt();return K(t,d(oG,{get href(){return`/${e.slug()}/trellis`},class:"flex items-center gap-1 min-w-0 w-full text-left py-1 rounded-md px-2 pr-3 hover:bg-surface-raised-base-hover [&.active]:bg-surface-base-active",onClick:()=>{e.ctx.setHoverSession(void 0),e.ctx.clearHoverProjectSoon()},get children(){return[(()=>{var n=dXt();return K(n,d(Kt,{name:"checklist",size:"small",class:"text-icon-weak"})),n})(),uXt()]}}),null),K(t,d(ve,{get when(){return e.showNew()},get children(){return d(iXt,{get slug(){return e.slug()},get mobile(){return e.mobile},get sidebarExpanded(){return e.ctx.sidebarExpanded},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},get setHoverSession(){return e.ctx.setHoverSession}})}}),null),K(t,d(ve,{get when(){return e.loading()},get children(){return d(aXt,{})}}),null),K(t,d(Qt,{get each(){return e.sessions()},children:n=>d(PU,{session:n,get list(){return e.sessions()},get navList(){return e.ctx.navList},get slug(){return e.slug()},get mobile(){return e.mobile},get popover(){return e.popover},get children(){return e.children()},get sidebarExpanded(){return e.ctx.sidebarExpanded},get sidebarHovering(){return e.ctx.sidebarHovering},get nav(){return e.ctx.nav},get hoverSession(){return e.ctx.hoverSession},get setHoverSession(){return e.ctx.setHoverSession},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},get prefetchSession(){return e.ctx.prefetchSession},get archiveSession(){return e.ctx.archiveSession}})}),null),K(t,d(ve,{get when(){return e.hasMore()},get children(){var n=hXt();return K(n,d(Mn,{variant:"ghost",class:"flex w-full text-left justify-start text-14-regular text-text-weak pl-9 pr-10",size:"large",onClick:r=>{e.loadMore(),r.currentTarget.blur()},get children(){return e.language.t("common.loadMore")}})),n}}),null),t})(),kXt=e=>{const t=ll(),n=di(),r=ha(),i=xr(),a=Lme(e.directory),[o,s]=r.child(e.directory,{bootstrap:!1}),[l,c]=nt({open:!1,pendingRename:!1}),u=Z(()=>St(e.directory)),h=Z(()=>H2(o,e.sortNow())),m=Z(()=>tq(o.session)),g=Z(()=>e.directory===e.project.worktree),y=Z(()=>tt(e.ctx.currentDir())===tt(e.directory)),v=Z(()=>{const E=o.vcs?.branch,T=E??Gn(e.directory);return e.ctx.workspaceName(e.directory,e.project.id,E)??T}),k=Z(()=>e.ctx.workspaceExpanded(e.directory,g())),b=Z(()=>k()||y()),x=Z(E=>E||o.status==="complete",!1),w=Z(()=>h()?.length??0),M=Z(()=>o.sessionTotal>w()),_=Z(()=>e.ctx.isBusy(e.directory)),C=Z(E=>E||_(),!1),L=Z(()=>k()&&!x()&&w()===0&&!C()),S=OU("(hover: none)"),I=Z(()=>!L()&&(S()||w()===0||y()&&!n.id)),A=async()=>{s("limit",E=>(E??0)+5),await r.project.loadSessions(e.directory)},D=Z(()=>e.ctx.editorOpen(`workspace:${e.directory}`)),P=()=>d(yXt,{local:g,busy:_,open:k,get directory(){return e.directory},language:i,branch:()=>o.vcs?.branch,workspaceValue:v,workspaceEditActive:D,get InlineEditor(){return e.ctx.InlineEditor},get renameWorkspace(){return e.ctx.renameWorkspace},get setEditor(){return e.ctx.setEditor},get projectId(){return e.project.id}}),O=E=>{e.ctx.setWorkspaceExpanded(e.directory,E),!E&&e.ctx.editorOpen(`workspace:${e.directory}`)&&e.ctx.closeEditor()};return fe(()=>{b()&&r.child(e.directory,{bootstrap:!0})}),(()=>{var E=Dne();return Hr(a,E,()=>!0),K(E,d(iV,{variant:"ghost",get open(){return k()},class:"shrink-0",onOpenChange:O,get children(){return[(()=>{var T=pXt(),R=T.firstChild,H=R.firstChild;return K(H,d(ve,{get when(){return D()},get fallback(){return d(iV.Trigger,{get class(){return`flex items-center justify-between w-full pl-2 py-1.5 rounded-md hover:bg-surface-raised-base-hover transition-[padding] duration-200 ${l.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`},"data-action":"workspace-toggle",get"data-workspace"(){return St(e.directory)},get children(){return P()}})},get children(){var J=Dne();return K(J,P),Qe(()=>U2(J,`flex items-center justify-between w-full pl-2 py-1.5 rounded-md transition-[padding] duration-200 ${l.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`)),J}}),null),K(H,d(vXt,{get directory(){return e.directory},local:g,busy:_,menuOpen:()=>l.open,pendingRename:()=>l.pendingRename,setMenuOpen:J=>c("open",J),setPendingRename:J=>c("pendingRename",J),get sidebarHovering(){return e.ctx.sidebarHovering},touch:S,language:i,workspaceValue:v,get openEditor(){return e.ctx.openEditor},get showResetWorkspaceDialog(){return e.ctx.showResetWorkspaceDialog},get showDeleteWorkspaceDialog(){return e.ctx.showDeleteWorkspaceDialog},get root(){return e.project.worktree},get setHoverSession(){return e.ctx.setHoverSession},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},navigateToNewSession:()=>t(`/${u()}/session?new=1`)}),null),Qe(()=>wt(R,"data-workspace",St(e.directory))),T})(),d(iV.Content,{get children(){return d(Zme,{slug:u,get mobile(){return e.mobile},get popover(){return e.popover},get ctx(){return e.ctx},showNew:I,loading:L,sessions:h,children:m,hasMore:M,loadMore:A,language:i})}})]}})),Qe(T=>hr(E,{"opacity-30":a.isActiveDraggable,"opacity-50 pointer-events-none":_()},T)),E})()},bXt=e=>{const t=ha(),n=xr(),r=Z(()=>{const[m,g]=t.child(e.project.worktree);return{store:m,setStore:g}}),i=Z(()=>St(e.project.worktree)),a=Z(()=>H2(r().store,e.sortNow())),o=Z(()=>tq(r().store.session)),s=Z(m=>m||r().store.status==="complete",!1),l=Z(()=>a()?.length??0),c=Z(()=>!s()&&l()===0),u=Z(()=>r().store.sessionTotal>l()),h=async()=>{r().setStore("limit",m=>(m??0)+5),await t.project.loadSessions(e.project.worktree)};return(()=>{var m=mXt();return Hr(g=>e.ctx.setScrollContainerRef(g,e.mobile),m),K(m,d(Zme,{slug:i,get mobile(){return e.mobile},get popover(){return e.popover},get ctx(){return e.ctx},showNew:()=>!1,loading:c,sessions:a,children:o,hasMore:u,loadMore:h,language:n})),m})()};var wXt={};Ga(wXt,{Arrow:()=>vs,CheckboxItem:()=>Rj,Content:()=>Kme,ContextMenu:()=>tr,Group:()=>Im,GroupLabel:()=>zj,Icon:()=>qj,Item:()=>jj,ItemDescription:()=>Hj,ItemIndicator:()=>Fj,ItemLabel:()=>Vj,Portal:()=>Bj,RadioGroup:()=>Uj,RadioItem:()=>Wj,Root:()=>Yme,Separator:()=>Ff,Sub:()=>Gj,SubContent:()=>Zj,SubTrigger:()=>Kj,Trigger:()=>Qme,useContextMenuContext:()=>Jme});function Kme(e){const t=fa(),[n,r]=Me(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return d(fme,f({onCloseAutoFocus:s=>{n.onCloseAutoFocus?.(s),!s.defaultPrevented&&i&&s.preventDefault(),i=!1},onInteractOutside:s=>{n.onInteractOutside?.(s),!s.defaultPrevented&&!t.isModal()&&(i=!0)}},r))}var Xme=Tt();function xXt(){return Lt(Xme)}function Jme(){const e=xXt();if(e===void 0)throw new Error("[kobalte]: `useContextMenuContext` must be used within a `ContextMenu` component");return e}function Yme(e){const t=`contextmenu-${wr()}`,{direction:n}=gs(),r=ft({id:t,placement:n()==="rtl"?"left-start":"right-start",gutter:2,shift:2},e),[i,a]=Me(r,["onOpenChange"]),[o,s]=Ce({x:0,y:0}),l=x0({defaultOpen:!1,onOpenChange:u=>i.onOpenChange?.(u)}),c={setAnchorRect:s};return d(Xme.Provider,{value:c,get children(){return d(yme,f({get open(){return l.isOpen()},get onOpenChange(){return l.setIsOpen},getAnchorRect:o},a))}})}function Qme(e){const t=fa(),n=Po(),r=Jme(),i=ft({id:t.generateId("trigger")},e),[a,o]=Me(i,["ref","style","disabled","onContextMenu","onPointerDown","onPointerMove","onPointerCancel","onPointerUp"]);let s=0;const l=()=>{window.clearTimeout(s)};me(()=>{l()});const c=v=>{if(a.disabled){dt(v,a.onContextMenu);return}l(),v.preventDefault(),v.stopPropagation(),r.setAnchorRect({x:v.clientX,y:v.clientY}),n.isOpen()?n.focusContent():n.open(!0)},u=v=>v.pointerType==="touch"||v.pointerType==="pen";return d(zt,f({as:"div",ref(v){var k=hn(n.setTriggerRef,a.ref);typeof k=="function"&&k(v)},get style(){return Wa({"-webkit-touch-callout":"none"},a.style)},get"data-disabled"(){return a.disabled?"":void 0},onContextMenu:c,onPointerDown:v=>{dt(v,a.onPointerDown),!a.disabled&&u(v)&&(l(),r.setAnchorRect({x:v.clientX,y:v.clientY}),s=window.setTimeout(()=>n.open(!1),700))},onPointerMove:v=>{dt(v,a.onPointerMove),!a.disabled&&u(v)&&l()},onPointerCancel:v=>{dt(v,a.onPointerCancel),!a.disabled&&u(v)&&l()},onPointerUp:v=>{dt(v,a.onPointerUp),!a.disabled&&u(v)&&l()}},()=>n.dataset(),o))}var tr=Object.assign(Yme,{Arrow:vs,CheckboxItem:Rj,Content:Kme,Group:Im,GroupLabel:zj,Icon:qj,Item:jj,ItemDescription:Hj,ItemIndicator:Fj,ItemLabel:Vj,Portal:Bj,RadioGroup:Uj,RadioItem:Wj,Separator:Ff,Sub:Gj,SubContent:Zj,SubTrigger:Kj,Trigger:Qme});function _Xt(e){return d(tr,f(e,{"data-component":"context-menu"}))}function MXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.Trigger,f(n,{"data-slot":"context-menu-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function SXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.Icon,f(n,{"data-slot":"context-menu-icon",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function CXt(e){return d(tr.Portal,e)}function LXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.Content,f(n,{"data-component":"context-menu-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function IXt(e){const[t,n]=Me(e,["class","classList"]);return d(tr.Arrow,f(n,{"data-slot":"context-menu-arrow",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function NXt(e){const[t,n]=Me(e,["class","classList"]);return d(tr.Separator,f(n,{"data-slot":"context-menu-separator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function AXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.Group,f(n,{"data-slot":"context-menu-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function $Xt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.GroupLabel,f(n,{"data-slot":"context-menu-group-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function TXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.Item,f(n,{"data-slot":"context-menu-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function EXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.ItemLabel,f(n,{"data-slot":"context-menu-item-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function PXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.ItemDescription,f(n,{"data-slot":"context-menu-item-description",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function DXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.ItemIndicator,f(n,{"data-slot":"context-menu-item-indicator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function OXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.RadioGroup,f(n,{"data-slot":"context-menu-radio-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function RXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.RadioItem,f(n,{"data-slot":"context-menu-radio-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function zXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.CheckboxItem,f(n,{"data-slot":"context-menu-checkbox-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function qXt(e){return d(tr.Sub,e)}function jXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.SubTrigger,f(n,{"data-slot":"context-menu-sub-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function HXt(e){const[t,n]=Me(e,["class","classList","children"]);return d(tr.SubContent,f(n,{"data-component":"context-menu-sub-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}const Li=Object.assign(_Xt,{Trigger:MXt,Icon:SXt,Portal:CXt,Content:LXt,Arrow:IXt,Separator:NXt,Group:AXt,GroupLabel:$Xt,Item:TXt,ItemLabel:EXt,ItemDescription:PXt,ItemIndicator:DXt,RadioGroup:OXt,RadioItem:RXt,CheckboxItem:zXt,Sub:qXt,SubTrigger:jXt,SubContent:HXt});var FXt=ie('<div class="bg-background-base rounded-xl p-1">'),VXt=ie('<div class="-m-3 p-2 flex flex-col w-72"><div class="px-4 pt-2 pb-1 flex items-center gap-2"><div class="text-14-medium text-text-strong truncate grow"></div></div><div class="px-4 pb-2 text-12-medium text-text-weak"></div><div class="px-2 pb-2 flex flex-col gap-2"></div><div class="px-2 py-2 border-t border-border-weak-base">'),BXt=ie('<div class="flex flex-col gap-1"><div class="px-2 py-0.5 flex items-center gap-1 min-w-0"><div class="shrink-0 size-6 flex items-center justify-center"></div><span class="truncate text-14-medium text-text-base">'),UXt=ie("<div>");const WXt=e=>{const t=Z(()=>e.projects().find(n=>n.worktree===e.activeProject()));return d(ve,{get when(){return t()},children:n=>(()=>{var r=FXt();return K(r,d(eX,{get project(){return n()}})),r})()})},GXt=e=>{const t=Lj(),n=If(),r=Z(()=>e.dirs().reduce((a,o)=>a+t.project.unseenCount(o),0)),i=()=>e.dirs().filter(a=>t.project.unseenCount(a)>0).forEach(a=>t.project.markViewed(a));return d(Li,{get modal(){return!e.sidebarHovering()},onOpenChange:a=>{e.setMenu(a),e.setSuppressHover(a),a&&e.setOpen(!1)},get children(){return[d(Li.Trigger,{as:"button",type:"button",get"aria-label"(){return JK(e.project)},"data-action":"project-switch",get"data-project"(){return St(e.project.worktree)},get classList(){return{"flex items-center justify-center size-10 p-1 rounded-lg overflow-hidden transition-colors cursor-default":!0,"bg-transparent border-2 border-icon-strong-base hover:bg-surface-base-hover":e.selected(),"bg-transparent border border-transparent hover:bg-surface-base-hover hover:border-border-weak-base":!e.selected()&&!e.active(),"bg-surface-base-hover border border-border-weak-base":!e.selected()&&e.active()}},onPointerDown:a=>{if(a.button===0&&!a.ctrlKey){e.setOpen(!1),e.setSuppressHover(!0);return}e.overlay()&&(a.button!==2&&!(a.button===0&&a.ctrlKey)||(e.setOpen(!1),e.setSuppressHover(!0),a.preventDefault()))},onMouseEnter:a=>{e.overlay()&&(e.suppressHover()||e.onProjectMouseEnter(e.project.worktree,a))},onMouseLeave:()=>{e.suppressHover()&&e.setSuppressHover(!1),e.overlay()&&e.onProjectMouseLeave(e.project.worktree)},onFocus:()=>{e.overlay()&&(e.suppressHover()||e.onProjectFocus(e.project.worktree))},onClick:()=>{if(e.setOpen(!1),e.selected()){n.sidebar.toggle();return}e.navigateToProject(e.project.worktree)},onBlur:()=>e.setOpen(!1),get children(){return d(eX,{get project(){return e.project},notify:!0})}}),d(Li.Portal,{get children(){return d(Li.Content,{get children(){return[d(Li.Item,{onSelect:()=>e.showEditProjectDialog(e.project),get children(){return d(Li.ItemLabel,{get children(){return e.language.t("common.edit")}})}}),d(Li.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return St(e.project.worktree)},get disabled(){return kt(()=>e.project.vcs!=="git")()&&!e.workspacesEnabled(e.project)},onSelect:()=>e.toggleProjectWorkspaces(e.project),get children(){return d(Li.ItemLabel,{get children(){return kt(()=>!!e.workspacesEnabled(e.project))()?e.language.t("sidebar.workspaces.disable"):e.language.t("sidebar.workspaces.enable")}})}}),d(Li.Item,{"data-action":"project-clear-notifications",get"data-project"(){return St(e.project.worktree)},get disabled(){return r()===0},onSelect:i,get children(){return d(Li.ItemLabel,{get children(){return e.language.t("sidebar.project.clearNotifications")}})}}),d(Li.Separator,{}),d(Li.Item,{"data-action":"project-close-menu",get"data-project"(){return St(e.project.worktree)},onSelect:()=>e.closeProject(e.project.worktree),get children(){return d(Li.ItemLabel,{get children(){return e.language.t("common.close")}})}})]}})}})]}})},ZXt=e=>(()=>{var t=VXt(),n=t.firstChild,r=n.firstChild,i=n.nextSibling,a=i.nextSibling,o=a.nextSibling;return K(r,()=>JK(e.project)),K(i,()=>e.language.t("sidebar.project.recentSessions")),K(a,d(ve,{get when(){return e.workspaceEnabled()},get fallback(){return d(Qt,{get each(){return e.projectSessions().slice(0,2)},children:s=>d(PU,f(()=>e.ctx.sessionProps,{session:s,get list(){return e.projectSessions()},get slug(){return St(e.project.worktree)},dense:!0,get mobile(){return e.mobile},popover:!1,get children(){return e.projectChildren()}}))})},get children(){return d(Qt,{get each(){return e.workspaces()},children:s=>{const l=Z(()=>e.workspaceSessions(s)),c=Z(()=>e.workspaceChildren(s));return(()=>{var u=BXt(),h=u.firstChild,m=h.firstChild,g=m.nextSibling;return K(m,d(Kt,{name:"branch",size:"small",class:"text-icon-base"})),K(g,()=>e.label(s)),K(u,d(Qt,{get each(){return l().slice(0,2)},children:y=>d(PU,f(()=>e.ctx.sessionProps,{session:y,get list(){return l()},get slug(){return St(s)},dense:!0,get mobile(){return e.mobile},popover:!1,get children(){return c()}}))}),null),u})()}})}})),K(o,d(Mn,{variant:"ghost",class:"flex w-full text-left justify-start text-text-base px-2 hover:bg-transparent active:bg-transparent",onClick:()=>{e.ctx.openSidebar(),e.ctx.onHoverOpenChanged(e.project.worktree,!1),!e.selected()&&e.ctx.navigateToProject(e.project.worktree)},get children(){return e.language.t("sidebar.project.viewAllSessions")}})),t})(),KXt=e=>{const t=ha(),n=xr(),r=Lme(e.project.worktree),i=Z(()=>e.ctx.currentProject()?.worktree===e.project.worktree),a=Z(()=>e.ctx.workspaceIds(e.project).slice(0,2)),o=Z(()=>e.ctx.workspacesEnabled(e.project)),s=Z(()=>e.ctx.workspaceIds(e.project)),[l,c]=nt({menu:!1,suppressHover:!1}),u=()=>e.ctx.hoverProject()===e.project.worktree,h=Z(()=>!e.mobile&&e.ctx.sidebarOpened()),m=Z(()=>!e.mobile&&!e.ctx.sidebarOpened()),g=Z(()=>l.menu||(h()||m())&&u()),y=()=>u()&&h()&&!i()&&!l.menu,v=C=>{const[L]=t.child(C,{bootstrap:!1}),S=C===e.project.worktree?n.t("workspace.type.local"):n.t("workspace.type.sandbox"),I=e.ctx.workspaceLabel(C,L.vcs?.branch,e.project.id);return`${S} : ${I}`},k=Z(()=>t.child(e.project.worktree,{bootstrap:!1})[0]),b=Z(()=>H2(k(),e.sortNow())),x=Z(()=>tq(k().session)),w=C=>{const[L]=t.child(C,{bootstrap:!1});return H2(L,e.sortNow())},M=C=>{const[L]=t.child(C,{bootstrap:!1});return tq(L.session)},_=()=>d(GXt,{get project(){return e.project},get mobile(){return e.mobile},get nav(){return e.ctx.nav},get sidebarHovering(){return e.ctx.sidebarHovering},selected:i,active:g,overlay:m,suppressHover:()=>l.suppressHover,dirs:s,get onProjectMouseEnter(){return e.ctx.onProjectMouseEnter},get onProjectMouseLeave(){return e.ctx.onProjectMouseLeave},get onProjectFocus(){return e.ctx.onProjectFocus},get navigateToProject(){return e.ctx.navigateToProject},get showEditProjectDialog(){return e.ctx.showEditProjectDialog},get toggleProjectWorkspaces(){return e.ctx.toggleProjectWorkspaces},get workspacesEnabled(){return e.ctx.workspacesEnabled},get closeProject(){return e.ctx.closeProject},setMenu:C=>c("menu",C),setOpen:C=>e.ctx.onHoverOpenChanged(e.project.worktree,C),setSuppressHover:C=>c("suppressHover",C),language:n});return(()=>{var C=UXt();return Hr(r,C,()=>!0),K(C,d(ve,{get when(){return kt(()=>!!h())()&&!i()},get fallback(){return _()},get children(){return d(Vme,{get open(){return kt(()=>!!(!l.suppressHover&&y()))()&&!l.menu},openDelay:0,closeDelay:0,placement:"right-start",gutter:6,get trigger(){return _()},onOpenChange:L=>{l.menu||L&&l.suppressHover||(e.ctx.onHoverOpenChanged(e.project.worktree,L),L&&e.ctx.setHoverSession(void 0))},get children(){return d(ZXt,{get project(){return e.project},get mobile(){return e.mobile},selected:i,workspaceEnabled:o,workspaces:a,label:v,projectSessions:b,projectChildren:x,workspaceSessions:w,workspaceChildren:M,get ctx(){return e.ctx},language:n})}})}})),Qe(()=>C.classList.toggle("opacity-30",!!r.isActiveDraggable)),C})()};var XXt=ie('<div class="h-full w-full flex flex-col items-center gap-3 px-3 py-3 overflow-y-auto no-scrollbar">'),JXt=ie('<div class="flex h-full w-full min-w-0 overflow-hidden"><div data-component=sidebar-rail class="w-16 shrink-0 bg-background-base flex flex-col items-center overflow-hidden"><div class="flex-1 min-h-0 w-full"></div><div class="shrink-0 w-full pt-3 pb-6 flex flex-col items-center gap-2"></div></div><div>'),YXt=ie('<span class="text-icon-base text-12-medium">'),QXt=ie('<div class="flex items-center gap-2"><span>');const eJt=e=>{const t=Z(()=>!!e.mobile||e.opened()),n=()=>e.mobile?"bottom":"right";let r;return fe(()=>{const i=r;if(i){if(t()){i.removeAttribute("inert");return}i.setAttribute("inert","")}}),(()=>{var i=JXt(),a=i.firstChild,o=a.firstChild,s=o.nextSibling,l=a.nextSibling;return J1(a,"mousemove",e.aimMove,!0),K(o,d(xme,{get onDragStart(){return e.handleDragStart},get onDragEnd(){return e.handleDragEnd},get onDragOver(){return e.handleDragOver},collisionDetector:bme,get children(){return[d(_me,{}),d(Ame,{}),(()=>{var c=XXt();return K(c,d(Cme,{get ids(){return e.projects().map(u=>u.worktree)},get children(){return d(Qt,{get each(){return e.projects()},children:u=>e.renderProject(u)})}}),null),K(c,d(Ua,{get placement(){return n()},get value(){return(()=>{var u=QXt(),h=u.firstChild;return K(h,()=>e.openProjectLabel),K(u,d(ve,{get when(){return kt(()=>!e.mobile)()&&!!e.openProjectKeybind()},get children(){var m=YXt();return K(m,()=>e.openProjectKeybind()),m}}),null),u})()},get children(){return d(Sr,{icon:"plus",variant:"ghost",size:"large",get onClick(){return e.onOpenProject},get"aria-label"(){return kt(()=>typeof e.openProjectLabel=="string")()?e.openProjectLabel:void 0}})}}),null),c})(),d(Mme,{get children(){return e.renderProjectOverlay()}})]}})),K(s,d(J2e,{get placement(){return n()},get title(){return e.settingsLabel()},get keybind(){return e.settingsKeybind()??""},get children(){return d(Sr,{icon:"settings-gear",variant:"ghost",size:"large",get onClick(){return e.onOpenSettings},get"aria-label"(){return e.settingsLabel()}})}}),null),K(s,d(Ua,{get placement(){return n()},get value(){return e.helpLabel()},get children(){return d(Sr,{icon:"help",variant:"ghost",size:"large",get onClick(){return e.onOpenHelp},get"aria-label"(){return e.helpLabel()}})}}),null),Hr(c=>{r=c},l),K(l,()=>e.renderPanel()),Qe(c=>{var u={"flex-1 flex h-full min-h-0 min-w-0 overflow-hidden":!0,"pointer-events-none":!t()},h=!t();return c.e=hr(l,u,c.e),h!==c.t&&wt(l,"aria-hidden",c.t=h),c},{e:void 0,t:void 0}),i})()};li(["mousemove"]);var tJt=ie('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div><div class="flex justify-end gap-2">'),nJt=ie('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"> <!> </span></div><div class="flex justify-end gap-2">'),rJt=ie('<span class="text-12-regular text-text-base truncate select-text">'),iJt=ie('<div class="shrink-0 pl-1 py-1"><div class="group/project flex items-start justify-between gap-2 py-2 pl-2 pr-0"><div class="flex flex-col min-w-0">'),One=ie('<div class="shrink-0 py-4">'),aJt=ie('<div class="relative flex-1 min-h-0"><div class="size-full flex flex-col py-2 gap-4 overflow-y-auto no-scrollbar [overflow-anchor:none]">'),oJt=ie('<div class="flex-1 min-h-0 flex flex-col">'),sJt=ie('<div><div class="shrink-0 px-3 py-3"><div class="rounded-xl bg-background-base shadow-xs-border-base"data-component=getting-started><div class="p-3 flex flex-col gap-6"><div class="flex flex-col gap-2"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div></div><div data-component=getting-started-actions>'),lJt=ie('<div class="flex-1 min-h-0 -mt-4 flex items-center justify-center px-6 pb-64 text-center"><div class="mt-8 flex max-w-60 flex-col items-center gap-6 text-center"><div class="flex flex-col gap-3"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)>'),cJt=ie('<div class="flex-1 min-h-0">'),dJt=ie('<div class=" hidden w-12 shrink-0 bg-background-base flex flex-col items-center py-2 gap-2 z-20"><div class="flex-1 w-full flex flex-col items-center gap-1 overflow-y-auto no-scrollbar"><button type=button class="flex items-center justify-center size-9 p-1 rounded-md transition-colors hover:bg-surface-base-hover"></button></div><div class="shrink-0 w-full flex flex-col items-center gap-1 pb-2"><button type=button class="flex items-center justify-center size-9 p-1 rounded-md transition-colors hover:bg-surface-base-hover">'),Rne=ie("<div class=size-full>"),uJt=ie('<div class="relative bg-background-base flex-1 min-h-0 min-w-0 flex flex-col select-none [&_input]:select-text [&_textarea]:select-text [&_[contenteditable]]:select-text"><div class="flex-1 min-h-0 min-w-0 flex overflow-hidden"><div class="flex-1 min-h-0 relative"><div class="size-full relative overflow-x-hidden"><div class=xl:hidden><div></div><nav data-component=sidebar-nav-mobile></nav></div><div><main>'),hJt=ie('<button type=button class="flex items-center justify-center size-9 p-0.5 rounded-md transition-colors">');function fJt(e){const[t,n,,r]=Yn(In.global("layout.page",["layout.page.v1"]),nt({lastProjectSession:{},activeProject:void 0,activeWorkspace:void 0,workspaceOrder:{},workspaceName:{},workspaceBranchName:{},workspaceExpanded:{},gettingStartedDismissed:!1,activityBarVisible:!0,statusBarVisible:!0,minimapVisible:!1,panelMaximized:!1,panelPosition:"bottom",panelAlignment:"center"})),i=Z(()=>r());let a,o=0,s=!1;const l=di(),c=E0(),u=ha(),h=If(),m=Z(()=>h.ready()),g=ms(),y=om(),v=T0(),k=Lj(),b=gK(),x=ll();DZt(x);const w=mK(),M=lf(),_=Cce(),C=cle(),L=xr(),S=xo(l.dir),I=Z(()=>{const B=l.dir;if(!B)return{slug:B,dir:""};const F=xo(B);return F?{slug:B,dir:u.peek(F,{bootstrap:!1})[0].path.directory||F}:{slug:B,dir:""}}),A=Z(()=>C.ids().map(B=>[B,C.themes()[B]])),D=["system","light","dark"],P={system:"theme.scheme.system",light:"theme.scheme.light",dark:"theme.scheme.dark"},O=B=>L.t(P[B]),E=Z(()=>I().dir),[T,R]=nt({autoselect:!S,busyWorkspaces:{},hoverSession:void 0,hoverProject:void 0,scrollSessionKey:void 0,nav:void 0,sortNow:Date.now(),sizing:!1,peek:void 0,peeked:!1}),H=fKt(),J=(B,F)=>{const re=tt(B);if(F){R("busyWorkspaces",re,!0);return}R("busyWorkspaces",Ye(pe=>{delete pe[re]}))},j=B=>!!T.busyWorkspaces[tt(B)],X=()=>T.sortNow;let W;const G=setTimeout(()=>{R("sortNow",Date.now()),W=setInterval(()=>R("sortNow",Date.now()),6e4)},6e4-Date.now()%6e4),Y=PZt({enabled:()=>!h.sidebar.opened(),active:()=>T.hoverProject,el:()=>T.nav?.querySelector("[data-component='sidebar-rail']")??T.nav,onActivate:B=>{u.child(B),R("hoverProject",B),R("hoverSession",void 0)}});me(()=>{s=!0,o+=1,clearTimeout(G),W&&clearInterval(W),Ee!==void 0&&clearTimeout(Ee),Y.reset()}),dn(()=>{const B=()=>R("sizing",!1),F=()=>Se(),re=()=>{document.visibilityState==="hidden"&&Se()};window.addEventListener("pointerup",B),window.addEventListener("pointercancel",B),window.addEventListener("blur",B),window.addEventListener("blur",F),document.addEventListener("visibilitychange",re),me(()=>{window.removeEventListener("pointerup",B),window.removeEventListener("pointercancel",B),window.removeEventListener("blur",B),window.removeEventListener("blur",F),document.removeEventListener("visibilitychange",re)})});const oe=Z(()=>!h.sidebar.opened()&&T.hoverProject!==void 0),ue=Z(()=>h.sidebar.opened()||oe()),ye=B=>{R("hoverProject",B),Y.reset()},de=()=>queueMicrotask(()=>ye(void 0)),le=B=>R("hoverSession",B),Se=()=>{R("hoverSession",void 0),ye(void 0)};let Ee;const He=Z(()=>{const B=T.hoverProject;if(B)return h.projects.list().find(F=>F.worktree===B)});Z(()=>{const B=T.peek;if(B)return h.projects.list().find(F=>F.worktree===B)}),fe(()=>{const B=He();if(B){Ee!==void 0&&(clearTimeout(Ee),Ee=void 0),R("peek",B.worktree),R("peeked",!0);return}R("peeked",!1),T.peek!==void 0&&(Ee!==void 0&&clearTimeout(Ee),Ee=window.setTimeout(()=>{Ee=void 0,R("peek",void 0)},180))}),fe(()=>{h.sidebar.opened()&&ye(void 0)}),fe(()=>{if(!T.autoselect)return;const B=l.dir;!B||!xo(B)||R("autoselect",!1)});const _t=H.editorOpen,Ue=H.openEditor,V=H.closeEditor,Fe=H.setEditor,Re=H.InlineEditor,At=()=>{h.sidebar.opened()||Se()},De=B=>{At(),x(B),h.mobileSidebar.hide()};function Nt(B=1){const F=A().map(([ge])=>ge);if(F.length===0)return;const re=F.indexOf(C.themeId()),pe=re===-1?0:(re+B+F.length)%F.length,xe=F[pe];C.setTheme(xe),lr({title:L.t("toast.theme.title"),description:C.name(xe)})}function jn(B=1){const F=C.colorScheme(),re=D.indexOf(F),pe=re===-1?0:(re+B+D.length)%D.length,xe=D[pe];C.setColorScheme(xe),lr({title:L.t("toast.scheme.title"),description:O(xe)})}function ui(B){B!==L.locale()&&(L.setLocale(B),lr({title:L.t("toast.language.title"),description:L.t("toast.language.description",{language:L.label(B)})}))}function _r(B=1){const F=L.locales,re=F.indexOf(L.locale()),pe=re===-1?0:(re+B+F.length)%F.length,xe=F[pe];xe&&ui(xe)}function hi(B){const F=y.appearance.fontSize();y.appearance.setFontSize(Math.max(8,Math.min(72,F+B)))}function yn(){y.appearance.setFontSize(14)}const Hn=()=>dn(()=>{if(!g.checkUpdate||!g.update||!g.restart)return;let B,F;const re=()=>g.checkUpdate().then(({updateAvailable:pe,version:xe})=>{pe&&B===void 0&&(B=lr({persistent:!0,icon:"download",title:L.t("toast.update.title"),description:L.t("toast.update.description",{version:xe??""}),actions:[{label:L.t("toast.update.action.installRestart"),onClick:async()=>{await g.update(),await g.restart()}},{label:L.t("toast.update.action.notYet"),onClick:"dismiss"}]}))});fe(()=>{if(y.ready()){if(!y.updates.startup()){if(F===void 0)return;clearInterval(F),F=void 0;return}F===void 0&&(re(),F=setInterval(re,600*1e3))}}),me(()=>{F!==void 0&&clearInterval(F)})}),en=()=>dn(()=>{const B=new Map,F=new Map,re=5e3,pe=ge=>{const qe=B.get(ge);qe!==void 0&&(Kh.dismiss(qe),B.delete(ge),F.delete(ge))},xe=c.event.listen(ge=>{if(ge.details?.type==="worktree.ready"){J(ge.name,!1),Jg.ready(ge.name);return}if(ge.details?.type==="worktree.failed"){J(ge.name,!1),Jg.failed(ge.name,ge.details.properties?.message??L.t("common.requestFailed"));return}if(ge.details?.type==="question.replied"||ge.details?.type==="question.rejected"||ge.details?.type==="permission.replied"){const q0=ge.details.properties,qm=`${ge.name}:${q0.sessionID}`;pe(qm);return}if(ge.details?.type!=="permission.asked"&&ge.details?.type!=="question.asked")return;const qe=ge.details.type==="permission.asked"?L.t("notification.permission.title"):L.t("notification.question.title"),Be=ge.details.type==="permission.asked"?"checklist":"bubble-5",Je=ge.name,je=ge.details.properties;if(ge.details.type==="permission.asked"&&b.autoResponds(ge.details.properties,Je))return;const[Ke]=u.child(Je,{bootstrap:!1}),qt=Ke.session.find(q0=>q0.id===je.sessionID),nn=`${Je}:${je.sessionID}`,Xt=qt?.title??L.t("command.session.new"),on=Gn(Je),Rt=ge.details.type==="permission.asked"?L.t("notification.permission.description",{sessionTitle:Xt,projectName:on}):L.t("notification.question.description",{sessionTitle:Xt,projectName:on}),mt=`/${St(Je)}/session/${je.sessionID}`,Lr=Date.now(),Do=F.get(nn)??0;if(Lr-Do<re)return;F.set(nn,Lr),ge.details.type==="permission.asked"&&(y.sounds.permissionsEnabled()&&nU(y.sounds.permissions()),y.notifications.permissions()&&g.notify(qe,Rt,mt)),ge.details.type==="question.asked"&&y.notifications.agent()&&g.notify(qe,Rt,mt);const yl=l.id;if(tt(Je)===tt(E())&&je.sessionID===yl||tt(Je)===tt(E())&&qt?.parentID===yl)return;pe(nn);const zm=lr({persistent:!0,icon:Be,title:qe,description:Rt,actions:[{label:L.t("notification.action.goToSession"),onClick:()=>x(mt)},{label:L.t("common.dismiss"),onClick:"dismiss"}]});B.set(nn,zm)});me(xe),fe(()=>{const ge=l.id;if(!E()||!ge)return;const qe=`${E()}:${ge}`;pe(qe);const[Be]=u.child(E(),{bootstrap:!1}),Je=Be.session.filter(je=>je.parentID===ge);for(const je of Je)pe(`${E()}:${je.id}`)})});Hn(),en();function tn(B,F){if(!a||T.scrollSessionKey===F)return;const re=a.querySelector(`[data-session-id="${B}"]`);if(!re)return;const pe=a.getBoundingClientRect(),xe=re.getBoundingClientRect();if(xe.top>=pe.top&&xe.bottom<=pe.bottom){R("scrollSessionKey",F);return}R("scrollSessionKey",F),re.scrollIntoView({block:"nearest",behavior:"smooth"})}const Vt=Z(()=>{const B=E();if(!B)return;const F=tt(B),re=h.projects.list(),pe=re.find(je=>je.sandboxes?.some(Ke=>tt(Ke)===F));if(pe)return pe;const xe=re.find(je=>tt(je.worktree)===F);if(xe)return xe;const[ge]=u.child(B,{bootstrap:!1}),qe=ge.project;if(!qe)return;const Je=u.data.project.find(je=>je.id===qe)?.worktree;if(Je)return re.find(je=>je.worktree===Je)}),[Ya]=Jr(async()=>{if(await r.promise,await h.ready.promise,!lt(()=>T.autoselect))return;const B=h.projects.list(),F=v.projects.last();if(B.length===0){if(!F)return;await We(F,!0)}else{const re=B.find(pe=>pe.worktree===F)??B[0];if(!re)return;await We(re.worktree,!0)}}),pa=(B,F,re)=>{const pe=tt(B),xe=t.workspaceName[pe]??t.workspaceName[B];if(xe)return xe;if(F&&re)return t.workspaceBranchName[F]?.[re]},Br=(B,F,re,pe)=>{const xe=tt(B);n("workspaceName",xe,F),re&&pe&&(t.workspaceBranchName[re]||n("workspaceBranchName",re,{}),n("workspaceBranchName",re,pe,F))},mr=(B,F,re)=>pa(B,re,F)??F??Gn(B),Ur=Z(()=>{const B=Vt();return!B||B.vcs!=="git"?!1:h.sidebar.workspaces(B.worktree)()}),fi=Z(()=>{const B=Vt();if(!B)return[];if(!Ur())return[B.worktree];const F=E();return Om(B).filter(re=>{const pe=t.workspaceExpanded[re]??re===B.worktree,xe=tt(re)===tt(F);return pe||xe})});fe(()=>{if(!i()||!m())return;const B=h.projects.list();for(const[F,re]of Object.entries(t.workspaceExpanded)){if(!re)continue;const pe=tt(F),xe=B.find(ge=>tt(ge.worktree)===pe||ge.sandboxes?.some(qe=>tt(qe)===pe));xe&&(xe.vcs==="git"&&h.sidebar.workspaces(xe.worktree)()||n("workspaceExpanded",F,!1))}});const An=Z(()=>{const B=Date.now(),F=fi();if(F.length===0)return[];const re=[];for(const pe of F){const[xe]=u.child(pe,{bootstrap:!0}),ge=H2(xe,B);re.push(...ge)}return re}),ma=200,hl=2,he=10,we=4,et={value:0},Dt=new Map,Mr=10,xi=new Map,fl=B=>{const F=xi.get(B);if(F)return F;const re=new Set;return xi.set(B,re),re},Vf=(B,F)=>{const re=fl(B);return Rhe({seen:re,keep:F,limit:Mr,preserve:l.id&&tt(B)===tt(E())?[l.id]:void 0})};fe(()=>{const B=new Set(fi());for(const F of[...xi.keys()])B.has(F)||xi.delete(F)}),fe(()=>{I(),c.url,et.value+=1,gPt(),Dt.clear()}),fe(()=>{const B=new Set(fi());for(const[F,re]of Dt)B.has(F)||(re.pending.length=0,re.pendingSet.clear(),re.running===0&&Dt.delete(F))});const mn=B=>{const F=Dt.get(B);if(F)return F;const re={inflight:new Set,pending:[],pendingSet:new Set,running:0};return Dt.set(B,re),re},_i=(B,F)=>{if(B.length===0)return F.slice().sort((pe,xe)=>pe.id<xe.id?-1:pe.id>xe.id?1:0);const re=new Map;for(const pe of B)re.set(pe.id,pe);for(const pe of F)re.set(pe.id,pe);return[...re.values()].sort((pe,xe)=>pe.id<xe.id?-1:pe.id>xe.id?1:0)};async function Bf(B,F,re){const[pe,xe]=u.child(B,{bootstrap:!1});return yPt({directory:B,sessionID:F,task:ge=>zn(()=>c.client.session.messages({directory:B,sessionID:F,limit:ma})).then(qe=>{if(et.value!==re||!oee(B,F,ge))return;const Be=(qe.data??[]).filter(Rt=>!!Rt?.info?.id),Je=Be.map(Rt=>Rt.info).filter(Rt=>!!Rt?.id),je=_i([],Je),Ke=Vf(B,F),qt=qe.response.headers.get("x-next-cursor")??void 0,nn={limit:je.length,cursor:qt,complete:!qt,at:Date.now()};if(Ke.length>0){Phe(B,Ke);for(const Rt of Ke)u.todo.set(Rt,void 0)}const Xt=pe.message[F]??[],on=_i(Xt.filter(Rt=>!!Rt?.id),je);if(oee(B,F,ge))return ct(()=>{Ke.length>0&&xe(Ye(Rt=>{bj(Rt,Ke)})),xe("message",F,Ct(on,{key:"id"})),Ehe({directory:B,sessionID:F,...nn});for(const Rt of Be){const mt=pe.part[Rt.info.id]??[],Lr=_i(mt.filter(Do=>!!Do?.id),Rt.parts.filter(Do=>!!Do?.id));xe("part",Rt.info.id,Ct(Lr,{key:"id"}))}}),nn}).catch(()=>{})})}const Uf=B=>{const F=mn(B);if(F.running>=hl)return;const re=F.pending.shift();if(!re)return;F.pendingSet.delete(re),F.inflight.add(re),F.running+=1;const pe=et.value;Bf(B,re,pe).finally(()=>{F.running-=1,F.inflight.delete(re),Uf(B)})},ga=(B,F="low")=>{const re=B.directory;if(!re)return;const[pe]=u.child(re,{bootstrap:!1});if(lt(()=>{const Je=HB(re,B.id);return pPt({message:pe.message[B.id]!==void 0,info:Je,chunk:ma})}))return;const ge=mn(re);if(ge.inflight.has(B.id))return;if(ge.pendingSet.has(B.id)){if(F!=="high")return;const Je=ge.pending.indexOf(B.id);Je>0&&(ge.pending.splice(Je,1),ge.pending.unshift(B.id));return}const qe=fl(re);if(!(!qe.has(B.id)&&qe.size>=Mr&&F!=="high")){for(F==="high"&&ge.pending.unshift(B.id),F!=="high"&&ge.pending.push(B.id),ge.pendingSet.add(B.id);ge.pending.length>he;){const Je=ge.pending.pop();Je&&ge.pendingSet.delete(Je)}Uf(re)}},z0=(B,F)=>{for(let re=1;re<=we;re++){const pe=B[F+re];pe&&ga(pe,re===1?"high":"low");const xe=B[F-re];xe&&ga(xe,re===1?"high":"low")}};fe(()=>{const B=An();if(B.length===0)return;const F=l.id?B.findIndex(re=>re.id===l.id):0;if(F!==-1){if(!l.id){const re=B[F];re&&ga(re,"high")}z0(B,F)}});function Wf(B){const F=An();if(F.length===0)return;const re=l.id?F.findIndex(ge=>ge.id===l.id):-1;let pe;re===-1?pe=B>0?0:F.length-1:pe=(re+B+F.length)%F.length;const xe=F[pe];xe&&(ga(xe,"high"),z0(F,pe),Em(xe))}function Am(B){const F=h.projects.list();if(F.length===0)return;const re=Vt()?.worktree,pe=E()?ml(E()):void 0,xe=re??pe,ge=xe?F.findIndex(Be=>Be.worktree===xe):-1,qe=ge===-1?B>0?F[0]:F[F.length-1]:F[(ge+B+F.length)%F.length];qe&&(u.child(qe.worktree),We(qe.worktree))}function Mi(B){const F=An();if(F.length===0||!F.some(ge=>k.session.unseenCount(ge.id)>0))return;const pe=l.id?F.findIndex(ge=>ge.id===l.id):-1,xe=pe===-1?B>0?-1:0:pe;for(let ge=1;ge<=F.length;ge++){const qe=B>0?(xe+ge)%F.length:(xe-ge+F.length)%F.length,Be=F[qe];if(Be&&k.session.unseenCount(Be.id)!==0){ga(Be,"high"),z0(F,qe),Em(Be);return}}}async function ya(B){const[F,re]=u.child(B.directory),pe=F.session??[],xe=pe.findIndex(qe=>qe.id===B.id),ge=pe[xe+1]??pe[xe-1];await c.client.session.update({directory:B.directory,sessionID:B.id,time:{archived:Date.now()}}),re(Ye(qe=>{const Be=rn.search(qe.session,B.id,Je=>Je.id);Be.found&&qe.session.splice(Be.index,1)})),B.id===l.id&&x(ge?`/${l.dir}/session/${ge.id}`:`/${l.dir}/session`)}_.register("layout",()=>{const B=[{id:"sidebar.toggle",title:L.t("command.sidebar.toggle"),category:L.t("command.category.view"),keybind:"mod+b",onSelect:()=>h.sidebar.toggle()},{id:"project.open",title:L.t("command.project.open"),category:L.t("command.category.project"),keybind:"mod+o",onSelect:()=>rr()},{id:"project.previous",title:L.t("command.project.previous"),category:L.t("command.category.project"),keybind:"mod+alt+arrowup",onSelect:()=>Am(-1)},{id:"project.next",title:L.t("command.project.next"),category:L.t("command.category.project"),keybind:"mod+alt+arrowdown",onSelect:()=>Am(1)},{id:"provider.connect",title:L.t("command.provider.connect"),category:L.t("command.category.provider"),onSelect:()=>Gf()},{id:"server.switch",title:L.t("command.server.switch"),category:L.t("command.category.server"),onSelect:()=>$m()},{id:"settings.open",title:L.t("command.settings.open"),category:L.t("command.category.settings"),keybind:"mod+shift+,",onSelect:()=>pl()},{id:"settings.shortcuts",title:L.t("command.settings.shortcuts"),category:L.t("command.category.settings"),keybind:"mod+shift+k",onSelect:()=>{const F=++o;z(()=>import("./dialog-settings-BZpXHdr7.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107])).then(re=>{s||o!==F||M.show(()=>d(re.DialogSettings,{tab:"shortcuts"}))})}},{id:"session.previous",title:L.t("command.session.previous"),category:L.t("command.category.session"),keybind:"mod+,",onSelect:()=>Wf(-1)},{id:"session.next",title:L.t("command.session.next"),category:L.t("command.category.session"),keybind:"mod+.",onSelect:()=>Wf(1)},{id:"view.toggleMinimap",title:L.t("command.view.toggleMinimap"),category:L.t("command.category.view"),keybind:"mod+shift+m,mod+alt+m",onSelect:()=>n("minimapVisible",F=>!F)},{id:"view.toggleMaximizedPanel",title:L.t("command.view.toggleMaximizedPanel"),category:L.t("command.category.view"),keybind:"ctrl+tab",onSelect:()=>n("panelMaximized",F=>!F)},{id:"view.toggleActivityBar",title:L.t("command.view.toggleActivityBar"),category:L.t("command.category.view"),keybind:"mod+shift+b",onSelect:()=>n("activityBarVisible",F=>!F)},{id:"view.toggleStatusBar",title:L.t("command.view.toggleStatusBar"),category:L.t("command.category.view"),keybind:"ctrl+mod+s",onSelect:()=>n("statusBarVisible",F=>!F)},{id:"view.moveSidebarLeft",title:L.t("command.view.moveSidebarLeft"),category:L.t("command.category.view"),keybind:"ctrl+shift+alt+left",onSelect:()=>{}},{id:"view.moveSidebarRight",title:L.t("command.view.moveSidebarRight"),category:L.t("command.category.view"),keybind:"ctrl+shift+alt+right",onSelect:()=>{}},{id:"view.alignPanelCenter",title:L.t("command.view.alignPanelCenter"),category:L.t("command.category.view"),keybind:"ctrl+shift+down",onSelect:()=>n("panelAlignment","center")},{id:"view.positionPanelBottom",title:L.t("command.view.positionPanelBottom"),category:L.t("command.category.view"),keybind:"ctrl+shift+down",onSelect:()=>n("panelPosition","bottom")},{id:"view.positionPanelRight",title:L.t("command.view.positionPanelRight"),category:L.t("command.category.view"),keybind:"ctrl+shift+right",onSelect:()=>n("panelPosition","right")},{id:"view.positionPanelLeft",title:L.t("command.view.positionPanelLeft"),category:L.t("command.category.view"),keybind:"ctrl+shift+left",onSelect:()=>n("panelPosition","left")},{id:"app.quit",title:L.t("command.app.quit"),category:L.t("command.category.app"),keybind:"mod+alt+q",onSelect:()=>{}},{id:"app.reload",title:L.t("command.app.reload"),category:L.t("command.category.app"),keybind:"mod+shift+alt+r",onSelect:()=>window.location.reload()},{id:"app.restart",title:L.t("command.app.restart"),category:L.t("command.category.app"),keybind:"mod+shift+r",onSelect:()=>{g.restart?.()}},{id:"theme.select",title:L.t("command.theme.select"),category:L.t("command.category.theme"),keybind:"alt+t",onSelect:()=>{}},{id:"theme.toggleLightDark",title:L.t("command.theme.toggleLightDark"),category:L.t("command.category.theme"),keybind:"mod+shift+alt+t",onSelect:()=>jn(1)},{id:"editor.fontZoomIn",title:L.t("command.editor.fontZoomIn"),category:L.t("command.category.editor"),keybind:"mod+alt+=",onSelect:()=>hi(1)},{id:"editor.fontZoomOut",title:L.t("command.editor.fontZoomOut"),category:L.t("command.category.editor"),keybind:"mod+alt+-",onSelect:()=>hi(-1)},{id:"editor.fontZoomReset",title:L.t("command.editor.fontZoomReset"),category:L.t("command.category.editor"),keybind:"alt+0",onSelect:()=>yn()},{id:"terminal.fontZoomIn",title:L.t("command.terminal.fontZoomIn"),category:L.t("command.category.terminal"),keybind:"mod+ctrl+alt+=",onSelect:()=>hi(1)},{id:"terminal.fontZoomOut",title:L.t("command.terminal.fontZoomOut"),category:L.t("command.category.terminal"),keybind:"mod+ctrl+alt+-",onSelect:()=>hi(-1)},{id:"session.previous.unseen",title:L.t("command.session.previous.unseen"),category:L.t("command.category.session"),keybind:"shift+alt+arrowup",onSelect:()=>Mi(-1)},{id:"session.next.unseen",title:L.t("command.session.next.unseen"),category:L.t("command.category.session"),keybind:"shift+alt+arrowdown",onSelect:()=>Mi(1)},{id:"session.archive",title:L.t("command.session.archive"),category:L.t("command.category.session"),keybind:"mod+shift+backspace",disabled:!l.dir||!l.id,onSelect:()=>{const F=An().find(re=>re.id===l.id);F&&ya(F)}},{id:"workspace.new",title:L.t("workspace.new"),category:L.t("command.category.workspace"),keybind:"mod+shift+w",disabled:!Ur(),onSelect:()=>{const F=Vt();if(F)return rX(F)}},{id:"workspace.toggle",title:L.t("command.workspace.toggle"),description:L.t("command.workspace.toggle.description"),category:L.t("command.category.workspace"),slash:"workspace",disabled:!Vt()||Vt()?.vcs!=="git",onSelect:()=>{const F=Vt();if(!F||F.vcs!=="git")return;const re=h.sidebar.workspaces(F.worktree)();h.sidebar.toggleWorkspaces(F.worktree),lr({title:re?L.t("toast.workspace.disabled.title"):L.t("toast.workspace.enabled.title"),description:re?L.t("toast.workspace.disabled.description"):L.t("toast.workspace.enabled.description")})}},{id:"theme.cycle",title:L.t("command.theme.cycle"),category:L.t("command.category.theme"),keybind:"mod+shift+t",onSelect:()=>Nt(1)}];for(const[F]of A())B.push({id:`theme.set.${F}`,title:L.t("command.theme.set",{theme:C.name(F)}),category:L.t("command.category.theme"),onSelect:()=>C.commitPreview(),onHighlight:()=>(C.previewTheme(F),()=>C.cancelPreview())});B.push({id:"theme.scheme.cycle",title:L.t("command.theme.scheme.cycle"),category:L.t("command.category.theme"),keybind:"mod+shift+s",onSelect:()=>jn(1)});for(const F of D)B.push({id:`theme.scheme.${F}`,title:L.t("command.theme.scheme.set",{scheme:O(F)}),category:L.t("command.category.theme"),onSelect:()=>C.commitPreview(),onHighlight:()=>(C.previewColorScheme(F),()=>C.cancelPreview())});B.push({id:"language.cycle",title:L.t("command.language.cycle"),category:L.t("command.category.language"),onSelect:()=>_r(1)});for(const F of L.locales)B.push({id:`language.set.${F}`,title:L.t("command.language.set",{language:L.label(F)}),category:L.t("command.category.language"),onSelect:()=>ui(F)});return B});function Gf(){const B=++o;z(()=>import("./dialog-select-provider-0ixbAs1U.js").then(F=>F.d),__vite__mapDeps([107,105,102,106,104])).then(F=>{s||o!==B||M.show(()=>d(F.DialogSelectProvider,{}))})}function $m(){const B=++o;z(()=>import("./dialog-select-server-DgqWEODB.js"),__vite__mapDeps([108,105,102,109])).then(F=>{s||o!==B||M.show(()=>d(F.DialogSelectServer,{}))})}function pl(){const B=++o;z(()=>import("./dialog-settings-BZpXHdr7.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107])).then(F=>{s||o!==B||M.show(()=>d(F.DialogSettings,{}))})}function ml(B){const F=tt(B),re=h.projects.list().find(Be=>tt(Be.worktree)===F||Be.sandboxes?.some(Je=>tt(Je)===F));if(re)return re.worktree;const pe=Object.entries(t.workspaceOrder).find(([Be,Je])=>tt(Be)===F||Je.some(je=>tt(je)===F));if(pe)return pe[0];const[xe]=u.child(B,{bootstrap:!1}),ge=xe.project;return ge?u.data.project.find(Be=>Be.id===ge)?.worktree??B:B}function Bi(B){return Vt()?.worktree??ml(B)}function Zf(B,F,re=Bi(B)){return n("lastProjectSession",re,{directory:B,id:F,at:Date.now()}),re}function Kf(B){t.lastProjectSession[B]&&n("lastProjectSession",Ye(F=>{delete F[B]}))}function Tm(B,F,re=Bi(B)){return Zf(B,F,re),k.session.markViewed(F),lt(()=>t.workspaceExpanded[B])===!1&&n("workspaceExpanded",B,!0),requestAnimationFrame(()=>tn(F,`${B}:${F}`)),re}async function gl(B){if(!B)return;const F=ml(B);v.projects.touch(F);const re=h.projects.list().find(Ke=>Ke.worktree===F);let pe=re?Yg(F,[F,...re.sandboxes??[]],t.workspaceOrder[F]):[F];const xe=Ke=>Ke?pe.some(qt=>tt(qt)===tt(Ke)):!1,ge=async Ke=>{if(!Ke||Ke===F||xe(Ke))return xe(Ke);const qt=await c.client.worktree.list({directory:F}).then(nn=>nn.data??[]).catch(()=>[]);return pe=Yg(F,[F,...qt],t.workspaceOrder[F]),xe(Ke)},qe=async Ke=>{if(!xe(Ke.directory))return!1;const[qt]=u.child(Ke.directory,{bootstrap:!1});if(qt.session.some(Xt=>Xt.id===Ke.id))return n("lastProjectSession",F,{directory:Ke.directory,id:Ke.id,at:Date.now()}),De(`/${St(Ke.directory)}/session/${Ke.id}`),!0;const nn=await c.client.session.get({sessionID:Ke.id}).then(Xt=>Xt.data).catch(()=>{});return!nn?.directory||!xe(nn.directory)?!1:(n("lastProjectSession",F,{directory:nn.directory,id:nn.id,at:Date.now()}),De(`/${St(nn.directory)}/session/${nn.id}`),!0)},Be=t.lastProjectSession[F];if(Be?.id){if(await ge(Be.directory),await qe(Be))return;Kf(F)}const Je=$ne(pe.map(Ke=>u.child(Ke,{bootstrap:!1})[0]),Date.now());if(Je&&await qe(Je))return;const je=$ne(await Promise.all(pe.map(async Ke=>({path:{directory:Ke},session:await c.client.session.list({directory:Ke}).then(qt=>qt.data??[]).catch(()=>[])}))),Date.now());je&&await qe(je)||De(`/${St(F)}/session`)}function Em(B){B&&De(`/${St(B.directory)}/session/${B.id}`)}function We(B,F=!0){if(h.projects.open(B),F)return gl(B)}const te=B=>{if(v.isLocal()){for(const F of cKt(B))We(F);for(const F of dKt(B)){We(F.directory,!1);const re=St(F.directory);F.prompt&&qZt(re,{prompt:F.prompt});const pe=F.prompt?`/${re}/session?prompt=${encodeURIComponent(F.prompt)}`:`/${re}/session`;De(pe)}}};dn(()=>{const B=F=>{const pe=F.detail?.urls??[];pe.length!==0&&te(pe)};te(uKt(window)),window.addEventListener(Tne,B),me(()=>window.removeEventListener(Tne,B))});async function Ne(B,F){const re=JK(B);if(F===re)return;const pe=F===Gn(B.worktree)?"":F;if(B.id&&B.id!=="global"){await c.client.project.update({projectID:B.id,directory:B.worktree,name:pe});return}u.project.meta(B.worktree,{name:pe})}const Ge=(B,F,re,pe)=>{(pa(B,re,pe)??pe??Gn(B))!==F&&Br(B,F,re,pe)};function an(B){const F=h.projects.list(),re=tt(B),pe=F.findIndex(qe=>tt(qe.worktree)===re),xe=tt(Vt()?.worktree??"")===re;if(pe===-1)return;const ge=F[pe+1];if(!xe){h.projects.close(B);return}if(!ge){h.projects.close(B),x("/");return}De(`/${St(ge.worktree)}/session`),h.projects.close(B),queueMicrotask(()=>{gl(ge.worktree)})}function nr(B){if(h.sidebar.workspaces(B.worktree)()){h.sidebar.toggleWorkspaces(B.worktree);return}B.vcs==="git"&&h.sidebar.toggleWorkspaces(B.worktree)}const wn=B=>{const F=++o;z(()=>import("./dialog-edit-project-CgJu_xty.js"),[]).then(re=>{s||o!==F||M.show(()=>d(re.DialogEditProject,{project:B}))})};async function rr(){function B(F){if(Array.isArray(F)){for(const re of F)We(re,!1);gl(F[0])}else F&&We(F)}if(g.openDirectoryPickerDialog&&v.isLocal()){const F=await g.openDirectoryPickerDialog?.({title:L.t("command.project.open"),multiple:!0});B(F)}else{const F=++o;z(()=>import("./dialog-select-directory-D7DAqsnF.js"),__vite__mapDeps([110,111,105,102])).then(re=>{s||o!==F||M.show(()=>d(re.DialogSelectDirectory,{multiple:!0,onSelect:B}),()=>B(null))})}}const va=async(B,F,re=!1)=>{if(F===B)return;const pe=E(),xe=tt(pe),ge=tt(F),qe=re||!!l.dir&&xe===ge;!re&&qe&&De(`/${St(B)}/session`),J(F,!0);const Be=await c.client.worktree.remove({directory:B,worktreeRemoveInput:{directory:F}}).then(Xt=>Xt.data).catch(Xt=>(lr({title:L.t("workspace.delete.failed.title"),description:rV(Xt,L.t("common.requestFailed"))}),!1));if(J(F,!1),!Be||(tt(t.lastProjectSession[B]?.directory??"")===tt(F)&&Kf(B),u.set("project",Ye(Xt=>{const on=Xt.find(Rt=>Rt.worktree===B);on&&(on.sandboxes=(on.sandboxes??[]).filter(Rt=>Rt!==F))})),n("workspaceOrder",B,Xt=>(Xt??[]).filter(on=>on!==F)),h.projects.close(F),h.projects.open(B),qe))return;const Je=E(),je=tt(Je),Ke=h.projects.list().find(Xt=>Xt.worktree===B),nn=(Ke?Yg(B,[B,...Ke.sandboxes??[]],t.workspaceOrder[B]):[B]).some(Xt=>tt(Xt)===je);l.dir&&ml(Je)===B&&!nn&&De(`/${St(B)}/session`)},ks=async(B,F)=>{if(F===B)return;J(F,!0);const re=lr({persistent:!0,title:L.t("workspace.resetting.title"),description:L.t("workspace.resetting.description")}),pe=()=>Kh.dismiss(re),xe=await c.client.session.list({directory:F}).then(Be=>Be.data??[]).catch(()=>[]);if(Gzt(F,xe.map(Be=>Be.id),g),await c.client.instance.dispose({directory:F}).catch(()=>{}),!await c.client.worktree.reset({directory:B,worktreeResetInput:{directory:F}}).then(Be=>Be.data).catch(Be=>(lr({title:L.t("workspace.reset.failed.title"),description:rV(Be,L.t("common.requestFailed"))}),!1))){J(F,!1),pe();return}const qe=Date.now();await Promise.all(xe.filter(Be=>Be.time.archived===void 0).map(Be=>c.client.session.update({sessionID:Be.id,directory:Be.directory,time:{archived:qe}}).catch(()=>{}))),J(F,!1),pe(),lr({title:L.t("workspace.reset.success.title"),description:L.t("workspace.reset.success.description"),actions:[{label:L.t("command.session.new"),onClick:()=>{const Be=`/${St(F)}/session?new=1`;x(Be),h.mobileSidebar.hide()}},{label:L.t("common.dismiss"),onClick:"dismiss"}]})};function Xf(B){const F=Z(()=>Gn(B.directory)),[re,pe]=nt({status:"loading",dirty:!1});dn(()=>{c.client.file.status({directory:B.directory}).then(qe=>{const Je=(qe.data??[]).length>0;pe({status:"ready",dirty:Je})}).catch(()=>{pe({status:"error",dirty:!1})})});const xe=()=>{const qe=!!l.dir&&tt(E())===tt(B.directory);qe&&De(`/${St(B.root)}/session`),M.close(),va(B.root,B.directory,qe)},ge=()=>re.status==="loading"?L.t("workspace.status.checking"):re.status==="error"?L.t("workspace.status.error"):re.dirty?L.t("workspace.status.dirty"):L.t("workspace.status.clean");return d(qz,{get title(){return L.t("workspace.delete.title")},fit:!0,get children(){var qe=tJt(),Be=qe.firstChild,Je=Be.firstChild,je=Je.nextSibling,Ke=Be.nextSibling;return K(Je,()=>L.t("workspace.delete.confirm",{name:F()})),K(je,ge),K(Ke,d(Mn,{variant:"ghost",size:"large",onClick:()=>M.close(),get children(){return L.t("common.cancel")}}),null),K(Ke,d(Mn,{variant:"primary",size:"large",get disabled(){return re.status==="loading"},onClick:xe,get children(){return L.t("workspace.delete.button")}}),null),qe}})}function ir(B){const F=Z(()=>Gn(B.directory)),[re,pe]=nt({status:"loading",dirty:!1,sessions:[]}),xe=async()=>{const Ke=(await c.client.session.list({directory:B.directory}).then(qt=>qt.data??[]).catch(()=>[])).filter(qt=>qt.time.archived===void 0);pe({sessions:Ke})};dn(()=>{c.client.file.status({directory:B.directory}).then(je=>{const qt=(je.data??[]).length>0;pe({status:"ready",dirty:qt}),xe()}).catch(()=>{pe({status:"error",dirty:!1})})});const ge=()=>{M.close(),ks(B.root,B.directory)},qe=()=>re.sessions.length,Be=()=>re.status==="loading"?L.t("workspace.status.checking"):re.status==="error"?L.t("workspace.status.error"):re.dirty?L.t("workspace.status.dirty"):L.t("workspace.status.clean"),Je=()=>{const je=qe();return je===0?L.t("workspace.reset.archived.none"):je===1?L.t("workspace.reset.archived.one"):L.t("workspace.reset.archived.many",{count:je})};return d(qz,{get title(){return L.t("workspace.reset.title")},fit:!0,get children(){var je=nJt(),Ke=je.firstChild,qt=Ke.firstChild,nn=qt.nextSibling,Xt=nn.firstChild,on=Xt.nextSibling;on.nextSibling;var Rt=Ke.nextSibling;return K(qt,()=>L.t("workspace.reset.confirm",{name:F()})),K(nn,Be,Xt),K(nn,Je,on),K(nn,()=>L.t("workspace.reset.note"),null),K(Rt,d(Mn,{variant:"ghost",size:"large",onClick:()=>M.close(),get children(){return L.t("common.cancel")}}),null),K(Rt,d(Mn,{variant:"primary",size:"large",get disabled(){return re.status==="loading"},onClick:ge,get children(){return L.t("workspace.reset.button")}}),null),je}})}const Fn={session:"",sessionProject:"",directory:""};fe(vn(()=>[i(),I().slug,l.id,Vt()?.worktree,E()],([B,F,re,pe,xe])=>{if(!B||!F||!xe){Fn.session="",Fn.sessionProject="",Fn.directory="";return}if(!re){Fn.session="",Fn.sessionProject="",Fn.directory="";return}const ge=`${F}/${re}`;if(!pe){Fn.session=ge,Fn.directory=xe,Fn.sessionProject="";return}if(v.projects.last()!==pe&&v.projects.touch(pe),ge!==Fn.session||xe!==Fn.directory){Fn.session=ge,Fn.directory=xe,Fn.sessionProject=Tm(xe,re,pe);return}pe!==Fn.sessionProject&&(Fn.directory=xe,Fn.sessionProject=Zf(xe,re,pe))})),fe(()=>{const B=h.sidebar.opened()?h.sidebar.width():48;document.documentElement.style.setProperty("--dialog-left-margin",`${B}px`)});const Pm=Z(()=>Math.max(h.sidebar.width(),244)),mge=Z(()=>Math.max(Pm()-64,0)),Dm=new Set;fe(vn(fi,B=>{if(B.length===0){Dm.clear();return}const F=new Set(B);for(const re of F)Dm.has(re)||u.project.loadSessions(re);Dm.clear();for(const re of F)Dm.add(re)},{defer:!0}));function gge(B){const F=eq(B);F&&(ye(void 0),n("activeProject",F))}function yge(B){const{draggable:F,droppable:re}=B;if(F&&re){const pe=h.projects.list(),xe=pe.findIndex(qe=>qe.worktree===F.id.toString()),ge=pe.findIndex(qe=>qe.worktree===re.id.toString());xe!==ge&&ge!==-1&&h.projects.move(F.id.toString(),ge)}}function vge(){n("activeProject",void 0)}function Om(B){if(!B)return[];const F=B.worktree,re=[F,...B.sandboxes??[]],pe=Vt(),xe=tt(pe?.worktree??"")===tt(B.worktree)?E():void 0,ge=xe&&tt(xe)!==tt(F)&&!re.some(Je=>tt(Je)===tt(xe))?xe:void 0,qe=ge?Jg.get(ge)?.status==="pending":!1,Be=Yg(F,re,t.workspaceOrder[B.worktree]);return qe&&ge?[F,ge,...Be.filter(Je=>Je!==F)]:!ge||qe?Be:[...Be,ge]}const nX=Z(()=>{if(h.sidebar.opened())return Vt();const B=He();return B||Vt()});function kge(B){const F=eq(B);F&&n("activeWorkspace",F)}function bge(B){const{draggable:F,droppable:re}=B;if(!F||!re)return;const pe=nX();if(!pe)return;const xe=Om(pe),ge=xe.findIndex(je=>je===F.id.toString()),qe=xe.findIndex(je=>je===re.id.toString());if(ge===-1||qe===-1||ge===qe)return;const Be=xe.slice(),[Je]=Be.splice(ge,1);Je&&(Be.splice(qe,0,Je),n("workspaceOrder",pe.worktree,Be.filter(je=>tt(je)!==tt(pe.worktree))))}function wge(){n("activeWorkspace",void 0)}const rX=async B=>{At();const F=await c.client.worktree.create({directory:B.worktree}).then(ge=>ge.data).catch(ge=>{lr({title:L.t("workspace.create.failed.title"),description:rV(ge,L.t("common.requestFailed"))})});if(!F?.directory)return;Br(F.directory,F.branch,B.id,F.branch);const re=B.worktree,pe=tt(F.directory),xe=tt(re);J(F.directory,!0),Jg.pending(F.directory),n("workspaceExpanded",pe,!0),pe!==F.directory&&n("workspaceExpanded",F.directory,!0),n("workspaceOrder",B.worktree,ge=>{const Be=(ge??[]).filter(Je=>{const je=tt(Je);return je!==xe&&je!==pe});return[F.directory,...Be]}),u.child(F.directory),De(`/${St(F.directory)}/session`)},iX={currentDir:E,navList:An,sidebarExpanded:ue,sidebarHovering:oe,nav:()=>T.nav,hoverSession:()=>T.hoverSession,setHoverSession:le,clearHoverProjectSoon:de,prefetchSession:ga,archiveSession:ya,workspaceName:pa,renameWorkspace:Ge,editorOpen:_t,openEditor:Ue,closeEditor:V,setEditor:Fe,InlineEditor:Re,isBusy:j,workspaceExpanded:(B,F)=>t.workspaceExpanded[B]??F,setWorkspaceExpanded:(B,F)=>n("workspaceExpanded",B,F),showResetWorkspaceDialog:(B,F)=>M.show(()=>d(ir,{root:B,directory:F})),showDeleteWorkspaceDialog:(B,F)=>M.show(()=>d(Xf,{root:B,directory:F})),setScrollContainerRef:(B,F)=>{F||(a=B)}},xge={currentDir:E,currentProject:Vt,sidebarOpened:()=>h.sidebar.opened(),sidebarHovering:oe,hoverProject:()=>T.hoverProject,nav:()=>T.nav,onProjectMouseEnter:(B,F)=>Y.enter(B,F),onProjectMouseLeave:B=>Y.leave(B),onProjectFocus:B=>Y.activate(B),onHoverOpenChanged:(B,F)=>{!F&&T.hoverProject&&T.hoverProject!==B||R("hoverProject",F?B:void 0)},navigateToProject:gl,openSidebar:()=>h.sidebar.open(),closeProject:an,showEditProjectDialog:wn,toggleProjectWorkspaces:nr,workspacesEnabled:B=>B.vcs==="git"&&h.sidebar.workspaces(B.worktree)(),workspaceIds:Om,workspaceLabel:mr,sessionProps:{navList:An,sidebarExpanded:ue,sidebarHovering:oe,nav:()=>T.nav,hoverSession:()=>T.hoverSession,setHoverSession:le,clearHoverProjectSoon:de,prefetchSession:ga,archiveSession:ya},setHoverSession:le},_ge=B=>{const F=B.project,re=Z(()=>B.mobile||(B.merged??h.sidebar.opened())),pe=Z(()=>!B.mobile&&B.merged===!1&&!h.sidebar.opened()),xe=Z(()=>!!B.mobile||B.merged===!1||h.sidebar.opened()),ge=Z(()=>!l.dir&&h.projects.list().length===0),qe=Z(()=>{const mt=F();return mt?mt.name||Gn(mt.worktree):""}),Be=Z(()=>F()?.id??""),Je=Z(()=>F()?.worktree??""),je=Z(()=>{const mt=Je();return mt?St(mt):""}),Ke=Z(()=>{const mt=F();return mt?Om(mt):[]}),qt=Z(()=>Ke().reduce((mt,Lr)=>mt+k.project.unseenCount(Lr),0)),nn=()=>Ke().filter(mt=>k.project.unseenCount(mt)>0).forEach(mt=>k.project.markViewed(mt)),Xt=Z(()=>{const mt=F();return!mt||mt.vcs!=="git"?!1:h.sidebar.workspaces(mt.worktree)()}),on=Z(()=>{const mt=F();return mt?mt.vcs==="git"||h.sidebar.workspaces(mt.worktree)():!1}),Rt=Z(()=>u.data.path.home);return(()=>{var mt=sJt(),Lr=mt.firstChild,Do=Lr.firstChild,yl=Do.firstChild,zm=yl.firstChild,q0=zm.firstChild,qm=q0.nextSibling,Lge=qm.nextSibling,oX=zm.nextSibling;return K(mt,d(ve,{get when(){return F()},get fallback(){return d(ve,{get when(){return ge()},get children(){var Ir=lJt(),ar=Ir.firstChild,Nr=ar.firstChild,xn=Nr.firstChild,jm=xn.nextSibling;return K(xn,()=>L.t("sidebar.empty.title")),K(jm,()=>L.t("sidebar.empty.description")),K(ar,d(Mn,{size:"large",icon:"folder-add-left",onClick:rr,get children(){return L.t("command.project.open")}}),null),Ir}})},get children(){return[(()=>{var Ir=iJt(),ar=Ir.firstChild,Nr=ar.firstChild;return K(Nr,d(Re,{get id(){return`project:${Be()}`},value:qe,onSave:xn=>{const jm=F();jm&&Ne(jm,xn)},class:"text-14-medium text-text-strong truncate",displayClass:"text-14-medium text-text-strong truncate",stopPropagation:!0}),null),K(Nr,d(Ua,{placement:"bottom",gutter:2,get value(){return Je()},class:"shrink-0",contentStyle:{"max-width":"640px",transform:"translate3d(52px, 0, 0)"},get children(){var xn=rJt();return K(xn,()=>Je().replace(Rt(),"~")),xn}}),null),K(ar,d(Mt,{get modal(){return!oe()},get children(){return[d(Mt.Trigger,{as:Sr,icon:"dot-grid",variant:"ghost","data-action":"project-menu",get"data-project"(){return je()},class:"shrink-0 size-6 rounded-md transition-opacity data-[expanded]:bg-surface-base-active",get classList(){return{"opacity-100":B.mobile||re(),"opacity-0 group-hover/project:opacity-100 group-focus-within/project:opacity-100 data-[expanded]:opacity-100":!B.mobile&&!re()}},get"aria-label"(){return L.t("common.moreOptions")}}),d(Mt.Portal,{get children(){return d(Mt.Content,{class:"mt-1",get children(){return[d(Mt.Item,{onSelect:()=>{const xn=F();xn&&wn(xn)},get children(){return d(Mt.ItemLabel,{get children(){return L.t("common.edit")}})}}),d(Mt.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return je()},get disabled(){return!on()},onSelect:()=>{const xn=F();xn&&nr(xn)},get children(){return d(Mt.ItemLabel,{get children(){return kt(()=>!!Xt())()?L.t("sidebar.workspaces.disable"):L.t("sidebar.workspaces.enable")}})}}),d(Mt.Item,{"data-action":"project-clear-notifications",get"data-project"(){return je()},get disabled(){return qt()===0},onSelect:nn,get children(){return d(Mt.ItemLabel,{get children(){return L.t("sidebar.project.clearNotifications")}})}}),d(Mt.Separator,{}),d(Mt.Item,{"data-action":"project-close-menu",get"data-project"(){return je()},onSelect:()=>{const xn=Je();xn&&an(xn)},get children(){return d(Mt.ItemLabel,{get children(){return L.t("common.close")}})}})]}})}})]}}),null),Ir})(),d(xme,{onDragStart:kge,onDragEnd:wge,onDragOver:bge,collisionDetector:bme,get children(){return[d(_me,{}),d(Ame,{}),(()=>{var Ir=oJt();return K(Ir,d(ve,{get when(){return Xt()},get fallback(){return[(()=>{var ar=One();return K(ar,d(Mn,{variant:"secondary",size:"large",icon:"new-session",class:"w-full",onClick:()=>{const Nr=Je();Nr&&De(`/${St(Nr)}/session?new=1`)},get children(){return L.t("command.session.new")}})),ar})(),(()=>{var ar=cJt();return K(ar,d(bXt,{ctx:iX,get project(){return F()},sortNow:X,get mobile(){return B.mobile},get popover(){return xe()}})),ar})()]},get children(){return[(()=>{var ar=One();return K(ar,d(Mn,{size:"large",icon:"plus-small",class:"w-full",onClick:()=>{const Nr=F();Nr&&rX(Nr)},get children(){return L.t("workspace.new")}})),ar})(),(()=>{var ar=aJt(),Nr=ar.firstChild;return Hr(xn=>{B.mobile||(a=xn)},Nr),K(Nr,d(Cme,{get ids(){return Ke()},get children(){return d(Qt,{get each(){return Ke()},children:xn=>d(kXt,{ctx:iX,directory:xn,get project(){return F()},sortNow:X,get mobile(){return B.mobile},get popover(){return xe()}})})}})),ar})()]}})),Ir})(),d(Mme,{get children(){return d(gXt,{sidebarProject:nX,activeWorkspace:()=>t.activeWorkspace,workspaceLabel:mr})}})]}})]}}),Lr),K(q0,()=>L.t("sidebar.gettingStarted.title")),K(qm,()=>L.t("sidebar.gettingStarted.line1")),K(Lge,()=>L.t("sidebar.gettingStarted.line2")),K(oX,d(Mn,{size:"large",icon:"plus-small",onClick:Gf,get children(){return L.t("command.provider.connect")}}),null),K(oX,d(Mn,{size:"large",variant:"ghost",onClick:()=>n("gettingStartedDismissed",!0),get children(){return L.t("toast.update.action.notYet")}}),null),Qe(Ir=>{var ar={"flex flex-col min-h-0 min-w-0 box-border rounded-tl-[12px] px-3":!0,"border border-b-0 border-border-weak-base":!re(),"border-l border-t border-border-weaker-base":re(),"bg-background-base":re()||pe(),"bg-background-stronger":!re()&&!pe(),"flex-1 min-w-0":B.mobile,"max-w-full overflow-hidden":B.mobile},Nr=B.mobile?void 0:`${mge()}px`,xn=!!(t.gettingStartedDismissed||!(w.all().length>0&&w.paid().length===0));return Ir.e=hr(mt,ar,Ir.e),Nr!==Ir.t&&Rr(mt,"width",Ir.t=Nr),xn!==Ir.a&&Lr.classList.toggle("hidden",Ir.a=xn),Ir},{e:void 0,t:void 0,a:void 0}),mt})()},aX=()=>h.projects.list(),Mge=()=>d(WXt,{projects:aX,activeProject:()=>t.activeProject}),Sge=B=>d(eJt,{mobile:B,opened:()=>h.sidebar.opened(),get aimMove(){return Y.move},projects:aX,renderProject:F=>d(KXt,{ctx:xge,project:F,sortNow:X,mobile:B}),handleDragStart:gge,handleDragEnd:vge,handleDragOver:yge,get openProjectLabel(){return L.t("command.project.open")},openProjectKeybind:()=>_.keybind("project.open"),onOpenProject:rr,renderProjectOverlay:Mge,settingsLabel:()=>L.t("sidebar.settings"),settingsKeybind:()=>_.keybind("settings.open"),onOpenSettings:pl,helpLabel:()=>L.t("sidebar.help"),onOpenHelp:()=>g.openLink("https://opencode.ai/desktop-feedback"),renderPanel:()=>d(_ge,{project:Vt,mobile:!0})});let Rm;const Cge=bf();return fe(()=>{Cge.pathname,Rm&&requestAnimationFrame(()=>{E2e(Rm,{opacity:[0,1],y:[4,0]},{type:"spring",stiffness:400,damping:30})})}),d(aqt,{get children(){var B=uJt(),F=B.firstChild,re=F.firstChild,pe=re.firstChild,xe=pe.firstChild,ge=xe.firstChild,qe=ge.nextSibling,Be=xe.nextSibling,Je=Be.firstChild;return K(B,d(iKt,{}),F),K(F,d(ve,{get when(){return t.activityBarVisible},get children(){var je=dJt(),Ke=je.firstChild,qt=Ke.firstChild,nn=Ke.nextSibling,Xt=nn.firstChild;return K(Ke,d(Qt,{get each(){return h.projects.list()},children:on=>{const Rt=Z(()=>Vt()?.worktree===on.worktree);return(()=>{var mt=hJt();return mt.$$click=()=>x(`/${St(on.worktree)}/session`),K(mt,d(eX,{project:on,notify:!0})),Qe(Lr=>{var Do={"bg-transparent hover:bg-surface-base-hover":!Rt(),"bg-surface-base-hover border border-border-weak-base":Rt()},yl=on.name||Gn(on.worktree);return Lr.e=hr(mt,Do,Lr.e),yl!==Lr.t&&wt(mt,"aria-label",Lr.t=yl),Lr},{e:void 0,t:void 0}),mt})()}}),qt),qt.$$click=rr,K(qt,d(Kt,{name:"plus",size:"small",class:"text-icon-weak"})),Xt.$$click=pl,K(Xt,d(Kt,{name:"settings-gear",size:"small",class:"text-icon-weak"})),Qe(on=>{var Rt=L.t("command.project.open"),mt=L.t("sidebar.settings");return Rt!==on.e&&wt(qt,"aria-label",on.e=Rt),mt!==on.t&&wt(Xt,"aria-label",on.t=mt),on},{e:void 0,t:void 0}),je}}),re),ge.$$click=je=>{je.target===je.currentTarget&&h.mobileSidebar.hide()},qe.$$click=je=>je.stopPropagation(),K(qe,()=>Sge(!0)),hr(Be,{"absolute p-3 pt-0 inset-0":!0,"xl:inset-y-0 xl:right-0 xl:left-0":!0,"z-20":!0}),hr(Je,{"size-full overflow-x-hidden flex flex-col items-start contain-strict rounded-xl":!0}),K(Je,d(ve,{get when(){return!Ya.loading},get fallback(){return Rne()},get children(){var je=Rne(),Ke=Rm;return typeof Ke=="function"?Hr(Ke,je):Rm=je,K(je,()=>e.children),je}})),K(B,d(As.Region,{}),null),Qe(je=>{var Ke={"fixed inset-x-0 top-10 bottom-0 z-40 transition-opacity duration-200":!0,"opacity-100 pointer-events-auto":h.mobileSidebar.opened(),"opacity-0 pointer-events-none":!h.mobileSidebar.opened()},qt=L.t("sidebar.nav.projectsAndSessions"),nn={"@container fixed top-10 bottom-0 left-0 z-50 w-full max-w-[400px] overflow-hidden border-r border-border-weaker-base bg-background-base transition-transform duration-200 ease-out":!0,"translate-x-0":h.mobileSidebar.opened(),"-translate-x-full":!h.mobileSidebar.opened()};return je.e=hr(ge,Ke,je.e),qt!==je.t&&wt(qe,"aria-label",je.t=qt),je.a=hr(qe,nn,je.a),je},{e:void 0,t:void 0,a:void 0}),B}})}li(["click"]);var pJt=["id","name","validationState","required","disabled","readOnly"];function mJt(e){const t=`form-control-${wr()}`,n=ft({id:t},e),[r,i]=Ce(),[a,o]=Ce(),[s,l]=Ce(),[c,u]=Ce(),h=(v,k,b)=>{const x=b!=null||r()!=null;return[b,r(),x&&k!=null?v:void 0].filter(Boolean).join(" ")||void 0},m=v=>[s(),c(),v].filter(Boolean).join(" ")||void 0,g=Z(()=>({"data-valid":ke(n.validationState)==="valid"?"":void 0,"data-invalid":ke(n.validationState)==="invalid"?"":void 0,"data-required":ke(n.required)?"":void 0,"data-disabled":ke(n.disabled)?"":void 0,"data-readonly":ke(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>ke(n.name)??ke(n.id),dataset:g,validationState:()=>ke(n.validationState),isRequired:()=>ke(n.required),isDisabled:()=>ke(n.disabled),isReadOnly:()=>ke(n.readOnly),labelId:r,fieldId:a,descriptionId:s,errorMessageId:c,getAriaLabelledBy:h,getAriaDescribedBy:m,generateId:Io(()=>ke(n.id)),registerLabel:zr(i),registerField:zr(o),registerDescription:zr(l),registerErrorMessage:zr(u)}}}var ege=Tt();function Nm(){const e=Lt(ege);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function tge(e){const t=Nm(),n=ft({id:t.generateId("description")},e);return fe(()=>me(t.registerDescription(n.id))),d(zt,f({as:"div"},()=>t.dataset(),n))}var gJt=["id","aria-label","aria-labelledby","aria-describedby"];function yJt(e){const t=Nm(),n=ft({id:t.generateId("field")},e);return fe(()=>me(t.registerField(ke(n.id)))),{fieldProps:{id:()=>ke(n.id),ariaLabel:()=>ke(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy(ke(n.id),ke(n["aria-label"]),ke(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy(ke(n["aria-describedby"]))}}}function nge(e){let t;const n=Nm(),r=ft({id:n.generateId("label")},e),[i,a]=Me(r,["ref"]),o=G2(()=>t,()=>"label");return fe(()=>me(n.registerLabel(a.id))),d(zt,f({as:"label",ref(s){var l=hn(c=>t=c,i.ref);typeof l=="function"&&l(s)},get for(){return kt(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),a))}function vJt(e,t){fe(vn(e,n=>{if(n==null)return;const r=kJt(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),me(()=>{r.removeEventListener("reset",t)}))}))}function kJt(e){return bJt(e)?e.form:e.closest("form")}function bJt(e){return e.matches("textarea, input, select, button")}function rge(e){const t=Nm(),n=ft({id:t.generateId("error-message")},e),[r,i]=Me(n,["forceMount"]),a=()=>t.validationState()==="invalid";return fe(()=>{a()&&me(t.registerErrorMessage(i.id))}),d(ve,{get when(){return r.forceMount||a()},get children(){return d(zt,f({as:"div"},()=>t.dataset(),i))}})}var wJt={};Ga(wJt,{Description:()=>tge,ErrorMessage:()=>rge,Input:()=>age,Label:()=>nge,Root:()=>sge,TextArea:()=>lge,TextField:()=>R1,useTextFieldContext:()=>tX});var ige=Tt();function tX(){const e=Lt(ige);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function age(e){return d(oge,f({type:"text"},e))}function oge(e){const t=Nm(),n=tX(),r=ft({id:n.generateId("input")},e),[i,a,o]=Me(r,["onInput"],gJt),{fieldProps:s}=yJt(a);return d(zt,f({as:"input",get id(){return s.id()},get name(){return t.name()},get value(){return n.value()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get"aria-label"(){return s.ariaLabel()},get"aria-labelledby"(){return s.ariaLabelledBy()},get"aria-describedby"(){return s.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},get onInput(){return Kn([i.onInput,n.onInput])}},()=>t.dataset(),o))}function sge(e){let t;const n=`textfield-${wr()}`,r=ft({id:n},e),[i,a,o]=Me(r,["ref","value","defaultValue","onChange"],pJt),s=i.value,[l,c]=W2({value:()=>s===void 0?void 0:i.value??"",defaultValue:()=>i.defaultValue,onChange:g=>i.onChange?.(g)}),{formControlContext:u}=mJt(a);vJt(()=>t,()=>c(i.defaultValue??""));const h=g=>{if(u.isReadOnly()||u.isDisabled())return;const y=g.target;c(y.value),y.value=l()??""},m={value:l,generateId:Io(()=>ke(a.id)),onInput:h};return d(ege.Provider,{value:u,get children(){return d(ige.Provider,{value:m,get children(){return d(zt,f({as:"div",ref(g){var y=hn(v=>t=v,i.ref);typeof y=="function"&&y(g)},role:"group",get id(){return ke(a.id)}},()=>u.dataset(),o))}})}})}function lge(e){let t;const n=tX(),r=ft({id:n.generateId("textarea")},e),[i,a]=Me(r,["ref","autoResize","submitOnEnter","onKeyPress"]);fe(vn([()=>t,()=>i.autoResize,()=>n.value()],([s,l])=>{!s||!l||xJt(s)}));const o=s=>{t&&i.submitOnEnter&&s.key==="Enter"&&!s.shiftKey&&t.form&&(t.form.requestSubmit(),s.preventDefault())};return d(oge,f({as:"textarea",get"aria-multiline"(){return i.submitOnEnter?"false":void 0},get onKeyPress(){return Kn([i.onKeyPress,o])},ref(s){var l=hn(c=>t=c,i.ref);typeof l=="function"&&l(s)}},a))}function xJt(e){const t=e.style.alignSelf,n=e.style.overflow;"MozAppearance"in e.style||(e.style.overflow="hidden"),e.style.alignSelf="start",e.style.height="auto",e.style.height=`${e.scrollHeight+(e.offsetHeight-e.clientHeight)}px`,e.style.overflow=n,e.style.alignSelf=t}var R1=Object.assign(sge,{Description:tge,ErrorMessage:rge,Input:age,Label:nge,TextArea:lge}),_Jt=ie("<div data-slot=input-wrapper>");function MJt(e){const t=M0(),[n,r]=Me(e,["name","defaultValue","value","onChange","onKeyDown","validationState","required","disabled","readOnly","class","label","hideLabel","description","error","variant","copyable","copyKind","multiline"]),[i,a]=Ce(!1),o=()=>i()?t.t("ui.textField.copied"):n.copyKind==="link"?t.t("ui.textField.copyLink"):t.t("ui.textField.copyToClipboard"),s=()=>i()?"check":n.copyKind==="link"?"link":"copy";async function l(){const u=n.value??n.defaultValue??"";await navigator.clipboard.writeText(u),a(!0),setTimeout(()=>a(!1),2e3)}function c(){n.copyable&&l()}return d(R1,{"data-component":"input",get"data-variant"(){return n.variant||"normal"},get name(){return n.name},get defaultValue(){return n.defaultValue},get value(){return n.value},get onChange(){return n.onChange},get onKeyDown(){return n.onKeyDown},onClick:c,get required(){return n.required},get disabled(){return n.disabled},get readOnly(){return n.readOnly},get validationState(){return n.validationState},get children(){return[d(ve,{get when(){return n.label},get children(){return d(R1.Label,{"data-slot":"input-label",get classList(){return{"sr-only":n.hideLabel}},get children(){return n.label}})}}),(()=>{var u=_Jt();return K(u,d(ve,{get when(){return n.multiline},get fallback(){return d(R1.Input,f(r,{"data-slot":"input-input",get class(){return n.class}}))},get children(){return d(R1.TextArea,f(r,{autoResize:!0,"data-slot":"input-input",get class(){return n.class}}))}}),null),K(u,d(ve,{get when(){return n.copyable},get children(){return d(Ua,{get value(){return o()},placement:"top",gutter:4,get forceOpen(){return i()},skipDelayDuration:0,get children(){return d(Sr,{type:"button",get icon(){return s()},variant:"ghost",onClick:l,tabIndex:-1,"data-slot":"input-copy-button",get"aria-label"(){return o()}})}})}}),null),u})(),d(ve,{get when(){return n.description},get children(){return d(R1.Description,{"data-slot":"input-description",get children(){return n.description}})}}),d(R1.ErrorMessage,{"data-slot":"input-error",get children(){return n.error}})]}})}var SJt=ie('<div class="relative flex-1 h-screen w-screen min-h-0 flex flex-col items-center justify-center bg-background-base font-sans"><div class="w-2/3 max-w-3xl flex flex-col items-center justify-center gap-8"><div class="flex flex-col items-center gap-2 text-center"><h1 class="text-lg font-medium text-text-strong"></h1><p class="text-sm text-text-weak"></p></div><div class="flex items-center gap-3"></div><div class="flex flex-col items-center gap-2"><div class="flex items-center justify-center gap-1"><button type=button class="flex items-center text-text-interactive-base gap-1"><div>'),CJt=ie('<p class="text-xs text-text-danger-base text-center max-w-2xl">'),LJt=ie('<p class="text-xs text-text-weak">');const Qg=`
|
|
2565
2565
|
`+"─".repeat(40)+`
|
|
2566
2566
|
`;function IJt(e){if(!e||typeof e!="object"||!("message"in e)||!("path"in e))return!1;const t=e.message,n=e.path;return typeof t!="string"||!Array.isArray(n)?!1:n.every(r=>typeof r=="string")}function NJt(e){return typeof e=="object"&&e!==null&&"name"in e&&"data"in e&&typeof e.data=="object"}function cge(e,t){const n=new WeakSet;return JSON.stringify(e,(i,a)=>{if(typeof a=="bigint")return a.toString();if(typeof a=="object"&&a){if(n.has(a))return t;n.add(a)}return a},2)??String(e)}function AJt(e,t){const n=e.data,r=i=>cge(i,t("error.page.circular"));switch(e.name){case"MCPFailed":{const i=typeof n.name=="string"?n.name:"";return t("error.chain.mcpFailed",{name:i})}case"ProviderAuthError":{const i=typeof n.providerID=="string"?n.providerID:t("common.unknown"),a=typeof n.message=="string"?n.message:r(n.message);return t("error.chain.providerAuthFailed",{provider:i,message:a})}case"APIError":{const a=[typeof n.message=="string"?n.message:t("error.chain.apiError")];return typeof n.statusCode=="number"&&a.push(t("error.chain.status",{status:n.statusCode})),typeof n.isRetryable=="boolean"&&a.push(t("error.chain.retryable",{retryable:n.isRetryable})),typeof n.responseBody=="string"&&n.responseBody&&a.push(t("error.chain.responseBody",{body:n.responseBody})),a.join(`
|
|
2567
2567
|
`)}case"ProviderModelNotFoundError":{const{providerID:i,modelID:a,suggestions:o}=n,s=Array.isArray(o)&&o.length?[t("error.chain.didYouMean",{suggestions:o.join(", ")})]:[];return[t("error.chain.modelNotFound",{provider:i,model:a}),...s,t("error.chain.checkConfig")].join(`
|
|
@@ -2581,4 +2581,4 @@ ${Qg}${t("error.chain.causedBy")}
|
|
|
2581
2581
|
`:"")+e:(n>0?`
|
|
2582
2582
|
${Qg}${t("error.chain.causedBy")}
|
|
2583
2583
|
`:"")+i(e)}function ey(e,t){return dge(e,t,0)}const $Jt=e=>{const t=ms(),n=xr(),[r,i]=nt({checking:!1,version:void 0,actionError:void 0});dn(()=>{if(!window.__opencode_e2e)return;const l=ey(e.error,n.t);console.error(`[e2e:error-boundary] ${window.location.pathname}
|
|
2584
|
-
${l}`)});async function a(){t.checkUpdate&&(i("checking",!0),await t.checkUpdate().then(s=>{i("actionError",void 0),s.updateAvailable&&s.version&&i("version",s.version)}).catch(s=>{i("actionError",ey(s,n.t))}).finally(()=>{i("checking",!1)}))}async function o(){!t.update||!t.restart||await t.update().then(()=>t.restart()).then(()=>i("actionError",void 0)).catch(s=>{i("actionError",ey(s,n.t))})}return(()=>{var s=SJt(),l=s.firstChild,c=l.firstChild,u=c.firstChild,h=u.nextSibling,m=c.nextSibling,g=m.nextSibling,y=g.firstChild,v=y.firstChild,k=v.firstChild;return K(l,d(kxt,{class:"w-58.5 opacity-12 shrink-0"}),c),K(u,()=>n.t("error.page.title")),K(h,()=>n.t("error.page.description")),K(l,d(MJt,{get value(){return ey(e.error,n.t)},readOnly:!0,copyable:!0,multiline:!0,class:"max-h-96 w-full font-mono text-xs no-scrollbar",get label(){return n.t("error.page.details.label")},hideLabel:!0}),m),K(m,d(Mn,{size:"large",get onClick(){return t.restart},get children(){return n.t("error.page.action.restart")}}),null),K(m,d(ve,{get when(){return t.checkUpdate},get children(){return d(ve,{get when(){return r.version},get fallback(){return d(Mn,{size:"large",variant:"ghost",onClick:a,get disabled(){return r.checking},get children(){return kt(()=>!!r.checking)()?n.t("error.page.action.checking"):n.t("error.page.action.checkUpdates")}})},get children(){return d(Mn,{size:"large",onClick:o,get children(){return n.t("error.page.action.updateTo",{version:r.version??""})}})}})}}),null),K(l,d(ve,{get when(){return r.actionError},children:b=>(()=>{var x=CJt();return K(x,b),x})()}),g),K(y,()=>n.t("error.page.report.prefix"),v),v.$$click=()=>t.openLink("https://opencode.ai/desktop-feedback"),K(k,()=>n.t("error.page.report.discord")),K(v,d(Kt,{name:"discord",class:"text-text-interactive-base"}),null),K(g,d(ve,{get when(){return t.version},children:b=>(()=>{var x=LJt();return K(x,()=>n.t("error.page.version",{version:b()})),x})()}),null),s})()};li(["click"]);var TJt=ie("<div class=size-full>"),EJt=ie('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base">'),PJt=ie('<div class="flex flex-col gap-2 w-full max-w-sm"><span class="text-12-regular text-text-base text-center"></span><div class="flex flex-col gap-1 bg-surface-base rounded-lg p-2">'),DJt=ie('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base gap-6 p-6"><div class="flex flex-col items-center max-w-md text-center"><p class="text-14-regular text-text-base"><span class="text-text-strong font-medium"></span></p><p class="mt-1 text-12-regular text-text-weak">'),OJt=ie('<button type=button class="flex items-center gap-3 w-full px-3 py-2 rounded-md hover:bg-surface-raised-base-hover transition-colors text-left"><span class="text-14-regular text-text-strong truncate">');const RJt=B2(()=>z(()=>import("./home-BnHPimua.js"),__vite__mapDeps([112,110,111,105,102,113]))),zJt=B2(()=>z(()=>import("./auth-callback-D7CK9pHp.js"),[])),uge=()=>z(()=>import("./session-BXKBDkSI.js").then(e=>e.s),__vite__mapDeps([114,100,101,102,105,115,98,116,117,106,111])),qJt=B2(uge),jJt=B2(()=>z(()=>import("./trellis-Csm7WAqm.js").then(e=>e.d),__vite__mapDeps([115,101,102,98,116,117]))),HJt=B2(()=>z(()=>import("./trellis-badge-demo-nxtlIRoh.js"),__vite__mapDeps([118,116]))),FJt=()=>TJt();typeof location=="object"&&/\/session(?:\/|$)/.test(location.pathname)&&uge();const zne=()=>d(GJt,{get children(){return d(qJt,{})}}),VJt=()=>d(m_t,{href:"session"});function BJt(e){const t=xr();return d(Ive,{get value(){return{locale:t.intl,t:t.t}},get children(){return e.children}})}function UJt(e){const t=new K_t;return d(G_t,{client:t,get children(){return e.children}})}function WJt(e){return d(fLt,{get children(){return d(Nzt,{get children(){return d(uDt,{get children(){return d(_zt,{get children(){return d(gzt,{get children(){return d(kLt,{get children(){return d(BDt,{get children(){return d(fJt,{get children(){return e.children}})}})}})}})}})}})}})}})}function GJt(e){return d(Kzt,{get children(){return d(LDt,{get children(){return d(jzt,{get children(){return d(NLt,{get children(){return e.children}})}})}})}})}function ZJt(e){return d(WJt,{get children(){return d(Uge,{get fallback(){return d(FJt,{})},get children(){return[kt(()=>e.appChildren),kt(()=>e.children)]}})}})}function KJt(e){return d(Rxt,{get children(){return[d(oxt,{}),d(Ext,{onThemeApplied:(t,n)=>{window.api?.setTitlebar?.({mode:n})},get children(){return d(aLt,{get locale(){return e.locale},get children(){return d(BJt,{get children(){return d(Vge,{fallback:t=>d($Jt,{error:t}),get children(){return d(UJt,{get children(){return d(Sve,{get children(){return d(K9e,{get children(){return d(gye,{component:Jse,get children(){return e.children}})}})}})}})}})}})}})}})]}})}const XJt=e=>t=>$Ct([t,zCt(e)],{concurrency:"unbounded"}).pipe(OCt(n=>n[0]));function JJt(e){const t=T0(),n=Ahe(),[r,i]=Ce("blocking"),[a,o]=Jr(()=>e.disableHealthCheck?!0:DCt(function*(){if(!t.current)return!0;const{http:s,type:l}=t.current;for(;;){if((yield*TCt(()=>n(s))).healthy)return!0;if(r()==="background"||l==="http")return!1}}).pipe(XJt(r()==="blocking"?"1.2 seconds":0),RCt({duration:"10 seconds",orElse:()=>ECt(!1)}),qCt(PCt(()=>i("background"))),jCt));return d(ve,{get when(){return kt(()=>r()==="blocking")()?!a.loading:a.state!=="pending"},get fallback(){return(()=>{var s=EJt();return K(s,d(Yse,{class:"w-16 h-20 opacity-50 animate-pulse"})),s})()},get children(){return d(ve,{get when(){return a()},get fallback(){return d(YJt,{onRetry:()=>{r()==="background"&&o.refetch()},onServerSelected:s=>{i("blocking"),t.setActive(s),o.refetch()}})},get children(){return e.children}})}})}function YJt(e){const t=xr(),n=T0(),r=()=>n.list.filter(l=>yo.key(l)!==n.key),i=Z(()=>n.name||n.key),a="\0server\0",o=Z(()=>t.t("app.server.unreachable",{server:a}).split(a)),s=setInterval(()=>e.onRetry?.(),1e3);return me(()=>clearInterval(s)),(()=>{var l=DJt(),c=l.firstChild,u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(c,d(Yse,{class:"w-12 h-15 mb-4"}),u),K(u,()=>o()[0],h),K(h,i),K(u,()=>o()[1],null),K(m,()=>t.t("app.server.retrying")),K(l,d(ve,{get when(){return r().length>0},get children(){var g=PJt(),y=g.firstChild,v=y.nextSibling;return K(y,()=>t.t("app.server.otherServers")),K(v,d(Qt,{get each(){return r()},children:k=>{const b=yo.key(k);return(()=>{var x=OJt(),w=x.firstChild;return x.$$click=()=>e.onServerSelected?.(b),K(w,()=>$he(k)),x})()}})),g}}),null),l})()}function QJt(e){const t=T0();return d(ve,{get when(){return t.key},keyed:!0,get children(){return e.children}})}function eYt(e){return d(sPt,{get defaultServer(){return e.defaultServer},get disableHealthCheck(){return e.disableHealthCheck},get servers(){return e.servers},get children(){return d(JJt,{get disableHealthCheck(){return e.disableHealthCheck},get children(){return d(QJt,{get children(){return d(cPt,{get children(){return d(UPt,{get children(){return d(Yzt,{get children(){return d(aq,{get component(){return e.router??f_t},root:t=>d(ZJt,{get appChildren(){return e.children},get children(){return t.children}}),get children(){return[d(xs,{path:"/",component:RJt}),d(xs,{path:"/auth/callback",component:zJt}),d(xs,{path:"/trellis-badge",component:HJt}),d(xs,{path:"/:dir",component:fWt,get children(){return[d(xs,{path:"/",component:VJt}),d(xs,{path:"/session",component:zne}),d(xs,{path:"/session/:id",component:zne}),d(xs,{path:"/trellis",component:jJt})]}})]}})}})}})}})}})}})}})}li(["click"]);const tYt="1.3.5",nYt={version:tYt},hge="opencode.settings.dat:defaultServerUrl",rYt=e=>{if(typeof localStorage>"u")return null;try{return localStorage.getItem(e)}catch{return null}},iYt=(e,t)=>{if(!(typeof localStorage>"u"))try{if(t!==null){localStorage.setItem(e,t);return}localStorage.removeItem(e)}catch{return}},fge=()=>rYt(hge),aYt=e=>iYt(hge,e),oYt=async(e,t,n)=>{if(!("Notification"in window)||(Notification.permission==="default"?await Notification.requestPermission().catch(()=>"denied"):Notification.permission)!=="granted"||document.visibilityState==="visible"&&document.hasFocus())return;const a=new Notification(e,{body:t??"",icon:"https://opencode.ai/favicon-96x96-v3.png"});a.onclick=()=>{OZt(n),a.close()}},sYt=e=>{window.open(e,"_blank")},lYt=()=>{window.history.back()},cYt=()=>{window.history.forward()},dYt=async()=>{window.location.reload()},qne=document.getElementById("root"),pge=()=>location.hostname.includes("opencode.ai")?"http://localhost:4096":location.origin,uYt=()=>{const e=fge();return e||pge()},hYt={platform:"web",version:nYt.version,openLink:sYt,back:lYt,forward:cYt,restart:dYt,notify:oYt,getDefaultServer:async()=>{const e=fge();return e?yo.Key.make(e):null},setDefaultServer:aYt};if(qne instanceof HTMLElement){const e={type:"http",http:{url:pge()}};nye(()=>d(BCt,{value:hYt,get children(){return d(KJt,{get children(){return d(eYt,{get defaultServer(){return yo.Key.make(uYt())},servers:[e],disableHealthCheck:!0})}})}}),qne)}export{f as $,Jr as A,Mn as B,Gn as C,ot as D,JYt as E,Qt as F,qz as G,nt as H,Kt as I,lr as J,Ahe as K,BYt as L,aPt as M,yo as N,fe as O,me as P,Sr as Q,Mt as R,ve as S,kxt as T,Ct as U,hr as V,$he as W,rq as X,Ua as Y,_Kt as Z,z as _,If as a,$R as a$,oDt as a0,wj as a1,Cf as a2,vn as a3,di as a4,sQt as a5,uQt as a6,mK as a7,hzt as a8,Uz as a9,nre as aA,Ga as aB,r0 as aC,Zn as aD,P2 as aE,Ye as aF,sqt as aG,ct as aH,Cce as aI,aQt as aJ,xo as aK,gF as aL,gYt as aM,gX as aN,yYt as aO,BGt as aP,UGt as aQ,tme as aR,Kn as aS,gs as aT,EGt as aU,i0 as aV,Vye as aW,W2 as aX,DGt as aY,vYt as aZ,ur as a_,Me as aa,wr as ab,ki as ac,Mm as ad,ft as ae,pJt as af,mJt as ag,WGt as ah,vJt as ai,zt as aj,ke as ak,hn as al,ege as am,Nm as an,nge as ao,gJt as ap,yJt as aq,Wa as ar,Gye as as,rge as at,tge as au,Tt as av,Io as aw,ere as ax,dt as ay,Lt as az,ms as b,Wh as b$,lt as b0,br as b1,IGt as b2,iq as b3,oq as b4,RGt as b5,zr as b6,vs as b7,AGt as b8,_0 as b9,iE as bA,rN as bB,QP as bC,nx as bD,nR as bE,dP as bF,jse as bG,Tr as bH,M0 as bI,_o as bJ,ni as bK,Xz as bL,fee as bM,Jn as bN,B2 as bO,Uge as bP,lQt as bQ,Yn as bR,In as bS,HKt as bT,J2e as bU,YK as bV,Rme as bW,Dme as bX,Ome as bY,J1 as bZ,PHt as b_,w0 as ba,hre as bb,mre as bc,ure as bd,Hf as be,sq as bf,x0 as bg,Uo as bh,bWt as bi,OGt as bj,Bz as bk,Jee as bl,cle as bm,om as bn,WYt as bo,hLt as bp,UYt as bq,uLt as br,ZYt as bs,GYt as bt,oQt as bu,nU as bv,$B as bw,mzt as bx,O1 as by,sN as bz,lf as c,_me as c$,Jse as c0,Lme as c1,Fzt as c2,xl as c3,KYt as c4,ole as c5,nee as c6,iDt as c7,gK as c8,Jg as c9,$xe as cA,zYt as cB,wT as cC,XE as cD,FC as cE,aA as cF,C7 as cG,RC as cH,Nn as cI,Ij as cJ,Ef as cK,oB as cL,OU as cM,Ad as cN,T_ as cO,Tb as cP,SL as cQ,d9 as cR,w8 as cS,k_ as cT,kA as cU,X7 as cV,t9 as cW,a6 as cX,Y3 as cY,xme as cZ,bme as c_,Xp as ca,rn as cb,af as cc,bLt as cd,YYt as ce,Ds as cf,XYt as cg,rpe as ch,Tzt as ci,rU as cj,PKt as ck,pYt as cl,pQt as cm,qZt as cn,vQt as co,FKt as cp,aq as cq,iV as cr,mye as cs,mYt as ct,bf as cu,OYt as cv,qYt as cw,RYt as cx,nye as cy,jYt as cz,ll as d,yQt as d0,Cme as d1,Mme as d2,eq as d3,mQt as d4,gQt as d5,dQt as d6,ipe as d7,hQt as d8,n2 as d9,HB as da,fPt as db,Yt as dc,mHt as dd,cHt as de,H9e as df,GHt as dg,CR as dh,AZt as di,NZt as dj,HYt as dk,LYt as dl,T0 as e,xr as f,cQt as g,Ce as h,Z as i,Hr as j,E2e as k,K as l,d as m,kt as n,dn as o,MJt as p,Qe as q,St as r,Rr as s,ie as t,ha as u,li as v,Jxt as w,U2 as x,wt as y,E0 as z};
|
|
2584
|
+
${l}`)});async function a(){t.checkUpdate&&(i("checking",!0),await t.checkUpdate().then(s=>{i("actionError",void 0),s.updateAvailable&&s.version&&i("version",s.version)}).catch(s=>{i("actionError",ey(s,n.t))}).finally(()=>{i("checking",!1)}))}async function o(){!t.update||!t.restart||await t.update().then(()=>t.restart()).then(()=>i("actionError",void 0)).catch(s=>{i("actionError",ey(s,n.t))})}return(()=>{var s=SJt(),l=s.firstChild,c=l.firstChild,u=c.firstChild,h=u.nextSibling,m=c.nextSibling,g=m.nextSibling,y=g.firstChild,v=y.firstChild,k=v.firstChild;return K(l,d(kxt,{class:"w-58.5 opacity-12 shrink-0"}),c),K(u,()=>n.t("error.page.title")),K(h,()=>n.t("error.page.description")),K(l,d(MJt,{get value(){return ey(e.error,n.t)},readOnly:!0,copyable:!0,multiline:!0,class:"max-h-96 w-full font-mono text-xs no-scrollbar",get label(){return n.t("error.page.details.label")},hideLabel:!0}),m),K(m,d(Mn,{size:"large",get onClick(){return t.restart},get children(){return n.t("error.page.action.restart")}}),null),K(m,d(ve,{get when(){return t.checkUpdate},get children(){return d(ve,{get when(){return r.version},get fallback(){return d(Mn,{size:"large",variant:"ghost",onClick:a,get disabled(){return r.checking},get children(){return kt(()=>!!r.checking)()?n.t("error.page.action.checking"):n.t("error.page.action.checkUpdates")}})},get children(){return d(Mn,{size:"large",onClick:o,get children(){return n.t("error.page.action.updateTo",{version:r.version??""})}})}})}}),null),K(l,d(ve,{get when(){return r.actionError},children:b=>(()=>{var x=CJt();return K(x,b),x})()}),g),K(y,()=>n.t("error.page.report.prefix"),v),v.$$click=()=>t.openLink("https://opencode.ai/desktop-feedback"),K(k,()=>n.t("error.page.report.discord")),K(v,d(Kt,{name:"discord",class:"text-text-interactive-base"}),null),K(g,d(ve,{get when(){return t.version},children:b=>(()=>{var x=LJt();return K(x,()=>n.t("error.page.version",{version:b()})),x})()}),null),s})()};li(["click"]);var TJt=ie("<div class=size-full>"),EJt=ie('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base">'),PJt=ie('<div class="flex flex-col gap-2 w-full max-w-sm"><span class="text-12-regular text-text-base text-center"></span><div class="flex flex-col gap-1 bg-surface-base rounded-lg p-2">'),DJt=ie('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base gap-6 p-6"><div class="flex flex-col items-center max-w-md text-center"><p class="text-14-regular text-text-base"><span class="text-text-strong font-medium"></span></p><p class="mt-1 text-12-regular text-text-weak">'),OJt=ie('<button type=button class="flex items-center gap-3 w-full px-3 py-2 rounded-md hover:bg-surface-raised-base-hover transition-colors text-left"><span class="text-14-regular text-text-strong truncate">');const RJt=B2(()=>z(()=>import("./home-Dl-ohVE3.js"),__vite__mapDeps([112,110,111,105,102,113]))),zJt=B2(()=>z(()=>import("./auth-callback-DDriykxK.js"),[])),uge=()=>z(()=>import("./session-kVY7vYXa.js").then(e=>e.s),__vite__mapDeps([114,100,101,102,105,115,98,116,117,106,111])),qJt=B2(uge),jJt=B2(()=>z(()=>import("./trellis-CGL9IdAb.js").then(e=>e.d),__vite__mapDeps([115,101,102,98,116,117]))),HJt=B2(()=>z(()=>import("./trellis-badge-demo-R0tqETOm.js"),__vite__mapDeps([118,116]))),FJt=()=>TJt();typeof location=="object"&&/\/session(?:\/|$)/.test(location.pathname)&&uge();const zne=()=>d(GJt,{get children(){return d(qJt,{})}}),VJt=()=>d(m_t,{href:"session"});function BJt(e){const t=xr();return d(Ive,{get value(){return{locale:t.intl,t:t.t}},get children(){return e.children}})}function UJt(e){const t=new K_t;return d(G_t,{client:t,get children(){return e.children}})}function WJt(e){return d(fLt,{get children(){return d(Nzt,{get children(){return d(uDt,{get children(){return d(_zt,{get children(){return d(gzt,{get children(){return d(kLt,{get children(){return d(BDt,{get children(){return d(fJt,{get children(){return e.children}})}})}})}})}})}})}})}})}function GJt(e){return d(Kzt,{get children(){return d(LDt,{get children(){return d(jzt,{get children(){return d(NLt,{get children(){return e.children}})}})}})}})}function ZJt(e){return d(WJt,{get children(){return d(Uge,{get fallback(){return d(FJt,{})},get children(){return[kt(()=>e.appChildren),kt(()=>e.children)]}})}})}function KJt(e){return d(Rxt,{get children(){return[d(oxt,{}),d(Ext,{onThemeApplied:(t,n)=>{window.api?.setTitlebar?.({mode:n})},get children(){return d(aLt,{get locale(){return e.locale},get children(){return d(BJt,{get children(){return d(Vge,{fallback:t=>d($Jt,{error:t}),get children(){return d(UJt,{get children(){return d(Sve,{get children(){return d(K9e,{get children(){return d(gye,{component:Jse,get children(){return e.children}})}})}})}})}})}})}})}})]}})}const XJt=e=>t=>$Ct([t,zCt(e)],{concurrency:"unbounded"}).pipe(OCt(n=>n[0]));function JJt(e){const t=T0(),n=Ahe(),[r,i]=Ce("blocking"),[a,o]=Jr(()=>e.disableHealthCheck?!0:DCt(function*(){if(!t.current)return!0;const{http:s,type:l}=t.current;for(;;){if((yield*TCt(()=>n(s))).healthy)return!0;if(r()==="background"||l==="http")return!1}}).pipe(XJt(r()==="blocking"?"1.2 seconds":0),RCt({duration:"10 seconds",orElse:()=>ECt(!1)}),qCt(PCt(()=>i("background"))),jCt));return d(ve,{get when(){return kt(()=>r()==="blocking")()?!a.loading:a.state!=="pending"},get fallback(){return(()=>{var s=EJt();return K(s,d(Yse,{class:"w-16 h-20 opacity-50 animate-pulse"})),s})()},get children(){return d(ve,{get when(){return a()},get fallback(){return d(YJt,{onRetry:()=>{r()==="background"&&o.refetch()},onServerSelected:s=>{i("blocking"),t.setActive(s),o.refetch()}})},get children(){return e.children}})}})}function YJt(e){const t=xr(),n=T0(),r=()=>n.list.filter(l=>yo.key(l)!==n.key),i=Z(()=>n.name||n.key),a="\0server\0",o=Z(()=>t.t("app.server.unreachable",{server:a}).split(a)),s=setInterval(()=>e.onRetry?.(),1e3);return me(()=>clearInterval(s)),(()=>{var l=DJt(),c=l.firstChild,u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(c,d(Yse,{class:"w-12 h-15 mb-4"}),u),K(u,()=>o()[0],h),K(h,i),K(u,()=>o()[1],null),K(m,()=>t.t("app.server.retrying")),K(l,d(ve,{get when(){return r().length>0},get children(){var g=PJt(),y=g.firstChild,v=y.nextSibling;return K(y,()=>t.t("app.server.otherServers")),K(v,d(Qt,{get each(){return r()},children:k=>{const b=yo.key(k);return(()=>{var x=OJt(),w=x.firstChild;return x.$$click=()=>e.onServerSelected?.(b),K(w,()=>$he(k)),x})()}})),g}}),null),l})()}function QJt(e){const t=T0();return d(ve,{get when(){return t.key},keyed:!0,get children(){return e.children}})}function eYt(e){return d(sPt,{get defaultServer(){return e.defaultServer},get disableHealthCheck(){return e.disableHealthCheck},get servers(){return e.servers},get children(){return d(JJt,{get disableHealthCheck(){return e.disableHealthCheck},get children(){return d(QJt,{get children(){return d(cPt,{get children(){return d(UPt,{get children(){return d(Yzt,{get children(){return d(aq,{get component(){return e.router??f_t},root:t=>d(ZJt,{get appChildren(){return e.children},get children(){return t.children}}),get children(){return[d(xs,{path:"/",component:RJt}),d(xs,{path:"/auth/callback",component:zJt}),d(xs,{path:"/trellis-badge",component:HJt}),d(xs,{path:"/:dir",component:fWt,get children(){return[d(xs,{path:"/",component:VJt}),d(xs,{path:"/session",component:zne}),d(xs,{path:"/session/:id",component:zne}),d(xs,{path:"/trellis",component:jJt})]}})]}})}})}})}})}})}})}})}li(["click"]);const tYt="1.3.5",nYt={version:tYt},hge="opencode.settings.dat:defaultServerUrl",rYt=e=>{if(typeof localStorage>"u")return null;try{return localStorage.getItem(e)}catch{return null}},iYt=(e,t)=>{if(!(typeof localStorage>"u"))try{if(t!==null){localStorage.setItem(e,t);return}localStorage.removeItem(e)}catch{return}},fge=()=>rYt(hge),aYt=e=>iYt(hge,e),oYt=async(e,t,n)=>{if(!("Notification"in window)||(Notification.permission==="default"?await Notification.requestPermission().catch(()=>"denied"):Notification.permission)!=="granted"||document.visibilityState==="visible"&&document.hasFocus())return;const a=new Notification(e,{body:t??"",icon:"https://opencode.ai/favicon-96x96-v3.png"});a.onclick=()=>{OZt(n),a.close()}},sYt=e=>{window.open(e,"_blank")},lYt=()=>{window.history.back()},cYt=()=>{window.history.forward()},dYt=async()=>{window.location.reload()},qne=document.getElementById("root"),pge=()=>location.hostname.includes("opencode.ai")?"http://localhost:4096":location.origin,uYt=()=>{const e=fge();return e||pge()},hYt={platform:"web",version:nYt.version,openLink:sYt,back:lYt,forward:cYt,restart:dYt,notify:oYt,getDefaultServer:async()=>{const e=fge();return e?yo.Key.make(e):null},setDefaultServer:aYt};if(qne instanceof HTMLElement){const e={type:"http",http:{url:pge()}};nye(()=>d(BCt,{value:hYt,get children(){return d(KJt,{get children(){return d(eYt,{get defaultServer(){return yo.Key.make(uYt())},servers:[e],disableHealthCheck:!0})}})}}),qne)}export{f as $,Jr as A,Mn as B,Gn as C,ot as D,JYt as E,Qt as F,qz as G,nt as H,Kt as I,lr as J,Ahe as K,BYt as L,aPt as M,yo as N,fe as O,me as P,Sr as Q,Mt as R,ve as S,kxt as T,Ct as U,hr as V,$he as W,rq as X,Ua as Y,_Kt as Z,z as _,If as a,$R as a$,oDt as a0,wj as a1,Cf as a2,vn as a3,di as a4,sQt as a5,uQt as a6,mK as a7,hzt as a8,Uz as a9,nre as aA,Ga as aB,r0 as aC,Zn as aD,P2 as aE,Ye as aF,sqt as aG,ct as aH,Cce as aI,aQt as aJ,xo as aK,gF as aL,gYt as aM,gX as aN,yYt as aO,BGt as aP,UGt as aQ,tme as aR,Kn as aS,gs as aT,EGt as aU,i0 as aV,Vye as aW,W2 as aX,DGt as aY,vYt as aZ,ur as a_,Me as aa,wr as ab,ki as ac,Mm as ad,ft as ae,pJt as af,mJt as ag,WGt as ah,vJt as ai,zt as aj,ke as ak,hn as al,ege as am,Nm as an,nge as ao,gJt as ap,yJt as aq,Wa as ar,Gye as as,rge as at,tge as au,Tt as av,Io as aw,ere as ax,dt as ay,Lt as az,ms as b,Wh as b$,lt as b0,br as b1,IGt as b2,iq as b3,oq as b4,RGt as b5,zr as b6,vs as b7,AGt as b8,_0 as b9,iE as bA,rN as bB,QP as bC,nx as bD,nR as bE,dP as bF,jse as bG,Tr as bH,M0 as bI,_o as bJ,ni as bK,Xz as bL,fee as bM,Jn as bN,B2 as bO,Uge as bP,lQt as bQ,Yn as bR,In as bS,HKt as bT,J2e as bU,YK as bV,Rme as bW,Dme as bX,Ome as bY,J1 as bZ,PHt as b_,w0 as ba,hre as bb,mre as bc,ure as bd,Hf as be,sq as bf,x0 as bg,Uo as bh,bWt as bi,OGt as bj,Bz as bk,Jee as bl,cle as bm,om as bn,WYt as bo,hLt as bp,UYt as bq,uLt as br,ZYt as bs,GYt as bt,oQt as bu,nU as bv,$B as bw,mzt as bx,O1 as by,sN as bz,lf as c,_me as c$,Jse as c0,Lme as c1,Fzt as c2,xl as c3,KYt as c4,ole as c5,nee as c6,iDt as c7,gK as c8,Jg as c9,$xe as cA,zYt as cB,wT as cC,XE as cD,FC as cE,aA as cF,C7 as cG,RC as cH,Nn as cI,Ij as cJ,Ef as cK,oB as cL,OU as cM,Ad as cN,T_ as cO,Tb as cP,SL as cQ,d9 as cR,w8 as cS,k_ as cT,kA as cU,X7 as cV,t9 as cW,a6 as cX,Y3 as cY,xme as cZ,bme as c_,Xp as ca,rn as cb,af as cc,bLt as cd,YYt as ce,Ds as cf,XYt as cg,rpe as ch,Tzt as ci,rU as cj,PKt as ck,pYt as cl,pQt as cm,qZt as cn,vQt as co,FKt as cp,aq as cq,iV as cr,mye as cs,mYt as ct,bf as cu,OYt as cv,qYt as cw,RYt as cx,nye as cy,jYt as cz,ll as d,yQt as d0,Cme as d1,Mme as d2,eq as d3,mQt as d4,gQt as d5,dQt as d6,ipe as d7,hQt as d8,n2 as d9,HB as da,fPt as db,Yt as dc,mHt as dd,cHt as de,H9e as df,GHt as dg,CR as dh,AZt as di,NZt as dj,HYt as dk,LYt as dl,T0 as e,xr as f,cQt as g,Ce as h,Z as i,Hr as j,E2e as k,K as l,d as m,kt as n,dn as o,MJt as p,Qe as q,St as r,Rr as s,ie as t,ha as u,li as v,Jxt as w,U2 as x,wt as y,E0 as z};
|