@ensocode/server 0.3.13 → 0.3.14
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/out/phone/assets/{EditDiff-B3HxLrbF.js → EditDiff-7At9BpWJ.js} +1 -1
- package/out/phone/assets/{ReadFileView-BFpGH-kK.js → ReadFileView-CFkjh0Xx.js} +1 -1
- package/out/phone/assets/{abnfDiagram-VCTEODGH-BNvyPGoF.js → abnfDiagram-VCTEODGH-D4384sfe.js} +1 -1
- package/out/phone/assets/architecture-7GRP2DOG-vDamN_Vr.js +1 -0
- package/out/phone/assets/{architectureDiagram-5GKGNRK7-1bhpTEFA.js → architectureDiagram-5GKGNRK7-CjzMXFHb.js} +1 -1
- package/out/phone/assets/{blockDiagram-I7D4REHJ-Bo9UMudu.js → blockDiagram-I7D4REHJ-COX4_2NT.js} +1 -1
- package/out/phone/assets/{c4Diagram-7LVT6UL2-YS11cig2.js → c4Diagram-7LVT6UL2-C0PHCrzg.js} +1 -1
- package/out/phone/assets/channel-TsMJYH0f.js +1 -0
- package/out/phone/assets/{chunk-4HAMMTFA-gA-CzNGD.js → chunk-4HAMMTFA-BSqiGn28.js} +1 -1
- package/out/phone/assets/{chunk-75Z2AOVW-BL_5b1Dw.js → chunk-75Z2AOVW-7eocu_Pa.js} +1 -1
- package/out/phone/assets/{chunk-DU6HZSFF-BpNlAs9R.js → chunk-DU6HZSFF-DMttOQUE.js} +1 -1
- package/out/phone/assets/{chunk-F27PBJKO-lsKx96Nt.js → chunk-F27PBJKO-BFNRrOvq.js} +1 -1
- package/out/phone/assets/{chunk-GMAD6QVW-CxbljbtE.js → chunk-GMAD6QVW-DPVV1Shj.js} +1 -1
- package/out/phone/assets/{chunk-GVQU2GXP-CTO3kTOF.js → chunk-GVQU2GXP-YataTcA_.js} +1 -1
- package/out/phone/assets/{chunk-IMKFNOWR-Cq8XlkcB.js → chunk-IMKFNOWR-DBQKd74U.js} +1 -1
- package/out/phone/assets/{chunk-L3NEJ4N5-CvIm0JX7.js → chunk-L3NEJ4N5-DXfrfXkv.js} +1 -1
- package/out/phone/assets/{chunk-OSK3NFVY-Cj3ilTL-.js → chunk-OSK3NFVY-DWr7pP6Q.js} +1 -1
- package/out/phone/assets/{chunk-P2QGCYS3-B-twI_Fz.js → chunk-P2QGCYS3-C_qNKS0g.js} +1 -1
- package/out/phone/assets/{chunk-POPQ4Y6H-lPQttJ5s.js → chunk-POPQ4Y6H-BhJK3UtM.js} +1 -1
- package/out/phone/assets/{chunk-PWAF6VOD-DjwqZuIR.js → chunk-PWAF6VOD-MmcwGVgC.js} +1 -1
- package/out/phone/assets/{chunk-SHT3W25Y-BWRVin1H.js → chunk-SHT3W25Y-BQHA3p2Q.js} +1 -1
- package/out/phone/assets/{chunk-SVP7TREG-CGLhvnsS.js → chunk-SVP7TREG-DbQH56Ci.js} +1 -1
- package/out/phone/assets/{chunk-TICWLB2K-DkFUa03q.js → chunk-TICWLB2K-pixKba1z.js} +1 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-Bhtnzu97.js +1 -0
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-Bhtnzu97.js +1 -0
- package/out/phone/assets/{codeHighlighter-jQti-W31.js → codeHighlighter-CrZcFhK_.js} +1 -1
- package/out/phone/assets/{cynefin-OW5HDTMX-L8oWVu5S.js → cynefin-OW5HDTMX-67ETi-0P.js} +1 -1
- package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-DH8-4p4N.js → cynefinDiagram-5FMLGOSQ-C3wqlm_-.js} +1 -1
- package/out/phone/assets/{dagre-GXQ25YYZ-HhLDmcu9.js → dagre-GXQ25YYZ-DTC1fZsc.js} +1 -1
- package/out/phone/assets/desk-B382G0e_.js +52 -0
- package/out/phone/assets/{diagram-S7CK7UJ4-CeIbR3Ir.js → diagram-S7CK7UJ4-uqcU7OpS.js} +1 -1
- package/out/phone/assets/{diagram-UQ7AKVKN-BQ84Qnq6.js → diagram-UQ7AKVKN-BQ6K9f6g.js} +1 -1
- package/out/phone/assets/{diagram-VSXAHHWV-aF_J57fD.js → diagram-VSXAHHWV-CDzRWkI9.js} +1 -1
- package/out/phone/assets/{diagram-VX7I27RA-Bg1ZqM4Y.js → diagram-VX7I27RA-CvI10CG1.js} +1 -1
- package/out/phone/assets/{diagram-Z3DM3KII-DjTkPAqa.js → diagram-Z3DM3KII-DM8G_CIZ.js} +1 -1
- package/out/phone/assets/{ebnfDiagram-PWID7BFC-DPsH5Eky.js → ebnfDiagram-PWID7BFC-BBbLoaIE.js} +1 -1
- package/out/phone/assets/{erDiagram-RLTQ6QDP-ExvY7e6T.js → erDiagram-RLTQ6QDP-Dz98FGLq.js} +1 -1
- package/out/phone/assets/eventmodeling-NTZA5JFV-BGT2L4_J.js +1 -0
- package/out/phone/assets/flowDiagram-HODETNUW-CpTX9nm5.js +1 -0
- package/out/phone/assets/{ganttDiagram-EL5Y4UJY-hCe06ucl.js → ganttDiagram-EL5Y4UJY-BADRjlHl.js} +1 -1
- package/out/phone/assets/{gitGraph-4MIJSDKK-BuZ6lDat.js → gitGraph-4MIJSDKK-DQGKRsA2.js} +1 -1
- package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-D-8aVxvj.js → gitGraphDiagram-WWUBYQGX-DrLRujhH.js} +1 -1
- package/out/phone/assets/{info-A6RAGUB7-CrZtdoYs.js → info-A6RAGUB7-b7IbwKqs.js} +1 -1
- package/out/phone/assets/{infoDiagram-27XIBGKW-BLRFHxtO.js → infoDiagram-27XIBGKW-BNbXaMmR.js} +1 -1
- package/out/phone/assets/{ishikawaDiagram-5VMMS53U-D7SYWKoj.js → ishikawaDiagram-5VMMS53U-B3SG131F.js} +1 -1
- package/out/phone/assets/{journeyDiagram-3NMN7TZE-BPsg7CQD.js → journeyDiagram-3NMN7TZE-BoRfNykb.js} +1 -1
- package/out/phone/assets/{kanban-definition-UXKFOSKX-CbPuNr-E.js → kanban-definition-UXKFOSKX-D0tKrJ8_.js} +1 -1
- package/out/phone/assets/{line-CkpKMiqK.js → line-W1HWn4B7.js} +1 -1
- package/out/phone/assets/main-Bc8DQVa6.css +2 -0
- package/out/phone/assets/main-Bez4gfKe.js +281 -0
- package/out/phone/assets/{mermaid-parser.core-RTq_mEm1.js → mermaid-parser.core-CpGE7UgS.js} +3 -3
- package/out/phone/assets/{mermaid.core-D9LtIKua.js → mermaid.core-wueTI3u_.js} +4 -4
- package/out/phone/assets/{mindmap-definition-YA3MSWOX-8cGgRiRD.js → mindmap-definition-YA3MSWOX-BDctzErY.js} +1 -1
- package/out/phone/assets/{packet-AYTQ26CC-D9-eSn0v.js → packet-AYTQ26CC-C0YWsXol.js} +1 -1
- package/out/phone/assets/{pegDiagram-XKGWAZYB-DztU_rIE.js → pegDiagram-XKGWAZYB-C97XjNI7.js} +1 -1
- package/out/phone/assets/{pie-WAS4IAKB-Bk2Tqaq_.js → pie-WAS4IAKB-BxuJ1GKP.js} +1 -1
- package/out/phone/assets/{pieDiagram-E7YTZNPT-Dm_3mJ9_.js → pieDiagram-E7YTZNPT-SP4DeWDw.js} +1 -1
- package/out/phone/assets/{quadrantDiagram-AXDQQJYC-lKskzjzu.js → quadrantDiagram-AXDQQJYC-DDHL4rrG.js} +1 -1
- package/out/phone/assets/{radar-RG4KPBEZ-B2z8Txd8.js → radar-RG4KPBEZ-AzVB8zoH.js} +1 -1
- package/out/phone/assets/{railroad-74A4TZTK-11VmdALq.js → railroad-74A4TZTK-CA2_A72l.js} +1 -1
- package/out/phone/assets/railroad-abnf-HS5TGJTU-CTHhRGvc.js +1 -0
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-CS68P4fL.js +1 -0
- package/out/phone/assets/railroad-peg-WCYAUIDC-BqCcrVdf.js +1 -0
- package/out/phone/assets/{railroadDiagram-O6MQD6OU-Dr0NTIA6.js → railroadDiagram-O6MQD6OU-D5zpQ5kq.js} +1 -1
- package/out/phone/assets/{requirementDiagram-BXWQKSXE-C0W6h_5I.js → requirementDiagram-BXWQKSXE-DkQKt5hJ.js} +1 -1
- package/out/phone/assets/{sankeyDiagram-P5KCCOFB-CVJDathY.js → sankeyDiagram-P5KCCOFB-xeXrVMVr.js} +1 -1
- package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-BxHQTG6x.js → sequenceDiagram-WJ2MYXX4-BOiNtyS8.js} +1 -1
- package/out/phone/assets/shellUpdate-C4yk9AaU.js +1 -0
- package/out/phone/assets/{stateDiagram-D77RDMKH-BO5MAjhs.js → stateDiagram-D77RDMKH-Bs8LX9-n.js} +1 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-nBP_YibA.js +1 -0
- package/out/phone/assets/{swimlanes-42K2YHIH-DnhDPyy6.js → swimlanes-42K2YHIH-DQVYfgSI.js} +1 -1
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-BkfzXxS-.js +8 -0
- package/out/phone/assets/{timeline-definition-24CTP7MA-bLEjS7re.js → timeline-definition-24CTP7MA-BlpgdxeN.js} +1 -1
- package/out/phone/assets/{treeView-Q6P3EWNA-Ci-sA9wK.js → treeView-Q6P3EWNA-D0PiggHr.js} +1 -1
- package/out/phone/assets/{treemap-WGGIJYW6-BXCjzK65.js → treemap-WGGIJYW6-DA07Kvo0.js} +1 -1
- package/out/phone/assets/{vennDiagram-4TSXK5OY-DHsj5dRx.js → vennDiagram-4TSXK5OY-BtvfF1a4.js} +1 -1
- package/out/phone/assets/{wardley-WFR3VGLG-d8TdCu-H.js → wardley-WFR3VGLG-Db-UrSZJ.js} +1 -1
- package/out/phone/assets/{wardleyDiagram-VM6X3IG4-DQFVP9qu.js → wardleyDiagram-VM6X3IG4-CaBnqFYM.js} +1 -1
- package/out/phone/assets/{xychartDiagram-S5SC5T6Z-Dni2Y0ov.js → xychartDiagram-S5SC5T6Z-Bbzz9YwS.js} +1 -1
- package/out/phone/desk.html +3 -3
- package/out/phone/index.html +4 -4
- package/out/phone/sw.js +2 -2
- package/out/renderer/assets/{EditDiff-DxxLuCEI.js → EditDiff-C9JBUR0o.js} +1 -1
- package/out/renderer/assets/{File-Tz3MUtN6.js → File-BIf-onMm.js} +1 -1
- package/out/renderer/assets/{ReadFileView-DFoLPU04.js → ReadFileView-C5AKNlFU.js} +1 -1
- package/out/renderer/assets/{SidePanel-D0m4IYxS.css → SidePanel-DN2RL6QD.css} +1 -1
- package/out/renderer/assets/SidePanel-DkSc3og9.js +48 -0
- package/out/renderer/assets/{Virtualizer-B0uwx_XV.js → Virtualizer-tZu4hGtC.js} +1 -1
- package/out/renderer/assets/{abnfDiagram-VCTEODGH-CJ9nn9eH.js → abnfDiagram-VCTEODGH-DxBBUZxF.js} +1 -1
- package/out/renderer/assets/{arc-B8im8n0O.js → arc-DXzwxP4j.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-5GKGNRK7-BRSi5FBk.js → architectureDiagram-5GKGNRK7-Bcykp-Fb.js} +1 -1
- package/out/renderer/assets/{blockDiagram-I7D4REHJ-CQ1wirIl.js → blockDiagram-I7D4REHJ-P7zMiiL3.js} +1 -1
- package/out/renderer/assets/{c4Diagram-7LVT6UL2-9HyLIioe.js → c4Diagram-7LVT6UL2-BVD9zEE8.js} +1 -1
- package/out/renderer/assets/channel-7bWV5QTy.js +1 -0
- package/out/renderer/assets/{chunk-2Q5K7J3B-BwC9g3bx.js → chunk-2Q5K7J3B-BXj05DaP.js} +1 -1
- package/out/renderer/assets/{chunk-5VM5RSS4-DMtgxPBL.js → chunk-5VM5RSS4-D-SpodcG.js} +1 -1
- package/out/renderer/assets/{chunk-F27PBJKO-DSi_XV5v.js → chunk-F27PBJKO-ORLEQ9sv.js} +1 -1
- package/out/renderer/assets/{chunk-IMKFNOWR-Dctc6Apj.js → chunk-IMKFNOWR-1lhHjr20.js} +1 -1
- package/out/renderer/assets/{chunk-JWPE2WC7-I2BD5qM7.js → chunk-JWPE2WC7-BgmlC9Vl.js} +1 -1
- package/out/renderer/assets/{chunk-POPQ4Y6H-k60pc4eT.js → chunk-POPQ4Y6H-DPEfkZnH.js} +1 -1
- package/out/renderer/assets/{chunk-SVP7TREG-zCGemfqm.js → chunk-SVP7TREG-7_S5Geoi.js} +1 -1
- package/out/renderer/assets/{chunk-TICWLB2K-CdDiHIq-.js → chunk-TICWLB2K-BKi8yvLf.js} +1 -1
- package/out/renderer/assets/{chunk-XXDRQBXY-GYVDxVfN.js → chunk-XXDRQBXY-PfB25f1D.js} +1 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-mgQwYiWM.js +1 -0
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-mgQwYiWM.js +1 -0
- package/out/renderer/assets/{cose-bilkent-JH36ORCC-BnSAtUh-.js → cose-bilkent-JH36ORCC-C246yayw.js} +1 -1
- package/out/renderer/assets/{cynefin-OW5HDTMX-DnQaS9VN.js → cynefin-OW5HDTMX-Dr9W26Pe.js} +1 -1
- package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-BNQdw0PV.js → cynefinDiagram-5FMLGOSQ-B3Jtuns2.js} +1 -1
- package/out/renderer/assets/{cytoscape-fcose-CzkrRInm.js → cytoscape-fcose-CJat50hU.js} +1 -1
- package/out/renderer/assets/{dagre-GXQ25YYZ-fG1vMsyn.js → dagre-GXQ25YYZ-Dt2pulYx.js} +1 -1
- package/out/renderer/assets/{diagram-S7CK7UJ4-BcfAFVc2.js → diagram-S7CK7UJ4-Bx-0FuVR.js} +1 -1
- package/out/renderer/assets/{diagram-UQ7AKVKN-D8f3Tsx9.js → diagram-UQ7AKVKN-D-8o1p4p.js} +1 -1
- package/out/renderer/assets/{diagram-VSXAHHWV-B-U9CIWt.js → diagram-VSXAHHWV-CI0jUOHM.js} +1 -1
- package/out/renderer/assets/{diagram-VX7I27RA-CX6ifTkJ.js → diagram-VX7I27RA-Byl54mOd.js} +1 -1
- package/out/renderer/assets/{diagram-Z3DM3KII-49dS9s3L.js → diagram-Z3DM3KII-Kf_GIJ7p.js} +1 -1
- package/out/renderer/assets/{ebnfDiagram-PWID7BFC-CraGJRI7.js → ebnfDiagram-PWID7BFC-BbOdw7R1.js} +1 -1
- package/out/renderer/assets/{erDiagram-RLTQ6QDP-CfMNvEoW.js → erDiagram-RLTQ6QDP-UjxTTQ7M.js} +1 -1
- package/out/renderer/assets/{flowDiagram-HODETNUW-C8XM3p4T.js → flowDiagram-HODETNUW-BVuwOxKp.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-DlJBMKFX.js → ganttDiagram-EL5Y4UJY-BpBSO-4X.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-DvEzDsKF.js → gitGraphDiagram-WWUBYQGX-b72vZ1j2.js} +1 -1
- package/out/renderer/assets/globals-2G408HiJ.css +1 -0
- package/out/renderer/assets/globals-BqVjlAT_.js +673 -0
- package/out/renderer/assets/index-AHhNcASr.js +113 -0
- package/out/renderer/assets/{infoDiagram-27XIBGKW-CckfBO-R.js → infoDiagram-27XIBGKW-CtnN4sif.js} +1 -1
- package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-mUoXchkB.js → ishikawaDiagram-5VMMS53U-B2YfGNEH.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-3NMN7TZE-zzLL0HFW.js → journeyDiagram-3NMN7TZE-fUfanA7T.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UXKFOSKX-BJ_9aIhB.js → kanban-definition-UXKFOSKX-DU0d3NVH.js} +1 -1
- package/out/renderer/assets/{layout-3SRMHY7n.js → layout-C0hE7llw.js} +1 -1
- package/out/renderer/assets/{linear-CWpclK_R.js → linear-BXPh0BlC.js} +1 -1
- package/out/renderer/assets/{manifest-DOzTaB8J.js → manifest-DoBt8euy.js} +1 -1
- package/out/renderer/assets/{mermaid.core-DORpmVi3.js → mermaid.core-DlBAsGZ7.js} +5 -5
- package/out/renderer/assets/{mindmap-definition-YA3MSWOX-CYBlCqIB.js → mindmap-definition-YA3MSWOX-DUIiyta9.js} +1 -1
- package/out/renderer/assets/{pegDiagram-XKGWAZYB-DhWwLs4v.js → pegDiagram-XKGWAZYB-yP15oXPx.js} +1 -1
- package/out/renderer/assets/{pieDiagram-E7YTZNPT-Bzpc57-A.js → pieDiagram-E7YTZNPT-DsaSjWfA.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-spKXEbds.js → quadrantDiagram-AXDQQJYC-BpWn5xT_.js} +1 -1
- package/out/renderer/assets/{railroadDiagram-O6MQD6OU-Br553px3.js → railroadDiagram-O6MQD6OU-BnXhwCom.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-BXWQKSXE-CX-Dqij_.js → requirementDiagram-BXWQKSXE-CMIMPMzx.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-Bgx1W6B9.js → sankeyDiagram-P5KCCOFB-CKqneOc7.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-CKQv6pcU.js → sequenceDiagram-WJ2MYXX4-azbHkcGk.js} +1 -1
- package/out/renderer/assets/{sessionChanges-BLzNhRuv.js → sessionChanges--o0RBCJW.js} +1 -1
- package/out/renderer/assets/settings-D5R80op8.js +28 -0
- package/out/renderer/assets/{sizeCapture-INFHLROL-DtRedfRe.js → sizeCapture-INFHLROL-C3uhIZ1e.js} +1 -1
- package/out/renderer/assets/{stateDiagram-D77RDMKH-CMP5owem.js → stateDiagram-D77RDMKH-CrGab2Ck.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-k_H7O8MU.js +1 -0
- package/out/renderer/assets/{swimlanes-42K2YHIH-D30AvvmW.js → swimlanes-42K2YHIH-6aX1l7C2.js} +1 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-D2XerlPy.js +8 -0
- package/out/renderer/assets/{timeline-definition-24CTP7MA-CsZAMmMZ.js → timeline-definition-24CTP7MA-DdVDUmce.js} +1 -1
- package/out/renderer/assets/{vennDiagram-4TSXK5OY-COQ7L1f7.js → vennDiagram-4TSXK5OY-DP6DTjdX.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-dqMWLTCs.js → wardleyDiagram-VM6X3IG4-DYJsuZCs.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-DX4clIYP.js → xychartDiagram-S5SC5T6Z-CloAJCw-.js} +1 -1
- package/out/renderer/index.html +3 -3
- package/out/renderer/settings.html +7 -7
- package/out/renderer/web-preload.js +1 -51
- package/out/server/agent.js +1172 -242
- package/out/server/chunks/agentConstants-D4t7d6iS.js +9 -0
- package/out/server/chunks/builtinOccupancy-Ci-Szozb.js +93 -0
- package/out/server/chunks/dispatchModel-DJxnHup9.js +75 -0
- package/out/server/chunks/{gpuBackendInstall-jAzoFq7U.js → gpuBackendInstall-snisWLXN.js} +2 -2
- package/out/server/chunks/killTree-T-p6Lr3w.js +787 -0
- package/out/server/chunks/{loadProvider-NdOVbsHi.js → loadProvider-Uq3i7kKZ.js} +2 -2
- package/out/server/chunks/{manifest-BPXFscqI.js → manifest-CmnE8RBt.js} +4 -2
- package/out/server/chunks/menuSkills-BEtW-Is6.js +53 -0
- package/out/server/chunks/projectCode-D9lgShsp.js +112 -0
- package/out/server/chunks/{registry-BhoHPSKn.js → registry-R2KRdU8n.js} +97 -115
- package/out/server/chunks/sendImage-CCjNsa-D.js +499 -0
- package/out/server/chunks/{sendImage-BCNW9JRV.js → toolParams-DVs5d3F9.js} +25 -234
- package/out/server/chunks/web-BIJOMDlz.js +7773 -0
- package/out/server/chunks/{workflowPresets-C2T1BzA2.js → workflowPresets-DVbQh2el.js} +13603 -15626
- package/out/server/index.js +8778 -3210
- package/out/server/memory-service.js +197 -147
- package/out/server/plugin-host.js +44 -18
- package/package.json +1 -1
- package/out/phone/assets/architecture-7GRP2DOG-Duql1LsL.js +0 -1
- package/out/phone/assets/channel-BPoIHov1.js +0 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-CIR76lHP.js +0 -1
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-CIR76lHP.js +0 -1
- package/out/phone/assets/desk-CixRGdTk.js +0 -52
- package/out/phone/assets/eventmodeling-NTZA5JFV-DYp-zWcL.js +0 -1
- package/out/phone/assets/flowDiagram-HODETNUW-CIU32By5.js +0 -1
- package/out/phone/assets/main-BCnf7dVM.js +0 -264
- package/out/phone/assets/main-nqB-uD3v.css +0 -2
- package/out/phone/assets/railroad-abnf-HS5TGJTU-BkSycwye.js +0 -1
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-BsPIU3iV.js +0 -1
- package/out/phone/assets/railroad-peg-WCYAUIDC-Cy8G7u5C.js +0 -1
- package/out/phone/assets/shellUpdate-DPSfgHG3.js +0 -36
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-B8IHc2bm.js +0 -1
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-dmSDAN2F.js +0 -8
- package/out/renderer/assets/SidePanel-CL40W2RY.js +0 -47
- package/out/renderer/assets/channel-DjB0ww6b.js +0 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-6SiAw1np.js +0 -1
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-6SiAw1np.js +0 -1
- package/out/renderer/assets/globals-BFf1P-Y5.js +0 -715
- package/out/renderer/assets/globals-DUBhAVpU.css +0 -1
- package/out/renderer/assets/index-L4TTIP10.js +0 -89
- package/out/renderer/assets/settings-Bsrw4ERp.js +0 -25
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-6-731AqJ.js +0 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-B8KijqIT.js +0 -8
- package/out/server/chunks/agent-BbNq8i9j.js +0 -4241
- package/out/server/chunks/dispatchModel-CsfmL396.js +0 -20
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-aPuBvESs.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/html-BsvMqTlf.js","assets/javascript-DcMHgNcu.js","assets/css-DlBQoFxe.js","assets/angular-ts-ocjSXnvf.js","assets/scss-BaZL6t2Y.js","assets/apl-D8Zaj6f9.js","assets/xml-C01ajBW7.js","assets/java-D7h0NA_A.js","assets/json-DePJdKYk.js","assets/astro-CbVusc_k.js","assets/typescript-BTGs5etX.js","assets/postcss-BXeXVLqQ.js","assets/tsx-DvWhG4dC.js","assets/blade-BuKMbjJR.js","assets/html-derivative-D9FvRNj4.js","assets/sql-DvarVTMJ.js","assets/bsl-_VjlB9mv.js","assets/sdbl-bTVj8UrX.js","assets/c-BNQJhXlP.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/chapel-CFMD-Djs.js","assets/cobol-qSrRm_BU.js","assets/coffee-BP03ytLP.js","assets/cpp-CUBNVKxn.js","assets/regexp-I2jnduhj.js","assets/glsl-CyFpZtQv.js","assets/crystal-CCpd0BXH.js","assets/shellscript-B51zB43X.js","assets/edge-k_uo0VIr.js","assets/elixir-CJS91GrO.js","assets/elm-Bmx6Fs0i.js","assets/erb-yi0ZozmI.js","assets/ruby-D1ky9XZ0.js","assets/haml-Dds4VdNJ.js","assets/graphql-BIyAKkG2.js","assets/jsx-BUUYi3qs.js","assets/lua-Z49wBRLR.js","assets/yaml-BWCS3NLV.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-xMC7jr7x.js","assets/gdshader-CBce3t8t.js","assets/gdscript-DYvRD3hg.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-C-RR1FSc.js","assets/glimmer-js-Di6EiJvU.js","assets/glimmer-ts-C2P-EwIP.js","assets/hack-DDi4pUY-.js","assets/handlebars-C81KA5yo.js","assets/http-c4_vT9ST.js","assets/hurl-BqZA9I9Q.js","assets/csv-Dx-8-gkx.js","assets/hxml-Dcm88srW.js","assets/haxe-C8oCnwJJ.js","assets/jinja-CixBDh_U.js","assets/jison-Ru_S5AEn.js","assets/julia-CaY0JZD0.js","assets/r-CvCSiWB_.js","assets/just-Q4EdCjF5.js","assets/perl-BtArmf81.js","assets/latex-t1iljvl0.js","assets/tex-JPaUWOrn.js","assets/liquid-DEL4RHa9.js","assets/marko-DYWPPmCl.js","assets/less-DVTAwKKz.js","assets/mdc-CsAWFGA9.js","assets/nextflow-BJtWHP5T.js","assets/nextflow-groovy-DJMQeKeT.js","assets/nginx-BrbrEdla.js","assets/nim-BjwzhXka.js","assets/org-TFl3N09_.js","assets/clojure-DqKBuwfJ.js","assets/csharp-oqKa8noW.js","assets/dart-CnvKMtbv.js","assets/docker-IyjqRm3v.js","assets/go-rLFTqkRN.js","assets/groovy-CacY0gHj.js","assets/ini-B5eOa1yu.js","assets/make-Dixweg8N.js","assets/objective-c-D1A_Heim.js","assets/ocaml-O90oeIOV.js","assets/php-Cx25uSIP.js","assets/vb-DOwzaHZ0.js","assets/raku-B3gFvitq.js","assets/rust-Cfkwpbl8.js","assets/scala-BiFt_7mu.js","assets/zig-CMLA9XwU.js","assets/xsl-CCLNyvR3.js","assets/pug-B4bk2kWf.js","assets/qml-g4UDed-8.js","assets/razor-BSt2ayLr.js","assets/rst-BucurtmO.js","assets/cmake-Bj61d0ZC.js","assets/sas-CUQt684o.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-B-KBpmJs.js","assets/soy-D5xCHD_M.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-8TbiBYrm.js","assets/surrealql-DalIYx4r.js","assets/svelte-D4FIy7cP.js","assets/templ-DP4lTcEq.js","assets/ts-tags-CNUq3so9.js","assets/twig-Chu5fnNS.js","assets/typst--WwEKe8X.js","assets/bat-qdxAdBWQ.js","assets/bibtex-Ci_nEsc7.js","assets/jsonc-CYpm1nAK.js","assets/log-BNLmms1o.js","assets/powershell-CCSX75yM.js","assets/swift-CyEgAFGc.js","assets/system-verilog-Dh5ihWbf.js","assets/verilog-B2gwz-sJ.js","assets/vue-DjCn01CB.js","assets/vue-html-BXjKVtKk.js","assets/vue-vine-By_xyXdL.js","assets/stylus-B6D30XZt.js","assets/mermaid.core-D9LtIKua.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-oBChb5qS.js","assets/chunk-DU6HZSFF-BpNlAs9R.js","assets/chunk-75Z2AOVW-BL_5b1Dw.js","assets/dist-B_J_HbC0.js","assets/chunk-PWAF6VOD-DjwqZuIR.js","assets/chunk-GMAD6QVW-CxbljbtE.js","assets/chunk-P2QGCYS3-B-twI_Fz.js","assets/chunk-4HAMMTFA-gA-CzNGD.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-GVQU2GXP-CTO3kTOF.js","assets/chunk-OSK3NFVY-Cj3ilTL-.js","assets/line-CkpKMiqK.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/graphlib-DS17s2tU.js","assets/chunk-L3NEJ4N5-CvIm0JX7.js","assets/EditDiff-B3HxLrbF.js","assets/shellUpdate-DPSfgHG3.js","assets/codeHighlighter-jQti-W31.js","assets/ReadFileView-BFpGH-kK.js","assets/jsQR-B1eQcpQl.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e,n as t,t as n}from"./rolldown-runtime-Dd_uD5pT.js";import{A as r,At as i,B as a,Bt as o,C as s,Ct as c,D as l,Dt as u,E as d,Et as f,F as p,Ft as m,G as h,H as g,Ht as _,I as v,It as y,L as b,Lt as x,M as S,Mt as C,N as w,Nt as T,O as E,Ot as D,P as O,Pt as k,R as A,Rt as j,S as M,St as N,T as P,Tt as F,U as I,V as ee,Vt as L,W as te,_ as R,_t as z,a as ne,at as re,b as B,bt as ie,c as ae,d as oe,f as V,g as se,h as ce,ht as le,it as ue,j as de,jt as fe,k as pe,kt as me,l as he,lt as ge,m as _e,mt as ve,n as ye,o as be,ot as xe,p as Se,pt as Ce,rt as we,s as Te,t as Ee,tt as De,vt as Oe,w as ke,wt as Ae,xt as je,y as Me,z as Ne,zt as Pe}from"./shellUpdate-DPSfgHG3.js";function Fe(){window.electronAPI||Object.defineProperty(window,"electronAPI",{value:{git:{diffHead:async()=>({ok:!1,error:`unavailable`})},changes:{readSnapshots:async()=>({}),writeSnapshots:async()=>!1},workspaceFiles:{listDir:async()=>({ok:!1,error:`unavailable`}),read:async()=>({ok:!1,error:`unavailable`}),write:async()=>({ok:!1,error:`unavailable`}),watchStart:async()=>({ok:!1,error:`unavailable`}),watchStop:async()=>({ok:!1,error:`unavailable`}),onChange:()=>()=>void 0,search:async()=>({ok:!1,error:`unavailable`})},files:{read:async()=>null,search:async()=>[],pathForFile:()=>null},agentRegistry:{list:async()=>null},agent:{stopTask:async()=>({ok:!1,error:`not supported on phone`}),stopSubagent:async()=>({ok:!1,error:`not supported on phone`})},providers:{listOauth:async()=>[],getOauthUsage:async()=>null}},writable:!1})}function Ie(e){let t=window.electronAPI?.agent;t&&(t.stopTask=async(t,n)=>(e.stopTask(t,n),{ok:!0}),t.stopSubagent=async(t,n)=>(e.stopSubagent(t,n),{ok:!0}))}Fe();var Le=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Re=n(((e,t)=>{t.exports=Le()})),ze=n((e=>{var t=_();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),Be=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ze()})),Ve=n((e=>{var t=Re(),n=_(),r=Be();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},ee=[],L=-1;function te(e){return{current:e}}function R(e){0>L||(e.current=ee[L],ee[L]=null,L--)}function z(e,t){L++,ee[L]=e.current,e.current=t}var ne=te(null),re=te(null),B=te(null),ie=te(null);function ae(e,t){switch(z(B,t),z(re,e),z(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(ne),z(ne,e)}function oe(){R(ne),R(re),R(B)}function V(e){e.memoizedState!==null&&z(ie,e);var t=ne.current,n=qd(t,e.type);t!==n&&(z(re,e),z(ne,n))}function se(e){re.current===e&&(R(ne),R(re)),ie.current===e&&(R(ie),rp._currentValue=I)}var ce,le;function ue(e){if(ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ce=t&&t[1]||``,le=-1<e.stack.indexOf(`
|
|
3
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
-
`+ce+e+le}var de=!1;function fe(e,t){if(!e||de)return``;de=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
-
`),l=s.split(`
|
|
6
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{de=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ue(n):``}function pe(e,t){switch(e.tag){case 26:case 27:case 5:return ue(e.type);case 16:return ue(`Lazy`);case 13:return e.child!==t&&t!==null?ue(`Suspense Fallback`):ue(`Suspense`);case 19:return ue(`SuspenseList`);case 0:case 15:return fe(e.type,!1);case 11:return fe(e.type.render,!1);case 1:return fe(e.type,!0);case 31:return ue(`Activity`);default:return``}}function me(e){try{var t=``,n=null;do t+=pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
-
Error generating stack: `+e.message+`
|
|
9
|
-
`+e.stack}}var he=Object.prototype.hasOwnProperty,ge=t.unstable_scheduleCallback,_e=t.unstable_cancelCallback,ve=t.unstable_shouldYield,ye=t.unstable_requestPaint,be=t.unstable_now,xe=t.unstable_getCurrentPriorityLevel,Se=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,we=t.unstable_NormalPriority,Te=t.unstable_LowPriority,Ee=t.unstable_IdlePriority,De=t.log,Oe=t.unstable_setDisableYieldValue,ke=null,Ae=null;function je(e){if(typeof De==`function`&&Oe(e),Ae&&typeof Ae.setStrictMode==`function`)try{Ae.setStrictMode(ke,e)}catch{}}var Me=Math.clz32?Math.clz32:Fe,Ne=Math.log,Pe=Math.LN2;function Fe(e){return e>>>=0,e===0?32:31-(Ne(e)/Pe|0)|0}var Ie=256,Le=262144,ze=4194304;function Ve(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function He(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ve(n))):i=Ve(o):i=Ve(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ve(n))):i=Ve(o)):i=Ve(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function H(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ue(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function We(){var e=ze;return ze<<=1,!(ze&62914560)&&(ze=4194304),e}function Ge(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ke(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Me(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Je(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Je(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Me(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ye(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Me(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Xe(e,t){var n=t&-t;return n=n&42?1:Ze(n),(n&(e.suspendedLanes|t))===0?n:0}function Ze(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=F.p;return e===0?(e=window.event,e===void 0?32:yp(e.type)):e}function et(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var U=Math.random().toString(36).slice(2),tt=`__reactFiber$`+U,nt=`__reactProps$`+U,rt=`__reactContainer$`+U,it=`__reactEvents$`+U,at=`__reactListeners$`+U,ot=`__reactHandles$`+U,st=`__reactResources$`+U,ct=`__reactMarker$`+U;function lt(e){delete e[tt],delete e[nt],delete e[it],delete e[at],delete e[ot]}function ut(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rt]||n[tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gf(e);e!==null;){if(n=e[tt])return n;e=gf(e)}return t}e=n,n=e.parentNode}return null}function dt(e){if(e=e[tt]||e[rt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function pt(e){var t=e[st];return t||=e[st]={hoistableStyles:new Map,hoistableScripts:new Map},t}function mt(e){e[ct]=!0}var ht=new Set,gt={};function _t(e,t){vt(e,t),vt(e+`Capture`,t)}function vt(e,t){for(gt[e]=t,e=0;e<t.length;e++)ht.add(t[e])}var yt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),bt={},xt={};function St(e){return he.call(xt,e)?!0:he.call(bt,e)?!1:yt.test(e)?xt[e]=!0:(bt[e]=!0,!1)}function Ct(e,t,n){if(St(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function wt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Tt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Et(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Dt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ot(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kt(e){if(!e._valueTracker){var t=Dt(e)?`checked`:`value`;e._valueTracker=Ot(e,t,``+e[t])}}function At(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Dt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function jt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Mt=/[\n"\\]/g;function Nt(e){return e.replace(Mt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Pt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Et(t)):e.value!==``+Et(t)&&(e.value=``+Et(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):It(e,o,Et(n)):It(e,o,Et(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Et(s):e.removeAttribute(`name`)}function Ft(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){kt(e);return}n=n==null?``:``+Et(n),t=t==null?n:``+Et(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),kt(e)}function It(e,t,n){t===`number`&&jt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Lt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Et(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Rt(e,t,n){if(t!=null&&(t=``+Et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Et(n)}function zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(N(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Et(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),kt(e)}function Bt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Ht(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Vt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ut(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ht(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ht(e,o,t[o])}function Wt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Gt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Kt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qt(e){return Kt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Jt(){}var Yt=null;function Xt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zt=null,Qt=null;function $t(e){var t=dt(e);if(t&&(e=t.stateNode)){var n=e[nt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Pt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Nt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[nt]||null;if(!a)throw Error(i(90));Pt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&At(r)}break a;case`textarea`:Rt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Lt(e,!!n.multiple,t,!1)}}}var en=!1;function tn(e,t,n){if(en)return e(t,n);en=!0;try{return e(t)}finally{if(en=!1,(Zt!==null||Qt!==null)&&(Cu(),Zt&&(t=Zt,e=Qt,Qt=Zt=null,$t(t),e)))for(t=0;t<e.length;t++)$t(e[t])}}function nn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[nt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var rn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),an=!1;if(rn)try{var on={};Object.defineProperty(on,"passive",{get:function(){an=!0}}),window.addEventListener(`test`,on,on),window.removeEventListener(`test`,on,on)}catch{an=!1}var sn=null,cn=null,ln=null;function un(){if(ln)return ln;var e,t=cn,n=t.length,r,i=`value`in sn?sn.value:sn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return ln=i.slice(e,1<r?1-r:void 0)}function dn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function fn(){return!0}function pn(){return!1}function mn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?fn:pn,this.isPropagationStopped=pn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=fn)},persist:function(){},isPersistent:fn}),t}var hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gn=mn(hn),_n=f({},hn,{view:0,detail:0}),vn=mn(_n),yn,bn,xn,Sn=f({},_n,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==xn&&(xn&&e.type===`mousemove`?(yn=e.screenX-xn.screenX,bn=e.screenY-xn.screenY):bn=yn=0,xn=e),yn)},movementY:function(e){return`movementY`in e?e.movementY:bn}}),Cn=mn(Sn),wn=mn(f({},Sn,{dataTransfer:0})),Tn=mn(f({},_n,{relatedTarget:0})),En=mn(f({},hn,{animationName:0,elapsedTime:0,pseudoElement:0})),Dn=mn(f({},hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),On=mn(f({},hn,{data:0})),kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},An={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jn[e])?!!t[e]:!1}function Nn(){return Mn}var Pn=mn(f({},_n,{key:function(e){if(e.key){var t=kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?An[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return e.type===`keypress`?dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Fn=mn(f({},Sn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=mn(f({},_n,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),Ln=mn(f({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=mn(f({},Sn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),zn=mn(f({},hn,{newState:0,oldState:0})),Bn=[9,13,27,32],Vn=rn&&`CompositionEvent`in window,Hn=null;rn&&`documentMode`in document&&(Hn=document.documentMode);var Un=rn&&`TextEvent`in window&&!Hn,Wn=rn&&(!Vn||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Jn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return Jn(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!Vn&&qn(e,t)?(e=un(),ln=cn=sn=null,Yn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){Zt?Qt?Qt.push(r):Qt=[r]:Zt=r,t=Ad(t,`onChange`),0<t.length&&(n=new gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){Sd(e,0)}function ir(e){if(At(ft(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(rn){var sr;if(rn){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,Xt(e)),tn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!he.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=jt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=jt(e.document)}return t}function Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var wr=rn&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==jt(r)||(r=Tr,`selectionStart`in r&&Cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dr&&vr(Dr,r)||(Dr=r,r=Ad(Er,`onSelect`),0<r.length&&(t=new gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};rn&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),Vr=Pr(`transitionend`),Hr=new Map,Ur=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Ur.push(`scrollEnd`);function Wr(e,t){Hr.set(e,t),_t(t,[e])}var Gr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Kr=[],qr=0,Jr=0;function Yr(){for(var e=qr,t=Jr=qr=0;t<e;){var n=Kr[t];Kr[t++]=null;var r=Kr[t];Kr[t++]=null;var i=Kr[t];Kr[t++]=null;var a=Kr[t];if(Kr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&$r(n,i,a)}}function Xr(e,t,n,r){Kr[qr++]=e,Kr[qr++]=t,Kr[qr++]=n,Kr[qr++]=r,Jr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zr(e,t,n,r){return Xr(e,t,n,r),ei(e)}function Qr(e,t){return Xr(e,null,null,t),ei(e)}function $r(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Me(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ei(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ti={};function ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ri(e,t,n,r){return new ni(e,t,n,r)}function ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ai(e,t){var n=e.alternate;return n===null?(n=ri(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function oi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function si(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=Jf(e,n,ne.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case D:return e=ri(31,n,t,a),e.elementType=D,e.lanes=o,e;case g:return ci(n.children,a,o,t);case v:s=8,a|=24;break;case y:return e=ri(12,n,t,a|2),e.elementType=y,e.lanes=o,e;case C:return e=ri(13,n,t,a),e.elementType=C,e.lanes=o,e;case w:return e=ri(19,n,t,a),e.elementType=w,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case x:s=10;break a;case b:s=9;break a;case S:s=11;break a;case T:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ci(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function li(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function ui(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function di(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fi=new WeakMap;function pi(e,t){if(typeof e==`object`&&e){var n=fi.get(e);return n===void 0?(t={value:e,source:t,stack:me(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:me(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],yi=0,bi=null,xi=1,Si=``;function Ci(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function wi(e,t,n){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,bi=e;var r=xi;e=Si;var i=32-Me(r)-1;r&=~(1<<i),n+=1;var a=32-Me(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xi=1<<32-Me(t)+i|n<<i|r,Si=a+e}else xi=1<<a|n<<i|r,Si=e}function Ti(e){e.return!==null&&(Ci(e,1),wi(e,1,0))}function Ei(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===bi;)bi=vi[--yi],vi[yi]=null,Si=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null}function Di(e,t){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,xi=t.id,Si=t.overflow,bi=e}var Oi=null,ki=null,Ai=!1,ji=null,Mi=!1,Ni=Error(i(519));function Pi(e){throw Bi(pi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ni}function Fi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[tt]=e,t[nt]=r,n){case`dialog`:Cd(`cancel`,t),Cd(`close`,t);break;case`iframe`:case`object`:case`embed`:Cd(`load`,t);break;case`video`:case`audio`:for(n=0;n<bd.length;n++)Cd(bd[n],t);break;case`source`:Cd(`error`,t);break;case`img`:case`image`:case`link`:Cd(`error`,t),Cd(`load`,t);break;case`details`:Cd(`toggle`,t);break;case`input`:Cd(`invalid`,t),Ft(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Cd(`invalid`,t);break;case`textarea`:Cd(`invalid`,t),zt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Id(t.textContent,n)?(r.popover!=null&&(Cd(`beforetoggle`,t),Cd(`toggle`,t)),r.onScroll!=null&&Cd(`scroll`,t),r.onScrollEnd!=null&&Cd(`scrollend`,t),r.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||Pi(e,!0)}function Ii(e){for(Oi=e.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:Oi=Oi.return}}function Li(e){if(e!==Oi)return!1;if(!Ai)return Ii(e),Ai=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Jd(e.type,e.memoizedProps)),n=!n),n&&ki&&Pi(e),Ii(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=hf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=hf(e)}else t===27?(t=ki,nf(e.type)?(e=mf,mf=null,ki=e):ki=t):ki=Oi?pf(e.stateNode.nextSibling):null;return!0}function Ri(){ki=Oi=null,Ai=!1}function zi(){var e=ji;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),ji=null),e}function Bi(e){ji===null?ji=[e]:ji.push(e)}var Vi=te(null),Hi=null,Ui=null;function Wi(e,t,n){z(Vi,t._currentValue),t._currentValue=n}function Gi(e){e._currentValue=Vi.current,R(Vi)}function Ki(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ki(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ki(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ji(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ie.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[rp]:e.push(rp))}a=a.return}e!==null&&qi(t,e,n,r),t.flags|=262144}function Yi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xi(e){Hi=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zi(e){return $i(Hi,e)}function Qi(e,t){return Hi===null&&Xi(e),$i(e,t)}function $i(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ui===null){if(e===null)throw Error(i(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return n}var ea=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ta=t.unstable_scheduleCallback,na=t.unstable_NormalPriority,ra={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new ea,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=md(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var pa=P.S;P.S=function(e,t){ru=be(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),pa!==null&&pa(e,t)};var ma=te(null);function ha(){var e=ma.current;return e===null?Rl.pooledCache:e}function ga(e,t){t===null?z(ma,ma.current):z(ma,t.pool)}function _a(){var e=ha();return e===null?null:{parent:ra._currentValue,pool:e}}var va=Error(i(460)),ya=Error(i(474)),ba=Error(i(542)),xa={then:function(){}};function Sa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function W(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jt,Jt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e;default:if(typeof t.status==`string`)t.then(Jt,Jt);else{if(e=Rl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e}throw wa=t,va}}function Ca(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(wa=e,va):e}}var wa=null;function Ta(){if(wa===null)throw Error(i(459));var e=wa;return wa=null,e}function Ea(e){if(e===va||e===ba)throw Error(i(483))}var Da=null,Oa=0;function ka(e){var t=Oa;return Oa+=1,Da===null&&(Da=[]),W(Da,e,t)}function Aa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ja(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ma(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===E&&Ca(i)===t.type)?(t=a(t,n.props),Aa(t,n),t.return=e,t):(t=si(n.type,n.key,n.props,null,e.mode,r),Aa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ci(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=si(t.type,t.key,t.props,null,e.mode,n),Aa(n,t),n.return=e,n;case h:return t=di(t,e.mode,n),t.return=e,t;case E:return t=Ca(t),f(e,t,n)}if(N(t)||A(t))return t=ci(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ka(t),n);if(t.$$typeof===x)return f(e,Qi(e,t),n);ja(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case E:return n=Ca(n),p(e,t,n,r)}if(N(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ka(n),r);if(n.$$typeof===x)return p(e,t,Qi(e,n),r);ja(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=Ca(r),_(e,t,n,r,i)}if(N(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,ka(r),i);if(r.$$typeof===x)return _(e,t,n,Qi(t,r),i);ja(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Ai&&Ci(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Ai&&Ci(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Ai&&Ci(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Ai&&Ci(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Ai&&Ci(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Ai&&Ci(a,h),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Ca(l)===r.type){n(e,r.sibling),c=a(r,o.props),Aa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===g?(c=ci(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=si(o.type,o.key,o.props,null,e.mode,c),Aa(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Ca(o),b(e,r,o,c)}if(N(o))return v(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,ka(o),c);if(o.$$typeof===x)return b(e,r,Qi(e,o),c);ja(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Oa=0;var i=b(e,t,n,r);return Da=null,i}catch(t){if(t===va||t===ba)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Na=Ma(!0),Pa=Ma(!1),Fa=!1;function Ia(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function La(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ll&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ei(e),$r(e,null,n),t}return Xr(e,r,t,n),ei(e)}function Ba(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}function Va(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ha=!1;function G(){if(Ha){var e=la;if(e!==null)throw e}}function Ua(e,t,n,r){Ha=!1;var i=e.updateQueue;Fa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Bl&p)===p:(r&p)===p){p!==0&&p===ca&&(Ha=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Fa=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Jl|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=te(null),qa=te(0);function Ja(e,t){e=Kl,z(qa,e),z(Ka,t),Kl=e|t.baseLanes}function Ya(){z(qa,Kl),z(Ka,Ka.current)}function Xa(){Kl=qa.current,R(Ka),R(qa)}var Za=te(null),Qa=null;function $a(e){var t=e.alternate;z(io,io.current&1),z(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){z(io,io.current),z(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(z(io,io.current),z(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){z(io,io.current),z(Za,Za.current)}function ro(e){R(Za),Qa===e&&(Qa=null),R(io)}var io=te(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||uf(n)||df(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oo=0,so=null,co=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return oo=a,so=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Is:Ls,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){P.H=Fs;var t=co!==null&&co.next!==null;if(oo=0,lo=co=so=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||$s||(e=e.dependencies,e!==null&&Yi(e)&&($s=!0))}function So(e,t,n,r){so=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=co=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Rs,o=t(n,r)}while(fo);return o}function Co(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(co===null?null:co.memoizedState)!==e&&(so.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}oo=0,lo=co=so=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?so.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(co===null){var e=so.alternate;e=e===null?null:e.memoizedState}else e=co.next;var t=lo===null?so.memoizedState:lo.next;if(t!==null)lo=t,co=e;else{if(e===null)throw so.alternate===null?Error(i(467)):Error(i(310));co=e,e={memoizedState:co.memoizedState,baseState:co.baseState,baseQueue:co.baseQueue,queue:co.queue,next:null},lo===null?so.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=W(go,e,t),t=so,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Is:Ls),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===x)return Zi(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=so.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=so.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ko(),so.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=O;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),co,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(oo&f)===f:(Bl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ca&&(d=!0);else if((oo&p)===p){u=u.next,p===ca&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,so.lanes|=p,Jl|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,so.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&($s=!0,d&&(n=la,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);_r(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=so,a=Oo(),o=Ai;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((co||a).memoizedState,n);if(s&&(a.memoizedState=n,$s=!0),a=a.queue,cs(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),Rl===null)throw Error(i(349));o||oo&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=so.updateQueue,t===null?(t=ko(),so.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Ho(e){var t=Qr(e,2);t!==null&&vu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){je(!0);try{n()}finally{je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,co,typeof r==`function`?r:No)}function Go(e,t,n,r,a){if(Ms(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(Ai){var n=Rl.formState;if(n!==null){a:{var r=so;if(Ai){if(ki){b:{for(var i=ki,a=Mi;i.nodeType!==8;){if(!a){i=null;break b}if(i=pf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ki=pf(i.nextSibling),r=i.data===`F!`;break a}}Pi(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=ks.bind(null,so,r),r.dispatch=n,r=Uo(!1),a=js.bind(null,so,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,so,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),co,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===va?ba:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(so.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=co;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=so.updateQueue,t===null&&(t=ko(),so.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();so.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;co!==null&&r!==null&&yo(r,co.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(so.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){so.flags|=4;var t=so.updateQueue;if(t===null)t=ko(),so.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(Ll&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||oo&1073741824&&!(Bl&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),so.lanes|=e,Jl|=e,n)}function ys(e,t,n,r){return _r(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(Bl&261930)?($s=!0,e.memoizedState=n):(e=_u(),so.lanes|=e,Jl|=e,t):(e=vs(e,n,r),_r(e,t)||($s=!0),e)}function bs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,js(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,fa(c,r),gu(e)):As(e,t,r,gu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,I,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},gu())}function Ts(){return Zi(rp)}function K(){return Oo().memoizedState}function Es(){return Oo().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=Ra(n);var r=za(t,e,n);r!==null&&(vu(r,t,n),Ba(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Zr(e,t,n,r),n!==null&&(vu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,gu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,_r(s,o))return Xr(e,t,i,0),Rl===null&&Yr(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return vu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:md(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Zr(e,n,r,2),t!==null&&vu(t,e,2)}function Ms(e){var t=e.alternate;return e===so||t!==null&&t===so}function Ns(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}var Fs={readContext:Zi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Fs.useEffectEvent=vo;var Is={readContext:Zi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){je(!0);try{n(t)}finally{je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Os.bind(null,so,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=ks.bind(null,so,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,so,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=so,a=Do();if(Ai){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Rl===null)throw Error(i(349));Bl&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=Rl.identifierPrefix;if(Ai){var n=Si,r=xi;n=(r&~(1<<32-Me(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,so,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Ds.bind(null,so)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(Ll&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),co.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:K,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),co,e,t)},useMemoCache:Mo,useCacheRefresh:Es};Ls.useEffectEvent=us;var Rs={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return co===null?vs(n,e,t):ys(n,co.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:K,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return co===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,co,e,t)},useMemoCache:Mo,useCacheRefresh:Es};Rs.useEffectEvent=us;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Ra(r);i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(vu(t,e,r),Ba(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Ra(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(vu(t,e,r),Ba(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=Ra(n);r.tag=2,t!=null&&(r.callback=t),t=za(e,r,n),t!==null&&(vu(t,e,n),Ba(t,e,n))}};function Vs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!vr(n,r)||!vr(i,a):!0}function Hs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Bs.enqueueReplaceState(t,t.state,null)}function Us(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function q(e){Gr(e)}function Ws(e){console.error(e)}function Gs(e){Gr(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){return n=Ra(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Ys(e){return e=Ra(e),e.tag=3,e}function Xs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){qs(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Zs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ji(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?Au():n.alternate===null&&ql===0&&(ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Yu(e,r,a)),!1;case 22:return n.flags|=65536,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Yu(e,r,a)),!1}throw Error(i(435,n.tag))}return Yu(e,r,a),Au(),!1}if(Ai)return t=Za.current,t===null?(r!==Ni&&(t=Error(i(423),{cause:r}),Bi(pi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=pi(r,n),a=Js(e.stateNode,r,a),Va(e,a),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ni&&(e=Error(i(422),{cause:r}),Bi(pi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=pi(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Js(n.stateNode,r,e),Va(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ys(a),Xs(a,e,n,r),Va(n,a),!1}n=n.return}while(n!==null);return!1}var Qs=Error(i(461)),$s=!1;function ec(e,t,n,r){t.child=e===null?Pa(t,null,n,r):Na(t,e.child,n,r)}function tc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Xi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!$s?(To(e,t,i),Tc(e,t,i)):(Ai&&s&&Ti(t),t.flags|=1,ec(e,t,r,i),t.child)}function nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,rc(e,t,a,r,i)):(e=si(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref){if($s=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,Tc(e,t,i)}}return dc(e,t,n,r,i)}function ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return oc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,oc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ga(t,null),Ya(),no(t)):(ga(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return ec(e,t,i,n),t.child}function ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function oc(e,t,n,r,i){var a=ha();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ga(t,null),Ya(),to(t),e!==null&&Ji(e,t,r,!0),t.childLanes=i,null}function sc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cc(e,t,n){return Na(t,e.child,null,n),e=sc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Ai){if(r.mode===`hidden`)return e=sc(t,r),t.lanes=536870912,ac(null,e);if(eo(t),(e=ki)?(e=lf(e,Mi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Pi(t);return t.lanes=536870912,null}return sc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a){if(t.flags&256)t.flags&=-257,t=cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if($s||Ji(e,t,n,!1),a=(n&e.childLanes)!==0,$s||a){if(r=Rl,r!==null&&(s=Xe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Qr(e,s),vu(r,e,s),Qs;Au(),t=cc(e,t,n)}else e=o.treeContext,ki=pf(s.nextSibling),Oi=t,Ai=!0,ji=null,Mi=!1,e!==null&&Di(t,e),t=sc(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function dc(e,t,n,r,i){return Xi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!$s?(To(e,t,i),Tc(e,t,i)):(Ai&&r&&Ti(t),t.flags|=1,ec(e,t,n,i),t.child)}function fc(e,t,n,r,i,a){return Xi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!$s?(To(e,t,a),Tc(e,t,a)):(Ai&&r&&Ti(t),t.flags|=1,ec(e,t,n,a),t.child)}function pc(e,t,n,r,i){if(Xi(t),t.stateNode===null){var a=ti,o=n.contextType;typeof o==`object`&&o&&(a=Zi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ia(t),o=n.contextType,a.context=typeof o==`object`&&o?Zi(o):ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Bs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),G(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=ti,typeof u==`object`&&u&&(o=Zi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Hs(t,a,r,o),Fa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),G(),l=t.memoizedState,s||f!==l||Fa?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Fa||Vs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,La(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ti,typeof l==`object`&&l&&(c=Zi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Hs(t,a,r,c),Fa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),G();var p=t.memoizedState;o!==d||f!==p||Fa||e!==null&&e.dependencies!==null&&Yi(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Fa||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Yi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,uc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Na(t,e.child,null,i),t.child=Na(t,null,n,i)):ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Ri(),t.flags|=256,ec(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:_a()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function vc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(io.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Ai){if(a?$a(t):no(t),(e=ki)?(e=lf(e,Mi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Pi(t);return df(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=bc({mode:`hidden`,children:c},a),r=ci(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(null,r)):($a(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=bc({mode:`visible`,children:r.children},a),c=ci(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Na(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=ac(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),df(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Bi({value:r,source:null,stack:null}),t=xc(e,t,n)}else if($s||Ji(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Rl,s!==null&&(r=Xe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),vu(s,e,r),Qs;uf(c)||Au(),t=xc(e,t,n)}else uf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ki=pf(c.nextSibling),Oi=t,Ai=!0,ji=null,Mi=!1,e!==null&&Di(t,e),t=yc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ai(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ci(c,a,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ac(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(a=c.cachePool,a===null?a=_a():(l=ra._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return Na(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ki(e.return,t,n)}function Cc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,z(io,o),ec(e,t,r,n),r=Ai?_i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case`together`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ji(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Yi(e)))}function Dc(e,t,n){switch(t.tag){case 3:ae(t,t.stateNode.containerInfo),Wi(t,ra,e.memoizedState.cache),Ri();break;case 27:case 5:V(t);break;case 4:ae(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Ji(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(io,io.current),r)break;return null;case 22:return t.lanes=0,ic(e,t,n,t.pendingProps);case 24:Wi(t,ra,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!Ec(e,n)&&!(t.flags&128))return $s=!1,Dc(e,t,n);$s=!!(e.flags&131072)}}else $s=!1,Ai&&t.flags&1048576&&wi(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ca(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=Us(e,r),t.tag=1,t=pc(null,t,e,r,n)):(t.tag=0,t=dc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===S){t.tag=11,t=tc(null,t,e,r,n);break a}if(a===T){t.tag=14,t=nc(null,t,e,r,n);break a}}throw t=M(e)||e,Error(i(306,t,``))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),pc(e,t,r,a,n);case 3:a:{if(ae(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,La(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wi(t,ra,r),r!==o.cache&&qi(t,[ra],n,!0),G(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mc(e,t,r,n);break a}if(r!==a){a=pi(Error(i(424)),t),Bi(a),t=mc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ki=pf(e.firstChild),Oi=t,Ai=!0,ji=null,Mi=!0,n=Pa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ri(),r===a){t=Tc(e,t,n);break a}ec(e,t,r,n)}t=t.child}return t;case 26:return uc(e,t),e===null?(n=Pf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ai||(n=t.type,e=t.pendingProps,r=Gd(B.current).createElement(n),r[tt]=t,r[nt]=e,zd(r,n,e),mt(r),t.stateNode=r):t.memoizedState=Pf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return V(t),e===null&&Ai&&(r=t.stateNode=_f(t.type,t.pendingProps,B.current),Oi=t,Mi=!0,a=ki,nf(t.type)?(mf=a,ki=pf(r.firstChild)):ki=a),ec(e,t,t.pendingProps.children,n),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ai&&((a=r=ki)&&(r=sf(r,t.type,t.pendingProps,Mi),r===null?a=!1:(t.stateNode=r,Oi=t,ki=pf(r.firstChild),Mi=!1,a=!0)),a||Pi(t)),V(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Jd(a,o)?r=null:s!==null&&Jd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),rp._currentValue=a),uc(e,t),ec(e,t,r,n),t.child;case 6:return e===null&&Ai&&((e=n=ki)&&(n=cf(n,t.pendingProps,Mi),n===null?e=!1:(t.stateNode=n,Oi=t,ki=null,e=!0)),e||Pi(t)),null;case 13:return vc(e,t,n);case 4:return ae(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Na(t,null,r,n):ec(e,t,r,n),t.child;case 11:return tc(e,t,t.type,t.pendingProps,n);case 7:return ec(e,t,t.pendingProps,n),t.child;case 8:return ec(e,t,t.pendingProps.children,n),t.child;case 12:return ec(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wi(t,t.type,r.value),ec(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Xi(t),a=Zi(a),r=r(a),t.flags|=1,ec(e,t,r,n),t.child;case 14:return nc(e,t,t.type,t.pendingProps,n);case 15:return rc(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return lc(e,t,n);case 22:return ic(e,t,n,t.pendingProps);case 24:return Xi(t),r=Zi(ra),e===null?(a=ha(),a===null&&(a=Rl,o=ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ia(t),Wi(t,ra,a)):((e.lanes&n)!==0&&(La(e,t),Ua(t,null,null,n),G()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Wi(t,ra,r),r!==a.cache&&qi(t,[ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Wi(t,ra,r))),ec(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Du())e.flags|=8192;else throw wa=xa,ya}}else e.flags&=-16777217}function jc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Yf(t)){if(Du())e.flags|=8192;else throw wa=xa,ya}}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:We(),e.lanes|=t,Ql|=t)}function Nc(e,t){if(!Ai)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Fc(e,t,n){var r=t.pendingProps;switch(Ei(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Gi(ra),oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Li(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zi())),Pc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(Pc(t),Ac(t,a,null,r,n)):(Pc(t),jc(t,o))):o?o===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(t,a,e,r,n)),null;case 27:if(se(t),n=B.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}e=ne.current,Li(t)?Fi(t,e):(e=_f(a,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(se(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}if(o=ne.current,Li(t))Fi(t,o);else{var s=Gd(B.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[tt]=t,o[nt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(zd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=B.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Oi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Id(e.nodeValue,n)),e||Pi(t,!0)}else e=Gd(e).createTextNode(r),e[tt]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[tt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[tt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),Pc(t),null);case 4:return oe(),e===null&&Ed(t.stateNode.containerInfo),Pc(t),null;case 10:return Gi(t.type),Pc(t),null;case 19:if(R(io),r=t.memoizedState,r===null)return Pc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Nc(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return z(io,io.current&1|2),Ai&&Ci(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&be()>iu&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ai)return Pc(t),null}else 2*be()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=be(),e.sibling=null,n=io.current,z(io,a?n&1|2:n&1),Ai&&Ci(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&R(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Ei(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return se(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(io),null;case 4:return oe(),null;case 10:return Gi(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&R(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function Lc(e,t){switch(Ei(t),t.tag){case 3:Gi(ra),oe();break;case 26:case 27:case 5:se(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:R(io);break;case 10:Gi(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&R(ma);break;case 24:Gi(ra)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ju(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Ju(e,e.return,t)}}}function Vc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ju(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ju(e,t,n)}else n.current=null}}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ju(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[nt]=t}catch(t){Ju(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&nf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jt));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zd(t,r,n),t[tt]=e,t[nt]=n}catch(t){Ju(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==`function`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,Ud=fp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Wd={focusedElem:e,selectionRange:n},fp=!1,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Us(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)of(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:of(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,tl=e;break}tl=t.return}}function rl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&Rc(5,n);break;case 1:if(vl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(vl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ga(e,t)}catch(e){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),ff(e,n))));break;case 22:if(r=n.memoizedState!==null||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?bl(e,n,!!(n.subtreeFlags&8772)):vl(e,n),Zc=i,Qc=a}break;case 30:break;default:vl(e,n)}}function il(e){var t=e.alternate;t!==null&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&<(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var al=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Ae&&typeof Ae.onCommitFiberUnmount==`function`)try{Ae.onCommitFiberUnmount(ke,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=al,i=ol;nf(n.type)&&(al=n.stateNode,ol=!1),sl(e,t,n),vf(n.stateNode),al=r,ol=i;break;case 5:Qc||Uc(n,t);case 6:if(r=al,i=ol,al=null,sl(e,t,n),al=r,ol=i,al!==null){if(ol)try{(al.nodeType===9?al.body:al.nodeName===`HTML`?al.ownerDocument.body:al).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{al.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}}break;case 18:al!==null&&(ol?(e=al,rf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Rp(e)):rf(al,n.stateNode));break;case 4:r=al,i=ol,al=n.stateNode.containerInfo,ol=!0,sl(e,t,n),al=r,ol=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),sl(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Vc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,sl(e,t,n),Qc=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rp(e)}catch(e){Ju(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rp(e)}catch(e){Ju(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(i(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function pl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(nf(c.type)){al=c.stateNode,ol=!1;break a}break;case 5:al=c.stateNode,ol=!1;break a;case 3:case 4:al=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(al===null)throw Error(i(160));cl(o,s,a),al=null,ol=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ml;if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ct]||o[tt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),zd(o,r,n),o[tt]=e,mt(o),r=o;break a;case`link`:var s=Kf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Kf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[tt]=e,mt(o),r=o}e.stateNode=r}else qf(a,e.type,e.stateNode)}else e.stateNode=Vf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Gc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?qf(a,e.type,e.stateNode):Vf(a,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){a=e.stateNode;try{Bt(a,``)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Gc(e,a,n===null?a:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Gf=null,a=ml,ml=xf(t.containerInfo),pl(t,e),ml=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Rp(t.containerInfo)}catch(t){Ju(e,e.return,t)}$c&&($c=!1,_l(e));break;case 4:r=ml,ml=xf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=be()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||a,Qc=d||l,pl(t,e),Qc=d,Zc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Zc||Qc||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ju(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?af(m,!0):af(l.stateNode,!1)}catch(e){Ju(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Yc(e,qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Bt(o,``),n.flags&=-33),Yc(e,qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(i(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rl(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),yl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Vc(t,t.return,n),yl(t);break;case 27:vf(t.stateNode);case 26:case 5:Uc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:bl(i,a,n),Rc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ju(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wa(c[i],s)}catch(e){Ju(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Hc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&aa(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e)));break;case 12:if(i&2048){Cl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ju(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Tl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Xf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=xf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;tl!==null;){var n=tl;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tl=r;else a:for(n=e;tl!==null;){r=tl;var i=r.sibling,a=r.return;if(il(r),r===n){tl=null;break a}if(i!==null){i.return=a,tl=i;break a}tl=a}}}var Fl={getCacheForType:function(e){var t=Zi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zi(ra).controller.signal}},Il=typeof WeakMap==`function`?WeakMap:Map,Ll=0,Rl=null,zl=null,Bl=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return Ll&2&&Bl!==0?Bl&-Bl:P.T===null?$e():md()}function _u(){if(Zl===0){if(!(Bl&536870912)||Ai){var e=Le;Le<<=1,!(Le&3932160)&&(Le=262144),Zl=e}else Zl=536870912}return e=Za.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===Rl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,Bl,Zl,!1)),Ke(e,n),(!(Ll&2)||e!==Rl)&&(e===Rl&&(!(Ll&2)&&(Yl|=n),ql===4&&Su(e,Bl,Zl,!1)),od(e))}function yu(e,t,n){if(Ll&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||H(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Wl&&!r&&Su(e,t,0,!1);break}if(n=e.current.alternate,o&&!xu(n)){a=ju(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Su(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-be(),10<a)){if(Su(r,t,Zl,!Ul),He(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Zd(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,`Throttled`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}break}while(1);od(e)}function bu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},kl(t,a,d);var m=(a&62914560)===a?nu-be():(a&4194048)===a?ru-be():0;if(m=Qf(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!_r(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Me(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Je(e,n,t)}function Cu(){return Ll&6?!0:(sd(0,!1),!1)}function wu(){if(zl!==null){if(Vl===0)var e=zl.return;else e=zl,Ui=Hi=null,Eo(e),Da=null,Oa=0,e=zl;for(;e!==null;)Lc(e.alternate,e),e=e.return;zl=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),Rl=e,zl=n=ai(e.current,null),Bl=t,Vl=0,Hl=null,Ul=!1,Wl=H(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Me(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,Yr(),n}function Eu(e,t){so=null,P.H=Fs,t===va||t===ba?(t=Ta(),Vl=3):t===ya?(t=Ta(),Vl=4):Vl=t===Qs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,zl===null&&(ql=1,Ks(e,pi(t,e.current)))}function Du(){var e=Za.current;return e===null?!0:(Bl&4194048)===Bl?Qa===null:(Bl&62914560)===Bl||Bl&536870912?e===Qa:!1}function Ou(){var e=P.H;return P.H=Fs,e===null?Fs:e}function ku(){var e=P.A;return P.A=Fl,e}function Au(){ql=4,Ul||(Bl&4194048)!==Bl&&Za.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||Rl===null||Su(Rl,Bl,Zl,!1)}function ju(e,t,n){var r=Ll;Ll|=2;var i=Ou(),a=ku();(Rl!==e||Bl!==t)&&(au=null,Tu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&zl!==null){var s=zl,c=Hl;switch(Vl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Lu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Lu(e,s,c,l)}}Mu(),o=ql;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ui=Hi=null,Ll=r,P.H=i,P.A=a,zl===null&&(Rl=null,Bl=0,Yr()),o}function Mu(){for(;zl!==null;)Fu(zl)}function Nu(e,t){var n=Ll;Ll|=2;var r=Ou(),a=ku();Rl!==e||Bl!==t?(au=null,iu=be()+500,Tu(e,t)):Wl=H(e,t);a:do try{if(Vl!==0&&zl!==null){t=zl;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Lu(e,t,o,1);break;case 2:case 9:if(Sa(o)){Vl=0,Hl=null,Iu(t);break}t=function(){Vl!==2&&Vl!==9||Rl!==e||(Vl=7),od(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:Sa(o)?(Vl=0,Hl=null,Iu(t)):(Vl=0,Hl=null,Lu(e,t,o,7));break;case 5:var s=null;switch(zl.tag){case 26:s=zl.memoizedState;case 5:case 27:var c=zl;if(s?Yf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)zl=l;else{var u=c.return;u===null?zl=null:(zl=u,Ru(u))}break b}}Vl=0,Hl=null,Lu(e,t,o,5);break;case 6:Vl=0,Hl=null,Lu(e,t,o,6);break;case 8:wu(),ql=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return Ui=Hi=null,P.H=r,P.A=a,Ll=n,zl===null?(Rl=null,Bl=0,Yr(),ql):0}function Pu(){for(;zl!==null&&!ve();)Fu(zl)}function Fu(e){var t=Oc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fc(n,t,t.pendingProps,t.type,void 0,Bl);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,Bl);break;case 5:Eo(t);default:Lc(n,t),t=zl=oi(t,Kl),t=Oc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Lu(e,t,n,r){Ui=Hi=null,Eo(t),Da=null,Oa=0;var i=t.return;try{if(Zs(e,i,t,n,Bl)){ql=1,Ks(e,pi(n,e.current)),zl=null;return}}catch(t){if(i!==null)throw zl=i,t;ql=1,Ks(e,pi(n,e.current)),zl=null;return}t.flags&32768?(Ai||r===1?e=!0:Wl||Bl&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Ul);return}e=t.return;var n=Fc(t.alternate,t,Kl);if(n!==null){zl=n;return}if(t=t.sibling,t!==null){zl=t;return}zl=t=e}while(t!==null);ql===0&&(ql=5)}function zu(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,zl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){zl=e;return}zl=e=n}while(e!==null);ql=6,zl=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(Ll&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Jr,qe(e,n,o,s,c,l),e===Rl&&(zl=Rl=null,Bl=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(we,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=Ll,Ll|=4;try{nl(e,t,n)}finally{Ll=s,F.p=a,P.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Ll;Ll|=4;try{hl(t,e);var a=Wd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=br(s,h),v=br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}fp=!!Ud,Wd=Ud=null}finally{Ll=i,F.p=r,P.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Ll;Ll|=4;try{rl(e,t.alternate,t)}finally{Ll=i,F.p=r,P.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,ye();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),Qe(n),t=t.stateNode,Ae&&typeof Ae.onCommitFiberRoot==`function`)try{Ae.onCommitFiberRoot(ke,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}uu&3&&Gu(),od(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,sd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=Qe(uu),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,Ll&6)throw Error(i(331));var c=Ll;if(Ll|=4,Ml(o.current),wl(o,o.current,s,n),Ll=c,sd(0,!1),Ae&&typeof Ae.onPostCommitFiberRoot==`function`)try{Ae.onPostCommitFiberRoot(ke,o)}catch{}return!0}finally{F.p=a,P.T=r,Wu(e,t)}}function qu(e,t,n){t=pi(n,t),t=Js(e.stateNode,t,2),e=za(e,t,2),e!==null&&(Ke(e,2),od(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=pi(n,e),n=Ys(2),r=za(t,n,2),r!==null&&(Xs(n,r,t,e),Ke(r,2),od(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Gl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Bl&n)===n&&(ql===4||ql===3&&(Bl&62914560)===Bl&&300>be()-nu?!(Ll&2)&&Tu(e,0):Xl|=n,Ql===Bl&&(Ql=0)),od(e)}function Zu(e,t){t===0&&(t=We()),e=Qr(e,t),e!==null&&(Ke(e,t),od(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zu(e,n)}function ed(e,t){return ge(e,t)}var td=null,nd=null,rd=!1,J=!1,id=!1,ad=0;function od(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),J=!0,rd||(rd=!0,pd())}function sd(e,t){if(!id&&J){id=!0;do for(var n=!1,r=td;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Me(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,fd(r,a))}else a=Bl,a=He(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||H(r,a)||(n=!0,fd(r,a))}r=r.next}while(n);id=!1}}function cd(){ld()}function ld(){J=rd=!1;var e=0;ad!==0&&Xd()&&(e=ad);for(var t=be(),n=null,r=td;r!==null;){var i=r.next,a=ud(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(J=!0)),r=i}su!==0&&su!==5||sd(e,!1),ad!==0&&(ad=0)}function ud(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Me(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ue(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=Bl,n=He(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&_e(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||H(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&_e(r),Qe(n)){case 2:case 8:n=Ce;break;case 32:n=we;break;case 268435456:n=Ee;break;default:n=we}return r=dd.bind(null,e),n=ge(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&_e(r),e.callbackPriority=2,e.callbackNode=null,2}function dd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=Bl;return r=He(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),ud(e,be()),e.callbackNode!=null&&e.callbackNode===n?dd.bind(null,e):null)}function fd(e,t){if(Gu())return null;yu(e,t,!0)}function pd(){ef(function(){Ll&6?ge(Se,cd):ld()})}function md(){if(ad===0){var e=ca;e===0&&(e=Ie,Ie<<=1,!(Ie&261888)&&(Ie=256)),ad=e}return ad}function hd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:qt(``+e)}function gd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function _d(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=hd((i[nt]||null).action),o=r.submitter;o&&(t=(t=o[nt]||null)?hd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new gn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ad!==0){var e=o?gd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?gd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var vd=0;vd<Ur.length;vd++){var yd=Ur[vd];Wr(yd.toLowerCase(),`on`+(yd[0].toUpperCase()+yd.slice(1)))}Wr(Fr,`onAnimationEnd`),Wr(Ir,`onAnimationIteration`),Wr(Lr,`onAnimationStart`),Wr(`dblclick`,`onDoubleClick`),Wr(`focusin`,`onFocus`),Wr(`focusout`,`onBlur`),Wr(Rr,`onTransitionRun`),Wr(zr,`onTransitionStart`),Wr(Br,`onTransitionCancel`),Wr(Vr,`onTransitionEnd`),vt(`onMouseEnter`,[`mouseout`,`mouseover`]),vt(`onMouseLeave`,[`mouseout`,`mouseover`]),vt(`onPointerEnter`,[`pointerout`,`pointerover`]),vt(`onPointerLeave`,[`pointerout`,`pointerover`]),_t(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),_t(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),_t(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),_t(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var bd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),xd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(bd));function Sd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}}}}function Cd(e,t){var n=t[it];n===void 0&&(n=t[it]=new Set);var r=e+`__bubble`;n.has(r)||(Dd(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Dd(n,e,r,t)}var Td=`_reactListening`+Math.random().toString(36).slice(2);function Ed(e){if(!e[Td]){e[Td]=!0,ht.forEach(function(t){t!==`selectionchange`&&(xd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(`selectionchange`,!1,t))}}function Dd(e,t,n,r){switch(yp(t)){case 2:var i=pp;break;case 8:i=mp;break;default:i=hp}n=i.bind(null,t,n,e),i=void 0,!an||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Od(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ut(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}tn(function(){var r=a,i=Xt(n),s=[];a:{var c=Hr.get(e);if(c!==void 0){var l=gn,u=e;switch(e){case`keypress`:if(dn(n)===0)break a;case`keydown`:case`keyup`:l=Pn;break;case`focusin`:u=`focus`,l=Tn;break;case`focusout`:u=`blur`,l=Tn;break;case`beforeblur`:case`afterblur`:l=Tn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Cn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=In;break;case Fr:case Ir:case Lr:l=En;break;case Vr:l=Ln;break;case`scroll`:case`scrollend`:l=vn;break;case`wheel`:l=Rn;break;case`copy`:case`cut`:case`paste`:l=Dn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Fn;break;case`toggle`:case`beforetoggle`:l=zn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=nn(m,p),g!=null&&d.push(kd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Yt&&(u=n.relatedTarget||n.fromElement)&&(ut(u)||u[rt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ut(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Cn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Fn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ft(l),h=u==null?c:ft(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ut(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=jd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Md(s,c,l,d,!1),u!==null&&f!==null&&Md(s,f,u,d,!0)}}a:{if(c=r?ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c)){if(or)v=hr;else{v=pr;var y=fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Wt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&It(c,`number`,c.value)}switch(y=r?ft(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(Vn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Yn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=un()):(sn=i,cn=`value`in sn?sn.value:sn.textContent,Yn=!0)),y=Ad(r,x),0<y.length&&(x=new On(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Jn(n),b!==null&&(x.data=b)))),(b=Un?Xn(e,n):Zn(e,n))&&(x=Ad(r,`onBeforeInput`),0<x.length&&(y=new On(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),_d(s,e,r,n,i)}Sd(s,t)})}function kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=nn(e,n),i!=null&&r.unshift(kd(e,i,a)),i=nn(e,t),i!=null&&r.push(kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Md(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=nn(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=nn(n,a),l!=null&&o.push(kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nd=/\r\n?/g,Pd=/\u0000|\uFFFD/g;function Fd(e){return(typeof e==`string`?e:``+e).replace(Nd,`
|
|
10
|
-
`).replace(Pd,``)}function Id(e,t){return t=Fd(t),Fd(e)===t}function Ld(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Bt(e,``+r);break;case`className`:wt(e,`class`,r);break;case`tabIndex`:wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:wt(e,n,r);break;case`style`:Ut(e,r,o);break;case`data`:if(t!==`object`){wt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ld(e,t,`name`,a.name,a,null),Ld(e,t,`formEncType`,a.formEncType,a,null),Ld(e,t,`formMethod`,a.formMethod,a,null),Ld(e,t,`formTarget`,a.formTarget,a,null)):(Ld(e,t,`encType`,a.encType,a,null),Ld(e,t,`method`,a.method,a,null),Ld(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Cd(`beforetoggle`,e),Cd(`toggle`,e),Ct(e,`popover`,r);break;case`xlinkActuate`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ct(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Gt.get(n)||n,Ct(e,n,r))}}function Rd(e,t,n,r,a,o){switch(n){case`style`:Ut(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Bt(e,``+r);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!gt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[nt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ct(e,n,r)}}}function zd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Cd(`error`,e),Cd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,o,s,n,null)}}a&&Ld(e,t,`srcSet`,n.srcSet,n,null),r&&Ld(e,t,`src`,n.src,n,null);return;case`input`:Cd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Ld(e,t,r,d,n,null)}}Ft(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Cd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Ld(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Lt(e,!!r,n,!0):Lt(e,!!r,t,!1);return;case`textarea`:for(s in Cd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Ld(e,t,s,c,n,null)}zt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Ld(e,t,l,r,n,null)}return;case`dialog`:Cd(`beforetoggle`,e),Cd(`toggle`,e),Cd(`cancel`,e),Cd(`close`,e);break;case`iframe`:case`object`:Cd(`load`,e);break;case`video`:case`audio`:for(r=0;r<bd.length;r++)Cd(bd[r],e);break;case`image`:Cd(`error`,e),Cd(`load`,e);break;case`details`:Cd(`toggle`,e);break;case`embed`:case`source`:case`link`:Cd(`error`,e),Cd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,u,r,n,null)}return;default:if(Wt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Rd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ld(e,t,c,r,n,null))}function Bd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Ld(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ld(e,t,p,m,r,f)}}Pt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Ld(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ld(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Lt(e,!!n,n?[]:``,!1):Lt(e,!!n,t,!0)):Lt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Ld(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ld(e,t,s,a,r,o)}Rt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Ld(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ld(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Ld(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Ld(e,t,u,p,r,m)}return;default:if(Wt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Rd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Rd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ld(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Ld(e,t,f,p,r,m)}function Vd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Hd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Vd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Vd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Ud=null,Wd=null;function Gd(e){return e.nodeType===9?e:e.ownerDocument}function Kd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function qd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Jd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Yd=null;function Xd(){var e=window.event;return e&&e.type===`popstate`?e!==Yd&&(Yd=e,!0):(Yd=null,!1)}var Zd=typeof setTimeout==`function`?setTimeout:void 0,Qd=typeof clearTimeout==`function`?clearTimeout:void 0,$d=typeof Promise==`function`?Promise:void 0,ef=typeof queueMicrotask==`function`?queueMicrotask:$d===void 0?Zd:function(e){return $d.resolve(null).then(e).catch(tf)};function tf(e){setTimeout(function(){throw e})}function nf(e){return e===`head`}function rf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Rp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vf(e.ownerDocument.body)}n=i}while(n);Rp(t)}function af(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function of(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:of(n),lt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=pf(e.nextSibling),e===null)break}return null}function cf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pf(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pf(e.nextSibling),e===null))return null;return e}function uf(e){return e.data===`$?`||e.data===`$~`}function df(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ff(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function pf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var mf=null;function hf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function _f(e,t,n){switch(t=Gd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function vf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lt(e)}var yf=new Map,bf=new Set;function xf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sf=F.d;F.d={f:Cf,r:wf,D:Df,C:Of,L:kf,m:Af,X:Mf,S:jf,M:Nf};function Cf(){var e=Sf.f(),t=Cu();return e||t}function wf(e){var t=dt(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):Sf.r(e)}var Tf=typeof document>`u`?null:document;function Ef(e,t,n){var r=Tf;if(r&&typeof t==`string`&&t){var i=Nt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bf.has(i)||(bf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),zd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Df(e){Sf.D(e),Ef(`dns-prefetch`,e,null)}function Of(e,t){Sf.C(e,t),Ef(`preconnect`,e,t)}function kf(e,t,n){Sf.L(e,t,n);var r=Tf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Nt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Nt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Nt(n.imageSizes)+`"]`)):i+=`[href="`+Nt(e)+`"]`;var a=i;switch(t){case`style`:a=Ff(e);break;case`script`:a=zf(e)}yf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),yf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(If(a))||t===`script`&&r.querySelector(Bf(a))||(t=r.createElement(`link`),zd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Af(e,t){Sf.m(e,t);var n=Tf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Nt(r)+`"][href="`+Nt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zf(e)}if(!yf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),yf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bf(a)))return}r=n.createElement(`link`),zd(r,`link`,e),mt(r),n.head.appendChild(r)}}}function jf(e,t,n){Sf.S(e,t,n);var r=Tf;if(r&&e){var i=pt(r).hoistableStyles,a=Ff(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(If(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=yf.get(a))&&Uf(e,n);var c=o=r.createElement(`link`);mt(c),zd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Hf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mf(e,t){Sf.X(e,t);var n=Tf;if(n&&e){var r=pt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=f({src:e,async:!0},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),mt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t){Sf.M(e,t);var n=Tf;if(n&&e){var r=pt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),mt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t,n,r){var a=(a=B.current)?xf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Ff(n.href),n=pt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Ff(n.href);var o=pt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(If(e)))&&!o._p&&(s.instance=o,s.state.loading=5),yf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yf.set(e,n),o||Rf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=zf(n),n=pt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ff(e){return`href="`+Nt(e)+`"`}function If(e){return`link[rel="stylesheet"][`+e+`]`}function Lf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Rf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),zd(t,`link`,n),mt(t),e.head.appendChild(t))}function zf(e){return`[src="`+Nt(e)+`"]`}function Bf(e){return`script[async]`+e}function Vf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Nt(n.href)+`"]`);if(r)return t.instance=r,mt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),mt(r),zd(r,`style`,a),Hf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Ff(n.href);var o=e.querySelector(If(a));if(o)return t.state.loading|=4,t.instance=o,mt(o),o;r=Lf(n),(a=yf.get(a))&&Uf(r,a),o=(e.ownerDocument||e).createElement(`link`),mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),zd(o,`link`,r),t.state.loading|=4,Hf(o,n.precedence,e),t.instance=o;case`script`:return o=zf(n.src),(a=e.querySelector(Bf(o)))?(t.instance=a,mt(a),a):(r=n,(a=yf.get(o))&&(r=f({},n),Wf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),mt(a),zd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Hf(r,n.precedence,e));return t.instance}function Hf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gf=null;function Kf(e,t,n){if(Gf===null){var r=new Map,i=Gf=new Map;i.set(n,r)}else i=Gf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ct]||a[tt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function qf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Yf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Ff(r.href),a=t.querySelector(If(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=$f.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,mt(a);return}a=t.ownerDocument||t,r=Lf(r),(i=yf.get(i))&&Uf(r,i),a=a.createElement(`link`),mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),zd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=$f.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Zf=0;function Qf(e,t){return e.stylesheets&&e.count===0&&tp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Zf===0&&(Zf=62500*Hd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Zf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function $f(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ep=null;function tp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ep=new Map,t.forEach(np,e),ep=null,$f.call(e))}function np(e,t){if(!(t.state.loading&4)){var n=ep.get(e);if(n)var r=n.get(null);else{n=new Map,ep.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=$f.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var rp={$$typeof:x,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function ip(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ap(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ip(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ia(a),e}function op(e){return e?(e=ti,e):ti}function sp(e,t,n,r,i,a){i=op(i),r.context===null?r.context=i:r.pendingContext=i,r=Ra(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=za(e,r,t),n!==null&&(vu(n,e,t),Ba(n,e,t))}function cp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lp(e,t){cp(e,t),(e=e.alternate)&&cp(e,t)}function up(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&vu(t,e,67108864),lp(e,67108864)}}function dp(e){if(e.tag===13||e.tag===31){var t=gu();t=Ze(t);var n=Qr(e,t);n!==null&&vu(n,e,t),lp(e,t)}}var fp=!0;function pp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,hp(e,t,n,r)}finally{F.p=a,P.T=i}}function mp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,hp(e,t,n,r)}finally{F.p=a,P.T=i}}function hp(e,t,n,r){if(fp){var i=gp(r);if(i===null)Od(e,t,r,_p,n),Op(e,r);else if(Ap(i,e,t,n,r))r.stopPropagation();else if(Op(e,r),t&4&&-1<Dp.indexOf(e)){for(;i!==null;){var a=dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ve(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Me(o);s.entanglements[1]|=c,o&=~c}od(a),!(Ll&6)&&(iu=be()+500,sd(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&vu(s,a,2),Cu(),lp(a,2)}if(a=gp(r),a===null&&Od(e,t,r,_p,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Od(e,t,r,null,n)}}function gp(e){return e=Xt(e),vp(e)}var _p=null;function vp(e){if(_p=null,e=ut(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return _p=e,null}function yp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(xe()){case Se:return 2;case Ce:return 8;case we:case Te:return 32;case Ee:return 268435456;default:return 32}default:return 32}}var bp=!1,xp=null,Sp=null,Cp=null,wp=new Map,Tp=new Map,Ep=[],Dp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Op(e,t){switch(e){case`focusin`:case`focusout`:xp=null;break;case`dragenter`:case`dragleave`:Sp=null;break;case`mouseover`:case`mouseout`:Cp=null;break;case`pointerover`:case`pointerout`:wp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Tp.delete(t.pointerId)}}function kp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=dt(t),t!==null&&up(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ap(e,t,n,r,i){switch(t){case`focusin`:return xp=kp(xp,e,t,n,r,i),!0;case`dragenter`:return Sp=kp(Sp,e,t,n,r,i),!0;case`mouseover`:return Cp=kp(Cp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return wp.set(a,kp(wp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Tp.set(a,kp(Tp.get(a)||null,e,t,n,r,i)),!0}return!1}function jp(e){var t=ut(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,et(e.priority,function(){dp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,et(e.priority,function(){dp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Mp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=gp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Yt=r,n.target.dispatchEvent(r),Yt=null}else return t=dt(n),t!==null&&up(t),e.blockedOn=n,!1;t.shift()}return!0}function Np(e,t,n){Mp(e)&&n.delete(t)}function Pp(){bp=!1,xp!==null&&Mp(xp)&&(xp=null),Sp!==null&&Mp(Sp)&&(Sp=null),Cp!==null&&Mp(Cp)&&(Cp=null),wp.forEach(Np),Tp.forEach(Np)}function Fp(e,n){e.blockedOn===n&&(e.blockedOn=null,bp||(bp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Pp)))}var Ip=null;function Lp(e){Ip!==e&&(Ip=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ip===e&&(Ip=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(vp(r||n)===null)continue;break}var a=dt(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Rp(e){function t(t){return Fp(t,e)}xp!==null&&Fp(xp,e),Sp!==null&&Fp(Sp,e),Cp!==null&&Fp(Cp,e),wp.forEach(t),Tp.forEach(t);for(var n=0;n<Ep.length;n++){var r=Ep[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ep.length&&(n=Ep[0],n.blockedOn===null);)jp(n),n.blockedOn===null&&Ep.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[nt]||null;if(typeof a==`function`)o||Lp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[nt]||null)s=o.formAction;else if(vp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Lp(n)}}}function zp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Bp(e){this._internalRoot=e}Vp.prototype.render=Bp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;sp(n,gu(),e,t,null,null)},Vp.prototype.unmount=Bp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sp(e.current,2,null,e,null,null),Cu(),t[rt]=null}};function Vp(e){this._internalRoot=e}Vp.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ep.length&&t!==0&&t<Ep[n].priority;n++);Ep.splice(n,0,e),n===0&&jp(e)}};var Hp=n.version;if(Hp!==`19.2.8`)throw Error(i(527,Hp,`19.2.8`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Up={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wp.isDisabled&&Wp.supportsFiber)try{ke=Wp.inject(Up),Ae=Wp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=q,s=Ws,c=Gs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ap(e,1,!1,null,null,n,r,null,o,s,c,zp),e[rt]=t.current,Ed(e),new Bp(t)}})),He=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ve()})),H=e(_(),1),Ue=He(),We=/^\/compact(?:\s+([\s\S]+))?$/i;function Ge(e){let t=We.exec(e.trim());if(!t)return null;let n=t[1]?.trim();return n?{instructions:n}:{}}var Ke=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),qe=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Je=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Ye=e=>{let t=Je(e);return t.charAt(0).toUpperCase()+t.slice(1)},Xe={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ze=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Qe=(0,H.createContext)({}),$e=()=>(0,H.useContext)(Qe),et=(0,H.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=$e()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,H.createElement)(`svg`,{ref:c,...Xe,width:t??l??Xe.width,height:t??l??Xe.height,stroke:e??f,strokeWidth:m,className:Ke(`lucide`,p,i),...!a&&!Ze(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,H.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),U=(e,t)=>{let n=(0,H.forwardRef)(({className:n,...r},i)=>(0,H.createElement)(et,{ref:i,iconNode:t,className:Ke(`lucide-${qe(Ye(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Ye(e),n},tt=U(`alarm-clock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),nt=U(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),rt=U(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),it=U(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),at=U(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),ot=U(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),st=U(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),ct=U(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),lt=U(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),ut=U(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),dt=U(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),ft=U(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),pt=U(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),mt=U(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ht=U(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),gt=U(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),_t=U(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),vt=U(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),yt=U(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),bt=U(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),xt=U(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),St=U(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Ct=U(`circle-play`,[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),wt=U(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),Tt=U(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Et=U(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Dt=U(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),Ot=U(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),kt=U(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),At=U(`coins`,[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]),jt=U(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),Mt=U(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Nt=U(`corner-down-right`,[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),Pt=U(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Ft=U(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),It=U(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Lt=U(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Rt=U(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),zt=U(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Bt=U(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Vt=U(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Ht=U(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),Ut=U(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Wt=U(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Gt=U(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Kt=U(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),qt=U(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),Jt=U(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),Yt=U(`image-down`,[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19 3 3v-5.5`,key:`9ldu5r`}],[`path`,{d:`m17 22 3-3`,key:`1nkfve`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Xt=U(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),Zt=U(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Qt=U(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),$t=U(`images`,[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]),en=U(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),tn=U(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),nn=U(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),rn=U(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),an=U(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),on=U(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),sn=U(`message-circle-question-mark`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),cn=U(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),ln=U(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),un=U(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),dn=U(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),fn=U(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),pn=U(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),mn=U(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),hn=U(`package-minus`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M16 17h6`,key:`1ook5g`}],[`path`,{d:`M21 13V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.675-.955`,key:`zu9avd`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),gn=U(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),_n=U(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),vn=U(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),yn=U(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),bn=U(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),xn=U(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Sn=U(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),Cn=U(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),wn=U(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),Tn=U(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),En=U(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Dn=U(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),On=U(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),kn=U(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),An=U(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),jn=U(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Mn=U(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Nn=U(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Pn=U(`shield-x`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m14.5 9.5-5 5`,key:`17q4r4`}],[`path`,{d:`m9.5 9.5 5 5`,key:`18nt4w`}]]),Fn=U(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),In=U(`skip-forward`,[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]),Ln=U(`slash`,[[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}]]),Rn=U(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),zn=U(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Bn=U(`square-dashed`,[[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M21 14v1`,key:`169vum`}]]),Vn=U(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Hn=U(`square-slash`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),Un=U(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Wn=U(`square-x`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Gn=U(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Kn=U(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),qn=U(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Jn=U(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),Yn=U(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),Xn=U(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),Zn=U(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Qn=U(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),$n=U(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),er=U(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),tr=U(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]);function nr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var rr={};function ir(e,t,n,r,i){if(!n&&!r&&!i&&!e)return or(t);let a=or(e);return t&&(a=sr(a,t)),n&&(a=sr(a,n)),r&&(a=sr(a,r)),i&&(a=sr(a,i)),a}function ar(e){if(e.length===0)return rr;if(e.length===1)return or(e[0]);let t=or(e[0]);for(let n=1;n<e.length;n+=1)t=sr(t,e[n]);return t}function or(e){return dr(e)?{...fr(e,rr)}:cr(e)}function sr(e,t){return dr(t)?fr(t,e):lr(e,t)}function cr(e){let t={...e};for(let e in t){let n=t[e];ur(e,n)&&(t[e]=mr(n))}return t}function lr(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=nr(e.style,r);break;case`className`:e[n]=gr(e.className,r);break;default:e[n]=ur(n,r)?pr(e[n],r):r}}return e}function ur(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function dr(e){return typeof e==`function`}function fr(e,t){return dr(e)?e(t):e??rr}function pr(e,t){return t?e?(...n)=>{let r=n[0];if(_r(r)){let i=r;hr(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:mr(t):e}function mr(e){return e&&((...t)=>{let n=t[0];return _r(n)&&hr(n),e(...t)})}function hr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function gr(e,t){return t?e?t+` `+e:t:e}function _r(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function vr(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var yr=vr(`https://base-ui.com/production-error`,`Base UI`),br={};function xr(e,t){let n=H.useRef(br);return n.current===br&&(n.current=e(t)),n}function Sr(e,t,n,r){let i=xr(wr).current;return Tr(i,e,t,n,r)&&Dr(i,[e,t,n,r]),i.callback}function Cr(e){let t=xr(wr).current;return Er(t,e)&&Dr(t,e),t.callback}function wr(){return{callback:null,cleanup:null,refs:[]}}function Tr(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Er(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Dr(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var Or=19;function kr(e){return Or>=e}function Ar(e){if(!H.isValidElement(e))return null;let t=e,n=t.props;return(kr(19)?n?.ref:t.ref)??null}function jr(){}var Mr=Object.freeze([]),Nr=Object.freeze({});function Pr(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Fr(e,t){return typeof e==`function`?e(t):e}function Ir(e,t){return typeof e==`function`?e(t):e}function Lr(e,t,n={}){let r=t.render,i=Rr(t,n);return n.enabled===!1?null:Vr(e,r,i,n.state??Nr)}function Rr(e,t={}){let{className:n,style:r,render:i}=e,{state:a=Nr,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Fr(n,a):void 0,d=l?Ir(r,a):void 0,f=l?Pr(a,c):Nr,p=l&&s?zr(s):void 0,m=l?nr(f,p)??{}:Nr;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Cr([m.ref,Ar(i),...o]):Sr(m.ref,Ar(i),o):Sr(null,null)),l?(u!==void 0&&(m.className=gr(m.className,u)),d!==void 0&&(m.style=nr(m.style,d)),m):Nr}function zr(e){return Array.isArray(e)?ar(e):ir(void 0,e)}var Br=Symbol.for(`react.lazy`);function Vr(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=ir(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===Br&&(i=H.Children.toArray(t)[0]),H.cloneElement(i,e)}if(e&&typeof e==`string`)return Hr(e,n);throw Error(yr(8))}function Hr(e,t){return e===`button`?(0,H.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,H.createElement)(`img`,{alt:``,...t,key:t.key}):H.createElement(e,t)}function Ur(e){return Lr(e.defaultTagName??`div`,e,e)}function Wr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Wr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Gr(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Wr(e))&&(r&&(r+=` `),r+=t);return r}var Kr=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,qr=Gr,Jr=(e,t)=>n=>{if(t?.variants==null)return qr(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Kr(t)||Kr(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return qr(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Yr=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Xr=(e,t)=>({classGroupId:e,validator:t}),Zr=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Qr=`-`,$r=[],ei=`arbitrary..`,ti=e=>{let t=ii(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ri(e);let n=e.split(Qr);return ni(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Yr(i,t):t:i||$r}return n[e]||$r}}},ni=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ni(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Qr):e.slice(t).join(Qr),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ri=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ei+r:void 0})(),ii=e=>{let{theme:t,classGroups:n}=e;return ai(n,t)},ai=(e,t)=>{let n=Zr();for(let r in e){let i=e[r];oi(i,n,r,t)}return n},oi=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];si(i,t,n,r)}},si=(e,t,n,r)=>{if(typeof e==`string`){ci(e,t,n);return}if(typeof e==`function`){li(e,t,n,r);return}ui(e,t,n,r)},ci=(e,t,n)=>{let r=e===``?t:di(t,e);r.classGroupId=n},li=(e,t,n,r)=>{if(fi(e)){oi(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Xr(n,e))},ui=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];oi(o,di(t,a),n,r)}},di=(e,t)=>{let n=e,r=t.split(Qr),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Zr(),n.nextPart.set(t,i)),n=i}return n},fi=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,pi=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},mi=`!`,hi=`:`,gi=[],_i=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),vi=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===hi){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(mi)?(c=s.slice(0,-1),l=!0):s.startsWith(mi)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return _i(t,l,c,u)};if(t){let e=t+hi,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):_i(gi,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},yi=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},bi=e=>({cache:pi(e.cacheSize),parseClassName:vi(e),sortModifiers:yi(e),postfixLookupClassGroupIds:xi(e),...ti(e)}),xi=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Si=/\s+/,Ci=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Si),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+mi:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},wi=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Ti(n))&&(i&&(i+=` `),i+=r);return i},Ti=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Ti(e[r]))&&(n&&(n+=` `),n+=t);return n},Ei=(e,...t)=>{let n,r,i,a,o=o=>(n=bi(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Ci(e,n);return i(e,a),a};return a=o,(...e)=>a(wi(...e))},Di=[],Oi=e=>{let t=t=>t[e]||Di;return t.isThemeGetter=!0,t},ki=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ai=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ji=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Mi=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ni=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Pi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Fi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ii=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Li=e=>ji.test(e),Ri=e=>!!e&&!Number.isNaN(Number(e)),zi=e=>!!e&&Number.isInteger(Number(e)),Bi=e=>e.endsWith(`%`)&&Ri(e.slice(0,-1)),Vi=e=>Mi.test(e),Hi=()=>!0,Ui=e=>Ni.test(e)&&!Pi.test(e),Wi=()=>!1,Gi=e=>Fi.test(e),Ki=e=>Ii.test(e),qi=e=>!Xi(e)&&!ia(e),Ji=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Yi=e=>fa(e,ga,Wi),Xi=e=>ki.test(e),Zi=e=>fa(e,_a,Ui),Qi=e=>fa(e,va,Ri),$i=e=>fa(e,ba,Hi),ea=e=>fa(e,ya,Wi),ta=e=>fa(e,ma,Wi),na=e=>fa(e,ha,Ki),ra=e=>fa(e,xa,Gi),ia=e=>Ai.test(e),aa=e=>pa(e,_a),oa=e=>pa(e,ya),sa=e=>pa(e,ma),ca=e=>pa(e,ga),la=e=>pa(e,ha),ua=e=>pa(e,xa,!0),da=e=>pa(e,ba,!0),fa=(e,t,n)=>{let r=ki.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},pa=(e,t,n=!1)=>{let r=Ai.exec(e);return r?r[1]?t(r[1]):n:!1},ma=e=>e===`position`||e===`percentage`,ha=e=>e===`image`||e===`url`,ga=e=>e===`length`||e===`size`||e===`bg-size`,_a=e=>e===`length`,va=e=>e===`number`,ya=e=>e===`family-name`,ba=e=>e===`number`||e===`weight`,xa=e=>e===`shadow`,Sa=Ei(()=>{let e=Oi(`color`),t=Oi(`font`),n=Oi(`text`),r=Oi(`font-weight`),i=Oi(`tracking`),a=Oi(`leading`),o=Oi(`breakpoint`),s=Oi(`container`),c=Oi(`spacing`),l=Oi(`radius`),u=Oi(`shadow`),d=Oi(`inset-shadow`),f=Oi(`text-shadow`),p=Oi(`drop-shadow`),m=Oi(`blur`),h=Oi(`perspective`),g=Oi(`aspect`),_=Oi(`ease`),v=Oi(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),ia,Xi],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[ia,Xi,c],T=()=>[Li,`full`,`auto`,...w()],E=()=>[zi,`none`,`subgrid`,ia,Xi],D=()=>[`auto`,{span:[`full`,zi,ia,Xi]},zi,ia,Xi],O=()=>[zi,`auto`,ia,Xi],k=()=>[`auto`,`min`,`max`,`fr`,ia,Xi],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Li,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Li,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Li,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,ia,Xi],ee=()=>[...b(),sa,ta,{position:[ia,Xi]}],L=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,ca,Yi,{size:[ia,Xi]}],R=()=>[Bi,aa,Zi],z=()=>[``,`none`,`full`,l,ia,Xi],ne=()=>[``,Ri,aa,Zi],re=()=>[`solid`,`dashed`,`dotted`,`double`],B=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ie=()=>[Ri,Bi,sa,ta],ae=()=>[``,`none`,m,ia,Xi],oe=()=>[`none`,Ri,ia,Xi],V=()=>[`none`,Ri,ia,Xi],se=()=>[Ri,ia,Xi],ce=()=>[Li,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Vi],breakpoint:[Vi],color:[Hi],container:[Vi],"drop-shadow":[Vi],ease:[`in`,`out`,`in-out`],font:[qi],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Vi],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Vi],shadow:[Vi],spacing:[`px`,Ri],text:[Vi],"text-shadow":[Vi],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Li,Xi,ia,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,ia,Xi]}],"container-named":[Ji],columns:[{columns:[Ri,Xi,ia,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[zi,`auto`,ia,Xi]}],basis:[{basis:[Li,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Ri,Li,`auto`,`initial`,`none`,Xi]}],grow:[{grow:[``,Ri,ia,Xi]}],shrink:[{shrink:[``,Ri,ia,Xi]}],order:[{order:[zi,`first`,`last`,`none`,ia,Xi]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,aa,Zi]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,da,$i]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Bi,Xi]}],"font-family":[{font:[oa,ea,t]}],"font-features":[{"font-features":[Xi]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,ia,Xi]}],"line-clamp":[{"line-clamp":[Ri,`none`,ia,Qi]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,ia,Xi]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,ia,Xi]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...re(),`wavy`]}],"text-decoration-thickness":[{decoration:[Ri,`from-font`,`auto`,ia,Zi]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Ri,`auto`,ia,Xi]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[zi,ia,Xi]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,ia,Xi]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,ia,Xi]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},zi,ia,Xi],radial:[``,ia,Xi],conic:[zi,ia,Xi]},la,na]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...re(),`hidden`,`none`]}],"divide-style":[{divide:[...re(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...re(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Ri,ia,Xi]}],"outline-w":[{outline:[``,Ri,aa,Zi]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,ua,ra]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,ua,ra]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ne()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Ri,Zi]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,ua,ra]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Ri,ia,Xi]}],"mix-blend":[{"mix-blend":[...B(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":B()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Ri]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[ia,Xi]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Ri]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,ia,Xi]}],filter:[{filter:[``,`none`,ia,Xi]}],blur:[{blur:ae()}],brightness:[{brightness:[Ri,ia,Xi]}],contrast:[{contrast:[Ri,ia,Xi]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,ua,ra]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,Ri,ia,Xi]}],"hue-rotate":[{"hue-rotate":[Ri,ia,Xi]}],invert:[{invert:[``,Ri,ia,Xi]}],saturate:[{saturate:[Ri,ia,Xi]}],sepia:[{sepia:[``,Ri,ia,Xi]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,ia,Xi]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[Ri,ia,Xi]}],"backdrop-contrast":[{"backdrop-contrast":[Ri,ia,Xi]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Ri,ia,Xi]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ri,ia,Xi]}],"backdrop-invert":[{"backdrop-invert":[``,Ri,ia,Xi]}],"backdrop-opacity":[{"backdrop-opacity":[Ri,ia,Xi]}],"backdrop-saturate":[{"backdrop-saturate":[Ri,ia,Xi]}],"backdrop-sepia":[{"backdrop-sepia":[``,Ri,ia,Xi]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,ia,Xi]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Ri,`initial`,ia,Xi]}],ease:[{ease:[`linear`,`initial`,_,ia,Xi]}],delay:[{delay:[Ri,ia,Xi]}],animate:[{animate:[`none`,v,ia,Xi]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,ia,Xi]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":[`scale-3d`],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[ia,Xi,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ce()}],"translate-x":[{"translate-x":ce()}],"translate-y":[{"translate-y":ce()}],"translate-z":[{"translate-z":ce()}],"translate-none":[`translate-none`],zoom:[{zoom:[zi,ia,Xi]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,ia,Xi]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,ia,Xi]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[Ri,aa,Zi,Qi]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function W(...e){return Sa(Gr(e))}var Ca=Jr(`[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base outline-none transition-[box-shadow,transform] duration-150 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 active:scale-[0.97] sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-9 px-[calc(--spacing(3)-1px)] sm:h-8`,icon:`size-9 sm:size-8`,"icon-lg":`size-10 sm:size-9`,"icon-sm":`size-8 sm:size-7`,"icon-xl":`size-11 sm:size-10 [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5`,"icon-xs":`size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-3.5`,lg:`h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9`,sm:`h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7`,xl:`h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5`,xs:`h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5`},variant:{default:`not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none`,destructive:`not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none`,"destructive-outline":`border-border bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/32 [:hover,[data-pressed]]:bg-destructive/4`,ghost:`border-transparent hover:bg-accent data-pressed:bg-accent`,link:`border-transparent underline-offset-4 hover:underline`,outline:`border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80`}}});function wa({className:e,variant:t,size:n,render:r,...i}){let a=r?void 0:`button`;return Ur({defaultTagName:`button`,props:ir({className:W(Ca({className:e,size:n,variant:t})),"data-slot":`button`,type:a},i),render:r})}function Ta(e){let t=0;for(let n of e)n.muted!==!0&&(t+=Ea(n.pendingAskCount),t+=Ea(n.pendingApprovalCount));return t}function Ea(e){return typeof e!=`number`||!Number.isFinite(e)||e<=0?0:Math.floor(e)}function Da(e,t=typeof navigator>`u`?{}:navigator){let n=Ea(e);try{n>0?t.setAppBadge?.(n):t.clearAppBadge?.()}catch{}}function Oa(e){switch(e){case`image-quota`:return`Chat image storage is full (200MiB). Message not sent.`;case`image-too-large`:return`An image is still over 10MiB after compression. Message not sent.`;case`image-not-image`:return`An attachment is not a supported image. Message not sent.`;case`image-storage`:return`Could not save the images. Message not sent. Please try again.`;default:return}}var ka=/^[a-f0-9]{64}\.(?:png|jpg|gif|webp)$/,Aa=e=>typeof e==`string`&&ka.test(e),ja=new Set([`image`,`markdown`,`html`,`pdf`,`text`,`other`]),Ma=new Set([`file`,`web`,`desktop`,`upload`]),Na=3e4,Pa=e=>`entryId`in e?`${e.chatId}|e|${e.entryId}`:`${e.chatId}|c|${e.conversationId}|${e.messageIndex}`,Fa=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Ia=e=>typeof e==`string`&&e?e:void 0,La=e=>typeof e==`string`&&/^data:image\/(?:png|jpeg|gif|webp|svg\+xml|bmp|avif|x-icon);base64,/.test(e);function Ra(e){if(!Fa(e))return null;let{rel:t,name:n,size:r,kind:i}=e;return typeof t==`string`&&typeof n==`string`&&typeof r==`number`&&typeof i==`string`&&ja.has(i)?{rel:t,name:n,size:r,kind:i}:null}function za(e){if(!Fa(e)||typeof e.source!=`string`||!Ma.has(e.source))return null;let t=e.source,n=Ia(e.name),r=Ia(e.caption),i={source:t,...n?{name:n}:{},...r?{caption:r}:{}};return e.ok===!0&&Aa(e.mediaId)?{ok:!0,mediaId:e.mediaId,...La(e.thumb)?{thumb:e.thumb}:{},...i}:e.ok===!1&&(e.error===`too-large`||e.error===`quota`)?{ok:!1,error:e.error,...i}:null}var Ba=class{send;cache=new Map;inflight=new Set;listeners=new Set;images=new Map;seq=0;constructor(e){this.send=e}get(e){return this.cache.get(Pa(e))}request(e){let t=Pa(e),n=this.cache.get(t);this.inflight.has(t)||n&&(n.artifacts.length>0||n.media.length>0)||(this.inflight.add(t),this.send({type:`bot-artifacts`,target:e}))}receive(e){if(!Fa(e.target))return;let t=Pa(e.target);this.inflight.delete(t);let n=(Array.isArray(e.artifacts)?e.artifacts:[]).map(Ra).filter(e=>e!==null),r=new Set,i=(Array.isArray(e.media)?e.media:[]).map(za).filter(e=>e?.ok?!r.has(e.mediaId)&&(r.add(e.mediaId),!0):e!==null).slice(0,4);this.cache.set(t,{artifacts:n,media:i});for(let e of this.listeners)e()}image(e,t){let n=`img-${Date.now().toString(36)}-${++this.seq}`;return new Promise(r=>{let i=setTimeout(()=>this.settle(n,{error:`timeout`}),Na);this.images.set(n,e=>{clearTimeout(i),r(e)}),this.send({type:`bot-artifact-image`,requestId:n,target:e,...t})})}receiveImage(e){this.settle(e.requestId,La(e.dataUrl)?{dataUrl:e.dataUrl}:{error:e.error??`invalid`})}reset(){this.inflight.clear();for(let e of[...this.images.keys()])this.settle(e,{error:`offline`})}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}settle(e,t){let n=this.images.get(e);n&&(this.images.delete(e),n(t))}},Va=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Ha=n(((e,t)=>{t.exports=Va()})),G=Ha(),Ua=(0,H.createContext)(null),Wa={web:`网页截图`,desktop:`桌面截图`,file:`工作区`,upload:``},Ga=e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`;function Ka({target:e}){let t=(0,H.useContext)(Ua),n=Pa(e),r=t?.port,i=(0,H.useSyncExternalStore)(e=>r?.subscribe(e)??(()=>{}),()=>r?.get(e)),a=t?.online??!1;(0,H.useEffect)(()=>{a&&r?.request(e)},[r,n,a]);let[o,s]=(0,H.useState)(null);if(!r||!i||i.media.length===0&&i.artifacts.length===0)return null;let c=i.media.some(e=>e.ok&&e.source===`desktop`);return(0,G.jsxs)(`div`,{className:`mt-1.5`,children:[i.media.length>0&&(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.media.map((e,t)=>e.ok?(0,G.jsxs)(`button`,{type:`button`,onClick:()=>s({ref:{mediaId:e.mediaId},title:e.caption??e.name??Wa[e.source],source:e.source,thumb:e.thumb}),className:`relative h-20 w-28 overflow-hidden rounded-lg border bg-muted`,children:[e.thumb?(0,G.jsx)(`img`,{src:e.thumb,alt:``,className:`h-full w-full object-cover`}):(0,G.jsx)(Xt,{className:`m-auto h-4 w-4 text-muted-foreground`}),Wa[e.source]&&(0,G.jsx)(`span`,{className:W(`absolute top-1 left-1 rounded px-1 text-[10px] leading-4`,e.source===`desktop`?`bg-warning text-warning-foreground`:`bg-black/60 text-white`),children:Wa[e.source]}),(e.caption||e.name)&&(0,G.jsx)(`span`,{className:`absolute inset-x-0 bottom-0 truncate bg-gradient-to-t from-black/70 to-transparent px-1.5 pt-3 pb-0.5 text-left text-[10px] text-white`,children:e.caption??e.name})]},e.mediaId):(0,G.jsxs)(`div`,{className:`flex w-32 flex-col gap-0.5 rounded-lg border border-destructive/60 border-dashed p-2 text-destructive text-xs`,children:[(0,G.jsx)(`span`,{className:`truncate font-medium`,children:e.name??Wa[e.source]}),(0,G.jsx)(`span`,{children:e.error===`quota`?`群图片空间已满,没收下`:`压缩后仍超过 10MiB,没发出去`})]},`failed-${t}`))}),c&&(0,G.jsx)(`p`,{className:`mt-1 text-warning text-xs`,children:`桌面截图可能拍到别的窗口里的敏感内容。`}),i.artifacts.length>0&&(0,G.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1.5`,children:i.artifacts.map(e=>(0,G.jsx)(qa,{artifact:e,onOpen:()=>s({ref:{rel:e.rel},title:e.name})},e.rel))}),o&&(0,G.jsx)(Ja,{preview:o,load:()=>r.image(e,o.ref),onClose:()=>s(null)})]})}function qa({artifact:e,onOpen:t}){let n=e.kind===`image`;return(0,G.jsxs)(`button`,{type:`button`,disabled:!n,onClick:t,title:e.rel,className:`flex max-w-60 items-center gap-1.5 rounded-lg border bg-card px-2 py-1 text-left text-xs disabled:cursor-default`,children:[(0,G.jsx)(Bt,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`truncate`,children:e.name}),(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:Ga(e.size)})]})}function Ja({preview:e,load:t,onClose:n}){let[r,i]=(0,H.useState)(null);(0,H.useEffect)(()=>{let e=!0;return t().then(t=>e&&i(t)),()=>{e=!1}},[]);let a=r&&`dataUrl`in r?r.dataUrl:e.thumb;return(0,G.jsxs)(`div`,{className:`fixed inset-0 z-50 flex flex-col bg-black/90 text-white`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pt-[max(env(safe-area-inset-top),0.75rem)] pb-2 text-sm`,children:[(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),e.source&&(0,G.jsx)(`span`,{className:`shrink-0 text-white/70 text-xs`,children:Wa[e.source]}),(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`关闭`,className:`rounded p-1.5`,children:(0,G.jsx)(er,{className:`h-5 w-5`})})]}),e.source===`desktop`&&(0,G.jsx)(`p`,{className:`px-3 text-warning text-xs`,children:`这是整桌面截图,可能拍到其他窗口里的敏感内容。`}),(0,G.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 items-center justify-center p-3`,children:[a&&(0,G.jsx)(`img`,{src:a,alt:e.title,className:`max-h-full max-w-full object-contain`}),!r&&(0,G.jsx)(an,{className:`absolute h-5 w-5 animate-spin`}),r&&`error`in r&&(0,G.jsx)(`p`,{className:`absolute bottom-4 rounded bg-black/70 px-2 py-1 text-xs`,children:r.error===`too-large`?`图片太大,手机上看不了`:`大图没拉下来`})]})]})}var Ya=`#64748b`,Xa=/^#[0-9a-f]{6}$/i;function Za(e){let[t,n,r]=[1,3,5].map(t=>Number.parseInt(e.slice(t,t+2),16)/255),i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s=i-a;if(s===0)return[0,0,o];let c=s/(1-Math.abs(2*o-1));return[((i===t?(n-r)/s%6:i===n?(r-t)/s+2:(t-n)/s+4)*60+360)%360,c,o]}function Qa(e,t,n){let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,[o,s,c]=e<60?[r,i,0]:e<120?[i,r,0]:e<180?[0,r,i]:e<240?[0,i,r]:e<300?[i,0,r]:[r,0,i];return`#${[o,s,c].map(e=>Math.round((e+a)*255).toString(16).padStart(2,`0`)).join(``)}`}function $a(e){let t=typeof e==`string`&&Xa.test(e)?e.toLowerCase():Ya,[n,r]=Za(t),i=Math.max(r,.35),a=(e,t)=>Qa((n+e+360)%360,i,t);return[t,a(35,.78),a(-35,.32),a(180,.62),a(90,.9)]}var eo=e=>{let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t&=t}return Math.abs(t)},to=(e,t)=>Math.floor(e/10**t%10),no=(e,t)=>!(to(e,t)%2),ro=(e,t,n)=>{let r=e%t;return n&&to(e,n)%2==0?-r:r},io=(e,t,n)=>t[e%n],ao=e=>{e.slice(0,1)===`#`&&(e=e.slice(1));let t=parseInt(e.substr(0,2),16),n=parseInt(e.substr(2,2),16),r=parseInt(e.substr(4,2),16);return(t*299+n*587+r*114)/1e3>=128?`#000000`:`#FFFFFF`},oo=4,so=80;function co(e,t){let n=eo(e),r=t&&t.length;return Array.from({length:oo},(e,i)=>({color:io(n+i,t,r),translateX:ro(n*(i+1),so/2-(i+17),1),translateY:ro(n*(i+1),so/2-(i+17),2),rotate:ro(n*(i+1),360),isSquare:no(n,2)}))}var lo=({name:e,colors:t,title:n,square:r,size:i,...a})=>{let o=co(e,t),s=H.useId();return(0,G.jsxs)(`svg`,{viewBox:`0 0 80 80`,fill:`none`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,...a,children:[n&&(0,G.jsx)(`title`,{children:e}),(0,G.jsx)(`mask`,{id:s,maskUnits:`userSpaceOnUse`,x:0,y:0,width:so,height:so,children:(0,G.jsx)(`rect`,{width:so,height:so,rx:r?void 0:160,fill:`#FFFFFF`})}),(0,G.jsxs)(`g`,{mask:`url(#${s})`,children:[(0,G.jsx)(`rect`,{width:so,height:so,fill:o[0].color}),(0,G.jsx)(`rect`,{x:10,y:30,width:so,height:o[1].isSquare?so:so/8,fill:o[1].color,transform:`translate(`+o[1].translateX+` `+o[1].translateY+`) rotate(`+o[1].rotate+` 40 40)`}),(0,G.jsx)(`circle`,{cx:so/2,cy:so/2,fill:o[2].color,r:so/5,transform:`translate(`+o[2].translateX+` `+o[2].translateY+`)`}),(0,G.jsx)(`line`,{x1:0,y1:so/2,x2:so,y2:so/2,strokeWidth:2,stroke:o[3].color,transform:`translate(`+o[3].translateX+` `+o[3].translateY+`) rotate(`+o[3].rotate+` 40 40)`})]})]})},uo=90,fo=5;function po(e,t){let n=eo(e),r=t&&t.length,i=Array.from({length:fo},(e,i)=>io(n+i,t,r)),a=[];return a[0]=i[0],a[1]=i[1],a[2]=i[1],a[3]=i[2],a[4]=i[2],a[5]=i[3],a[6]=i[3],a[7]=i[0],a[8]=i[4],a}var mo=({name:e,colors:t,title:n,square:r,size:i,...a})=>{let o=po(e,t),s=H.useId();return(0,G.jsxs)(`svg`,{viewBox:`0 0 90 90`,fill:`none`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,...a,children:[n&&(0,G.jsx)(`title`,{children:e}),(0,G.jsx)(`mask`,{id:s,maskUnits:`userSpaceOnUse`,x:0,y:0,width:uo,height:uo,children:(0,G.jsx)(`rect`,{width:uo,height:uo,rx:r?void 0:180,fill:`#FFFFFF`})}),(0,G.jsxs)(`g`,{mask:`url(#${s})`,children:[(0,G.jsx)(`path`,{d:`M0 0h90v45H0z`,fill:o[0]}),(0,G.jsx)(`path`,{d:`M0 45h90v45H0z`,fill:o[1]}),(0,G.jsx)(`path`,{d:`M83 45a38 38 0 00-76 0h76z`,fill:o[2]}),(0,G.jsx)(`path`,{d:`M83 45a38 38 0 01-76 0h76z`,fill:o[3]}),(0,G.jsx)(`path`,{d:`M77 45a32 32 0 10-64 0h64z`,fill:o[4]}),(0,G.jsx)(`path`,{d:`M77 45a32 32 0 11-64 0h64z`,fill:o[5]}),(0,G.jsx)(`path`,{d:`M71 45a26 26 0 00-52 0h52z`,fill:o[6]}),(0,G.jsx)(`path`,{d:`M71 45a26 26 0 01-52 0h52z`,fill:o[7]}),(0,G.jsx)(`circle`,{cx:45,cy:45,r:23,fill:o[8]})]})]})},ho=64,go=80;function _o(e,t){let n=eo(e),r=t&&t.length;return Array.from({length:ho},(e,i)=>io(n%(i+1),t,r))}var vo=({name:e,colors:t,title:n,square:r,size:i,...a})=>{let o=_o(e,t),s=H.useId();return(0,G.jsxs)(`svg`,{viewBox:`0 0 80 80`,fill:`none`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,...a,children:[n&&(0,G.jsx)(`title`,{children:e}),(0,G.jsx)(`mask`,{id:s,"mask-type":`alpha`,maskUnits:`userSpaceOnUse`,x:0,y:0,width:go,height:go,children:(0,G.jsx)(`rect`,{width:go,height:go,rx:r?void 0:160,fill:`#FFFFFF`})}),(0,G.jsxs)(`g`,{mask:`url(#${s})`,children:[(0,G.jsx)(`rect`,{width:10,height:10,fill:o[0]}),(0,G.jsx)(`rect`,{x:20,width:10,height:10,fill:o[1]}),(0,G.jsx)(`rect`,{x:40,width:10,height:10,fill:o[2]}),(0,G.jsx)(`rect`,{x:60,width:10,height:10,fill:o[3]}),(0,G.jsx)(`rect`,{x:10,width:10,height:10,fill:o[4]}),(0,G.jsx)(`rect`,{x:30,width:10,height:10,fill:o[5]}),(0,G.jsx)(`rect`,{x:50,width:10,height:10,fill:o[6]}),(0,G.jsx)(`rect`,{x:70,width:10,height:10,fill:o[7]}),(0,G.jsx)(`rect`,{y:10,width:10,height:10,fill:o[8]}),(0,G.jsx)(`rect`,{y:20,width:10,height:10,fill:o[9]}),(0,G.jsx)(`rect`,{y:30,width:10,height:10,fill:o[10]}),(0,G.jsx)(`rect`,{y:40,width:10,height:10,fill:o[11]}),(0,G.jsx)(`rect`,{y:50,width:10,height:10,fill:o[12]}),(0,G.jsx)(`rect`,{y:60,width:10,height:10,fill:o[13]}),(0,G.jsx)(`rect`,{y:70,width:10,height:10,fill:o[14]}),(0,G.jsx)(`rect`,{x:20,y:10,width:10,height:10,fill:o[15]}),(0,G.jsx)(`rect`,{x:20,y:20,width:10,height:10,fill:o[16]}),(0,G.jsx)(`rect`,{x:20,y:30,width:10,height:10,fill:o[17]}),(0,G.jsx)(`rect`,{x:20,y:40,width:10,height:10,fill:o[18]}),(0,G.jsx)(`rect`,{x:20,y:50,width:10,height:10,fill:o[19]}),(0,G.jsx)(`rect`,{x:20,y:60,width:10,height:10,fill:o[20]}),(0,G.jsx)(`rect`,{x:20,y:70,width:10,height:10,fill:o[21]}),(0,G.jsx)(`rect`,{x:40,y:10,width:10,height:10,fill:o[22]}),(0,G.jsx)(`rect`,{x:40,y:20,width:10,height:10,fill:o[23]}),(0,G.jsx)(`rect`,{x:40,y:30,width:10,height:10,fill:o[24]}),(0,G.jsx)(`rect`,{x:40,y:40,width:10,height:10,fill:o[25]}),(0,G.jsx)(`rect`,{x:40,y:50,width:10,height:10,fill:o[26]}),(0,G.jsx)(`rect`,{x:40,y:60,width:10,height:10,fill:o[27]}),(0,G.jsx)(`rect`,{x:40,y:70,width:10,height:10,fill:o[28]}),(0,G.jsx)(`rect`,{x:60,y:10,width:10,height:10,fill:o[29]}),(0,G.jsx)(`rect`,{x:60,y:20,width:10,height:10,fill:o[30]}),(0,G.jsx)(`rect`,{x:60,y:30,width:10,height:10,fill:o[31]}),(0,G.jsx)(`rect`,{x:60,y:40,width:10,height:10,fill:o[32]}),(0,G.jsx)(`rect`,{x:60,y:50,width:10,height:10,fill:o[33]}),(0,G.jsx)(`rect`,{x:60,y:60,width:10,height:10,fill:o[34]}),(0,G.jsx)(`rect`,{x:60,y:70,width:10,height:10,fill:o[35]}),(0,G.jsx)(`rect`,{x:10,y:10,width:10,height:10,fill:o[36]}),(0,G.jsx)(`rect`,{x:10,y:20,width:10,height:10,fill:o[37]}),(0,G.jsx)(`rect`,{x:10,y:30,width:10,height:10,fill:o[38]}),(0,G.jsx)(`rect`,{x:10,y:40,width:10,height:10,fill:o[39]}),(0,G.jsx)(`rect`,{x:10,y:50,width:10,height:10,fill:o[40]}),(0,G.jsx)(`rect`,{x:10,y:60,width:10,height:10,fill:o[41]}),(0,G.jsx)(`rect`,{x:10,y:70,width:10,height:10,fill:o[42]}),(0,G.jsx)(`rect`,{x:30,y:10,width:10,height:10,fill:o[43]}),(0,G.jsx)(`rect`,{x:30,y:20,width:10,height:10,fill:o[44]}),(0,G.jsx)(`rect`,{x:30,y:30,width:10,height:10,fill:o[45]}),(0,G.jsx)(`rect`,{x:30,y:40,width:10,height:10,fill:o[46]}),(0,G.jsx)(`rect`,{x:30,y:50,width:10,height:10,fill:o[47]}),(0,G.jsx)(`rect`,{x:30,y:60,width:10,height:10,fill:o[48]}),(0,G.jsx)(`rect`,{x:30,y:70,width:10,height:10,fill:o[49]}),(0,G.jsx)(`rect`,{x:50,y:10,width:10,height:10,fill:o[50]}),(0,G.jsx)(`rect`,{x:50,y:20,width:10,height:10,fill:o[51]}),(0,G.jsx)(`rect`,{x:50,y:30,width:10,height:10,fill:o[52]}),(0,G.jsx)(`rect`,{x:50,y:40,width:10,height:10,fill:o[53]}),(0,G.jsx)(`rect`,{x:50,y:50,width:10,height:10,fill:o[54]}),(0,G.jsx)(`rect`,{x:50,y:60,width:10,height:10,fill:o[55]}),(0,G.jsx)(`rect`,{x:50,y:70,width:10,height:10,fill:o[56]}),(0,G.jsx)(`rect`,{x:70,y:10,width:10,height:10,fill:o[57]}),(0,G.jsx)(`rect`,{x:70,y:20,width:10,height:10,fill:o[58]}),(0,G.jsx)(`rect`,{x:70,y:30,width:10,height:10,fill:o[59]}),(0,G.jsx)(`rect`,{x:70,y:40,width:10,height:10,fill:o[60]}),(0,G.jsx)(`rect`,{x:70,y:50,width:10,height:10,fill:o[61]}),(0,G.jsx)(`rect`,{x:70,y:60,width:10,height:10,fill:o[62]}),(0,G.jsx)(`rect`,{x:70,y:70,width:10,height:10,fill:o[63]})]})]})},yo=36;function bo(e,t){let n=eo(e),r=t&&t.length,i=io(n,t,r),a=ro(n,10,1),o=a<5?a+yo/9:a,s=ro(n,10,2),c=s<5?s+yo/9:s;return{wrapperColor:i,faceColor:ao(i),backgroundColor:io(n+13,t,r),wrapperTranslateX:o,wrapperTranslateY:c,wrapperRotate:ro(n,360),wrapperScale:1+ro(n,yo/12)/10,isMouthOpen:no(n,2),isCircle:no(n,1),eyeSpread:ro(n,5),mouthSpread:ro(n,3),faceRotate:ro(n,10,3),faceTranslateX:o>yo/6?o/2:ro(n,8,1),faceTranslateY:c>yo/6?c/2:ro(n,7,2)}}var xo=({name:e,colors:t,title:n,square:r,size:i,...a})=>{let o=bo(e,t),s=H.useId();return(0,G.jsxs)(`svg`,{viewBox:`0 0 36 36`,fill:`none`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,...a,children:[n&&(0,G.jsx)(`title`,{children:e}),(0,G.jsx)(`mask`,{id:s,maskUnits:`userSpaceOnUse`,x:0,y:0,width:yo,height:yo,children:(0,G.jsx)(`rect`,{width:yo,height:yo,rx:r?void 0:72,fill:`#FFFFFF`})}),(0,G.jsxs)(`g`,{mask:`url(#${s})`,children:[(0,G.jsx)(`rect`,{width:yo,height:yo,fill:o.backgroundColor}),(0,G.jsx)(`rect`,{x:`0`,y:`0`,width:yo,height:yo,transform:`translate(`+o.wrapperTranslateX+` `+o.wrapperTranslateY+`) rotate(`+o.wrapperRotate+` 18 18) scale(`+o.wrapperScale+`)`,fill:o.wrapperColor,rx:o.isCircle?yo:yo/6}),(0,G.jsxs)(`g`,{transform:`translate(`+o.faceTranslateX+` `+o.faceTranslateY+`) rotate(`+o.faceRotate+` 18 18)`,children:[o.isMouthOpen?(0,G.jsx)(`path`,{d:`M15 `+(19+o.mouthSpread)+`c2 1 4 1 6 0`,stroke:o.faceColor,fill:`none`,strokeLinecap:`round`}):(0,G.jsx)(`path`,{d:`M13,`+(19+o.mouthSpread)+` a1,0.75 0 0,0 10,0`,fill:o.faceColor}),(0,G.jsx)(`rect`,{x:14-o.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:`none`,fill:o.faceColor}),(0,G.jsx)(`rect`,{x:20+o.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:`none`,fill:o.faceColor})]})]})]})},So=4,Co=80;function wo(e,t){let n=eo(e),r=t&&t.length;return Array.from({length:So},(e,i)=>io(n+i,t,r))}var To=({name:e,colors:t,title:n,square:r,size:i,...a})=>{let o=wo(e,t),s=e.replace(/\s/g,``),c=H.useId();return(0,G.jsxs)(`svg`,{viewBox:`0 0 80 80`,fill:`none`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,...a,children:[n&&(0,G.jsx)(`title`,{children:e}),(0,G.jsx)(`mask`,{id:c,maskUnits:`userSpaceOnUse`,x:0,y:0,width:Co,height:Co,children:(0,G.jsx)(`rect`,{width:Co,height:Co,rx:r?void 0:160,fill:`#FFFFFF`})}),(0,G.jsxs)(`g`,{mask:`url(#${c})`,children:[(0,G.jsx)(`path`,{fill:`url(#gradient_paint0_linear_`+s+`)`,d:`M0 0h80v40H0z`}),(0,G.jsx)(`path`,{fill:`url(#gradient_paint1_linear_`+s+`)`,d:`M0 40h80v40H0z`})]}),(0,G.jsxs)(`defs`,{children:[(0,G.jsxs)(`linearGradient`,{id:`gradient_paint0_linear_`+s,x1:Co/2,y1:0,x2:Co/2,y2:Co/2,gradientUnits:`userSpaceOnUse`,children:[(0,G.jsx)(`stop`,{stopColor:o[0]}),(0,G.jsx)(`stop`,{offset:1,stopColor:o[1]})]}),(0,G.jsxs)(`linearGradient`,{id:`gradient_paint1_linear_`+s,x1:Co/2,y1:Co/2,x2:Co/2,y2:Co,gradientUnits:`userSpaceOnUse`,children:[(0,G.jsx)(`stop`,{stopColor:o[2]}),(0,G.jsx)(`stop`,{offset:1,stopColor:o[3]})]})]})]})},Eo=3,Do=80;function Oo(e,t){let n=eo(e),r=t&&t.length;return Array.from({length:Eo},(e,i)=>({color:io(n+i,t,r),translateX:ro(n*(i+1),Do/10,1),translateY:ro(n*(i+1),Do/10,2),scale:1.2+ro(n*(i+1),Do/20)/10,rotate:ro(n*(i+1),360,1)}))}var ko=({name:e,colors:t,title:n,square:r,size:i,...a})=>{let o=Oo(e,t),s=H.useId();return(0,G.jsxs)(`svg`,{viewBox:`0 0 80 80`,fill:`none`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,...a,children:[n&&(0,G.jsx)(`title`,{children:e}),(0,G.jsx)(`mask`,{id:s,maskUnits:`userSpaceOnUse`,x:0,y:0,width:Do,height:Do,children:(0,G.jsx)(`rect`,{width:Do,height:Do,rx:r?void 0:160,fill:`#FFFFFF`})}),(0,G.jsxs)(`g`,{mask:`url(#${s})`,children:[(0,G.jsx)(`rect`,{width:Do,height:Do,fill:o[0].color}),(0,G.jsx)(`path`,{filter:`url(#filter_${s})`,d:`M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z`,fill:o[1].color,transform:`translate(`+o[1].translateX+` `+o[1].translateY+`) rotate(`+o[1].rotate+` 40 40) scale(`+o[2].scale+`)`}),(0,G.jsx)(`path`,{filter:`url(#filter_${s})`,style:{mixBlendMode:`overlay`},d:`M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z`,fill:o[2].color,transform:`translate(`+o[2].translateX+` `+o[2].translateY+`) rotate(`+o[2].rotate+` 40 40) scale(`+o[2].scale+`)`})]}),(0,G.jsx)(`defs`,{children:(0,G.jsxs)(`filter`,{id:`filter_${s}`,filterUnits:`userSpaceOnUse`,colorInterpolationFilters:`sRGB`,children:[(0,G.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,G.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,G.jsx)(`feGaussianBlur`,{stdDeviation:7,result:`effect1_foregroundBlur`})]})})]})},Ao={pixel:vo,bauhaus:lo,ring:mo,beam:xo,sunset:To,marble:ko,geometric:xo,abstract:lo},jo=({variant:e=`marble`,colors:t=[`#92A1C6`,`#146A7C`,`#F0AB3D`,`#C271B4`,`#C20D90`],name:n=`Clara Barton`,title:r=!1,size:i=`40px`,square:a=!1,...o})=>{let s=Ao[e]||ko;return(0,G.jsx)(s,{colors:t,name:n,title:r,size:i,square:a,...o})};function Mo({bot:e,size:t=`md`,busy:n}){return(0,G.jsx)(`span`,{"aria-hidden":!0,className:W(`flex shrink-0 overflow-hidden rounded-full bg-muted`,t===`sm`?`h-7 w-7`:`h-9 w-9`,n&&`ring-2 ring-brand/60 ring-offset-1 ring-offset-background animate-pulse`),children:e&&(0,G.jsx)(jo,{name:e.name,variant:`beam`,colors:$a(e.avatarColor),size:`100%`})})}var No=[[0,59],[0,23],[1,31],[1,12],[0,7]];function Po(e,t,n){if(!/^\d+$/u.test(e))return;let r=Number(e);return r>=t&&r<=n?r:void 0}function Fo(e,t,n){let r=new Set;for(let i of e.split(`,`)){let[e,a,o]=i.split(`/`);if(o!==void 0)return;let s=a===void 0?1:Po(a,1,n);if(s===void 0)return;let c,l;if(e===`*`)c=t,l=n;else{let[r,i,o]=e.split(`-`);if(o!==void 0)return;c=Po(r,t,n),l=i===void 0?a===void 0?c:n:Po(i,t,n)}if(c===void 0||l===void 0||c>l)return;for(let e=c;e<=l;e+=s)r.add(e)}return[...r].sort((e,t)=>e-t)}function Io(e){let t=e.trim().split(/\s+/u);if(t.length!==5)return;let n=t.map((e,t)=>Fo(e,...No[t]));if(n.some(e=>e===void 0))return;let[r,i,a,o,s]=n;return{source:t.join(` `),minute:r,hour:i,dayOfMonth:a,month:o,dayOfWeek:[...new Set(s.map(e=>e%7))].sort((e,t)=>e-t),domStar:t[2].startsWith(`*`),dowStar:t[4].startsWith(`*`)}}var Lo=e(Be()),Ro=e=>{let t=e.indexOf(`#`);return t===-1?e:e.slice(0,t)},zo=[`on`,`off`],Bo=[`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],Vo=[`所有人`,`everyone`,`all`],Ho=e=>e.normalize(`NFC`).toLowerCase();function Uo(e){return Array.isArray(e)?e.filter(e=>!!e&&typeof e==`object`&&typeof e.id==`string`&&typeof e.name==`string`&&e.name.length>0):[]}function Wo(e,t){let n=Ho(typeof e==`string`?e.replace(/^@/,``):``);return Uo(t).filter(e=>Ho(e.name).startsWith(n))}var Go=(e,t)=>Number(!!t.pinned)-Number(!!e.pinned)||t.updatedAt-e.updatedAt;function Ko(e,t){let n=new Set(t.filter(e=>!e.archived).map(e=>e.id));return{groups:e.filter(e=>e.kind===`group`).sort(Go),directs:e.filter(e=>e.kind===`direct`&&n.has(e.members[0])).sort(Go)}}function qo(e,t){let n=[e,...t.filter(t=>t.parentId===e.id)];return{current:n.find(t=>t.id===e.activeThreadId)??e,entries:n.map(e=>({id:e.id,title:e.threadTitle??(e.parentId?`新话题`:`主话题`),...e.last?.text?{preview:e.last.text}:{},activityAt:e.last?.at??e.updatedAt,unread:!1,running:e.status!==`idle`}))}}var Jo=400;function Yo(e,t=!1){return e.entries.length<=Jo?e:{...e,entries:t?e.entries.slice(0,Jo):e.entries.slice(-400),hasOlder:!t||e.hasOlder,...t?{history:!0}:{}}}function Xo(e,t,n){return n||t===0?e:e.filter(e=>e.seq>=t)}function Zo(e,t){let n={entries:[...t.entries].sort((e,t)=>e.seq-t.seq),lastSeq:t.lastSeq,hasOlder:t.hasOlder,...t.epochSeq===void 0?{}:{epochSeq:t.epochSeq}};if(e&&t.epochSeq!==void 0){if(t.epochSeq<(e.epochSeq??0))return e;if(t.epochSeq>(e.epochSeq??0)&&t.beforeSeq===void 0)return Yo(n)}if(!e||e.entries.length===0)return Yo(n,t.beforeSeq!==void 0);if(t.beforeSeq===void 0&&e.history)return{...e,lastSeq:Math.max(e.lastSeq,t.lastSeq)};if(t.beforeSeq===void 0&&t.lastSeq<e.lastSeq)return e;let r=e.entries[0].seq;if(t.beforeSeq!==void 0){if(t.beforeSeq!==r)return e}else{let t=e.entries.at(-1)?.seq??0;if((n.entries[0]?.seq??t+1)>t+1)return Yo(n)}let i=new Map(e.entries.map(e=>[e.seq,e]));for(let e of n.entries){let t=i.get(e.seq);e.truncated&&t&&!t.truncated||i.set(e.seq,e)}let a=[...i.values()].sort((e,t)=>e.seq-t.seq),o=(n.entries[0]?.seq??1/0)<r;return Yo({entries:a,lastSeq:Math.max(e.lastSeq,n.lastSeq),hasOlder:t.beforeSeq!==void 0||o?n.hasOlder:e.hasOlder,...e.history?{history:!0}:{},...n.epochSeq===void 0?e.epochSeq===void 0?{}:{epochSeq:e.epochSeq}:{epochSeq:n.epochSeq}},t.beforeSeq!==void 0)}var Qo=/[A-Za-z0-9._%+-]/;function $o(e,t){let n=e.slice(0,t),r=n.lastIndexOf(`@`);if(r<0||r>0&&Qo.test(n[r-1]))return null;let i=n.slice(r+1);return/\s/.test(i)?null:{start:r,query:i}}var es=`__all__`;function ts(e,t){let n=Vo[0],r=Ho(e.replace(/^@/,``));return[...Ho(n).startsWith(r)?[{id:es,name:n}]:[],...Wo(e,t).map(({id:e,name:t})=>({id:e,name:t}))]}function ns(e,t,n,r){let i=`@${r} `;return{text:e.slice(0,t.start)+i+e.slice(n),caret:t.start+i.length}}var rs={approval:`需要审批`,ask:`等你回答`,"delegation-interrupted":`委派中断`,budget:`今日预算已用完`,"routine-draft":`例行任务待批准`,"routine-blocked":`例行任务被阻塞`,"task-blocked":`任务卡住`};function is(e,t){return e.kind===`silence`?`已安静 ${Math.max(0,Math.floor((t-(e.since??t))/1e3))} 秒`:rs[e.kind]}var as={thinking:`思考中`,typing:`输出中`,tool:`调用工具`,retrying:`重试中`},os={turn:`排队 · 等上一轮结束`,capacity:`排队 · 并发已满`,"member-check":`排队 · 正在判断是否可并行`,"member-serial":`排队 · 等待成员当前任务完成`,"member-fifo":`排队 · 等待成员前序任务`,"member-stopping":`排队 · 等待成员停止完成`};function ss(e){return e.state===`queued`?e.reason&&Object.hasOwn(os,e.reason)?os[e.reason]:`排队中`:as[e.state]}function cs(e){let t=e.steps.findLast(e=>e.status===`running`);return t?`${t.name} ${t.detail}`.trim():ss(e)}function ls(e,t){return e.filter(e=>e.chatId===t).sort((e,t)=>Number(e.state===`queued`)-Number(t.state===`queued`))}function us(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m${String(t%60).padStart(2,`0`)}s`:`${Math.floor(n/60)}h${String(n%60).padStart(2,`0`)}m`}var ds={running:`工作中`,queued:`排队中`};function fs(e,t,n){if(n){let r=cs(n),i=t.get(n.botId)?.name;return e.kind===`group`&&i?`${i}:${r}`:r}if(e.status!==`idle`)return ds[e.status];let r=e.last;if(!r)return e.kind===`group`?`${e.members.length} 位成员`:``;let i=r.kind===`human`?`我`:r.botId?t.get(r.botId)?.name:void 0;return i&&e.kind===`group`?`${i}:${r.text}`:r.text}function ps({bots:e,chats:t,activeChatId:n,onSelect:r,inbox:i=[],onDismiss:a,activities:o=[]}){let s=new Map(e.map(e=>[e.id,e])),{groups:c,directs:l}=Ko(t,e),u=e=>{let t=e.kind===`direct`?s.get(e.members[0]):void 0,i=ls(o,e.id)[0],a=i?i.state!==`queued`:e.status===`running`,c=!i&&e.status===`idle`;return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:W(`flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors hover:bg-muted/60`,e.id===n&&`bg-muted`),children:[t?(0,G.jsx)(Mo,{bot:t,busy:a}):(0,G.jsx)(`span`,{className:`flex shrink-0 -space-x-2`,children:e.members.slice(0,3).map(e=>(0,G.jsx)(Mo,{bot:s.get(e),size:`sm`},e))}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`block truncate font-medium text-sm`,children:t?.name??(e.title||`群聊`)}),(0,G.jsx)(`span`,{className:W(`block truncate text-xs`,c?`text-muted-foreground`:`text-brand`),children:fs(e,s,i)||t?.title||`\xA0`})]})]},e.id)};return(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-2`,children:[c.length===0&&l.length===0&&(0,G.jsx)(`p`,{className:`rounded-lg border border-dashed px-3 py-6 text-center text-muted-foreground text-sm`,children:`桌面端还没有 Bot 聊天`}),i.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`p`,{className:`px-2 py-1.5 font-medium text-muted-foreground text-xs`,children:[`收件箱 · `,i.length]}),i.map(e=>{let t=e.botId?s.get(e.botId):void 0,n=e.ownerBotId?s.get(e.ownerBotId):void 0;return(0,G.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-2 py-2`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:!e.chatId,onClick:()=>e.chatId&&r(e.chatId),className:`flex min-w-0 flex-1 items-center gap-2.5 text-left`,children:[(0,G.jsx)(Mo,{bot:t}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`span`,{className:`block truncate font-medium text-sm`,children:[t?.name??`成员`,n?` 替 ${n.name}`:``,(0,G.jsx)(`span`,{className:`ml-1.5 font-normal text-brand text-xs`,children:is(e,Date.now())})]}),(0,G.jsx)(`span`,{className:`block truncate text-muted-foreground text-xs`,children:e.text||`\xA0`})]})]}),e.dismissible&&a&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>a(e.key),className:`shrink-0 rounded px-2 py-1 text-muted-foreground text-xs hover:bg-muted`,children:`忽略`})]},e.key)})]}),c.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`px-2 py-1.5 font-medium text-muted-foreground text-xs`,children:`群聊`}),c.map(u)]}),l.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`px-2 py-1.5 font-medium text-muted-foreground text-xs`,children:`成员`}),l.map(u)]})]}),(0,G.jsx)(`p`,{className:`shrink-0 px-3 py-2 text-center text-[11px] text-muted-foreground`,children:`新建成员 / 群聊、例行任务请在桌面端管理`})]})}var ms=class{send;generation=0;active=null;pending=null;constructor(e){this.send=e}start(e,t){if(this.active)return this.active;let n=this.generation,r=(async()=>{let r=await this.request(e);return n===this.generation?r.needsConfirmation===!0?t()?this.request(e,!0):null:r:{...r,ok:!1,error:`offline`}})().finally(()=>{this.active===r&&(this.active=null)});return this.active=r,r}receive(e){e.requestId===this.pending?.requestId&&e.chatId===this.pending.chatId&&this.pending.settle(e)}reset(){this.generation++;let e=this.pending;e&&e.settle({type:`bot-new-session-result`,chatId:e.chatId,requestId:e.requestId,ok:!1,error:`offline`}),this.active=null}request(e,t=!1){let n=crypto.randomUUID();return new Promise(r=>{let i=setTimeout(()=>this.receive({type:`bot-new-session-result`,chatId:e,requestId:n,ok:!1,error:`timeout`}),6e4);this.pending={chatId:e,requestId:n,settle:e=>{clearTimeout(i),this.pending=null,r(e)}};try{this.send({type:`bot-new-session`,chatId:e,requestId:n,...t?{confirmed:!0}:{}})}catch{this.receive({type:`bot-new-session-result`,chatId:e,requestId:n,ok:!1,error:`offline`})}})}},hs=15e3,gs=class{send;pending=null;constructor(e){this.send=e}request(e){let t=crypto.randomUUID(),n=n=>({type:`bot-thread-result`,chatId:e.chatId,requestId:t,ok:!1,error:n});return this.pending?Promise.resolve(n(`busy`)):new Promise(r=>{let i=setTimeout(()=>this.receive(n(`timeout`)),hs);this.pending={chatId:e.chatId,requestId:t,settle:e=>{clearTimeout(i),this.pending=null,r(e)}};try{this.send({...e,requestId:t})}catch{this.receive(n(`offline`))}})}receive(e){e.requestId===this.pending?.requestId&&e.chatId===this.pending.chatId&&this.pending.settle(e)}reset(){let e=this.pending;e&&e.settle({type:`bot-thread-result`,chatId:e.chatId,requestId:e.requestId,ok:!1,error:`offline`})}};function _s(e){return/^(.+)\/\d+$/.exec(e)?.[1]}var vs=e=>_s(e)!==void 0,ys={Contacts:`联系方式`,"From Telegram":`来自 Telegram`,"From {{name}}":`来自 {{name}}`,"Not set up":`未配置`,"Waiting to bind":`等待绑定`,"Enable {{name}}":`启用{{name}}`,"Push to this channel":`主动推送`,"Milestones, questions from the secretary, cards and approval notices go out here.":`里程碑、秘书的提问、确认卡与审批提示会推到这里。`,"Confirm cards from the phone":`手机确认卡`,"Off by default. Approvals are never handled from the phone.":`默认关闭。审批永远不能在手机上处理。`,'Off by default. Reply "confirm 1" to confirm a card. Approvals are never handled from the phone.':`默认关闭。回复「确认 1」确认对应的卡;审批永远不能在手机上处理。`,"Mirror every reply":`同步镜像`,"Off by default. Every reply in the secretary conversation is sent here, not just milestones.":`默认关闭。秘书会话里每一轮回复都发到这里,不只是里程碑。`,"Allow viewing memory titles":`允许查看记忆标题`,"No buttons: questions and cards arrive as numbered text.":`没有按钮:提问和确认卡会变成编号文本。`,"Cannot edit sent messages: answered questions are not marked there.":`不能改已发出的消息:答过的提问不会在这里标记。`,"No typing indicator.":`不显示「正在输入」。`,"The Telegram remote plugin (enso.telegram) is enabled. Do not give both the same bot token: only one place can poll a bot, so they would steal each other's messages.":`已启用 Telegram 远程插件(enso.telegram)。两边不要用同一个 bot token:一个 bot 只能有一处在轮询,会互相抢消息。`,"Enable contacts":`启用联系方式`,"Contacts are off: nothing is sent or received on any channel.":`联系方式已关闭:所有渠道都不收不发。`,"Find more contact channels in the plugin market":`从插件市场找更多联系方式`,"Reach the secretary from your phone. Milestones go out; your replies come back.":`不在电脑前也能找到秘书:里程碑推到手机,你在手机上回话就是跟秘书说话。`,"Telegram returned an error":`Telegram 返回了一个错误`,"Cannot reach api.telegram.org. Check the proxy.":`连不上 api.telegram.org,检查代理。`,"Bound to @{{username}}":`已绑定 @{{username}}`,"Bot @{{bot}}":`机器人 @{{bot}}`,"Send a test message":`发一条测试消息`,"Test message sent":`测试消息已发出`,Unbind:`解绑`,"Change bot":`更换 bot`,"Allow confirming cards from Telegram":`允许从 Telegram 确认卡片`,"On by default. A tap on your phone can confirm settings, skill, tool, takeover and cleanup cards. Those cards change which projects the secretary sees, what it may take over, which skills and tools it installs and what it cleans up. Approvals are never handled from Telegram.":`默认打开:手机上的一个按钮就能确认设置、技能、工具、接管与清理卡片——这些卡片能改秘书的可见项目、接管范围,装 skill 和工具,也能清理分支与会话。审批无论如何都不能从 Telegram 处理。`,"No system keychain available: the bot token is stored unencrypted on this machine.":`系统钥匙串不可用:bot token 会以明文存在这台机器上。`,"Bot verified":`bot 已校验`,"Open the bot and press Start":`打开 bot 点 Start`,"Binding QR code":`绑定二维码`,"Binding code":`绑定码`,"Valid for {{minutes}} more minutes":`还有 {{minutes}} 分钟有效`,"Open @{{bot}}":`打开 @{{bot}}`,"Copy link":`复制链接`,"Link copied":`链接已复制`,"New code":`重新生成`,"The code works once, in a private chat with this bot only.":`这个码只能用一次,且只在这个 bot 的私聊里有效。`,"Create a bot with @BotFather":`找 @BotFather 建一个 bot`,"Send /newbot, pick a name, and copy the token it gives you.":`发 /newbot,起个名字,把它给的 token 复制过来。`,"Open @BotFather":`打开 @BotFather`,"Paste the bot token":`粘贴 bot token`,"Verify and continue":`校验并继续`,"Bind again with @{{bot}}":`用 @{{bot}} 重新绑定`,"The token is stored with the system keychain and never written to logs.":`token 存在系统钥匙串里,不会写进日志。`,"That does not look like a bot token":`这不像一个 bot token`,"Telegram rejected this token":`Telegram 拒绝了这个 token`,"Paste a bot token first":`先粘贴 bot token`,"Not bound yet":`还没绑定`,"No secretary conversation is available":`没有可用的秘书会话`,"Could not reach the secretary session":`没能把消息送到秘书会话`,"Not allowed from this window":`这个窗口没有权限`,Privacy:`隐私`,"Privacy masking":`隐私脱敏`,"Replace API keys and personal data with placeholders before requests leave this device, and restore them in replies. Original values stay in memory on this device only.":`请求离开本机前把 API Key 和个人信息换成占位符,回复中自动还原。原值只保存在本机内存里。`,"Applies to chats, compaction, bot members and helper requests.":`作用于会话、压缩、Bot 成员和各类辅助请求。`,Secrets:`密钥`,"API keys, tokens, private keys, passwords in URLs and config files.":`API Key、令牌、私钥、URL 和配置文件里的密码。`,"Detect secrets":`识别密钥`,"Recommended. Covers common vendor key formats.":`建议开启,覆盖常见厂商的 key 格式。`,"Send look-alike keys":`发送形似的假 key`,"Replace keys with fake keys of the same format instead of placeholders, so the model treats them as real keys.":`用格式相同的假 key 代替占位符,模型会把它当成真 key 处理。`,"Personal data":`个人信息`,"Detect personal data":`识别个人信息`,"Matches are validated (checksums, real domains) to limit false hits.":`命中会做校验(校验位、真实域名),减少误伤。`,Mask:`脱敏`,"Warn only":`只提醒`,Block:`拦截`,Email:`邮箱`,"Phone number":`手机号`,"ID card number":`身份证号`,"Bank card number":`银行卡号`,"IP address":`IP 地址`,"Custom rules":`自定义规则`,Words:`词语`,"One per line, case-insensitive. Project codenames, customer names…":`每行一个,不区分大小写。项目代号、客户名称等。`,"Prefixes or patterns":`前缀或正则`,"One per line. A prefix like corp_ or a regex like /INC-\\d{4}/i.":`每行一个。可以是前缀如 corp_,或正则如 /INC-\\d{4}/i。`,"Allow list":`允许名单`,"Never mask":`从不脱敏`,"Exact values, one per line. Team emails, test keys…":`完整值,每行一个。团队邮箱、测试 key 等。`,"Try it":`试一试`,"Runs locally. Nothing is remembered or sent anywhere.":`只在本地运行,不记住也不发送任何内容。`,"Paste some text, e.g. an .env file":`粘贴一段文本,例如 .env 文件`,"Nothing matched":`没有命中`,Records:`记录`,"Requested at":`请求时间`,"Auxiliary request":`辅助请求`,Compaction:`压缩`,Hits:`命中`,"Request blocked":`请求已拦截`,"No records yet":`暂无记录`,"Your message":`你的消息`,"Tool output":`工具输出`,"Tool arguments":`工具参数`,"Earlier replies":`之前的回复`,"Tool descriptions":`工具说明`,"Restored {{count}} in the reply":`回复中已还原 {{count}} 处`,"{{count}} values":`{{count}} 个值`,"Privacy masking blocks {{kinds}}. Remove it, or change the action or allow list in Settings → Privacy.":`隐私脱敏拦截了 {{kinds}}。请删掉它,或到「设置 → 隐私」调整动作或允许名单。`,"Will be blocked: {{kinds}}":`将被拦截:{{kinds}}`,"Emails, phone numbers, ID and bank card numbers, IP addresses.":`邮箱、手机号、身份证号、银行卡号、IP 地址。`,"Words and patterns specific to your work.":`与你的工作相关的词语和格式。`,"{{count}} will be masked":`发送时将脱敏 {{count}} 项`,"Classification only, not for chat":`仅用于分类,不能聊天`,"ChatGPT account selected":`已选择 ChatGPT 账号`,"ChatGPT account switched":`ChatGPT 账号已接替`,"ChatGPT account selected: {{account}}":`已选择 ChatGPT 账号:{{account}}`,"ChatGPT account switched: {{previous}} → {{current}}":`ChatGPT 账号已接替:{{previous}} → {{current}}`,"ChatGPT (automatic failover)":`ChatGPT(自动接替)`,"Create ChatGPT account pool":`创建 ChatGPT 自动接替池`,"Pool members":`接替账号`,"Use enabled, signed-in accounts in the listed order. Model and reasoning stay unchanged. Main agents and subagents share this pool.":`按列表顺序使用已启用且已登录的账号。模型和推理设置保持不变,主代理与子代理共用此池。`,"Account disabled":`账号已停用`,"Account signed out":`账号未登录`,"Pool entries do not show a single account quota. Fixed-account entries remain unchanged.":`自动接替池不显示单个账号额度,固定账号条目保持不变。`,"This reply can no longer be retried. Please send your request again.":`这条回复已无法重试,请重新发送需求。`,"Chat image storage is full (200MiB). Message not sent.":`群图片空间已满(200MiB),这条消息未发送。`,"An image is still over 10MiB after compression. Message not sent.":`图片压缩后仍超过 10MiB,这条消息未发送。`,"An attachment is not a supported image. Message not sent.":`附件不是支持的图片格式,这条消息未发送。`,"Could not save the images. Message not sent. Please try again.":`图片保存失败,这条消息未发送,请重试。`,"Add to favorites":`添加收藏`,Appearance:`外观`,"Bold font weight":`粗体字重`,"Terminal shell":`终端 Shell`,"System default":`系统默认`,"Applies to new side panel terminals. SSH projects keep the remote login shell.":`仅对新开的侧边栏终端生效。SSH 项目仍用远端登录 shell。`,"Worktree root directory":`Worktree 根目录`,"Where isolated session worktrees are created. Leave empty to use the app data directory. Existing worktrees stay where they are.":`隔离会话的 worktree 建在此目录下。留空则用应用数据目录。已有 worktree 不迁移。`,"Default location":`默认位置`,"Enter an absolute path":`请输入绝对路径`,"Choose interface theme":`选择界面主题`,"Accent color":`强调色`,"Highlight color used across the interface":`界面高亮使用的颜色`,"Follow theme":`跟随主题`,Theme:`主题`,"Built-in and plugin themes; each one is a set of color tokens":`内置与插件主题,每个主题是一组颜色 token`,"Plugin · {{name}}":`插件 · {{name}}`,"Get more themes":`获取更多主题`,Personalization:`个性化`,"Applied on top of any theme":`在任意主题之上覆盖`,"Used for running state, checkmarks and plan mode":`用于运行状态、勾选与计划模式`,"Custom CSS":`自定义 CSS`,"Inject user.css into every window; saved changes apply immediately":`把 user.css 注入所有窗口,保存即生效`,"Open user.css":`打开 user.css`,"Cannot open user.css":`无法打开 user.css`,Violet:`紫罗兰`,Indigo:`靛蓝`,Teal:`青绿`,Amber:`琥珀`,Graphite:`石墨`,"Color scheme":`配色方案`,Dark:`深色`,Font:`字体`,"Font size":`字号`,"Font weight":`字重`,General:`通用`,"General application settings":`应用通用设置`,"File opening":`文件打开`,"Context menu opening":`右键打开方式`,"File manager":`文件管理器`,"VS Code":`VS Code`,"Change application":`更换应用`,"Configure list":`配置列表`,"Add application":`添加应用`,"Open in {{app}}":`在 {{app}} 中打开`,"No opening methods enabled":`未启用打开方式`,"You can configure up to 32 opening methods.":`最多可配置 32 项打开方式。`,"Select the opening methods shown in file link context menus. You can add multiple applications.":`勾选文件链接右键菜单中显示的打开方式,可添加多个应用。`,"Configure how local workspace file links open by extension.":`按扩展名配置本地工作区文件链接的打开方式。`,"By default, supported files open inside EnsoCode; other files are revealed in the file manager.":`默认在 EnsoCode 内打开支持的文件,其他文件在文件管理器中显示。`,"Executable and installer files are always revealed in the file manager.":`可执行文件和安装包始终在文件管理器中显示。`,"File extension":`文件扩展名`,"Open inside EnsoCode":`在 EnsoCode 内打开`,"Reveal in file manager":`在文件管理器中显示`,"System default application":`系统默认应用`,"Selected application":`指定应用`,"Choose application":`选择应用`,"The selected application path is invalid.":`所选应用路径无效。`,"VS Code is unavailable. Install it or select another application.":`未找到 VS Code,请安装或选择其他应用。`,"Enter a valid file extension, for example .md.":`请输入有效的文件扩展名,例如 .md。`,"This extension does not support internal preview.":`此扩展名不支持内部预览。`,"Choose an application before saving this rule.":`保存此规则前请选择应用。`,"This extension already has an opening rule.":`此扩展名已有打开规则。`,"Image preview":`图片预览`,"Unable to preview this image.":`无法预览此图片。`,"Open in code editor":`用代码编辑器打开`,"Image is too large. Click to load.":`图片过大,点击加载`,"Actual size":`原始尺寸`,"Fit to window":`适应窗口`,"This file format cannot be previewed inside EnsoCode.":`此文件格式无法在 EnsoCode 内预览。`,"The image is too large to preview.":`图片过大,无法预览。`,Updates:`更新`,"Application update settings":`应用更新设置`,"Current version":`当前版本`,"Check for updates":`检查更新`,"Checking for updates…":`正在检查更新…`,"New version {{version}} found":`发现新版本 {{version}}`,"You are on the latest version":`已是最新版本`,"Downloading update… {{percent}}%":`正在下载更新… {{percent}}%`,"New version {{version}} is downloaded. Restarting waits for the current tool to finish; background commands keep running.":`新版本 {{version}} 已下载。重启会在当前工具结束后进行,转到后台的命令会接着跑。`,"Update check failed":`检查更新失败`,"Restart to update":`重启更新`,"Restart to update is already in progress. Please wait.":`正在重启更新,请稍候`,"No downloaded update to install. Check for updates again.":`没有已下载的更新可安装,请重新检查更新`,"Restart to update failed: {{error}}. Try Restart to update again in a moment; if it still fails, quit EnsoCode completely and reopen it.":`重启更新失败:{{error}}。请稍后再点一次「重启更新」;仍不行就完全退出 EnsoCode 再重新打开`,"{{count}} conversation(s) interrupted by app exit":`{{count}} 个会话因应用退出被中断,已在会话里说明原因`,"Update failed: {{error}}":`更新失败:{{error}}`,"Download update":`下载更新`,"New version {{version}} found. This local build can't install it automatically.":`发现新版本 {{version}},本地构建无法自动安装,请手动下载。`,"This local build is signed differently from the release and can't install updates automatically. Download it manually.":`本地构建与正式版签名不一致,无法自动安装更新,请手动下载。`,"Open release page":`打开 Release 页面`,"Download DMG":`下载 DMG`,"Release notes":`更新日志`,"What's new in {{version}}":`{{version}} 更新内容`,"No release notes provided.":`此版本未提供更新日志。`,Restart:`重启`,"Restarting…":`正在重启…`,"Waiting for running commands to restart…":`等命令跑完再重启…`,"Waiting for the current command to finish":`正在等当前命令结束`,"Waiting for the current reply to finish":`正在等这一轮回复写完`,"Running {{tool}}":`正在执行 {{tool}}`,"A subagent is running {{tool}}":`子代理正在执行 {{tool}}`,"Writing a reply":`正在写回复`,"A subagent is writing a reply":`子代理正在写回复`,"Opening the session":`正在打开会话`,"A subagent is opening the session":`子代理正在打开会话`,"A background command is still running":`转到后台的命令还在跑`,"A subagent still has a background command running":`子代理转到后台的命令还在跑`,"Finishing the turn":`正在收尾这一回合`,"A subagent is finishing the turn":`子代理正在收尾这一回合`,"{{count}} more sessions":`还有 {{count}} 个会话`," · waiting for {{count}} sessions":` · 等 {{count}} 个会话`,"Interrupted by a restart, continued below":`因重启中断,已在下方接着写`,"Show the interrupted part":`展开查看`,"Hide the interrupted part":`收起`,"A session is still writing its reply. EnsoCode waits up to {{minutes}} minutes; if it stops producing output for more than {{idle}} seconds, it is stopped first and continues automatically after the restart.":`有会话的回复还在写,最多等 {{minutes}} 分钟;停止输出超过 {{idle}} 秒就先停下,重启后自动接着写。`,"Restarting EnsoCode…":`正在重启 EnsoCode…`,"Restoring sessions…":`正在恢复会话…`,"EnsoCode will restart once the current command finishes.":`当前命令结束后再重启 EnsoCode。`,"EnsoCode will install the update once the current command finishes.":`当前命令结束后再安装更新。`,"EnsoCode will quit once the current command finishes.":`当前命令结束后再退出 EnsoCode。`,"A command moved to the background cannot keep running without EnsoCode (for example a remote or Windows command), so EnsoCode waits for it.":`有转到后台的命令没法脱离 EnsoCode 继续跑(如远程会话或 Windows 上的命令),所以要等它结束。`,"Force quit":`强制退出`,"Restarting once the current command finishes":`等当前命令结束后重启`,"Installing the update once the current command finishes":`等当前命令结束后安装更新`,"Quitting once the current command finishes":`等当前命令结束后退出`,"Restart failed: {{error}}":`重启失败:{{error}}`,"Restart server":`重启服务端`,"Restart server?":`重启服务端?`,"Running tasks are interrupted; this page reconnects after the server is back.":`正在运行的任务会被中断,服务端起来后本页会自动重连。`,"Server updates install the new version with npm and restart.":`服务端(npm 全局安装):用 npm 安装新版本后重启。`,"This server must be updated on the machine itself.":`这台服务端无法远程更新,请在服务器上执行 npm i -g @ensocode/server。`,"Automatic updates":`自动更新`,"Download and install updates automatically":`自动下载并安装更新`,"Restart automatically to apply updates":`自动重启以应用更新`,"When idle":`空闲时`,"Don't wait for idle":`不等空闲`,"Only notify when an update is ready; never restart automatically.":`更新下载完成后只提示,不自动重启。`,"Restart as soon as the update is downloaded, even while agents are running or messages are queued. The restart happens after the current tool finishes, and running sessions keep going afterwards. It still waits while you're using the window (input in the last 2 minutes), while an input box has an unsent draft, or while a question or approval is pending.":`更新下载完成后就重启,有 agent 在跑、有排队消息也不等。重启会在当前工具结束后进行,在跑的会话重启后接着跑。你正在用窗口(2 分钟内有键盘或鼠标输入)、输入框里有未发送的草稿、或者有待回答/待审批时先等。`,"Update channel":`更新渠道`,Stable:`稳定版`,Beta:`内测版`,"Only stable releases.":`只接收正式发布的稳定版。`,"Beta builds come from the latest main branch and may be unstable. You get whichever of beta and stable is newer.":`内测版由 main 分支最新代码自动构建,可能不稳定;内测版和稳定版里哪个更新就更新到哪个。`,"You're on a beta build. Switching to stable doesn't downgrade; you'll move to the next stable release once it's out.":`当前装的是内测版。切回稳定版不会降级,等下一个稳定版发布后自动更新过去。`,"After the update is downloaded, restart automatically if no agent is running, nothing is queued, and there are no pending questions or approvals. The idle state must last 5 minutes, and a focused window also blocks it.":`更新下载完成后,没有 agent 在跑、没有排队消息、也没有待回答/待审批时自动重启。该状态需连续保持 5 分钟;窗口在前台时也会拦住。`,"Network proxy":`网络代理`,"Used by model requests, the built-in browser, and agent tools":`作用于模型请求、内嵌浏览器和 agent 工具`,"Proxy mode":`代理模式`,"Follow system proxy":`跟随系统代理`,"No proxy":`不使用代理`,"Custom proxy":`自定义代理`,"Proxy URL":`代理地址`,"Enter an http(s) proxy URL":`请输入 http(s) 代理地址`,"Custom CA certificate":`自定义 CA 证书`,"Trust an extra CA (PEM file) for model endpoints signed by a private CA. TLS verification stays on.":`为私有 CA 签发的模型接口额外信任一个 CA(PEM 文件),TLS 校验保持开启。`,"Choose certificate file":`选择证书文件`,"Set: {{path}}":`已设置:{{path}}`,"Using NODE_EXTRA_CA_CERTS from the launch environment: {{path}}":`已使用启动环境中的 NODE_EXTRA_CA_CERTS(优先于此设置):{{path}}`,"Not set; using NODE_EXTRA_CA_CERTS from the login shell: {{path}}":`未设置,使用登录 shell 中的 NODE_EXTRA_CA_CERTS:{{path}}`,"Certificate file unavailable ({{reason}}): {{path}}":`证书文件不可用({{reason}}):{{path}}`,"Path must be absolute":`须为绝对路径`,"File not found":`文件不存在`,"Not a file":`不是文件`,"File is not readable":`文件不可读`,"Changes restart the agent process right away (running turns are interrupted). Requests made by the app main process take effect after restarting the app.":`修改后会立即重启 Agent 进程(进行中的回合会中断);主进程侧需重启应用生效。`,Shortcuts:`快捷键`,"Click a shortcut to rebind it. Backspace removes it; Esc cancels.":`点击键位改绑。Backspace 删除;Esc 取消。`,"Remove shortcut":`删除快捷键`,"No shortcut":`无快捷键`,"Toggle sidebar":`折叠/展开侧栏`,"Open settings":`打开设置`,"Switch model":`切换模型`,"Focus chat input":`聚焦输入框`,"Find in conversation":`在对话中查找`,"Search workspace":`搜索工作区`,"Search anything":`搜索任意内容`,"Search conversations...":`搜索会话...`,"Search conversations, browser tabs, settings…":`搜索对话、浏览器标签、设置…`,"Search all projects":`搜索全部项目`,"Switch scope":`切换范围`,Navigate:`选择`,Open:`打开`,"No matching results":`没有匹配结果`,Conversations:`对话`,"This project":`当前项目`,"All projects":`全部项目`,"Include archived":`含归档`,Current:`当前`,Recent:`最近`,"No projects active in the last {{n}} days":`最近 {{n}} 天没有活跃项目`,"No projects in this group yet":`这个分组还没有项目`,Actions:`动作`,"No matching conversations":`没有匹配的会话`,"Search messages...":`搜索消息...`,"Only when the chat input is focused":`仅在输入框聚焦时生效`,"Send message":`发送消息`,"Next coworker tab":`下一个 coworker 标签`,"Previous coworker tab":`上一个 coworker 标签`,"Press shortcut…":`按下新快捷键…`,'Already used by "{{label}}"':`已被「{{label}}」占用`,"Reset to default":`恢复默认`,Language:`语言`,"Windows local command shell":`Windows 本地命令壳`,"Only the Windows local agent command tool. SSH and other platforms stay on bash. Takes effect on the next session.":`只影响 Windows 本机 agent 命令工具。SSH 与其它平台仍用 bash。下次开会话生效。`,"Windows default (PowerShell)":`Windows 默认(PowerShell)`,PowerShell:`PowerShell`,"Git Bash":`Git Bash`,Light:`浅色`,"No favorite themes yet. Click the heart icon to add favorites.":`暂无收藏主题。点击爱心图标添加收藏。`,"No themes found":`未找到主题`,Preview:`预览`,"Remove from favorites":`取消收藏`,"Search themes...":`搜索主题...`,Settings:`设置`,"Search settings":`搜索设置`,Application:`应用`,"Models & agents":`模型与智能体`,"Tools & extensions":`工具与扩展`,Connections:`连接`,"Show favorites only":`只显示收藏`,"Sync terminal theme":`同步终端主题`,System:`系统`,Terminal:`终端`,"Conversation display":`对话显示`,"Conversation typography":`会话排版`,"Headings, tables and inline code scale with the body text":`标题、表格与行内代码按正文比例缩放`,Body:`正文`,"Heading 1":`一级标题`,"Heading 2":`二级标题`,"Heading 3":`三级标题`,"Heading 4–6":`四到六级标题`,Table:`表格`,"Inline code":`行内代码`,"Code block":`代码块`,"Reset to defaults":`恢复默认`,"Agent runtime":`Agent 运行`,"Sessions & worktrees":`会话与 Worktree`,"Collaboration & planning":`协作与规划`,Web:`联网`,Execution:`执行`,"Context & memory":`上下文与记忆`,Safety:`安全`,Changes:`改动`,Session:`会话`,Git:`Git`,"Git views":`Git 视图`,"Staged changes":`已暂存`,"Unstaged changes":`未暂存`,"Untracked changes":`未跟踪`,"Changed files":`改动文件`,"List view":`列表视图`,"Tree view":`树状视图`,"Collapse list":`收起列表`,"Expand list":`展开列表`,"No matching files.":`没有匹配的文件。`,Stage:`暂存`,Unstage:`取消暂存`,"Stage all":`暂存全部`,"Unstage all":`取消全部暂存`,"Discard changes":`丢弃修改`,"Delete untracked file":`删除未跟踪文件`,"Delete untracked file {{path}} permanently?":`永久删除未跟踪文件 {{path}}?`,"Restore {{path}} to its staged version? Unstaged changes will be lost.":`将 {{path}} 恢复为暂存版本?未暂存的修改将丢失。`,"Commit message":`提交信息`,"Enter commit message…":`输入提交信息…`,"{{count}} staged files":`已暂存 {{count}} 个文件`,Commit:`提交`,Fetch:`获取远程更新`,Pull:`拉取`,Push:`推送`,"No upstream":`未关联上游`,"No upstream branch configured.":`当前分支未关联上游分支。`,"Working tree clean.":`工作区没有改动。`,"Filter changed files…":`筛选改动文件…`,"Workspace is changing. Please wait.":`工作区正在切换,请稍候。`,"Could not read Git status.":`读取 Git 状态失败。`,"Could not complete the Git operation.":`Git 操作失败。`,"Could not load Git history.":`加载提交历史失败。`,"Could not load the changed files.":`加载改动文件失败。`,"Could not load the diff.":`加载差异失败。`,"Could not load the diff viewer.":`加载差异查看器失败。`,"Select a file to view its diff.":`选择文件查看差异。`,"No text changes to display.":`没有可显示的文本差异。`,"Only line endings changed.":`仅换行符发生变化。`,"No commits yet.":`暂无提交。`,"No file changes in this commit.":`该提交没有文件改动。`,"Load more commits":`加载更多提交`,added:`新增`,modified:`修改`,deleted:`删除`,untracked:`未跟踪`,conflicted:`冲突`,Browser:`浏览器`,"New tab":`新建标签页`,"Pin as default tab":`固定为默认标签页`,"Show in all sessions":`在所有会话中显示`,"Unpin default tab":`取消固定默认标签页`,Soon:`即将支持`,Forward:`前进`,"Enter a URL":`输入网址`,"Navigation failed":`导航失败`,"Agent is browsing":`Agent 正在操作`,"Take control":`接管`,"Enso is in control":`Enso 正在接管`,"Toggle Developer Tools":`开关开发者工具`,"Toggle Design Mode":`开关圈选模式`,"Selected UI element":`圈选的界面元素`,"No Composer for this selection":`没有可接收圈选的输入框`,"Add to conversation":`添加到对话`,"Browser data":`浏览器数据`,"RTK command compression":`RTK 命令压缩`,"Compress supported command output before it enters the model context. Takes effect on new conversations.":`在受支持的命令输出进入模型上下文前进行压缩。新会话生效。`,"Protected action confirmation":`受保护操作确认`,"Even in full-access mode, ask before external sends, deletions, payments, deployments and secret-file access. Always on for Bot members not set to Full access. Takes effect on new conversations.":`即使在完全放行模式下,对外发送、删除、付款、部署和访问密钥文件前也要求确认。非完全放行的 Bot 成员始终开启。新会话生效。`,"Protected actions will not ask for confirmation either.":`受保护操作也不再询问。`,"Protected: external send":`受保护:对外发送`,"Protected: delete":`受保护:删除`,"Protected: payment":`受保护:付款`,"Protected: deploy / production":`受保护:部署 / 生产`,"Protected: secrets":`受保护:密钥`,"Protected: destructive command":`受保护:破坏性命令`,"dcg: {{reason}}":`dcg:{{reason}}`,"Destructive command guard (dcg)":`破坏性命令守卫(dcg)`,"Check bash and PowerShell commands with dcg before running. Matches such as git reset --hard or recursive deletes always require your confirmation, even in full-access mode. Takes effect on new conversations.":`执行 bash 和 PowerShell 命令前先用 dcg 检查。命中 git reset --hard、递归删除等危险命令时,即使在完全放行模式下也必须由你确认。新会话生效。`,"Not available on this platform":`当前平台不可用`,"Installed v{{version}}":`已安装 v{{version}}`,"Not installed":`未安装`,Install:`安装`,Uninstall:`卸载`,OK:`好`,Integrations:`集成`,"Install 'enso' Command in PATH":`在 PATH 中安装 enso 命令`,"Install Finder Quick Action":`安装访达快速操作`,"'enso' terminal command":`enso 终端命令`,"Finder Quick Action":`访达快速操作`,"Couldn't install the 'enso' command":`无法安装 enso 命令`,"Shell command 'enso' installed in {{dir}}.":`已在 {{dir}} 安装 enso 命令。`,"Run `enso .` in a terminal to open the current folder in EnsoCode.":"在终端运行 `enso .` 即可用 EnsoCode 打开当前目录。","Run `enso .` in a terminal to open the current folder in EnsoCode. Links the command into /usr/local/bin and may ask for your password.":"在终端运行 `enso .` 即可用 EnsoCode 打开当前目录。会把命令链接到 /usr/local/bin,可能需要输入密码。","Couldn't install the Finder Quick Action":`无法安装访达快速操作`,"Finder Quick Action installed.":`访达快速操作已安装。`,"Right-click a folder in Finder and choose Services > Open with EnsoCode.":`在访达中右键文件夹,选择「服务」>「用 EnsoCode 打开」。`,"Installing…":`安装中…`,"Operation failed":`操作失败`,"Install dcg":`安装 dcg`,"Downloads dcg v{{version}} from its GitHub release and verifies the checksum. dcg is a third-party tool, not part of EnsoCode.":`从 GitHub Release 下载 dcg v{{version}} 并校验 sha256。dcg 是第三方工具,不属于 EnsoCode。`,"dcg is licensed under MIT with an additional rider: no rights are granted to OpenAI, Anthropic, their affiliates, or anyone acting on their behalf. Install only if this restriction does not apply to you.":`dcg 使用附加限制条款的 MIT 许可证:不授予 OpenAI、Anthropic 及其关联方或代表它们行事的任何人任何权利。仅在该限制不适用于你时安装。`,"Agree and install":`同意并安装`,"Memory write":`记忆写入`,"Secrets redacted":`已脱敏密钥`,"Memory writes awaiting approval":`待批准的记忆写入`,"Bot members need your approval before writing to project or global memory.":`Bot 成员写入项目或全局记忆前需要你批准。`,Compressed:`已压缩`,Unchanged:`未改变`,"Background task started":`后台任务已启动`,Bypassed:`已绕过`,Unavailable:`不可用`,"This is the startup receipt; see the task_output result for final statistics.":`此处为启动回执,最终统计见 task_output 的结果。`,"~{{count}} tokens saved":`约节省 {{count}} tokens`,"Input estimate":`输入估算`,"Output estimate":`输出估算`,"{{count}} tokens":`{{count}} tokens`,Reason:`原因`,"Cookies and site storage of the built-in browser, separate from the app itself.":`内嵌浏览器的 Cookie 与站点存储,与应用本身隔离。`,"Open chat links in the built-in browser":`对话链接在内嵌浏览器打开`,"Clicking a web link in chat opens it in the side panel browser. {{key}}+Click opens it in the external browser.":`点击对话里的网页链接会在侧栏内嵌浏览器打开;{{key}}+点击在外部浏览器打开。`,"{{key}}+Click to open in external browser":`{{key}}+点击在外部浏览器打开`,Cleared:`已清除`,"Clear cookies":`清除 Cookie`,"Clear cache":`清除缓存`,"Clear all browsing data":`清除全部浏览数据`,"Enter a URL above, or let the agent open a page with browser_navigate.":`在上方输入网址,或让 agent 用 browser_navigate 打开页面。`,"Search...":`搜索…`,"Case sensitive":`区分大小写`,"Whole word":`全词匹配`,"Regular expression":`正则`,"Previous match":`上一个`,"Next match":`下一个`,"Use full chat width":`铺满两侧`,"Use reading width":`恢复两侧留白`,"Toggle side panel":`折叠/展开右侧面板`,"Toggle side panel fullscreen":`右侧面板全屏`,"Toggle minimize to tray":`切换最小化到托盘`,"Works while the app is in the tray":`应用在托盘时也能切换`,"Expand side panel":`全屏右侧面板`,"Exit side panel fullscreen":`退出右侧面板全屏`,"New terminal tab":`新建终端标签`,"New terminal when the side panel is focused; otherwise new conversation":`焦点在右侧边栏时新建终端,否则新建会话`,"Close terminal tab":`关闭终端标签`,"Collapse side panel":`折叠右侧面板`,"Select a conversation to use the side panel.":`选择一个会话后使用右侧面板。`,"No tabs yet. Create one to get started.":`还没有标签页,新建一个开始使用。`,"Open Changes when files are edited":`有文件改动时打开 Changes`,"Automatically show the side panel Changes tab after the agent edits a file":`Agent 改文件后自动打开右侧 Changes`,"Open in side panel":`在侧栏打开`,"Compact read-only tool calls":`精简只读工具调用`,"Expand file edits while running":`运行中自动展开文件改动`,"Automatically unfold diffs or written content from file modification tools while the agent is still running":`agent 运行中,文件修改工具的 diff 或写入内容自动展开`,"Expand reasoning while streaming":`流式推理时自动展开`,"Automatically unfold the thinking block while the model is still reasoning. It collapses again when reasoning ends.":`模型思考时自动展开推理内容;思考结束后仍自动收起`,"Context compaction strategy":`上下文压缩策略`,"Standard uses default compact. Smart compaction uses Enso verified summary at compact time. Codex native compaction additionally stores an official Codex checkpoint on Codex models and uses smart compaction otherwise. Continuous memory records observations in the background so compact keeps more context; all fall back to default compact on failure. Switching strategy takes effect on the next session. The summary model and compaction mode apply to open conversations on the next compaction.":`标准使用默认压缩。智能压缩在压缩时用 Enso 验证式摘要。Codex 原生压缩在 Codex 模型上额外保存官方 Codex checkpoint,其他模型按智能压缩处理。持续记忆在后台持续记录观察,压缩时保留更多上下文;失败都回退默认压缩。切换策略从下一个会话生效。摘要模型和压缩档位对已打开的对话在下一次压缩时用最新设置。`,Standard:`标准`,"Smart compaction":`智能压缩`,"Codex native compaction":`Codex 原生压缩`,"Continuous memory (experimental)":`持续记忆(实验性)`,"Summary model":`摘要模型`,"Background memory model":`后台记忆模型`,"Compaction mode":`压缩档位`,"Auto (by usage)":`自动(按占用)`,Fast:`快速`,Balanced:`均衡`,Thorough:`详尽`,"Mode changes summary budget and how much recent tail to keep. It does not decide whether compact runs.":`档位只影响摘要细致和留多长尾巴,不决定是否压缩。`,"Follows the session model":`跟随当前会话模型`,"Follow session model":`改跟会话模型`,"Selected model is unavailable — falls back to the session model.":`所选模型已不可用——将回退到当前会话模型。`,"Show read/grep/find/ls as one-line rows and fold consecutive tool calls while the agent is still running":`read/grep/find/ls 显示为单行,agent 运行中也折叠连续的工具调用`,"Auto-collapse previous turns":`自动折叠历史轮次`,"Collapse activity after reply":`回答完成后折叠过程`,"Collapse finished activity while replying":`过程中折叠已完成的调用`,"Wait before folding":`折叠前等待`,"Seconds to wait after tools and thinking finish":`工具和思考都结束后再等这么多秒`,sec:`秒`,"Pin unfinished todos":`固定显示未完成待办`,"Show active sessions in the title bar":`在顶栏显示活跃会话`,"Show active conversations as tabs above the conversation. Hold ⌘/Ctrl to see number shortcuts. Hidden while Bot mode is enabled.":`在对话区上方以标签显示活跃中的会话,按住 ⌘/Ctrl 显示数字快捷键。开启 Bot 模式时不显示。`,"Also show recent conversations":`同时显示最近会话`,"Remove from title bar":`移出顶栏`,"Conversations with messages within this window. Off shows only Active ones.":`这段时间内有过消息的会话;关闭则只显示活跃中的会话。`,"Turn marks":`轮次刻度`,"Marks along the conversation for each turn. Hover to preview, click to jump. Hidden when the chat uses the full width.":`对话旁边的轮次刻度。悬停预览,点击跳转。聊天铺满宽度时不显示。`,Left:`左`,Right:`右`,"Keep the latest todo list above the input while it has unfinished items, so it does not scroll away with the timeline":`最新任务清单还有未完成项时,固定显示在输入框上方,不随时间线滚走`,"Hide until the todo list updates":`隐藏,清单更新后再显示`,"When a reply finishes, fold consecutive thinking and tool calls (including edits and commands) into one summary row; failed calls stay visible":`回答结束后,把连续的思考和工具调用(包括编辑、命令)折成一行摘要;失败的调用仍单独显示`,"While a reply is still running, wait a moment after tools and thinking finish, then fold that stretch into one row. Calls still running stay visible, and failed calls stay visible":`回答还在进行时,工具和思考都结束后稍等片刻,把这一段折成一行。正在跑的调用不收,失败的调用仍单独显示`,"Worked for {{duration}}":`已工作 {{duration}}`,"Patrol clear":`巡检正常`,"Update seen":`已查看`,"Continue goal: {{summary}}":`继续目标:{{summary}}`,"Scheduled: {{summary}}":`定时:{{summary}}`,"Session updates":`会话更新`,"Session updates: {{summary}}":`会话更新:{{summary}}`,"{{count}} thinking steps":`{{count}} 段思考`,Activity:`过程`,"After you send a new message, fold earlier turns down to the question, timestamp and duration; the latest turn stays expanded":`发送新消息后,之前的轮次只保留提问、时间与用时;最后一轮保持展开`,"Notify only for the main agent":`仅主 agent 发送完成通知`,"Skip coworker completion and failure notifications on this computer and the paired phone. Questions and approvals still notify.":`coworker 的回合完成和失败不弹桌面或手机通知。提问和审批仍会提醒。`,"Stop if no output":`无输出则停止`,"Abort and retry the run when no tokens or tool results arrive for this long. Thinking counts as output.":`超过此时长没有 token 或工具结果就中止并重试。思考输出也算有输出。`,Never:`永不`,"{{count}} min":`{{count}} 分钟`,"Compaction reserve tokens":`压缩预留 token`,"Decision models only allow or block when highly confident. Everything else asks you.":`决策模型只在把握很高时才自动放行或拦截,其余都交给你审批。`,"The assistant approval classifier is unavailable.":`助手代审的决策模型不可用。`,"Auto-manage approvals":`全自动托管`,"Auto-allow threshold":`自动放行阈值`,"0.85 (looser)":`0.85(偏松)`,"0.9 (default)":`0.9(默认)`,"0.95 (stricter)":`0.95(偏严)`,"Only runs automatically when the allow probability reaches this value. Operations near the threshold may be allowed one time and not the next.":`放行概率达到该值才自动执行。概率在阈值附近的操作,可能这次放行、下次不放行。`,"Auto-managed: runs only when the decision model is highly confident it is safe. Everything else is denied and the agent tries another way. Protected actions still ask you.":`托管中:只有决策模型高度确信安全的操作才会执行,其余直接拒绝,由 AI 换一种做法继续。受保护操作仍会问你。`,"Auto-managed · allowed":`托管 · 已放行`,"Auto-managed · denied":`托管 · 已拒绝`,"Read-only":`只读`,"Regenerable output":`可再生成`,"Reversible workspace change":`工作区内可回退的改动`,"Possible data loss":`可能丢失数据`,"Changes system state":`改动系统状态`,"Sends data externally":`向外发送数据`,"Unclear target or intent":`目标或意图不明`,"Auto-managed review timed out. Please decide.":`托管判定超时,请你来决定。`,"Auto-managed review failed. Please decide.":`托管判定出错,请你来决定。`,"Auto-managed review returned no valid decision. Please decide.":`托管判定结果无效,请你来决定。`,"Compaction runs when context exceeds the model window minus this value. Larger values compact earlier. Do not set it close to the window of small-context models, or every request compacts first. Leave empty for the default.":`上下文超过「模型窗口 − 此值」时触发压缩,值越大压缩越早。小窗口模型请勿设得过大,接近窗口会导致每次请求前都先压缩。留空使用默认值。`,"Enter a whole number between {{min}} and {{max}}, or leave it empty.":`请输入 {{min}} 到 {{max}} 之间的整数,或留空。`,"Could not save. Check that pi-agent/settings.json is valid JSON.":`保存失败,请检查 pi-agent/settings.json 是否为合法 JSON。`,"Keep in Active after last message":`活跃中留存时长`,"Stays in Active for about {{count}} more min":`活跃中还会保留约 {{count}} 分钟`,"Viewed conversations stay in Active for this long after their last message or your last open while still in Active, then leave. Unviewed ones stay until you open them.":`从最后一条消息或在「活跃中」时最后一次点开算起,此时长内即使已查看也保留,超时后移出;未查看的仍保留到你点开。`,"Auto-retry on transient errors":`瞬态错误自动重试`,"Retry with backoff (up to 60s apart) after 429, 5xx or network errors. Quota and billing errors are never retried. Unlimited keeps retrying until you cancel.":`遇到 429、5xx 或网络错误时退避重试(间隔最长 60 秒)。额度与计费错误不重试。选「无限」会一直重试,直到手动取消。`,"Retry count after 429, 5xx or network errors; off, fixed count or unlimited":`429、5xx 或网络错误后的重试次数:关闭、固定次数或无限`,"Long prompt cache (1 hour)":`长缓存(1 小时)`,"Keep the prompt cache for 1 hour instead of 5 minutes. Saves a lot when turns are more than 5 minutes apart, since the cache no longer expires and gets rewritten every turn, but cache writes cost 2× instead of 1.25×, so rapid follow-ups tens of seconds apart cost more. Anthropic models only. Applies from the next request.":`把 prompt 缓存有效期从 5 分钟延长到 1 小时。轮次间隔超过 5 分钟时能省很多(缓存不再每轮过期重写),但缓存写入单价从 1.25× 涨到 2×,间隔几十秒的快速连续追问反而更贵。仅对 Anthropic 系模型生效,从下一次请求起生效。`,Unlimited:`无限`,"{{count}} times":`{{count}} 次`,"{{count}} day":`{{count}} 天`,"{{count}} days":`{{count}} 天`,"Archive idle conversations":`归档闲置会话`,"Move conversations that have been idle this long into Archived. Does not delete them.":`将闲置超过此天数的会话移入已归档,不会删除。`,"Clean up merged worktrees":`清理已合并 worktree`,"When archiving idle conversations, also remove isolated worktrees that are merged and clean.":`归档闲置会话时,一并清理已合并且干净的隔离 worktree。`,"Delete archived conversations after":`归档超过此天数后删除`,"Permanently delete conversations that have been archived longer than this. This cannot be undone. Choosing a positive value deletes already-overdue archived conversations immediately.":`永久删除归档超过此天数的会话,不可恢复。改成正数会立即删除已超期的归档。`,"No output for {{minutes}} minutes — retrying":`{{minutes}} 分钟没有输出,正在重试`,"Stopped after repeated stalls":`多次卡住后已停止`,"No file changes in this conversation yet.":`本会话还没有文件改动。`,"No changes relative to HEAD.":`相对 HEAD 没有改动。`,"Collapse all":`全部折叠`,"Expand all":`全部展开`,"Not a git repository.":`不是 git 仓库。`,"Git diff is not available for this workspace.":`当前工作区不支持 Git diff。`,"Terminal appearance":`终端外观`,"Theme mode":`主题模式`,"Background image":`背景图`,"Show a custom image behind the interface":`在界面背后显示自定义背景图`,"The current theme has its own background. Turn this on to replace it with your image.":`当前主题自带背景,开启后用你的图片替换`,"Source type":`来源类型`,"Single image":`单张图片`,"Folder (random)":`文件夹(随机)`,"Remote URL":`网络图片`,"Image path":`图片路径`,"Folder path":`文件夹路径`,"Image URL":`图片地址`,"Auto switch":`自动切换`,seconds:`秒`,"Refresh now":`立即刷新`,"Background visibility":`背景可见度`,"Composer opacity":`输入框不透明度`,"Border opacity":`边框不透明度`,"Code block opacity":`代码块不透明度`,Blur:`模糊`,Brightness:`亮度`,Saturation:`饱和度`,Overlay:`遮罩`,"Size mode":`填充方式`,Cover:`覆盖`,Contain:`完整显示`,Repeat:`平铺`,Center:`居中原图`,Search:`搜索`,"No results":`无匹配结果`,"Semantic similarity":`语义相似度`,"Preset is locked after the conversation starts":`对话开始后预设已锁定,不能中途替换`,Path:`路径`,"Welcome to EnsoCode":`欢迎使用 EnsoCode`,"Import your providers and assets from local AI apps to get started. You can skip any step.":`从本地 AI 应用导入模型服务与资源即可开始,每一步都可跳过。`,"Sign in with a provider subscription, or import API providers from local AI apps":`使用订阅账号登录,或从本地 AI 应用导入 API 服务`,"Import skills from Claude Code, Codex or Cursor":`从 Claude Code、Codex 或 Cursor 导入技能`,"Scan and import":`扫描并导入`,"{{count}} imported":`已导入 {{count}} 个`,"All set":`全部就绪`,"You can always import more from Settings later.":`之后随时可在设置里导入更多。`,Back:`上一步`,Skip:`跳过`,Next:`下一步`,"Get started":`开始`,Close:`关闭`,Minimize:`最小化`,Maximize:`最大化`,Restore:`还原`,"No new providers imported":`没有新导入的模型服务`,"Fetch models for each provider, then enable the ones you want.":`为每个模型服务拉取模型,再启用你需要的。`,"Fetch failed":`拉取失败`,"No models yet":`暂无模型,点击拉取`,"Bundle skills, MCP servers and an instruction file into a preset (optional)":`把技能、MCP 服务和一份指令组合成预设(可选)`,"Give subagents their own model, skills and MCP servers (optional)":`为子代理配置专属模型、技能与 MCP 服务(可选)`,"{{count}} presets":`已有 {{count}} 个预设`,"Model Providers":`模型中心`,"Automatically fetch models":`自动拉取模型`,"Model fetch interval":`拉取间隔`,"This interval applies when automatic fetching is enabled for this provider.":`开启此供应商的自动拉取后,按此间隔拉取模型。`,"Enter a whole number from {{min}} to {{max}} hours.":`请输入 {{min}}–{{max}} 小时之间的整数。`,hours:`小时`,"Last fetched {{time}}":`上次拉取成功:{{time}}`,"Last fetch failed {{time}}":`上次拉取失败:{{time}}`,"Manage model API providers for this app":`管理应用的模型 API 服务`,"Import from local apps":`从本地应用导入`,"Scan providers configured in local AI apps and import them.":`扫描本机 AI 应用中已配置的模型服务并导入。`,"Scanning local apps...":`正在扫描本地应用...`,"Scan failed":`扫描失败`,Rescan:`重新扫描`,"No local apps detected":`未检测到本地应用`,"Supported: Claude Code, Codex, CC Switch, Alma, Cherry Studio, Hermes, OpenClaw, Grok CLI, Cursor":`支持:Claude Code、Codex、CC Switch、Alma、Cherry Studio、Hermes、OpenClaw、Grok CLI、Cursor`,"No importable providers found":`未发现可导入的模型服务`,"Already exists":`已存在`,"{{count}} models":`{{count}} 个模型`,"{{count}} selected":`已选 {{count}} 项`,"Import selected":`导入所选`,Done:`完成`,"No providers yet":`暂无模型服务`,"Import providers from local apps or add one manually to get started":`从本地应用导入或手动添加模型服务以开始使用`,"Add provider":`添加服务`,"Add Provider":`添加模型服务`,"Subscription login":`订阅登录`,"Sign in with provider subscriptions (SuperGrok, Claude Pro, ChatGPT, etc.)":`使用订阅账号登录(SuperGrok、Claude Pro、ChatGPT 等)`,"Add account":`添加账号`,"{{count}} accounts":`{{count}} 个账号`,"Log out":`退出登录`,"Starting login...":`正在启动登录…`,"Complete authorization in your browser":`请在浏览器中完成授权`,"Open authorization page":`打开授权页面`,"Enter code":`输入代码`,"Verifying...":`正在验证…`,"resets {{time}}":`{{time}} 重置`,Submit:`提交`,"Edit Provider":`编辑模型服务`,Name:`名称`,"API Type":`API 类型`,"Base URL":`Base URL`,"API Key":`API Key`,Models:`模型`,"Add a model id":`添加模型 ID`,"Filter models...":`筛选模型...`,"Filter skills...":`筛选技能...`,"Filter MCP servers...":`筛选 MCP...`,"Filter projects...":`筛选项目...`,"No models match":`没有匹配的模型`,"Enable all":`全部启用`,"Disable all":`全部禁用`,Enable:`启用`,Disable:`禁用`,"Select all":`全选`,"Deselect all":`全不选`,"{{enabled}}/{{total}} enabled":`已启用 {{enabled}}/{{total}}`,"Fetch models":`拉取模型`,"Fetch all models":`拉取全部模型`,"Refresh model info":`刷新模型信息`,"Refresh all models and info":`拉取全部模型与模型信息`,"Model info updated":`模型信息已更新`,"Model info refresh failed, using cache":`模型信息刷新失败,仍使用缓存`,"Model info refresh failed":`模型信息刷新失败`,"Fetched {{count}} providers":`已拉取 {{count}} 个模型服务`,"{{ok}} succeeded, {{failed}} failed":`{{ok}} 个成功,{{failed}} 个失败`,"Sync failed ({{failed}})":`同步失败({{failed}} 个)`,"Skipped {{count}} disabled providers":`已跳过 {{count}} 个未启用的模型服务`,"No enabled providers to sync":`没有已启用的模型服务可同步`,"Test connection":`测试连接`,Authorize:`授权`,Authorizing:`授权中...`,"Revoke authorization":`取消授权`,Connecting:`连接中`,"Not authorized":`未授权`,"Authorized, pending connection":`已授权,待连接`,"Authorized. Conversations that already include this server can use it on the next message.":`已授权。已包含该服务器的对话,下一条消息即可使用。`,"New sessions only":`新会话生效`,"Open sessions keep the previous setting; it applies once you start a new session.":`已打开的会话保持原设置,新建会话后生效。`,"Settings without this tag take effect immediately.":`没有此标签的设置修改后立即生效。`,"Isolated sandbox switches between script and tool-search mode, so open sessions keep the mode they started with.":`隔离沙箱决定会话用脚本模式还是工具检索模式,已打开的会话保持启动时的模式。`,"The / menu updates right away, but open sessions keep the skills they loaded. Start a new session to load the change.":`输入框的 / 菜单会立即更新,但已打开的会话仍使用原来加载的技能,新建会话后才会加载改动。`,"The file panel and terminal use the change right away. Agents in open sessions keep the previous connection settings.":`文件面板和终端立即使用新配置;已打开会话里的代理仍使用原来的连接配置。`,"Newly enabled models can be picked right away. After changing a key or address, an open session uses it once you switch its model or start a new session.":`新启用的模型可以立即选用;修改 API Key 或地址后,已打开的会话需切换一次模型或新建会话才会使用。`,"Always loaded":`常驻`,"On demand":`按需`,"Load mode":`加载方式`,"On demand: tool descriptions are not preloaded into context; the model connects through the mcp tool when needed. Suits servers with many or rarely used tools. Takes effect in new conversations.":`按需:不预先把工具说明放进上下文,模型用到时经 mcp 工具连接;适合工具多、不常用的 server。新会话生效。`,"{{count}} tools":`{{count}} 个工具`,Fetching:`拉取中...`,Testing:`测试中...`,"Fetched {{count}} models":`拉取到 {{count}} 个模型`,"Connected ({{ms}}ms)":`连接成功({{ms}}ms)`,"Connection failed":`连接失败`,Cancel:`取消`,"Confirm exit":`确认退出`,"Exit closes the app completely, so your phone can no longer connect. Minimize to tray keeps the app running in the background so your phone can still connect.":`退出会完全关闭应用,手机将无法连接。最小化到托盘后应用会在后台继续运行,手机仍可连接。`,"Minimize to tray":`最小化到托盘`,Exit:`退出`,"Add a provider subscription or API Key, or import providers from local AI apps":`添加提供商订阅或 API Key,也可从本地 AI 应用导入模型服务`,"Add model or provider":`添加模型 / 提供商`,"Import providers from local apps or use the unified setup to get started":`从本地应用导入模型服务,或使用统一向导开始配置`,"Choose a provider first. You will select subscription or API Key next.":`请先选择提供商,下一步再选择订阅或 API Key。`,"Choose how to connect":`选择连接方式`,Subscription:`订阅`,"Provider subscription":`提供商订阅`,"ChatGPT (PI login)":`ChatGPT(PI 登录)`,"Sign in in your browser and use your subscription account.":`在浏览器中登录并使用订阅账号。`,"Configure an endpoint and key, then fetch or test its models.":`配置端点和密钥后,再拉取或测试模型。`,"Authorization failed":`授权失败`,"Authorizing {{provider}}":`正在授权 {{provider}}`,"Enter this code in your browser":`请在浏览器中输入此代码`,"Enter the code in your browser":`请在浏览器中输入代码`,"Open authorization page again":`重新打开授权页面`,"Cancel authorization":`取消授权`,"Subscription authorization":`订阅授权`,"No subscription account connected":`尚未连接订阅账号`,"Authorize this provider to add its available models.":`授权此提供商,以添加其可用模型。`,"Connect subscription":`连接订阅`,"Add another account":`添加其他账号`,"Import from Codex":`从 Codex 导入`,"Codex login not found. Sign in to Codex Desktop or CLI first.":`未找到 Codex 登录态,请先在 Codex Desktop 或 CLI 中登录。`,"Codex is not signed in with a ChatGPT account.":`Codex 未使用 ChatGPT 账号登录。`,"This ChatGPT account is already connected.":`该 ChatGPT 账号已连接。`,"Resets {{time}}":`{{time}} 后重置`,Local:`本地`,"Default model":`默认模型`,"Used for new conversations.":`用于普通新对话。`,"Follow last selection":`跟随最后一次选择`,"New conversations use the last model you picked.":`新对话使用你上次选择的模型。`,"Used for new conversations in this project.":`用于本项目的新对话。`,"Used for new conversations in this group.":`用于本组的新对话。`,"Project settings":`项目设置`,"Default model for {{name}}":`{{name}} 的默认模型`,"Follows group, then global default":`跟随分组默认,再跟随全局默认`,"Follows the global default":`跟随全局默认`,"Follow global built-in tools":`跟随全局内置工具`,"When off, configure built-in tools for this project. They override the global setting on the next session.":`关闭后可为本项目单独配置内置工具,优先级高于全局,下次会话生效。`,"Session choice overrides the project default.":`会话里手动选的模型优先于项目默认。`,"Conversation title summary":`会话标题总结`,"Generate a short AI title from the first message of a new conversation.":`新会话发出首条消息后,用 AI 自动生成简短标题。`,"Follows the default model":`跟随默认模型`,"Follow default model":`改跟默认模型`,"Use the default model":`使用默认模型`,"Summarizing title":`标题总结中`,"Title summary failed":`标题总结失败`,"Click to retry":`点击重试`,"Selected model is unavailable — falls back to the default model.":`所选模型已不可用——将回退到默认模型。`,"No default model":`未设置默认模型`,"No usable models":`没有可用模型`,"Image generation":`生图模型`,"Default image generation model":`默认生图模型`,"Selected image generation model is unavailable":`所选生图模型不可用,请检查模型标记、启用状态和 API Key。`,"Generate images with the configured image model and save them to the session scratch directory":`使用默认生图模型生成图片,并保存到会话专属目录。`,"No image generation models available":`没有可用的图像生成模型`,"Enable a model and configure valid provider credentials first.":`请先启用模型并配置有效的提供商凭证。`,"Default model changed: {{previous}} → {{next}}":`默认模型已更改:{{previous}} → {{next}}`,"Subscription credentials are loading. API-key models remain available.":`正在加载订阅凭证,API Key 模型仍可使用。`,"Subscription credentials could not be loaded: {{error}}":`无法加载订阅凭证:{{error}}`,"Subscription credentials are loading. Choose an API-key model or wait, then retry.":`正在加载订阅凭证。请选择 API Key 模型,或等待加载完成后重试。`,"Subscription credentials could not be loaded. Choose an API-key model or retry the credential refresh.":`无法加载订阅凭证。请选择 API Key 模型,或重新加载凭证。`,"Choose a model for this conversation or set a global default before sending.":`发送前请为此对话选择模型,或设置全局默认模型。`,"Choose a model for this conversation or set a project, group, or global default before sending.":`发送前请为此对话选择模型,或设置项目、分组或全局默认模型。`,"No usable model is available. Configure provider credentials and enable a model first.":`没有可用模型。请先配置提供商凭证并启用模型。`,Agent:`Agent`,Agents:`Agent`,File:`文件`,Files:`文件`,Folder:`文件夹`,"Open a file from the tree.":`从左侧树打开文件。`,"This file is too large to open in the editor.":`文件太大,无法在编辑器中打开。`,"This file changed on disk.":`磁盘上的文件已更改。`,Reload:`重新加载`,"Send to conversation":`发送到对话`,"New File":`新文件`,"New Folder":`新建文件夹`,"Copy Path":`复制路径`,"Copy Relative Path":`复制相对路径`,"View File":`查看文件`,"Open in Browser":`在浏览器中打开`,"Open Markdown Preview":`打开 Markdown 预览`,"View Source":`查看源码`,"Reveal in Finder":`在访达中显示`,"Open in Finder":`在访达中打开`,"Open in File Explorer":`在资源管理器中打开`,"Open in File Manager":`在文件管理器中打开`,Editors:`编辑器`,Terminals:`终端`,"Open Containing Folder":`打开所在文件夹`,"Reveal in File Explorer":`在资源管理器中显示`,"This file is outside the workspace and was not written by this conversation. Show it anyway?":`该文件在工作区外,且不是本会话写入的。仍要在文件管理器中显示吗?`,"A file or folder with that name already exists.":`已存在同名文件或文件夹。`,"Invalid name.":`名称无效。`,"Could not complete the file action.":`无法完成该文件操作。`,"Search needs ripgrep (rg). Install it and make sure it is on PATH.":`搜索依赖 ripgrep(rg):请安装并确保它在 PATH 里。`,"Search timed out. Try a more specific query or a smaller folder.":`搜索超时,请换更具体的关键词或缩小目录范围。`,"Could not open local file link":`无法打开本地文件链接`,"The link is outside the current workspace.":`链接位于当前工作区之外。`,"This link is not available on the local computer.":`此链接不在本机工作区中,无法打开。`,"The linked file or folder is unavailable.":`链接的文件或文件夹不可用。`,"Delete {{name}} permanently?":`永久删除 {{name}}?`,"Close others":`关闭其他`,"Close tabs to the right":`关闭右侧标签页`,"Close saved":`关闭已保存`,"Close all":`关闭所有`,"Force close others":`强制关闭其他`,"Force close all":`强制关闭所有`,"Unsaved changes":`未保存的更改`,"This file has unsaved changes. Close anyway?":`此文件有未保存的更改,仍要关闭吗?`,"Some files have unsaved changes. Close anyway?":`有文件未保存,仍要关闭吗?`,Chat:`会话`,Chats:`过去会话`,"Remove chat reference":`移除会话引用`,"Mention suggestions":`提及建议`,"Command suggestions":`命令建议`,"Plugin suggestions":`插件建议`,"Plugin is not enabled":`插件未启用`,Configure:`配置`,"Set (leave blank to keep)":`已设置(留空保持不变)`,"Not set":`未设置`,"Clear value":`清除`,"Saved. New calls use it right away.":`已保存,新的调用立即生效。`,"Host MCP tools it may call":`可调用的宿主 MCP 工具`,"Type @ to choose a file or Agent":`输入 @ 选择文件或 Agent`,Recipient:`接收者`,"Remove Agent recipient":`移除 Agent 接收者`,"Message the selected Agent…":`向所选 Agent 发送消息…`,"Send only to the selected Agent":`仅发送给所选 Agent`,Send:`发送`,"Create or select a project to start a conversation":`创建或选择一个项目以开始对话`,"Compact view":`精简版`,"The built-in browser is not available in full view. Check it on the computer.":`完整版暂不支持内置浏览器,请在电脑上查看。`,Locked:`已锁定`,"This Agent name is reserved":`此 Agent 名称为系统保留名称`,"Fast read-only recon; returns compressed findings":`快速只读调研,返回精简结论`,"Implements a self-contained coding subtask end to end":`端到端实现自包含编码子任务`,"Reviews code or diffs; read-only, returns prioritized issues":`只读审查代码或差异,并按优先级返回问题`,"Dispatched to":`已派发给`,"From plugin {{name}}":`来自插件 {{name}}`,Completed:`已完成`,Failed:`失败`,succeeded:`已成功`,denied:`已拒绝`,running:`进行中`,done:`已完成`,failed:`失败`,unavailable:`不可用`,cancelled:`已取消`,"The conversation binding expired. Retry.":`对话绑定已过期,请重试。`,"The selected Agent type is no longer available.":`所选 Agent 类型已不可用。`,"Model credentials could not be verified.":`无法验证模型凭证。`,"The parent model is unavailable.":`父会话模型不可用。`,"The Agent type is unavailable.":`Agent 类型不可用。`,"Coworker limit reached (active or reserved).":`已达到容量上限(正在运行或已预留的 coworker)。`,"Failed to spawn parent container.":`无法启动父会话容器。`,"Failed to spawn child Agent.":`无法启动子 Agent。`,"Agent worker exited before ready.":`Agent worker 在就绪前退出。`,"Agent session was rejected before ready.":`Agent 会话在就绪前被拒绝。`,"Agent session ready handshake timed out.":`Agent 会话就绪握手超时。`,"Parent ready model did not match the bound model.":`父会话就绪模型与绑定模型不匹配。`,"Child ready identity mismatch.":`子 Agent 就绪身份不匹配。`,"Child ready profile or model mismatch.":`子 Agent 就绪配置或模型不匹配。`,"Failed to prompt child Agent.":`无法向子 Agent 发送任务。`,"Failed to record dispatch.":`无法记录派发结果。`,Target:`目标`,Provider:`提供商`,Account:`账号`,Coworker:`队员`,"Could not load subscription providers":`无法加载订阅提供商`,Save:`保存`,Skills:`技能`,Skill:`技能`,"Skills registered by reference; files stay in their original location":`以引用方式登记,文件仍留在原应用目录`,"No skills yet":`暂无技能`,"Import skills from Claude Code, Codex or Cursor to get started":`从 Claude Code、Codex 或 Cursor 导入技能以开始使用`,"Import skills from local apps":`从本地应用导入技能`,"MCP Servers":`MCP 服务器`,"Model Context Protocol servers available to this app":`应用可用的 MCP 服务器`,"No MCP servers yet":`暂无 MCP 服务器`,"Import MCP servers configured in local AI apps":`导入本机 AI 应用中已配置的 MCP 服务器`,"Import MCP servers from local apps or add one manually to get started":`从本地应用导入或手动添加 MCP 服务器以开始使用`,"Add MCP server":`添加 MCP`,"Add MCP Server":`添加 MCP 服务器`,"Edit MCP Server":`编辑 MCP 服务器`,Transport:`传输方式`,Command:`命令`,"Arguments (one per line)":`参数(每行一条)`,"Environment variables (KEY=VALUE, one per line)":`环境变量(KEY=VALUE,每行一条)`,"Headers (Name: value, one per line)":`请求头(Name: value,每行一条)`,URL:`URL`,"Connection timeout (seconds)":`连接超时(秒)`,"Tool call timeout (seconds)":`工具调用超时(秒)`,"Description (optional)":`描述(可选)`,"One line telling the model what this server is for":`一句话告诉模型这个服务器的用途`,"OAuth client name (optional)":`OAuth 客户端名称(可选)`,"For servers that only accept known OAuth clients":`用于只接受已知 OAuth 客户端的服务器`,"OAuth authorization server metadata URL (optional)":`OAuth 授权服务器元数据地址(可选)`,"Use when the server advertises a wrong authorization server or none":`服务器声明的授权服务器不对或没有声明时填写`,"This MCP server already exists":`该 MCP 服务器已存在`,"Import MCP servers":`导入 MCP 服务器`,Form:`表单`,JSON:`JSON`,"JSON configuration":`JSON 配置`,Format:`格式化`,"Format failed: {{error}}":`格式化失败:{{error}}`,"Generated code is already formatted":`设计器生成的代码已是规范格式`,"Invalid JSON":`JSON 格式错误`,"No MCP servers found in JSON":`JSON 中没有有效的 MCP 服务器`,"JSON must describe a single MCP server":`JSON 只能描述一台 MCP 服务器`,"JSON must describe a single MCP server to switch to the form":`切回表单时 JSON 只能描述一台 MCP 服务器`,"Paste a server object or mcpServers JSON from Cursor / Claude Desktop":`可粘贴单台配置,或 Cursor / Claude Desktop 的 mcpServers JSON`,"Scan local AI apps and register the entries you want to reuse.":`扫描本机 AI 应用,登记你想复用的条目。`,"Nothing importable found":`未发现可导入的条目`,"{{count}} env vars":`{{count}} 个环境变量`,"Imported {{count}} entries":`已导入 {{count}} 项`,"Instruction Files":`指令文件`,Phone:`手机`,"Use your phone as a second screen. Keep this app running.":`把手机当作第二块屏幕。需保持本应用运行。`,"Pair a phone":`配对手机`,"Cancel pairing":`取消配对`,"Failed to start pairing":`发起配对失败`,"Scan with your phone camera":`用手机相机扫码`,"The code expires in 60 seconds and can only be used once.":`配对码 60 秒后失效,且只能使用一次。`,"Pairing QR code":`配对二维码`,"Expires in {{seconds}}s · single use":`{{seconds}} 秒后失效 · 仅可用一次`,"Code expired":`配对码已失效`,"Scanning opens the app and pairs it. To keep it handy, add it to your home screen.":`扫码即可打开并完成配对。想常用的话,打开后添加到主屏幕。`,"Paired devices":`已配对设备`,"No paired devices":`暂无已配对设备`,"Pair a phone to view sessions and reply on the go.":`配对手机后即可随时查看会话并回复。`,"Secure storage is unavailable on this system, so pairing keys are stored unencrypted.":`当前系统不支持安全存储,配对密钥将以未加密方式保存。`,"Waiting for phone":`等待手机`,Online:`在线`,Offline:`离线`,"Relay server":`中继服务器`,"The relay only forwards encrypted frames and cannot read your messages.":`中继只转发密文,无法读取你的消息内容。`,"Global CLAUDE.md / AGENTS.md style files from local AI tools":`本机 AI 工具的全局 CLAUDE.md / AGENTS.md 类文件`,"No instruction files yet":`暂无指令文件`,"Only one file is active at a time; enabling one disables the others":`同一时间仅一份生效(注入会话);启用一份会自动关闭其余`,"Import global instruction files configured in local AI tools":`导入本机 AI 工具中已配置的全局指令文件`,"Import instruction files from local apps or add one manually to get started":`从本地应用导入或手动添加指令文件以开始使用`,"Add instruction":`添加指令`,"Add Instruction":`添加指令文件`,"An instruction with this name already exists":`已有同名指令文件`,"Import instruction files":`导入指令文件`,"Same content":`内容相同`,"Same name":`同名`,"Edit Instruction":`编辑指令文件`,Content:`内容`,"Loading...":`加载中...`,Linked:`链接`,"Local copy":`本地副本`,"Local copy — edits stay in this app.":`本地副本 —— 修改只保存在应用内。`,"Write back to original file":`直接修改原文件`,"Saving creates a local copy — {{path}} is left untouched, and this entry stops following its updates.":`保存后会复制一份到应用内 —— {{path}} 不会被改动,此条目也将不再跟随其更新。`,"Saving overwrites {{path}} directly — {{source}} will pick up the change.":`保存会直接覆盖 {{path}} —— {{source}} 会随之生效。`,"Overwrite original":`覆盖原文件`,"Save as local copy":`保存为本地副本`,"Failed to read content":`读取内容失败`,"Failed to save":`保存失败`,Model:`模型`,"Working directory":`工作目录`,"Ask the agent…":`想让 agent 做什么…`,"Thinking…":`思考中…`,"Thought process":`思考过程`,"Thought for {{duration}}":`思考了 {{duration}}`,"Working…":`生成中…`,"Map the project":`梳理项目结构`,"Entry points, modules and key dependencies":`入口、模块划分与关键依赖`,"Walk me through this project's structure: entry points, module layout and key dependencies.":`梳理一下这个项目的结构:入口、模块划分和关键依赖。`,"Find potential issues":`排查潜在问题`,"Suspicious logic and unhandled edge cases":`找出可疑逻辑与未处理的边界情况`,"Review this project for potential bugs, suspicious logic and unhandled edge cases, and list them by severity.":`检查这个项目里的潜在 bug、可疑逻辑和未处理的边界情况,按严重程度列出来。`,"Add unit tests":`补充单元测试`,"Cover the core modules with tests":`为核心模块补上测试`,"Find the core modules that lack tests and add unit tests for them.":`找出缺少测试的核心模块,并为它们补充单元测试。`,"Summarize recent changes":`总结最近改动`,"A digest based on git log":`基于 git log 生成变更摘要`,"Summarize the recent changes in this repository based on git log.":`根据 git log 总结这个仓库最近的改动。`,"Loading Mermaid diagram...":`加载 Mermaid 图表...`,"Mermaid render error":`Mermaid 渲染错误`,"Mermaid render failed":`Mermaid 渲染失败`,"Mermaid preview":`Mermaid 预览`,"Zoom in":`放大`,"Zoom out":`缩小`,"Reset zoom":`重置缩放`,"Fit to original size":`适应初始大小`,"View fullscreen":`全屏查看`,"Exit fullscreen":`退出全屏`,"Export SVG":`导出 SVG`,"Export PNG":`导出 PNG`,"Diagram is too large for PNG, exported SVG instead":`图太大,无法导出 PNG,已改为导出 SVG`,"PNG export failed, exported SVG instead":`PNG 导出失败,已改为导出 SVG`,Projects:`项目`,All:`全部`,Ungrouped:`未分组`,"New group":`新建分组`,"Edit group":`编辑分组`,"All groups":`全部分组`,"Search in {{group}}...":`在「{{group}}」中搜索...`,"Delete group":`删除分组`,"No color":`无颜色`,"Project group":`项目组`,Alias:`别名`,"Shown in the sidebar instead of the folder name. Leave blank to reset.":`在侧边栏代替目录名显示,留空则恢复默认。`,"Groups organize projects in the sidebar.":`用分组整理侧栏里的项目。`,"Move projects into this group":`选择要移入的项目`,"Move to group":`移动到分组`,"Open folder":`打开文件夹`,Emoji:`表情符号`,"Add project":`添加项目`,"Adding...":`正在添加...`,"Add a project to start":`添加一个项目开始`,"Temporary chats":`临时会话`,"Drop shelf":`拖放浮窗`,Secretary:`秘书`,"A global agent that watches your projects and sessions, creates sessions to do the work, and reports results back to you.":`一个全局 Agent:替你查看各项目与会话的进展,创建普通会话派活,并把结果回报给你。`,"When you drag files in Finder, a small panel appears at the top right of the screen. Drop them on it to reference them in the current conversation, or drop folders to open them as projects, even when EnsoCode is minimized or in the tray.":`在访达中拖动文件时,屏幕右上角会出现一个小浮窗:把文件拖到上面即可引用到当前会话,拖文件夹还可选择作为项目打开;EnsoCode 最小化或在托盘时同样可用。`,"Drop here to add to the conversation":`拖到这里,添加到会话`,"Reference files in the current conversation":`松手即可引用到当前会话`,"Reference as files":`作为文件引用`,"Opening project":`正在打开项目`,"Opening {{count}} projects":`正在打开 {{count}} 个项目`,"Added 1 file":`已添加 1 个文件`,"Added {{count}} files":`已添加 {{count}} 个文件`,"{{name}} and more":`{{name}} 等`,"Start a temporary chat":`开始临时会话`,"Chats that are not tied to a project. Tools follow your global settings.":`不挂项目的会话。工具跟随全局设置。`,"Add a local directory as the conversation working folder.":`把本地目录加为对话的工作目录。`,"Type a path or select from recent projects...":`输入路径或从最近项目中选择...`,"Local directory":`本地目录`,"Remote (SSH)":`远程(SSH)`,"SSH host":`SSH 主机`,"user@host or an alias from ~/.ssh/config":`user@host 或 ~/.ssh/config 里的别名`,"Remote directory":`远端目录`,Up:`上级`,"Use this directory":`选择此目录`,"No subdirectories":`没有子目录`,"Invalid folder name.":`文件夹名称无效。`,"Folder name":`文件夹名称`,"Failed to list remote directory.":`远程目录列取失败。`,"Requires key-based SSH access. Tools run on the remote host; chat history stays local.":`需要免密钥 SSH 访问。工具在远端主机执行,聊天记录保存在本地。`,"Tools run on the remote host; chat history stays local.":`工具在远端主机执行,聊天记录保存在本地。`,"SSH connection":`SSH 连接`,"Select an SSH connection":`选择 SSH 连接`,"Add an SSH connection in Settings first.":`请先在设置里添加 SSH 连接。`,SSH:`SSH`,Usage:`用量`,"Token usage across all local sessions; cost is estimated from catalog prices.":`统计本机全部会话的 Token 用量;费用按目录单价估算,可在下方覆盖。`,Today:`今天`,"7D":`7 天`,"30D":`30 天`,"90D":`90 天`,"Estimated cost":`预估费用`,"Total tokens":`总 Token`,"Input tokens":`输入 Token`,"Output tokens":`输出 Token`,"Cache tokens":`缓存 Token`,"Active time":`活跃时长`,Sessions:`会话数`,Messages:`消息数`,"Daily trend":`每日趋势`,Input:`输入`,Cache:`缓存`,Token:`Token`,Cost:`费用`,"Activity by hour":`分时活跃`,Less:`少`,More:`多`,Sun:`周日`,Mon:`周一`,Tue:`周二`,Wed:`周三`,Thu:`周四`,Fri:`周五`,Sat:`周六`,"By model":`按模型`,"By project":`按项目`,"By member":`按成员`,"Last 7 days":`近 7 天`,"Last 30 days":`近 30 天`,"Daily budget":`每日预算`,"Cost (USD), empty = unlimited":`成本(美元),留空不限`,"Daily cost limit (USD)":`每日成本上限(美元)`,"Tokens, empty = unlimited":`Token 数,留空不限`,"Daily token limit":`每日 Token 上限`,"Resets at local midnight. Once reached, new messages to this member are refused and a running reply is stopped.":`按本地时间零点重置。用完后新消息会被拒绝,正在进行的回复会被停止。`,"Today's budget is used up":`今日预算已用完`,"Budget must be a positive number":`预算必须是正数`,"Delegation time limit (minutes)":`委派时限(分钟)`,"Empty = 240":`留空 = 240`,"When other members delegate to this one, the task fails with a timeout after this long. A delegator can ask for less, not more.":`其他成员委派给该成员时,超过这个时长未完成即判超时失败。发起方只能要求更短,不能更长。`,"Check the per-turn token limit and delegation time limit":`请检查单回合 Token 上限(正整数)与委派时限(1–1440 的整数分钟)`,"Per-turn token limit":`单回合 Token 上限`,"A single reply that uses more tokens than this (counted while streaming) is stopped.":`单次回复(流式累计)用量超过该值即被停止。`,"Stopped: the member's per-turn token limit was exceeded.":`已停止:超出成员的单回合 Token 上限。`,"This member's daily budget is used up. Try again tomorrow or raise the budget.":`该成员今日预算已用完,请明天再试或调高预算。`,"Over budget":`超出预算`,"The member's daily budget is used up.":`成员今日预算已用完。`,Budget:`预算`,"{{name}}'s budget for today is used up":`{{name}} 今日预算已用完`,"Daily cost limit reached. New messages are refused until local midnight.":`已达每日成本上限,本地时间零点前新消息会被拒绝。`,"Daily token limit reached. New messages are refused until local midnight.":`已达每日 Token 上限,本地时间零点前新消息会被拒绝。`,"No usage in this period":`该周期内没有用量`,"Top {{count}} of {{total}}":`共 {{total}} 项,显示前 {{count}} 项`,"{{total}} items":`共 {{total}} 项`,"(no project)":`(无项目)`,"No catalog price for: {{models}}. Their cost is not included.":`以下模型无目录单价:{{models}},其费用未计入。`,"Unit prices":`单价`,"Rates used for cost estimates ($/M tokens).":`费用估算用的单价($/百万 tokens)。`,"Show all":`显示所有`,"Show all {{count}} lines":`显示全部 {{count}} 行`,"Raw text":`原文`,"Search table":`搜索表格`,"No matching models":`没有匹配的模型`,"Model id":`模型 id`,"Enter a model id and non-negative rates.":`请填写模型 id 和非负单价。`,Reset:`重置`,Refresh:`刷新`,"Saved hosts for remote projects. Passwords stay in the system keychain.":`远程项目用的主机。密码保存在系统钥匙串。`,"Add connection":`添加连接`,"No SSH connections yet":`还没有 SSH 连接`,"SSH timeout":`SSH 超时`,"Time limit for connection tests, loading remote AGENTS.md, remote folder browsing and file panel actions. Agent tool commands are not affected.":`连接测试、读取远端 AGENTS.md、浏览远程目录和文件面板操作的超时时间。不影响 Agent 工具执行的命令。`,"Add SSH connection":`添加 SSH 连接`,"Edit SSH connection":`编辑 SSH 连接`,"Key / agent":`密钥 / agent`,Password:`密码`,Authentication:`认证方式`,"User (optional)":`用户(可选)`,"Port (optional)":`端口(可选)`,Host:`主机`,Test:`测试`,"SSH connection succeeded":`SSH 连接成功`,"Unknown SSH host":`未知 SSH 主机`,"Trust this host and add its key to known_hosts?":`信任此主机并把密钥写入 known_hosts?`,Trust:`信任`,"Could not save host key.":`无法保存主机密钥。`,"Password (leave blank to keep)":`密码(留空则保持原密码)`,"Failed to add project":`添加项目失败`,"Failed to add project.":`添加项目失败。`,"New project":`新建项目`,"Only folders can be added as projects":`只能将文件夹添加为项目`,"At most {{count}} folders can be added at once":`一次最多添加 {{count}} 个文件夹`,"Release to add":`松开以添加`,"Open as project":`作为项目打开`,"Add {{count}} projects":`将添加 {{count}} 个项目`,"Add all":`全部添加`,"Add to current conversation":`添加到当前会话`,"Open a conversation to add files":`请先打开一个会话再添加文件`,Browse:`浏览`,"No matching projects found":`没有匹配的项目`,Add:`添加`,"New conversation":`新对话`,"Local workspace":`本地工作区`,"Workspace moved to an isolated worktree":`工作区已迁移到隔离 worktree`,"Workspace fell back to the main working tree":`工作区已回退到主工作树`,"Work directly in the main working tree":`直接在主工作树里工作`,"Run this session on its own git worktree":`让这个会话在独立的 git worktree 里运行`,"Move to worktree":`切到隔离 worktree`,"Failed to move to worktree":`切到隔离 worktree 失败`,"Move to project…":`移动到项目…`,"Add to project…":`添加到项目…`,"Failed to move conversation":`移动会话失败`,"Cannot move a running conversation":`运行中的会话不能移动`,"Cannot move while its worktree is in use":`会话的 worktree 正在使用,暂不能移动`,"Secretary conversations cannot be moved":`秘书会话不能移出秘书`,"Import conversations from another project…":`导入其他项目的会话…`,"Import conversations from another project":`导入其他项目的会话`,"Pick a project. All of its conversations, archived ones included, are brought into {{name}}.":`选择一个项目,它的全部会话(含已归档)将导入到 {{name}}。`,"Move to this project":`移动到此项目`,"Copy to this project":`复制到此项目`,"The conversations leave the original project and show up only here. Session files stay as they are; nothing is copied or deleted.":`会话从原项目移到这里,原项目中不再显示。会话记录文件原样保留,不复制也不删除。`,"The original project keeps its conversations unchanged; this project gets an independent copy.":`原项目中的会话原样保留,此项目得到一份独立的副本。`,"The source project folder no longer exists, so moving is preselected.":`源项目的目录已不存在,默认选择移动。`,"Already copied here {{count}} times. Copying again adds another independent copy.":`已复制到此项目 {{count}} 次,再次复制会再生成一份独立副本。`,"Copy here":`复制到此项目`,"Moving…":`正在移动…`,"Copying…":`正在复制…`,"Copied {{count}} conversations":`已复制 {{count}} 个会话`,"Copied {{moved}} conversations; {{count}} running ones were not copied":`已复制 {{moved}} 个会话,{{count}} 个运行中的会话未复制`,"Failed to remove project":`移除项目失败`,"The old project has no conversations left. Remove it from the list?":`旧项目已经没有会话了,要从列表中移除吗?`,'"{{name}}" is only removed from the EnsoCode list. Its folder and files on disk are not deleted.':`只会把「{{name}}」从 EnsoCode 列表中移除,磁盘上的目录和文件不会被删除。`,"Move here":`移动到此项目`,"No other projects":`没有其他项目`,"{{count}} conversations":`{{count}} 个会话`,"Failed to import conversations":`导入会话失败`,"Imported {{count}} conversations":`已导入 {{count}} 个会话`,"No conversations to import":`没有可导入的会话`,"Imported {{moved}} conversations; {{count}} running or busy ones stay in the original project":`已导入 {{moved}} 个会话,{{count}} 个运行中或占用中的会话留在原项目`,"Main working tree has uncommitted changes":`主工作树有未提交改动`,"The new worktree branches off HEAD, so those changes stay in the main working tree and will not follow this session.":`新 worktree 从 HEAD 切出,这些改动会留在主工作树,不会跟随本会话。`,"Move anyway":`仍然切换`,"Clean up worktree":`清理 worktree`,"Clean up worktree?":`清理 worktree?`,"Failed to clean up worktree":`清理 worktree 失败`,"Reload conversation":`重新读取会话`,"Failed to reload conversation":`重新读取会话失败`,"Restart conversation (reload settings)":`重启会话(重新加载配置)`,"Failed to restart conversation":`重启会话失败`,"Clean up":`清理`,"Archive session and clean up worktree?":`归档会话并清理 worktree?`,"Pending work: {{warning}}. This session returns to the main working tree. The worktree directory and uncommitted changes are removed only when no other sessions use it. The branch is kept.":`待处理工作:{{warning}}。本会话将回退主工作树。仅在没有其他会话使用此 worktree 时,才删除目录及未提交改动;分支会保留。`,"uncommitted changes will be lost":`未提交改动将丢失`,"{{n}} unmerged commits (branch is kept)":`{{n}} 个未合并提交(分支会保留)`,"Pending work: {{warning}}. This conversation will be removed. Its worktree directory and uncommitted changes are removed only when no other sessions use it. The branch is kept.":`待处理工作:{{warning}}。本会话将被移除。仅在没有其他会话使用此 worktree 时,才删除目录及未提交改动;分支会保留。`,"Isolated worktree":`隔离 worktree`,"New isolated worktree":`新建隔离 worktree`,"Existing worktrees":`已有 worktree`,"New conversation in this worktree":`在此 worktree 新建会话`,"Rename worktree":`重命名 worktree`,"Worktree name":`Worktree 名称`,"Only the display name changes, for all sessions in this worktree. Leave empty to use the branch name.":`仅修改此 worktree 所有会话的显示名称,不改变分支或目录。留空恢复分支名。`,"Failed to rename worktree":`重命名 worktree 失败`,"Failed to use worktree":`使用 worktree 失败`,"Failed to create conversation":`新建会话失败`,"Switch branch":`切换分支`,"Back to workspaces":`返回工作区`,"Local branches":`本地分支`,"Search local branches":`搜索本地分支`,"Switching branches affects all conversations in this workspace.":`切换分支会影响此工作区的所有会话。`,"Create branch from HEAD…":`从当前 HEAD 新建分支…`,"Create branch":`新建分支`,"Create and switch":`新建并切换`,"Branch name":`分支名称`,"Detached HEAD":`分离 HEAD`,"No matching local branches.":`没有匹配的本地分支。`,"Failed to load branches":`读取分支失败`,"Failed to switch branch":`切换分支失败`,"Creates a branch from the current HEAD and switches every conversation in this workspace to it.":`从当前 HEAD 新建分支,并将此工作区的所有会话切换到该分支。`,"Create a commit before creating a branch from HEAD.":`请先创建一个提交,再从 HEAD 新建分支。`,"Stop running conversations and coworkers in this workspace before switching branches.":`请先停止此工作区中运行的会话和协作者,再切换分支。`,"Commit or stash uncommitted changes before switching branches.":`请先提交或暂存(stash)未提交改动,再切换分支。`,"This workspace is busy. Try again when its conversations are ready.":`此工作区正忙,请等待会话就绪后重试。`,"Branch is checked out in another worktree.":`此分支已被其他 worktree 占用。`,"Enter a valid Git branch name.":`请输入有效的 Git 分支名称。`,"A branch with this name already exists.":`同名分支已存在。`,"This branch no longer exists. Refresh the branch list.":`此分支已不存在,请刷新分支列表。`,"This workspace is already on that branch.":`此工作区已在该分支上。`,"Branches are not available for this workspace.":`此工作区无法使用 Git 分支。`,"Git could not switch branches.":`Git 无法切换分支。`,"Wait for the workspace operation to finish before saving.":`请等待工作区操作完成后再保存文件。`,"Worktree missing":`Worktree 已丢失`,"Worktree status unknown":`Worktree 状态未知`,"Uncommitted changes":`有未提交改动`,"Working tree clean":`工作区干净`,"{{n}} unmerged commits":`{{n}} 个未合并提交`,"Isolated worktree · uncommitted changes":`隔离 worktree · 有未提交改动`,"{{n}} browsers":`{{n}} 个浏览器`,"{{n}} terminals":`{{n}} 个终端`,"Isolated worktree · {{n}} unmerged commits":`隔离 worktree · {{n}} 个未合并提交`,"Isolated worktree is missing":`隔离 worktree 已丢失`,'The worktree of this session was deleted. Rebuild it from branch "{{branch}}" (committed work is preserved), or fall back to the main working tree.':`该会话的 worktree 已被删除。可从分支「{{branch}}」重建(已提交的工作会保留),或回退到主工作树继续。`,"Fall back to main working tree":`回退主工作树`,"Rebuild worktree":`重建 worktree`,"Failed to rebuild worktree":`重建 worktree 失败`,"Remove project":`移除项目`,"Archive project":`归档项目`,"Unarchive project":`恢复项目`,"Pin project":`置顶项目`,"Unpin project":`取消置顶项目`,"Pinned projects":`置顶项目`,"Select or create a conversation":`选择或新建一个对话`,"Collapse sidebar":`折叠侧边栏`,"Show {{n}} more":`展开其余 {{n}} 条`,"Archive {{n}} conversations":`归档 {{n}} 条会话`,Collapse:`收起`,Expand:`展开`,"Expand sidebar":`展开侧边栏`,"Show or hide sidebar":`显示/隐藏侧边栏`,"Approval required":`需要审批`,"Timed out · denied":`已超时拒绝`,"Timed out · no answer":`已超时未回答`,"{{time}} left":`剩余 {{time}}`,"Waiting for your answer":`等待你回答`,"Custom answer":`自定义回答`,"No answer in time; the default was selected":`超时未回答,已自动选择默认项`,Selected:`已选`,"Type an answer…":`输入回答…`,Later:`稍后`,Recommended:`推荐`,"Files read":`读入的文件`,"Tool results":`工具输出`,"About {{tokens}} left":`大约还剩 {{tokens}}`,"{{count}} more":`其余 {{count}} 项`,"Earlier {{count}} turns":`更早的 {{count}} 轮`,"Turn {{count}}":`第 {{count}} 轮`,"Compacted summary":`压缩摘要`,"System reminders":`系统提醒`,"Message will queue until this round finishes…":`消息将排队,本轮结束后发送…`,"Press {{key}} to steer the next queued message into this round…":`按 {{key}} 将下一条排队消息插入本轮…`,Queued:`排队`,"Withdraw message":`撤回`,"Not sent":`未发送`,"Not sent: the previous turn is stuck and could not be interrupted. Restart the conversation, then resend.":`未发送:上一轮卡住了,停不下来。请先重启会话再重发`,"Restart conversation":`重启会话`,Resend:`重发`,"Delivery unconfirmed":`送达待确认`,attachments:`个附件`,Edit:`编辑`,"Send now":`立即发送`,"Interrupt and send now":`打断并立即发送`,Remove:`移除`,"Agent types":`子代理类型`,"Max active coworkers":`同时在编 coworker 上限`,"How many coworkers one conversation can keep at once. Existing ones stay if you lower the limit; hire more only after dismissing. Subagents are not counted.":`单个会话最多同时保留多少个 coworker。调低上限不会解散现有成员,雇新的前需先解雇。subagent 不计入。`,"Built-in tools":`内置工具`,"Toggle the built-in tools available to agents.":`开关 agent 可用的内置工具。`,"Try these models' built-in search in order. Credentials resolve at call time; if all fail, the keyless Exa service is the permanent fallback.":`按顺序尝试这些模型的原生搜索。凭证在调用时现取;全部失败时由免 key 的 Exa 服务永久兜底。`,"Default: use the current session model's built-in search when available, otherwise Exa.":`默认:优先使用当前会话模型的原生搜索能力,不支持时回退 Exa。`,"Add candidate":`添加候选`,"Final fallback: Exa (keyless hosted search). Not a chain entry; always last.":`最终兜底:Exa(免 key 托管搜索)。不是链条目,永远在最后。`,"Isolated sandbox":`隔离沙箱`,Memory:`记忆`,"Durable knowledge the agent can search and write across sessions. Stored locally in a SQLite database.":`可跨会话检索与写入的持久知识,本地存放在一个 SQLite 库里。`,"Enable memory tools":`启用记忆工具`,"Gives the agent memory_search, memory_capture, memory_crystallize and memory_delete. The database is only created after you enable this.":`给 agent 提供 memory_search、memory_capture、memory_crystallize 与 memory_delete。开启后才会创建数据库。`,"Memory is off. The settings below take effect once you enable it.":`记忆已关闭。开启后下面的设置才会生效。`,"Embedding model":`嵌入模型`,"Used for semantic search and near-duplicate detection. Without it search still works using full-text only.":`用于语义检索与近重复识别。没有它检索仍可用,只是退化为纯全文。`,"Remote (OpenAI-compatible)":`远程(OpenAI 兼容)`,"Unknown model; the default is used instead.":`未知模型,实际使用默认模型。`,"Model downloaded":`模型已下载`,"Model not downloaded":`模型未下载`,"Downloading…":`下载中…`,"Semantic search stays off until the model is on disk.":`模型落盘前语义检索不会生效。`,"Remote (API model)":`远程(API 模型)`,Experimental:`实验功能`,"Bot mode":`Bot 模式`,"Chat with AI members that have personas, form groups and delegate work. Off by default.":`与有人设的 AI 成员私聊、拉群并互相委派工作。默认关闭。`,"Bot mode is turned off.":`Bot 模式已关闭。`,Download:`下载`,"Remote model":`远程模型`,"Credentials stay in the main process and are never sent to the renderer.":`凭证只留在主进程,不会下发到渲染层。`,"Unload automatically when idle":`空闲自动卸载`,"Release local model memory after this idle period. Models load automatically the next time they are needed.":`空闲达到此时长后释放本地模型内存,下次需要时会自动加载。`,"Download models automatically":`自动下载模型`,"Off by default, so a model is only fetched when you press Download. While a model is missing, search degrades to full-text; existing memories are re-embedded once it arrives.":`默认关闭,模型只在你点「下载」时才获取。模型缺失期间检索降级为纯全文,模型就绪后已有记忆会自动补向量。`,Distillation:`提炼`,"Distillation model":`提炼模型`,"Reads finished sessions and writes the memories.":`读已结束的会话并写出记忆。`,"Follows the title-summary model":`跟随标题模型`,"Memory language":`记忆语言`,"English keeps retrieval and near-duplicate detection stable across languages. Choose Follow conversation if your team only works in one language.":`英文能让跨语言的检索与近重复识别更稳。团队只用一种语言时可选「跟随对话」。`,English:`英文`,"Simplified Chinese":`简体中文`,"Background processing":`后台处理`,"Distill sessions automatically":`自动提炼会话`,"When a session ends, or goes idle for 30 minutes and is reclaimed, extract 1-3 durable memories from it in the background.":`会话结束、或空闲 30 分钟被回收时,在后台从中提炼 1-3 条值得长期保留的记忆。`,"Merge sessions in the same project":`合并同项目会话`,"Wait this long after a session ends, then distill every session of the same project that ended meanwhile in one run. Immediately distills each session on its own.":`会话结束后等待这段时间,再把期间结束的同项目会话合并成一次提炼。选「立即」则每个会话单独提炼。`,Immediately:`立即`,"{{done}}/{{total}} done":`已完成 {{done}}/{{total}}`,"about {{time}} left":`约剩 {{time}}`,"Extract entities":`抽取实体`,"Build an entity graph so a memory can be recalled by a name it does not literally contain.":`建立实体图谱,让正文里没出现该词的记忆也能被这个名字召回。`,"Review conflicting memories":`复核矛盾记忆`,"After new memories are written, ask the model whether they contradict older ones. Conflicts are only flagged for your review; nothing is hidden or deleted. Up to 20 model calls per run.":`写入新记忆后,让模型判断它是否推翻了已有记忆。发现的矛盾只标记待你审阅,不隐藏也不删除任何记忆。每轮最多调用模型 20 次。`,"Review now runs even when the switch above is off.":`「立即复核」在上面的开关关闭时也能运行。`,"No model is available for memory tasks.":`没有可用于记忆任务的模型。`,"Checked {{pairs}} pairs, flagged {{count}} conflicts.":`已复核 {{pairs}} 对,标出 {{count}} 处矛盾。`,"Review now":`立即复核`,Forgetting:`遗忘`,"Decay only changes how search ranks a memory. Archiving keeps it and can be undone; nothing on this page ever deletes a memory.":`衰减只影响检索排序。归档会保留记忆、可随时还原;这一页的任何操作都不会删除记忆。`,"Rank lower when never retrieved":`久未命中则降权`,"Memories that have not been retrieved for a long time rank lower. This changes ranking only — nothing is archived or deleted.":`很久没被检索到的记忆排序靠后。只改排序,不归档也不删除。`,"Mark archive candidates":`标记归档候选`,"Mark cold, low-importance memories as candidates and show them in the library. Marking alone changes nothing.":`把「冷且不重要」的记忆标成候选,并在记忆库里显示。只标记,不改变任何状态。`,"Archive candidates automatically":`自动归档候选`,"Archive candidates at the end of each run. Archived memories are hidden from search but kept and can be restored.":`每轮巡检结束时把候选归档。归档后不参与检索,但记忆仍在,可随时还原。`,"Not retrieved for":`未命中超过`,"Counted from the last retrieval; a memory that was never retrieved counts from creation.":`从最后一次被检索命中算起;从未命中的按创建时间算。`,"Importance at most":`重要度不高于`,"Only memories at or below this importance can become candidates. 0.5 is the lowest tier distillation writes.":`只有重要度不高于这个值的记忆才可能成为候选。0.5 是提炼允许写库的最低档。`,"Run every":`巡检间隔`,"Checked when the library opens; there is no separate background timer.":`开库时检查是否到期,不另起后台定时器。`,"Archive candidates: {{count}}":`归档候选:{{count}} 条`,"Archive candidates: marking is off":`归档候选:未开启标记`,"Running…":`运行中…`,"Review candidates":`查看候选`,"Never run yet":`还没有运行过`,"Last run {{date}}: {{scored}} scored, {{candidates}} candidates, {{archived}} archived":`上次运行 {{date}}:计算 {{scored}} 条,候选 {{candidates}} 条,归档 {{archived}} 条`,"Last retrieved {{date}}":`最后命中 {{date}}`,"No archive candidates right now.":`当前没有归档候选。`,"Archiving…":`归档中…`,"Archive candidate":`建议归档`,"Marked by the forgetting pass: cold and low importance":`遗忘巡检标记:久未命中且重要度低`,"Archive candidates only":`只看归档候选`,"Archive candidates":`归档候选`,"Showing the first {{shown}} of {{total}}.":`只显示前 {{shown}} 条,共 {{total}} 条。`,"{{selected}} of {{total}} selected":`已选 {{selected}}/{{total}}`,"Cold and low-importance memories. Archiving keeps them, hides them from search, and can be undone from the library.":`久未命中且重要度低的记忆。归档会保留它们、从检索里隐藏,随时能在记忆库还原。`,Library:`记忆库`,"No memories stored yet.":`还没有存下任何记忆。`,"Memory is not enabled.":`记忆未启用。`,Memories:`记忆数`,Crystals:`结晶数`,Entities:`实体数`,"With vectors":`已向量化`,Backfill:`补齐`,"Backfilling…":`补齐中…`,"Vectors unavailable: {{reason}}":`无法生成向量:{{reason}}`,"No remote embedding provider is selected. Choose a provider with an API key, or switch to a local embedding model.":`还没有选择远程向量服务商:请选择一个填了 API Key 的服务商,或改用本地向量模型。`,"The selected embedding provider no longer exists. Choose another provider, or switch to a local embedding model.":`所选的向量服务商已被删除:请重新选择服务商,或改用本地向量模型。`,'Provider "{{provider}}" has no Base URL. Fill it in, or choose another provider.':`服务商「{{provider}}」没有填写 Base URL:请补全,或换一个服务商。`,'Provider "{{provider}}" has no API key. Subscription sign-in cannot be used for embeddings; choose a provider with an API key, or switch to a local embedding model.':`服务商「{{provider}}」没有 API Key:订阅登录不能用于向量化,请换一个填了 API Key 的服务商,或改用本地向量模型。`,"No remote embedding model is selected. Choose a model that supports /embeddings.":`还没有选择远程向量模型:请选择支持 /embeddings 的模型。`,'"{{model}}" is a chat model and cannot be used for embeddings. Choose a model that supports /embeddings, or switch to a local embedding model.':`「{{model}}」是对话模型,不能用于向量化:请选择支持 /embeddings 的模型,或改用本地向量模型。`,'Provider "{{provider}}" has no embedding model ("{{model}}" is a chat model). Add one that supports /embeddings (e.g. text-embedding-3-small), or switch to a local embedding model.':`服务商「{{provider}}」下没有向量模型(「{{model}}」是对话模型):请在该服务商里添加支持 /embeddings 的模型(如 text-embedding-3-small),或改用本地向量模型。`,"No model can be used for embeddings: it needs a provider with an API key and an embedding model (e.g. text-embedding-3-small). Subscription sign-in cannot be used for embeddings.":`没有可用于向量化的模型:需要填了 API Key 的服务商,且其中有向量模型(如 text-embedding-3-small)。订阅登录不能用于向量化。`,"{{name}}: missing API key":`{{name}}:没有 API Key`,"{{name}}: missing Base URL":`{{name}}:没有 Base URL`,"{{name}}: no matching embedding model (model names must contain keywords like embed/voyage/bge)":`{{name}}:没有匹配的向量模型(模型名需包含 embed/voyage/bge 等关键词)`,"Database size":`库体积`,Spaces:`空间数`,"Never retrieved":`从未命中`,"{{percent}}% of library":`占 {{percent}}%`,"Added in 7 days":`近 7 天新增`,"Distill past sessions":`提炼历史会话`,"The automatic switch only covers sessions that end from now on. Distill earlier sessions here to fill the library.":`自动开关只对从现在开始结束或被回收的会话生效。早于此的会话在这里手动提炼,否则记忆库一直是空的。`,"No recorded sessions found.":`没有找到已记录的会话。`,"No project":`无项目`,"Already distilled":`已提炼`,"Distill all ({{count}})":`全部提炼({{count}})`,"All sessions":`全部会话`,"View sessions":`会话`,"Some sessions were already distilled":`部分会话已经提炼过`,"{{label}}: {{total}} sessions, {{done}} already distilled. Re-distilling runs the model again and may add new memories alongside the existing ones.":`{{label}}:共 {{total}} 个会话,其中 {{done}} 个已提炼。重新提炼会再跑一次模型,可能在现有记忆之外新增几条。`,"Only the {{count}} remaining":`只提炼剩下的 {{count}} 个`,"Re-distill all {{count}}":`重新提炼全部 {{count}} 个`,"Distill project":`提炼本项目`,"{{total}} sessions · {{pending}} not distilled":`{{total}} 个会话 · {{pending}} 个未提炼`,Distill:`提炼`,"Distill again":`重新提炼`,"Distilling…":`提炼中…`,"Background tasks":`后台任务`,"Background tasks started by this subagent":`这个子代理起的后台任务(归它所有,结束时不通知主会话)`,"Clear finished tasks":`清空历史任务`,"Retry failed extractions ({{count}})":`重试失败项({{count}})`,"Removes completed and cancelled jobs. Running tasks are kept. Sessions will show as not distilled again, since that flag is derived from job history — re-distilling is deduplicated, so it will not create duplicate memories.":`清除已完成和已作废的任务,进行中的保留。清除后会话会重新显示为「未提炼」——该标记是由任务历史推导的;重新提炼有去重,不会产生重复记忆。`,"Removes completed and cancelled jobs. Running tasks are kept.":`只删除已完成和已作废的记录,不影响进行中的任务。`,"Re-embedding memories":`正在重建向量`,"Nothing running.":`没有正在运行的任务。`,"Turn memory off in Built-in tools.":`如需关闭,请到「内置工具」中操作。`,critical:`关键`,important:`重要`,useful:`有用`,low:`次要`,"Importance {{value}}":`重要度 {{value}}`,"(legacy)":`(旧版)`,"superseded by the GGUF build":`已被 GGUF 版取代`,"job:distill":`提炼`,"job:entities":`实体`,"job:vectors":`向量`,"Show less":`收起`,"Show full text":`展开全文`,"Dispatch instructions":`派发指令`,Message:`消息`,"Show all {{count}}":`查看全部 {{count}} 条`,"{{count}} task(s) in progress":`{{count}} 个任务进行中`,"Exact match":`精确匹配`,"Semantic search":`语义检索`,"Fast retrieval":`快速检索`,"Deep retrieval":`深入检索`,"Same path the agent uses: full-text, vectors and entities merged by relevance. Shows the top matches only — no exact count, and archived memories are excluded.":`与 agent 同一条检索路径:全文、向量、实体与一跳相关实体按相关度融合。只给最相关的几条,没有精确总数,也不包含已归档的记忆。`,"Same recall as Fast, plus intent-weighted fusion and an optional short-timeout LLM rerank. Failures fall back; archived memories are excluded.":`召回与快速检索相同,再按意图加权融合,并可选短超时 LLM 重排。失败则回退;不含已归档记忆。`,"Embedding model is not ready, so vectors are skipped.":`嵌入模型未就绪,本次跳过了向量通道。`,Knowledge:`知识`,"Browse what the agent knows as a graph or a tree, ask for an interpretation, and consolidate related memories into a crystal.":`用图谱或树浏览 agent 已知的知识,让它解读,并把相关记忆合成结晶。`,Graph:`图谱`,Tree:`知识树`,"By type":`按类型`,"By entity":`按实体`,"By month":`按月份`,"Knowledge graph":`知识图谱`,"No entities yet. Turn on entity extraction and store a few memories first.":`还没有实体。先打开「抽取实体」并存下几条记忆。`,"Colour = entity type · size = how many memories mention it":`颜色 = 实体类型 · 大小 = 被多少条记忆提及`,"{{shown}} of {{total}} entities":`{{total}} 个实体中的 {{shown}} 个`,Fit:`适应窗口`,"Fit to view":`缩放到全图`,Relayout:`重新布局`,"Re-run layout":`重新计算布局`,"{{count}} memories · {{space}}":`{{count}} 条记忆 · {{space}}`,Interpret:`解读`,"Interpreting…":`解读中…`,Interpretation:`解读`,"Based on {{count}} memories":`基于 {{count}} 条记忆`,"Crystallize ({{min}}+)":`结晶({{min}} 条起)`,"Synthesizing…":`合成中…`,"Crystal created":`已生成结晶`,"Nothing was written":`没有写入任何内容`,"Similar memories already exist, nothing was written":`已有相似记忆,没有写入`,"Identical memory already exists, nothing new was written":`已有完全相同的记忆,没有重复写入`,"Showing {{shown}} of {{total}}":`显示 {{shown}} / {{total}}`,"No memories yet.":`还没有记忆。`,"Stored memories":`已存记忆`,"Everything the agent has saved. Archiving hides a memory from search but keeps it.":`agent 存下的全部记忆。归档只是让它不再出现在检索里,内容仍保留。`,"Clear selection":`取消选择`,"Archive selected":`归档所选`,"Select memory":`选中记忆`,"Delete {{count}} memories permanently?":`永久删除这 {{count}} 条记忆?`,"Search memories":`搜索记忆`,"All spaces":`全部空间`,"All types":`全部类型`,"Show archived":`显示已归档`,"No memories yet. They appear here once the agent stores something.":`还没有记忆。agent 存下第一条后会出现在这里。`,"No memories match these filters.":`没有符合当前筛选条件的记忆。`,"Type a query to search by meaning.":`输入关键词后按语义检索。`,Crystal:`结晶`,"Retrieved {{count}} times":`被检索 {{count}} 次`,Previous:`上一页`,"Needs review":`待审阅`,"Reviewing only records your judgement. Nothing is deleted and no memory is superseded.":`审阅只记录你的判断,不会删除任何记忆,也不会让任何一条被取代。`,"Accept: recorded as a confirmed contradiction. Both memories stay and stay searchable — you just stop being asked.":`接受:记为「确认矛盾」。两条记忆都保留、都还能被检索,只是不再提示你。`,"Dismiss: recorded as not a contradiction. Both memories stay unchanged and you stop being asked.":`忽略:记为「不算矛盾」。两条记忆都保持原样,也不再提示你。`,"Nothing to review. When a new memory contradicts an existing one, the pair shows up here.":`没有待审阅的矛盾。新记忆与已有记忆冲突时,这一对会出现在这里。`,"{{count}} contradictions are waiting for review. Clear them in bulk so real conflicts do not get buried.":`已有 {{count}} 条矛盾待审阅,建议批量处理,别让真正的冲突被埋掉。`,"Accept selected":`批量接受`,"Dismiss selected":`批量忽略`,"Earlier memory":`旧记忆`,"Newer memory":`新记忆`,"Why they conflict":`矛盾理由`,"No reason recorded for this pair.":`这一对没有记录矛盾理由。`,Accept:`接受`,Dismiss:`忽略`,Type:`类型`,Space:`空间`,Importance:`重要度`,Created:`创建于`,"Event date":`事件日期`,Embedding:`向量模型`,"Synthesized from":`合成自`,"Related versions":`相关版本`,"Delete permanently":`永久删除`,"Delete this memory permanently?":`永久删除这条记忆?`,"All space types":`全部空间类型`,"Recorded {{date}}":`记录于 {{date}}`,"Recorded at":`记录时间`,"Updated at":`更新时间`,"Edit memory":`编辑记忆`,"Search indexes are rebuilt from the new text right away.":`保存后全文、向量和实体索引会立即按新内容重建,旧内容不再能被搜到。`,"Importance (0–1)":`重要度(0–1)`,"Content cannot be empty.":`内容不能为空。`,"Importance must be between 0 and 1.":`重要度需在 0 到 1 之间。`,"Could not save the memory.":`记忆保存失败。`,"Checking what this affects…":`正在检查删除会影响哪些记忆…`,"Memory not found.":`记忆不存在或已被删除。`,"Also deletes {{count}} older versions it replaced: {{titles}}":`会一并删除被它替换掉的 {{count}} 个历史版本:{{titles}}`,"The older and newer versions around it are linked directly, so the history stays continuous.":`它前后的版本会直接相连,版本历史保持连续。`,"Removes the relation links to {{titles}}; those memories are kept.":`会解除与 {{titles}} 的关联,这些记忆本身保留。`,"Crystal {{title}} loses this source and keeps {{count}} sources.":`结晶 {{title}} 会失去这条来源,剩余 {{count}} 条来源。`,"Crystal {{title}} would be left with {{count}} sources, so it becomes a normal memory. Its content is kept.":`结晶 {{title}} 只剩 {{count}} 条来源,不再构成结晶,将转为普通记忆,正文保留。`,"This is a crystal: its {{count}} source memories are kept, only the links are removed.":`这是一条结晶:它的 {{count}} 条来源记忆会保留,只解除结晶关系。`,"No other memories are affected.":`不影响其他记忆。`,"This cannot be undone. Archiving keeps the memory out of search while preserving it.":`此操作不可撤销。归档可以让它不再出现在检索里,同时保留内容。`,"Long-term memory: the agent can search, capture and consolidate durable decisions, preferences and lessons across sessions":`长期记忆:agent 可跨会话检索、记录与归纳持久的决策、偏好与经验`,"Let the agent drop an irrelevant automatic delivery or throwaway exchange from its context; the timeline keeps it and turn_recall can read it back":`让 agent 把无关的自动投递或一次性问答从上下文里丢掉;时间线保留原文,turn_recall 可取回`,"Plan mode: research read-only, submit a plan for approval, then carry it out after approval":`Plan 模式:只读调研并提交计划,审批通过后再执行`,"Run JavaScript in an isolated sandbox that can call session tools. Intermediate reads and edits stay out of the chat; only the returned value is added to the conversation.":`在隔离沙箱里跑 JavaScript,并可调用会话工具。中间的读取和修改不会进对话,只有返回值会留下。`,Workflow:`工作流`,"Run a JavaScript workflow that fans work out across subagents.":`运行一段扇出子代理的 JavaScript 工作流。`,"Run a JavaScript workflow that fans work out across subagents. Live status appears in the side panel.":`运行一段扇出子代理的 JavaScript 工作流。实时状态显示在右侧栏。`,"No workflow runs":`还没有工作流`,"Clear finished runs":`清除已结束`,Run:`运行`,"Workflow preset":`预设工作流`,"Manage workflow presets":`管理工作流预设`,Workflows:`工作流`,"Preset workflows you can run from the Workflow side panel":`可在侧边栏「工作流」面板中运行的预设`,"Project .agents/workflows files take precedence over these; ~/.agents/workflows and built-in presets come after.":`同名时项目 .agents/workflows 下的文件优先于这里,其次是 ~/.agents/workflows 和内置预设。`,"Add workflow preset":`新增工作流预设`,"Edit workflow preset":`编辑工作流预设`,"No custom workflow presets yet":`还没有自定义工作流预设`,"Custom presets":`自定义预设`,"Built-in presets":`内置预设`,Label:`显示名`,"Default value":`默认值`,Required:`必填`,"Add argument":`添加参数`,Script:`脚本`,Steps:`步骤`,Design:`设计`,Code:`代码`,"Default (worker)":`默认(worker)`,"Phase {{n}}":`阶段 {{n}}`,"Phase title":`阶段名称`,Prompt:`提示词`,"Click a node to edit it. Steps in a column run in parallel; columns run from left to right.":`点击节点即可编辑。同一列的步骤并行执行,各列从左到右依次执行。`,Start:`开始`,"No arguments":`无参数`,"Last phase output":`末阶段输出`,"Untitled phase":`未命名阶段`,"Untitled step":`未命名步骤`,"No prompt yet":`尚未填写提示词`,"Parallel step":`并行步骤`,"Insert phase here":`在此插入阶段`,"Phase {{n}} · Step {{m}}":`阶段 {{n}} · 步骤 {{m}}`,"Move left":`左移`,"Move right":`右移`,"Insert argument":`插入参数`,"Previous phase output":`上一阶段输出`,"This preset is plain code and cannot be shown in the designer. Using the designer replaces the current script.":`该预设是纯代码,无法在设计器中显示。改用设计器会替换当前脚本。`,"Use the designer":`改用设计器`,"Every phase needs a title and every step needs a label and a prompt.":`每个阶段需要名称,每个步骤需要显示名和提示词。`,"Generated from the design. Editing the code detaches it from the designer.":`由设计生成。手动修改代码后将脱离设计器,变为纯代码预设。`,"Plain JavaScript with top-level await; end with return. Available: agent(prompt, opts), parallel, pipeline, phase, log, args.":`纯 JavaScript,支持顶层 await,以 return 结束。可用:agent(prompt, opts)、parallel、pipeline、phase、log、args。`,"Workflow preset not found":`工作流预设不存在`,"Workflow preset is larger than 64 KB":`工作流预设超过 64 KB`,"Invalid workflow preset":`工作流预设无效:检查参数名(字母、数字、下划线),且各字段不能包含 */`,"Parallel review":`并行审查`,"Review a change set in parallel along several dimensions with read-only reviewers.":`用只读审查代理按多个维度并行审查一组改动。`,"Review scope":`审查范围`,"Dimensions (comma separated)":`审查维度(逗号分隔)`,"Multi-angle investigation":`多角度调研`,"Investigate one question from implementation, tests and docs in parallel with read-only scouts.":`用只读侦察代理从实现、测试、文档三个角度并行调研同一个问题。`,Question:`问题`,Parallel:`并行`,"{{count}} agents":`{{count}} 个子代理`,"One-shot subagent: delegate a self-contained task and return a final report (parallel or async)":`一次性子代理:委派自包含子任务,返回最终报告(可并行、可异步)`,"Persistent subagent: hire for multi-turn dialogue; you can watch and intervene from a tab":`持久子代理:雇佣后多轮对话,用户可在 tab 旁观介入`,"Task list: track progress on multi-step work":`任务清单:跟踪多步骤工作的进度`,"Ask the user a question and wait for an answer (options / timeout)":`向用户提问并等待回答(带选项/超时)`,"Background shell task: run long commands in the background and notify on completion":`后台 shell 任务:长命令挂后台跑,完成时通知`,"Built-in browser: open pages in Enso's own Chromium, read snapshots, click and type by ref":`内嵌浏览器:在 Enso 自带 Chromium 里打开页面,读快照,按 ref 点击与输入`,"Web search and fetch: search with the session model's built-in search (falls back to a keyless service) and read public pages as markdown":`联网搜索与抓取:优先用会话模型自带的搜索(不支持时降级到免 key 服务),并把公开网页读成 markdown`,"This project ships pi extension code that runs with your permissions. It was not loaded. Trust it only if you trust this repository.":`此项目带有 pi 扩展代码,会以你的权限运行,已阻止加载。只有信任这个仓库时才加载。`,"Trust and load":`信任并加载`,Plugin:`插件`,"Enso plugins":`Enso 插件`,"No Enso plugins installed":`还没有安装 Enso 插件`,"Browse the marketplace or install from a GitHub URL, folder or zip.":`可以从插件市场浏览,或通过 GitHub 地址、文件夹、zip 安装。`,"Or install from":`或从本地安装`,"Installing a plugin lets it run code on this machine. Review what it asks for before confirming.":`安装插件会让它在这台电脑上运行代码。确认前请先查看它申请的权限。`,"Install from folder":`从文件夹安装`,"Install from zip":`从压缩包安装`,"Install from URL":`从链接安装`,Marketplace:`插件市场`,"Search plugins":`搜索插件`,"China mirror":`国内镜像`,"Usage guide":`使用说明`,Homepage:`主页`,"Update plugins automatically":`自动更新插件`,"Marketplace updates that do not ask for new permissions install on their own.":`权限不变的市场更新会自动装上。需要新权限的仍等你同意。`,"{{name}} tried to message another session and was blocked":`插件 {{name}} 想向其他会话发消息,已拦截`,"Turn on":`去开启`,"{{name}} {{version}} needs new permissions":`插件 {{name}} 新版本 {{version}} 需要新权限`,"Review permissions":`去授权`,"{{name}} updated to {{version}}":`插件 {{name}} 已更新到 {{version}}`,View:`查看`,"Could not reach the marketplace; showing the last saved list.":`无法连接插件市场,显示的是上次保存的列表。`,"No matching plugins":`没有匹配的插件`,Official:`官方`,Community:`社区`,Installed:`已安装`,"https://github.com/owner/repo":`https://github.com/owner/repo`,"Install failed":`安装失败`,"{{name}} installed":`已安装 {{name}}`,"Turn it on in the list below to use it.":`在下面的列表里打开开关即可使用。`,"updating from {{version}}":`从 {{version}} 更新`,"Keep current":`保持现状`,"Stopped after crashes":`多次崩溃后已停止`,"Plugin command failed":`插件命令执行失败`,"Plugin logs":`插件日志`,"No logs yet":`暂无日志`,"Reinstall from source":`从来源重新安装`,"No plugins installed from GitHub to check":`没有从 GitHub 安装的插件可以检查`,"{{count}} update(s) available":`{{count}} 个插件有新版本`,"All plugins are up to date":`插件都是最新版本`,"Version {{version}} is available":`有新版本 {{version}}`,Update:`更新`,"Update check failed: {{reason}}":`检查更新失败:{{reason}}`,Commands:`命令`,"Project extensions trusted. They load in new sessions and after this one restarts.":`已信任项目扩展,新会话和本会话重新启动后加载。`,"Trusted project extensions":`已信任的项目扩展`,"Revoke trust":`撤销信任`,"No longer loaded after saving, starting with the next session.":`保存后不再加载,从下一个会话开始生效。`,"Web search":`联网搜索`,"Web fetch":`网页抓取`,Computer:`电脑操控`,"Host desktop: list windows, screenshot, accessibility tree, and input. Default off. Not the built-in browser.":`宿主桌面:列窗口、截图、无障碍树与键鼠。默认关闭。不是内嵌浏览器。`,"Operate the host desktop with screenshots, accessibility, and input.":`用截图、无障碍树和键鼠操作宿主桌面。`,"Enso never receives host-desktop computer tools.":`Enso 不会拿到宿主桌面 computer 工具。`,"Ask the coding agent to use the computer tool.":`请让编程 agent 使用 computer 工具。`,"Screen Recording":`屏幕录制`,Accessibility:`辅助功能`,"Open Screen Recording settings":`打开屏幕录制设置`,"Open Accessibility settings":`打开辅助功能设置`,"Computer needs Screen Recording to capture windows and Accessibility to inspect or click them. Grant both to EnsoCode, then restart the app.":`电脑操控需要屏幕录制才能截窗,需要辅助功能才能读无障碍树或点击。请把这两项授权给 EnsoCode,然后重启应用。`,"Grant Computer permissions":`授权电脑操控权限`,"Show permission guide":`打开权限引导`,"Apps the AI may control":`AI 可操作的应用`,"Allow all apps":`允许所有应用`,"The AI can click, type and read in any app without asking. It can see everything in their windows, including chats and passwords.":`AI 操作任何应用都不再询问,可点击、输入并读取所有应用窗口里的内容,包括聊天记录和密码等。`,"Show the app being operated":`显示正在操作的应用`,"While the AI works in an app in the background, a small floating window shows that app live. Close it any time.":`AI 在后台操作某个应用时,用一个小浮窗实时显示这个应用的画面,可随时关掉。`,"The first time the AI clicks or types in an app, EnsoCode asks you. Apps you always allow are listed here; it can then read everything in their windows.":`AI 第一次在某个应用里点击或输入时,EnsoCode 会先询问你。你选择「始终允许」的应用会列在这里,AI 之后可以读取这些应用窗口里的全部内容。`,"No apps are always allowed yet.":`还没有始终允许的应用。`,Revoke:`撤销`,"The agent can screenshot windows and control the mouse and keyboard. Grant Screen Recording and Accessibility to EnsoCode, then restart.":`Agent 可以截取窗口并控制键鼠。请把屏幕录制和辅助功能授权给 EnsoCode,然后重启。`,"Computer is ready. Open sessions can use it from their next step.":`电脑操控已就绪。已打开的会话从下一步起即可使用。`,"Capture: granted":`截屏:已授权`,"Capture: denied":`截屏:未授权`,"Input/AX: granted":`键鼠/AX:已授权`,"Input/AX: denied":`键鼠/AX:未授权`,"This platform cannot operate the desktop yet.":`当前系统还不能操作桌面。`,"QuickJS sandbox: write JavaScript that calls session tools (including edits) in one cell":`QuickJS 沙箱:用 JavaScript 在一个 cell 里调用会话工具(含编辑)`,"(log unavailable)":`(日志不可用)`,"Loading…":`加载中…`,"(no log available)":`(暂无日志)`,"Context compacted":`上下文已压缩`,"{{kind}} · {{before}} → {{after}} · freed {{percent}}%":`{{kind}} · {{before}} → {{after}} · 释放 {{percent}}%`,"Context compacted ({{tokens}} tokens before)":`上下文已压缩(压缩前 {{tokens}} tokens)`,"Verified context compacted":`验证式压缩完成`,"Verified context compacted ({{tokens}} tokens before)":`验证式压缩完成(压缩前 {{tokens}} tokens)`,"Verified summary from smart compaction. Messages above are no longer in the model context.":`这次用了验证式摘要。此线之上的历史已不在模型上下文中。`,"Memory context compacted":`持续记忆压缩完成`,"Memory context compacted ({{tokens}} tokens before)":`持续记忆压缩完成(压缩前 {{tokens}} tokens)`,"Summary rendered from continuous memory. Messages above are no longer in the model context; use recall for sources.":`这次由持续记忆直接渲染摘要。此线之上的历史已不在模型上下文中,可用 recall 查看来源。`,"Messages above are no longer in the model context; only this summary is.":`以上消息已不在模型上下文中,模型只看到这份摘要。`,"Latest compaction summary — expand to read what the model kept.":`最近一次压缩摘要,点开可查看模型保留的内容。`,"(summary unavailable)":`(摘要不可用)`,Note:`注意`,Tip:`提示`,Important:`重要`,Warning:`警告`,Caution:`小心`,"Let the agent pick subagent models":`允许子代理指定模型`,"The main agent can pick one of these models when dispatching subagents or coworkers. The description tells it when to use each model.":`主 agent 派发 subagent/coworker 时可从这些模型里挑选;描述用于告诉它每个模型适合什么任务。`,"When to use it, e.g. cheap and fast for simple subtasks":`什么时候用它,例如:便宜快,适合简单子任务`,"Add model":`添加模型`,Delete:`删除`,Archived:`已归档`,"Clean up archived":`清理已归档`,"Older than {{days}} days":`{{days}} 天前`,"Delete all archived":`全部删除`,"All {{count}} archived conversations will be removed from the list.":`全部 {{count}} 个已归档对话将从列表移除。`,'All {{count}} archived conversations in "{{name}}" will be removed from the list.':`「{{name}}」中全部 {{count}} 个已归档对话将从列表移除。`,"Delete archived conversations?":`删除已归档对话?`,"{{count}} conversations archived more than {{days}} days ago will be removed from the list.":`{{count}} 个归档超过 {{days}} 天的对话将从列表移除。`,'{{count}} conversations in "{{name}}" archived more than {{days}} days ago will be removed from the list.':`「{{name}}」中 {{count}} 个归档超过 {{days}} 天的对话将从列表移除。`,Other:`其他`,Archive:`归档`,Unarchive:`取消归档`,Active:`活跃中`,Pinned:`已置顶`,"Drop here to pin":`拖到此处置顶`,Pin:`置顶`,Unpin:`取消置顶`,Rename:`重命名`,"Model selection":`模型选择`,"Must be picked by main agent":`必须由主 Agent 选择`,"Picked by main agent":`由主 Agent 选择`,"Fixed model":`自选固定模型`,"Subagent models not configured warning":`未在【模型服务】中配置【允许子代理指定模型】。设为【必须由主 Agent 选择】的子代理类型将暂时回退为跟随会话。`,"Custom subagent presets: system prompt, model and toolset. The agent picks one via the agent_type parameter.":`自定义子代理预设:系统提示、模型与工具集,主 agent 经 agent_type 参数选用。`,"New agent type":`新建类型`,"Built-in":`内置`,"Follows the conversation model, full toolset":`跟随会话模型,全部工具`,"Follows the conversation model":`跟随会话模型`,"Overrides built-in":`覆盖内置`,"Edit agent type":`编辑类型`,"Name (slug)":`名称(slug)`,"Description (helps the agent pick this type)":`描述(帮助主 agent 选型)`,"Fast read-only recon, returns compressed findings":`快速只读调研,返回压缩结论`,"System prompt":`系统提示`,"You are a fast recon agent. Explore, never modify…":`你是快速调研代理,只探索不修改…`,"Provider (optional)":`模型服务(可选)`,"Follow conversation":`跟随会话`,"Enable subagent model":`启用子代理模型`,"Make this model available to subagents":`允许子代理选择此模型`,"Applies to newly started conversations.":`对新启动的会话生效。`,"Follow parent":`跟随父会话`,"Depth: {{level}}":`深度:{{level}}`,Disabled:`已停用`,"Select model":`选择模型`,Toolset:`工具集`,"All tools (bash/edit/write)":`全部工具(bash/edit/write)`,"Read-only (read/grep/find/ls + bound MCP)":`只读(read/grep/find/ls + 绑定的 MCP)`,Stop:`停止`,"Attach image":`添加图片`,"Stop task":`停止任务`,"Move to background":`转为后台`,"Moving to background…":`正在转后台…`,"Moved to background":`已转后台`,"Moves to background in {{seconds}}s":`{{seconds}} 秒后转后台`,"No output for {{seconds}}s":`{{seconds}} 秒无输出`,"Exit {{code}}":`退出码 {{code}}`,"Killed at timeout":`超时被终止`,"Stopped by you":`已被你停止`,"Needs terminal":`需要终端`,"Needs login":`需要登录`,"Command not found":`找不到命令`,"Not executable":`不可执行`,"Binary output":`二进制输出`,"Log truncated":`日志已截断`,"Killed when its timeout was reached. Raise the timeout or run it in the background.":`到达 timeout 被终止。可提高 timeout 或改为后台运行。`,"Needs an interactive terminal. Use a non-interactive flag (such as --yes) or run it in your own terminal.":`需要交互式终端。改用非交互参数(如 --yes),或在你自己的终端里运行。`,"Needs credentials. Sign in from your own terminal, then retry.":`需要凭证。请先在你自己的终端里登录,再重试。`,"The program is not installed or not on PATH.":`程序未安装或不在 PATH 中。`,"Copy command":`复制命令`,"Rerun in background":`转后台重跑`,"Rerun with {{seconds}}s timeout":`以 {{seconds}}s timeout 重跑`,"Rerun this command with background: true:\n\n{{command}}":`用 background: true 重新运行这条命令:
|
|
11
|
-
|
|
12
|
-
{{command}}`,"Rerun this command with timeout: {{seconds}}:\n\n{{command}}":`用 timeout: {{seconds}} 重新运行这条命令:
|
|
13
|
-
|
|
14
|
-
{{command}}`,"Stop waiting":`不等了`,"Stopping wait…":`正在结束等待…`,"Writing reply…":`正在写回复…`,"No running subagents":`没有在跑的子代理`,"Stopping the wait does not stop subagents; the assistant is notified when they finish.":`不等了也不会停下子代理,它们做完会自动通知助手。`,"Stop subagent":`停止子代理`,"Dismiss coworker":`解雇 coworker`,"Hire coworker":`雇佣 coworker`,"Subagent history":`子代理记录`,"Set a session goal (/goal <objective> · pause · resume · clear)":`设定会话目标(/goal <目标> · pause · resume · clear)`,"Pause the current session goal":`暂停当前会话目标`,"Resume a paused session goal":`继续已暂停的会话目标`,"Clear the session goal":`清除会话目标`,working:`推进中`,paused:`已暂停`,waiting:`等待中`,blocked:`受阻`,completed:`已完成`,aborted:`已中止`,"Goal completed":`目标完成`,"Goal blocked":`目标受阻`,"Goal waiting":`目标等待中`,"Pause goal":`暂停目标`,"Resume goal":`继续目标`,"Clear goal":`清除目标`,Plan:`计划`,"Plan mode is on: read-only research, then a plan for your approval":`Plan 模式已开启:只读调研,产出计划交你审批`,"Plan first: research read-only and submit a plan for approval":`先出计划:只读调研,提交计划审批后再执行`,"Plan response failed":`计划审批未送达`,"Plan awaiting approval":`计划待审批`,"What should change in this plan?":`这份计划需要怎么改?`,"Discard and exit plan mode":`放弃并退出 Plan`,"Send feedback":`发送修改意见`,"Request changes":`修改意见`,"Approve and execute":`批准并执行`,"Choose the approval mode for execution":`选择执行时的审批档位`,"Approve and execute with":`批准后按以下审批档位执行`,"Executing plan":`执行计划`,"Finish plan":`结束计划`,"Plan mode: research read-only, then approve a plan (/plan [task] · off)":`Plan 模式:只读调研后审批计划(/plan [任务] · off)`,"Describe the task — a plan comes first":`描述任务,先产出计划`,"Plan mode on: read-only research, then a plan for your approval":`已进入 Plan 模式:只读调研,产出计划交你审批`,"Plan mode off":`已退出 Plan 模式`,"Unattended mode on: no one is watching, so it decides and keeps going":`已开启无人值守:没人在看,它会自己决定并继续`,"Unattended mode off: a person is available again":`已关闭无人值守:可以再问你了`,"Context compacted: the approved plan was attached again":`上下文已压缩,已重新附上执行中的计划`,"Plan approved, executing":`已批准计划,开始执行`,"Plan feedback":`计划修改意见`,"From main agent":`来自主 agent`,Role:`角色`,"Agent type":`类型`,Hire:`雇佣`,"Dismiss this coworker? Its session will be closed.":`解雇这个 coworker?其会话将被关闭。`,Output:`输出`,Assistant:`助手输出`,Arguments:`参数`,Result:`结果`,"Final report":`最终报告`,"{{count}} chars":`{{count}} 字符`,"Earlier activity details were cleared; the final report is still available.":`较早的过程详情已清理,最终报告仍然保留。`,"(no output yet)":`(暂无输出)`,"Output written ({{size}}), not loaded yet":`已输出 {{size}},面板尚未加载`,"The process has not written anything. Without a terminal, some programs buffer output and only write it in blocks or on exit.":`进程还没有写出任何内容。不在终端里运行时,有些程序会把输出攒成一块或等退出时才写出。`,Deny:`拒绝`,Allow:`允许`,"Run as administrator":`以管理员权限运行`,"Login password":`本机登录密码`,"A command is waiting for the administrator password":`有命令在等待管理员密码`,"Incorrect password. Try again.":`密码不正确,请重试。`,"Applies to this command only. The password is never shown to the AI.":`仅对这一条命令生效,密码不会交给 AI。`,Adjust:`调整`,"Send back for a safer command":`打回去,让模型换一个更安全的命令`,"Assistant review":`代审`,"Let the assistant decide":`交给助手代审`,"Always allow this session":`本会话总是允许`,"Resolve the pending approval to continue":`请先处理待审批的操作`,Supervised:`全程审批`,"Approve every command and file change":`每条命令与文件改动都需确认`,"Auto-accept edits":`自动接受编辑`,"Edits run freely; commands and MCP still ask":`文件编辑直接执行,命令与 MCP 仍需确认`,"Full access":`完全放行`,"Run everything without asking":`所有操作不经确认直接执行`,"Assistant approval":`助手代审`,Unattended:`无人值守`,"Rejects actions that need approval instead of waiting for you":`需要确认的动作直接拒绝,不再弹卡片等人`,"Assistant reviewing…":`代审中…`,"A configured model reviews each action first":`由设置中的模型先审每一步操作`,"Select an assistant approval model in Settings first":`请先在设置里选择助手代审模型`,"Assistant approval model":`助手代审模型`,"Required before Assistant approval can be selected. Does not fall back to the chat model.":`选好后新会话默认走助手代审;未选则该档不可用,不会回退到当前会话模型。`,"No assistant approval model selected":`尚未选择助手代审模型`,"Selected model is unavailable":`所选模型不可用`,Clear:`清除`,"No conversations yet":`暂无对话`,"Preparing session…":`正在读取历史…`,"Loading earlier messages…":`加载更早的消息…`,"Load earlier messages":`加载更早的消息`,"Beginning of conversation":`已到对话开头`,"Retry resume":`重新恢复`,"Session is not ready yet — no history to show.":`会话准备超时,暂无可显示的历史。`,"Retry sync":`重新同步`,Todos:`任务清单`,"Todo list cleared":`已清空`,"{{count}} tool calls":`{{count}} 个工具调用`,"ran {{count}} commands":`跑了 {{count}} 条命令`,"total {{duration}}":`总计 {{duration}}`,"took {{duration}}":`用时 {{duration}}`,"read {{count}} files":`读了 {{count}} 个文件`,"searched {{count}} times":`搜索 {{count}} 次`,"{{count}} other calls":`其他 {{count}} 次调用`,Explored:`探索了`,Exploring:`探索中`,"{{count}} files":`{{count}} 个文件`,"{{count}} searches":`{{count}} 次搜索`,"{{turns}} turns · {{steps}} steps":`{{turns}} 轮 · {{steps}} 步`,"LLM {{duration}}":`LLM {{duration}}`,"Tool calls {{duration}}":`工具调用 {{duration}}`,"First token avg {{duration}}":`首 token 平均 {{duration}}`,"Cache hit {{percent}}%":`缓存命中 {{percent}}%`,"Input {{input}} tok · Output {{output}} tok":`输入 {{input}} · 输出 {{output}} tok`,"{{speed}} tok/s":`{{speed}} tok/s`,"Search models":`搜索模型`,"Virtual models":`虚拟模型`,"Starred & virtual":`星标与虚拟`,"Recently used":`最近使用`,"Remove from recently used":`从最近使用中移除`,"Enable virtual model":`启用虚拟模型`,"Primary model":`主模型`,"Default for each new turn":`每轮默认使用`,"Fast model":`快模型`,"Summaries and simple turns":`摘要与简单问题`,"Fallback models":`备用模型`,"Used in order when a model is rate limited or down":`限流或故障时按顺序切换`,"Add fallback":`添加备用`,"Not used":`不使用`,"Difficulty routing":`按难度分档`,"Set a fast model first":`先设置快模型`,"Fast model judges":`快模型判断`,"Classifier model":`分类器模型`,"No classifier models available":`该服务商暂无可用的分类器模型`,"Classifies each new turn: simple turns use the fast model, complex ones the primary model. Adds a short delay before the reply.":`每轮新输入先分类:简单问题用快模型,复杂任务用主模型。回复前会多一点延迟。`,"New virtual model":`新建虚拟模型`,"A virtual model appears as one model in the picker and routes each request to a real model: fallbacks on rate limits or outages, image-capable or larger-context members when needed, and the fast model for summaries.":`虚拟模型在选择器里显示为一个模型,每次请求由路由挑选真实模型:限流或故障时切到备用,需要时换成支持图片或上下文更大的成员,摘要使用快模型。`,"No models found":`没有匹配的模型`,"Import session":`导入会话`,"More actions":`更多操作`,"Pick a conversation from a local AI app under {{name}}.":`从本地 AI 应用导入 {{name}} 项目下的对话历史。`,"No sessions found for this project":`没有找到该项目的会话`,"Select a session to preview":`选择一个会话预览`,Untitled:`未命名`,"{{count}} messages":`{{count}} 条消息`,Import:`导入`,"Scroll to bottom":`回到底部`,Rewind:`回退`,"Rewinding…":`正在回退…`,"Restoring files…":`正在还原文件…`,"Rewinding conversation and files…":`正在回退对话并还原文件…`,"Rewind to this message":`回退到这条消息(其后的消息移出当前分支,文本回填输入框)`,"Conversation only":`仅回退对话`,"Conversation + files":`对话+还原文件`,"Rewind and restore files to before this turn":`回退对话并把工作树还原到这一轮之前(git 项目有效)`,"Rewind to this message?":`回退到这条消息?`,"Later messages leave the current branch; the text returns to the input box.":`其后的消息将移出当前分支,该消息文本回填输入框。`,"Later messages leave the current branch and working-tree files are restored to before this turn.":`其后的消息将移出当前分支,并把工作树文件还原到这一轮开始之前。`,"Remove project?":`移除项目?`,"Delete conversation?":`删除对话?`,'"{{name}}" and its {{count}} conversations will be removed from the list.':`将从列表移除「{{name}}」及其 {{count}} 个对话。`,"This conversation will be removed from the list.":`该对话将从列表移除。`,Reasoning:`推理`,"Load local skills":`加载本机 skill`,Presets:`预设`,"New preset":`新建预设`,"Edit preset":`编辑预设`,"Role descriptions, skills, MCP servers and instruction files, chosen per conversation":`角色描述 / 技能 / MCP / 指令文件的组合,按对话选用`,"View default role description":`查看默认角色描述`,"Custom role":`自定义角色`,"Role description":`角色描述`,"Replace pi opening role description":`替换 pi 开头的角色描述`,"Built-in default (read-only)":`内置默认(只读)`,"System prompt cannot be empty":`系统提示词不能为空`,"Failed to save system prompt":`系统提示词保存失败`,"Failed to read system prompt":`系统提示词读取失败`,"Only replaces the opening role paragraph. Available tools and everything after it stay unchanged. Applies to new and cold-restored sessions.":`仅替换开头的角色段落,Available tools 及之后的全部内容保持不变。新建及冷恢复的会话生效。`,"This is the pi opening role paragraph. Custom presets replace only this paragraph; tools, guidelines and project context stay unchanged.":`这是 pi 开头的角色段落。自定义预设只替换这段,工具、使用准则和项目上下文均保持不变。`,Global:`全局`,"Set as default":`设为默认`,"Plugin preset unavailable":`插件预设不可用`,"Bundled by {{plugin}}":`由插件 {{plugin}} 提供`,"Overlay plugin preset":`叠加插件预设`,"No overlay":`不叠加`,"Unavailable plugin preset":`插件预设不可用`,"Also loads the plugin preset's prompts, skills and overrides. Tails are joined (this preset first); the plugin's role, boost and refusal retry win. Ignored while the plugin is disabled.":`额外加载插件预设的提示词、skill 和覆盖项。两边的尾段依次拼接(本预设在前),角色、加强段和推脱补发以插件为准。插件停用时忽略。`,Default:`默认`,None:`不注入`,"Injection bundles of skills, MCP servers and instruction files, chosen per conversation":`skill / MCP / 指令文件的注入组合,按对话选用`,"Follows the enabled switches on the Skills / MCP / Instructions pages":`跟随技能 / MCP / 指令文件页的启用开关`,"{{skills}} skills · {{mcp}} MCP · {{instruction}} instruction":`{{skills}} 个技能 · {{mcp}} 个 MCP · {{instruction}} 份指令`,Tail:`真尾`,Boost:`Boost`,"Refusal retry":`拒答补发`,"Refusal retry prompt":`拒答补发正文`,Advanced:`高级`,"Request headers":`请求头`,"Add header":`添加请求头`,"Remove header":`移除请求头`,"Header values can only contain tab and single-byte characters (no Chinese, newlines, or NUL).":`请求头的值只能包含制表符和单字节字符(不能有中文、换行或空字符)。`,"Rewrites the role paragraph or appends text to the system prompt.":`改写角色段落,或往系统提示词末尾追加内容。`,"Import URL":`从 URL 导入`,"https://example.com/preset.json":`https://example.com/preset.json`,"Pinned after skills and working directory. Child sessions inherit this text.":`钉在 skills 和工作目录之后。子会话会继承这段文字。`,"Short override block after the tail. Child sessions inherit this text.":`接在真尾之后的短覆盖块。子会话会继承这段文字。`,"If the model refuses, send this once per turn as an internal follow-up. Child sessions inherit it.":`模型推脱时,每轮内部补发一次。子会话会继承。`,"Import hints (not selected): {{skills}} / {{mcp}}":`导入提示(未勾选):{{skills}} / {{mcp}}`,"Let the agent auto-discover skills under .agents/skills and .pi/skills":`让 agent 自动发现 .agents/skills、.pi/skills 下的 skill`,"Explore fold":`探后折叠`,"Explore mark":`开始探索`,"Turn discard":`丢弃本轮`,"Turn recall":`取回已丢弃`,Goal:`目标`,"Show process":`展开过程`,"Hide process":`收起过程`,Subagent:`子代理`,"Read report":`查看报告`,Wait:`等待`,"Dismiss agent":`解雇`,"List agents":`列出全部`,"Resume agent":`续跑`,"awaiting input":`等待输入`,validating:`校验中`,interrupted:`已中断`,"Run info":`运行信息`,"Timed out; unfinished agents keep running":`等待超时,未结束的子代理仍在运行`,"Wait was interrupted":`等待被打断`,creating:`创建中`,idle:`空闲`,parked:`已休眠`,closed:`已关闭`,"No agents":`没有子代理`,"Ask user":`询问用户`,"Task output":`查看后台任务`,"Task stop":`停止后台任务`,"Message coworker":`联系队员`,"Message main agent":`联系主 agent`,"Enso app":`Enso 应用`,"Recall memory":`回溯记忆`,"Memory search":`搜索记忆`,"Memory capture":`记录记忆`,"Memory crystallize":`提炼记忆`,"Memory delete":`删除记忆`,"Browser navigate":`浏览器 · 打开`,"Browser snapshot":`浏览器 · 快照`,"Browser click":`浏览器 · 点击`,"Browser type":`浏览器 · 输入`,"Browser tabs":`浏览器 · 标签页`,"Browser lock":`浏览器 · 锁定`,"Browser fill":`浏览器 · 填写`,"Browser press key":`浏览器 · 按键`,"Browser scroll":`浏览器 · 滚动`,"Browser select option":`浏览器 · 选择选项`,"Browser click xy":`浏览器 · 坐标点击`,"Browser drag":`浏览器 · 拖拽`,"Browser highlight":`浏览器 · 高亮`,"Browser bounding box":`浏览器 · 元素位置`,"Browser screenshot":`浏览器 · 截图`,"Browser CDP":`浏览器 · CDP`,"Let the agent mark exploratory reads and keep only a short report in later model context. Timeline stays intact.":`让模型在探仓库前打点,探完只把报告留在后续模型上下文里;时间线仍完整。`,"File edit mode":`文件编辑模式`,"Choose how files are modified. Apply patch is the default. New and cold-restored sessions use this mode; already warm sessions keep their current mode.":`选择文件修改方式。默认为应用补丁。新建和冷恢复的会话使用此模式;已在内存中的会话保持原模式。`,"Text replacement":`文本替换`,"Apply patch":`应用补丁`,"Tool search":`工具检索`,"Apply patch (default)":`应用补丁(默认)`,"Truncated preview":`截断预览`,"Diff unavailable because the original snapshot was truncated.":`原始快照已截断,无法显示完整差异。`,"Load project harness assets":`加载项目内其它工具目录`,"Also load skills from .claude/.codex/.cursor and rule files (.cursorrules, .cursor/rules, .claude/rules) in the project":`同时加载项目内 .claude/.codex/.cursor 下的 skills,以及规则文件(.cursorrules、.cursor/rules、.claude/rules)`,Custom:`自定义`,"Remove provider?":`删除该配置?`,"Removing this also signs out {{name}}. Other accounts for the same vendor stay signed in.":`删除会同时退登「{{name}}」。同一厂商下的其他账号仍保持登录。`,'This permanently deletes the "{{name}}" provider configuration.':`将永久删除「{{name}}」这项配置。`,"Sign-out failed: {{message}}":`退登失败:{{message}}`,Retry:`重试`,"Auto-retrying ({{attempt}}/{{max}})":`自动重试中 ({{attempt}}/{{max}})`,"Auto-retrying ({{attempt}})":`自动重试中(第 {{attempt}} 次)`,"retrying in {{seconds}}s":`{{seconds}}s 后重试`,"retrying…":`正在重试…`,"Cancel auto-retry":`取消自动重试`,"Delete anyway":`仍要删除`,Overridden:`已覆盖`,Catalog:`catalog`,Inherit:`跟随`,On:`开`,Off:`关`,"Thinking level":`思考档位`,Context:`上下文`,"Max tokens":`最大输出`,"Context window":`上下文窗口`,Estimate:`估算`,"Enabled instructions":`已启用指令`,"Enabled skills":`已启用 Skill`,"Tool definitions":`工具定义`,Conversation:`对话正文`,"Compaction summary":`压缩摘要`,Reminders:`续跑提示`,"{{count}} older messages are folded into the summary":`{{count}} 条旧消息已不在窗口,只留摘要`,"Current summary was produced by another model family":`当前摘要由另一模型生成`,"Context occupancy unavailable until the session starts":`会话启动后才能查看拆账`,"Conversation branch":`对话分支`,"Compact context":`压缩上下文`,"Compaction failed":`压缩失败`,"Compacting…":`正在压缩…`,"Compacts after this turn":`本轮结束后压缩`,"Compaction already in progress":`正在压缩中,请等待完成`,"Compaction is queued and runs after this turn":`压缩已排队,本轮结束后自动执行`,"Session not started yet — nothing to compact":`会话尚未启动,暂无可压缩的上下文`,"Workspace operation in progress — compact again when it finishes":`工作区操作进行中(切换分支、worktree 等),完成后再压缩`,"Workspace operation in progress":`工作区操作进行中`,"Compact the context now (/compact [summary focus])":`立即压缩上下文(/compact [摘要侧重])`,"Keep this session and start a parallel one from here":`保留源线,从这里开对话分支`,"Branched from {{title}}":`分支自 {{title}}`,"Estimated context window (catalog fallback)":`上下文窗口为估算值(取自模型目录回退)`,"{{model}} does not support reasoning":`{{model}} 不支持推理`,"Filter models in this entry":`在此配置内筛选模型`,"Showing {{shown}} of {{total}} models":`显示 {{shown}} / 共 {{total}} 个模型`,"Status line settings":`状态栏设置`,"Session stats":`会话统计`,"Recent request body":`最近请求体`,"Serialized payload":`已序列化`,"Before send":`发送前`,"Blocked before send":`超限,未发送`,"No data yet":`暂无数据`,"{{count}} coworkers":`{{count}} 名队员`,"Drag to reorder":`拖动排序`,Turns:`轮次`,Duration:`耗时`,Speed:`速度`,Tokens:`Token 用量`,"Cache hit rate":`缓存命中率`,"Session name":`会话名称`,"Approval mode":`审批档位`,Coworkers:`队员`,"Session time":`会话时长`,"Subscription usage":`订阅额度`,"resets in {{remaining}}":`{{remaining}} 后重置`,Minimal:`简洁`,Full:`完整`,Min:`极低`,Low:`低`,Medium:`中`,Med:`中`,High:`高`,Extra:`极高`,"Extra High":`极高`,Max:`最高`,"Loading diff…":`加载 diff…`,Copy:`复制`,Description:`描述`,Source:`来源`,"This computer":`本机`,"Switch node":`切换节点`,"{{n}} remote":`{{n}} 个远程`,"Connect to a node":`连接到节点`,"Connect to a node…":`连接到节点…`,Connect:`连接`,Create:`创建`,Project:`项目`,"No conversations":`没有会话`,"Connecting…":`连接中…`,"Remote desktop is offline":`对方桌面离线`,"Directory not found.":`目录不存在。`,"Project path is not a directory.":`项目路径不是目录。`,"On the other computer open Settings → Devices, generate a pairing code and copy the link. Paste it here.":`在对方电脑打开「设置 → 设备」,生成配对码并复制链接,粘到这里。`,"That is not an EnsoCode pairing link.":`这不是 EnsoCode 配对链接。`,"This pairing link has expired or was already used. Generate a new one.":`配对链接已过期或已被使用,请重新生成。`,"Could not reach the relay. Check your network and try again.":`无法连接中继,请检查网络后重试。`,Devices:`设备`,"Allow connections":`允许连入`,"Let your phone or another EnsoCode desktop connect to this computer. Keep this app running.":`让手机或另一台 EnsoCode 桌面连到这台电脑。需保持本应用运行。`,"Generate pairing code":`生成配对码`,"On another EnsoCode desktop, paste the link below into Settings → Devices → Connect to a node.":`在另一台 EnsoCode 桌面,把下方链接粘到「设置 → 设备 → 连接到节点」。`,"Generate a pairing code to let a phone or another desktop connect.":`生成配对码,让手机或另一台桌面连入。`,"Waiting for device":`等待设备`,"Direct link":`直连`,"Via relay":`中继`,Connected:`已连接`,"Desktop is offline":`桌面端离线`,"Pairing expired":`配对已失效`,"Reconnecting…":`重连中…`,"Turn on notifications":`开启推送通知`,"Turn off notifications":`关闭推送通知`,"Push notifications":`推送通知`,"Computers and notifications":`电脑与通知`,"Turning on notifications…":`正在开启推送…`,"Notifications need a newer desktop app.":`需先升级桌面端才能开启推送。`,"Add this app to the Home Screen before notifications can be turned on.":`iOS 需先用分享菜单「添加到主屏幕」,从主屏幕打开后才能开启。`,"This browser cannot show notifications.":`当前浏览器不支持推送。`,"Notification permission was denied. Allow notifications for this site and try again.":`通知权限被拒绝,请在浏览器站点设置中允许后重试。`,"Cannot reach the push service. Check the network or proxy and try again.":`无法连接推送服务,请检查网络或代理后重试。`,"Could not turn on notifications.":`无法开启推送。`,"View only":`只读`,"Can operate":`可操作`,"Click to switch: view-only devices cannot send, approve or stop.":`点击切换:只读设备不能发送、审批或停止。`,Copied:`已复制`,"Copy image":`复制图片`,"Image copied":`图片已复制`,"Image {{n}}":`图片 {{n}}`,"Image {{n}} not accepted: {{reason}}":`图片 {{n}} 未收下:{{reason}}`,"over 10 MB, not saved":`超过 10MB,没有保存`,"not a png / jpeg / webp / gif image, not saved":`不是 png / jpeg / webp / gif 图片,没有保存`,"could not be saved":`没能保存`,"Could not copy image":`复制图片失败`,"Copy failed":`复制失败`,"Browse and drive conversations on another EnsoCode desktop. Its agent, keys and history stay there.":`浏览并操控另一台 EnsoCode 桌面上的会话。agent、密钥与历史都留在对方机器上。`,"Connected nodes":`已连接的节点`,"No connected nodes":`还没有连接节点`,"Each connecting computer needs its own pairing code from the other desktop.":`每台要连入的电脑都需要对方桌面单独生成一个配对码。`,Disconnect:`断开`,"Configuration transfer":`配置迁移`,"Move models, presets, agent types, skills, MCP servers and instruction files between devices.":`在设备之间迁移模型、预设、子代理类型、技能、MCP 服务和指令文件。`,"Portable Enso configuration":`可移植 Enso 配置`,"Export a package or preview one before importing it.":`导出配置包,或在导入前预览配置包。`,"Import configuration":`导入配置`,"Export configuration":`导出配置`,Export:`导出`,"OAuth login sessions are never transferred. Skill, instruction, and system prompt contents require an encrypted export.":`OAuth 登录态不会迁移。技能、指令和系统提示词正文需要使用加密导出。`,"Create a portable .enso-config package for another device.":`创建可在另一台设备使用的 .enso-config 配置包。`,"File contents can be private":`文件内容可能包含私密信息`,"Skill and instruction file contents may contain private data, so configurations containing them can only be exported with encryption.":`技能和指令文件内容可能包含私密信息,因此包含这些文件的配置只能使用加密导出。`,"Include sensitive configuration":`包含敏感配置`,"Encrypt the entire package with a password. OAuth login sessions are still excluded.":`使用密码加密整个配置包。OAuth 登录态仍不会包含在内。`,"API keys, provider account links, MCP arguments and environment values, plus credentials and private URL parts in MCP endpoints, will be omitted. Configurations containing skill or instruction files require encryption.":`API Key、模型服务账号关联、MCP 参数和环境变量,以及 MCP 地址中的凭据和私密 URL 部分都会被省略。包含技能或指令文件的配置需要加密导出。`,"Encryption password":`加密密码`,"Confirm password":`确认密码`,"Use at least 8 characters. This password cannot be recovered.":`请使用至少 8 个字符。此密码无法恢复。`,"Password must be at least 8 characters.":`密码至少需要 8 个字符。`,"Passwords do not match.":`两次输入的密码不一致。`,"Configuration exported":`配置已导出`,"Saved package:":`配置包已保存至:`,"Export cancelled.":`导出已取消。`,"Exporting…":`正在导出…`,"Could not export configuration.":`无法导出配置。`,"Encrypted configuration package":`加密配置包`,"Enter the export password to decrypt and preview this package.":`请输入导出时设置的密码,以解密并预览此配置包。`,"Review {{fileName}} before changing this device.":`修改此设备前,请预览 {{fileName}}。`,"Import mode":`导入模式`,Merge:`合并`,"Add and update matching items while keeping items only on this device.":`新增并更新匹配条目,同时保留此设备独有的条目。`,Replace:`替换`,"Replace transferred item categories, removing local-only items in them.":`替换迁移的条目类别,并删除其中此设备独有的条目。`,"Preparing preview…":`正在准备预览…`,Category:`类别`,Added:`新增`,"Subagent Models":`子代理模型`,"Scalar settings":`标量设置`,"Portable settings changed:":`变更的可移植设置:`,Updated:`更新`,Skipped:`跳过`,Removed:`删除`,"Local-only configuration will be deleted":`此设备独有的配置将被删除`,"Items in transferred collections that exist only on this device will be removed. Removed counts are shown above. Included portable preferences are overwritten. A complete backup is created first.":`迁移集合中仅存在于此设备的条目将被删除。上方会显示删除数量。包含的可移植偏好会被覆盖,并会先创建完整备份。`,"Only import packages you trust":`只导入你信任的配置包`,"An imported package can change portable preferences and configuration. Skills and MCP servers may also run commands later when you use them. Previewing does not execute them; continue only if you trust the package.":`导入的配置包可以修改可移植偏好和配置。技能和 MCP 服务在之后使用时也可能运行命令。预览过程不会执行它们;请仅在信任配置包时继续。`,"Confirm configuration import":`确认导入配置`,"This package can change portable preferences and configuration. Continue only if you trust this package.":`此配置包可以修改可移植偏好和配置。请仅在信任此配置包时继续。`,"It includes skills or MCP servers that may execute commands when you use them.":`它包含在使用时可能执行命令的技能或 MCP 服务。`,"Replace mode removes local-only items from transferred collections and overwrites included portable preferences. A complete backup will be created first.":`替换模式会删除迁移集合中此设备独有的条目,并覆盖包中包含的可移植偏好。替换前会先创建完整备份。`,"Do you want to continue with this import?":`要继续导入吗?`,"Confirm import":`确认导入`,"Sensitive provider or MCP values were omitted; existing local values were preserved when available.":`敏感的模型服务或 MCP 配置值已省略;如本机已有对应值,则会保留。`,"OAuth login state is not included; sign in again after import.":`配置包不包含 OAuth 登录态;导入后请重新登录。`,"Imported MCP servers may require external commands, packages, or paths.":`导入的 MCP 服务可能依赖外部命令、软件包或本机路径。`,"Refresh preview":`刷新预览`,"Importing…":`正在导入…`,"Could not open configuration package.":`无法打开配置包。`,"Could not preview configuration package.":`无法预览配置包。`,"Could not import configuration.":`无法导入配置。`,"Invalid export options":`导出选项无效。`,"Invalid export request.":`导出请求无效。`,"Export password is too short.":`导出密码太短。`,"Configuration package is too large.":`配置包过大。`,"Unable to export configuration.":`无法导出配置。`,"A preset uses a system prompt that is missing or empty.":`有预设引用的系统提示词不存在或为空。`,"Could not write the export file. Check that the folder is writable.":`无法写入导出文件,请确认所选文件夹可写。`,"The selected file is a symbolic link. Choose a different location.":`所选文件是符号链接,请换一个位置保存。`,"These instructions were skipped because their source files are missing or unreadable:":`以下指令的源文件已丢失或无法读取,未包含在配置包中:`,"Skill, instruction, and system prompt contents require an encrypted export.":`技能、指令和系统提示词正文需要使用加密导出。`,"Invalid import request.":`导入请求无效。`,"Invalid configuration package.":`配置包无效。`,"Unable to read configuration package.":`无法读取配置包。`,"Invalid import preview request.":`导入预览请求无效。`,"Import session expired.":`导入会话已过期。`,"Import password is required.":`请输入导入密码。`,"Invalid import commit request.":`导入提交请求无效。`,"Import must be previewed before commit.":`提交导入前必须先预览。`,"Unable to commit configuration.":`无法提交配置。`,"Settings changed since preview; preview again.":`预览后设置发生了变化,请重新预览。`,"Unable to flush pending settings writes.":`无法刷新待写入的设置。`,"Unable to create settings backup.":`无法创建设置备份。`,"Unable to write settings.":`无法写入设置。`,"Import cancelled.":`导入已取消。`,"Configuration imported":`配置已导入`,"This window has been refreshed with the imported settings.":`此窗口已刷新为导入后的设置。`,"Configuration was imported, but this window could not refresh automatically.":`配置已导入,但此窗口无法自动刷新。`,"Reopen Settings to load the imported configuration in this window.":`请重新打开设置,以在此窗口载入导入后的配置。`,"Import complete":`导入完成`,"Backup of previous settings:":`之前设置的备份位置:`,Btw:`旁路`,Contextual:`带上下文`,Tangent:`独立旁路`,"Insert into chat":`填入主输入框`,"Ask aside…":`旁路提问…`,"Ask a side question without sending it to the main agent.":`旁路提问,不会发给主 agent。`,"New Btw tab":`新建旁路标签`,"Open a Btw tab in the side panel":`在右侧栏打开旁路对话`,"Unified agents: delegate one-shot tasks or keep persistent coworkers under Main control":`统一 Agent:委派一次性任务,或在 Main 控制下保留持久 coworker`,"Unified agent modes":`统一 Agent 模式`,"Choose which Agent modes the unified subagent tool may create in new sessions.":`选择统一 subagent 工具可在新会话中创建哪些 Agent 模式。`,"One-shot task agents":`一次性任务 Agent`,"Persistent coworkers":`持久 coworker`,"The unified subagent tool is off. Re-enabling it keeps this mode selection.":`统一 subagent 工具已关闭。重新开启时会保留此模式选择。`,"Follow global unified agent modes":`跟随全局统一 Agent 模式`,"When off, this project uses its own explicit Agent mode permission mask.":`关闭后,此项目使用自己明确配置的 Agent 模式权限掩码。`,Resources:`资源`,"CPU, memory and disk usage of EnsoCode and the processes it started.":`EnsoCode 及其启动的进程占用的 CPU、内存和磁盘。`,RAM:`内存`,Storage:`存储`,"App processes":`应用进程`,"Agent and tools":`Agent 与工具`,"Other child processes":`其他子进程`,"Scanning...":`扫描中...`,Clean:`清理`,"Cleaning...":`清理中...`,"Clean {{name}}?":`清理{{name}}?`,"You will be signed out of sites opened in the built-in browser.":`内置浏览器中打开过的网站将退出登录。`,"Deleted files cannot be restored.":`删除的文件无法恢复。`,"Show in folder":`在文件夹中显示`,"Conversation history":`对话记录`,"Conversation transcripts and usage ledger.":`对话记录文件与用量账本。`,"Coworker transcripts":`Coworker 记录`,"Secretary images":`秘书图片`,"Images sent to the secretary. Cleaning removes only images no message references any more and older than 7 days; referenced images are kept.":`发给秘书的图片。清理只删已不被任何消息引用、且超过 7 天的图片,仍被引用的保留。`,"Coworker journals; only those of deleted conversations are cleaned.":`Coworker 的对话记录;只清理已删除会话留下的。`,"Tool outputs":`工具输出`,"Saved long tool outputs; only those of deleted conversations are cleaned.":`落盘的超长工具输出;只清理已删除会话留下的。`,"Memory database and working memory.":`记忆数据库与工作记忆。`,"Local models":`本地模型`,"Downloaded embedding and chat models.":`已下载的嵌入与对话模型。`,Runtimes:`运行时`,"Bundled tools and GPU backends.":`内置工具与 GPU 后端。`,Worktrees:`Worktree`,"Isolated worktrees created for conversations.":`为会话创建的隔离 worktree。`,"Change snapshots":`变更快照`,"Baselines for the Changes panel.":`Changes 面板的编辑前基线。`,"Cookies, storage and cache of the built-in browser.":`内置浏览器的 Cookie、存储与缓存。`,"Rebuildable caches; cleaning is safe.":`可重建的缓存,清理是安全的。`,Logs:`日志`,"Task and memory logs; files written in the last 24 hours are kept.":`任务与记忆日志;保留最近 24 小时写入的文件。`,Backups:`备份`,"Configuration backup files; files from the last 24 hours are kept.":`配置备份文件;保留最近 24 小时内的文件。`,Configuration:`配置`,"Settings, instructions, prompts and credentials.":`设置、指令、提示词与凭证。`,"Chromium profile data and other files.":`Chromium 配置数据及其他文件。`,"Main process":`主进程`,"Main window":`主窗口`,Window:`窗口`,"Built-in browser":`内置浏览器`,Service:`服务`,Tool:`工具`,"Child process":`子进程`,"App data":`应用数据`,"Worktree directory":`Worktree 目录`,"Freed {{size}}":`释放 {{size}}`,"{{count}} files removed":`删除 {{count}} 个文件`,"{{count}} kept":`保留 {{count}} 个`,"{{count}} failed":`{{count}} 个失败`,"{{name}} cleaned":`已清理{{name}}`,"{{count}} conversations deleted":`已删除 {{count}} 个会话`,"Scanning {{count}} files · {{size}}":`正在扫描 {{count}} 个文件 · {{size}}`,"Scanned at {{time}} · took {{seconds}}s":`扫描于 {{time}} · 用时 {{seconds}} 秒`,"{{count}} paths could not be read and are not counted.":`{{count}} 个路径无法读取,未计入。`,"Include unarchived":`包含未归档会话`,'Delete "{{title}}"?':`删除「{{title}}」?`,"Delete {{count}} conversations?":`删除 {{count}} 个会话?`,"Delete {{count}} conversations in {{project}}?":`删除「{{project}}」下的 {{count}} 个会话?`,"About {{size}} of history, tool output and isolated worktrees will be removed and cannot be restored.":`将删除约 {{size}} 的对话记录、工具输出和隔离 worktree,无法恢复。`,"Open, running and waiting conversations are skipped.":`当前打开、运行中和等待处理的会话会跳过。`,"This chat is archived. Restore it before sending.":`该聊天已归档,恢复后才能发送。`,"Without @, the group owner replies":`不 @ 时由群主回复`,"{{name}} is replying; new messages are routed after they finish":`{{name}}回复中,新消息会在他说完后重新分配`,"Queued until a session slot frees up":`排队中,等有空闲会话名额后开始`,"Queued and has not started yet":`排队中,还没开始`,"{{name}} is working; your message joins the current turn":`{{name}}正在工作,新消息会插入当前这一轮`,"Message not sent":`消息未发送`,"{{n}} members · Owner {{name}}":`{{n}} 名成员 · 群主 {{name}}`,"Group info":`群信息`,"Member profile":`成员资料`,"Message {{name}}…":`给 {{name}} 发消息…`,"@ a member, or just say it…":`@ 成员,或直接说…`,Working:`工作中`,Idle:`空闲`,"Say hi to {{name}}":`和 {{name}} 打个招呼`,"{{name}} needs you":`{{name}} 需要你处理`,"Deleted member":`已删除成员`,everyone:`所有人`,"Mention a member":`提及成员`,"Reference a chat":`引用聊天`,"Unavailable chat":`不可用的聊天`,"Direct chat":`私聊`,"Referenced chat":`引用的聊天`,"Dispatch hint: {{note}}":`分派提示:{{note}}`,"The referenced chat no longer exists.":`引用的聊天已不存在。`,"A chat cannot reference itself.":`不能引用当前聊天本身。`,"The file is not inside this chat's workspace.":`文件不在该聊天的工作区内。`,"This skill is not available to the member.":`该成员没有这个技能。`,"{{names}} cannot use this skill; they will be told it is unavailable":`{{names}} 没有这个技能,投递时会告知其不可用`,"The member is busy. Try again after the current turn.":`成员正忙,请等这一轮结束后再试。`,"That message is no longer on the current branch.":`这条消息已不在当前分支上。`,"Custom color":`自定义颜色`,Inbox:`收件箱`,"Everything members are waiting on you for":`所有成员待你处理的事`,"Nothing needs your attention":`暂无待处理事项`,Approval:`审批`,"Go to chat":`去聊天`,"Always allow in this session":`本会话总是允许`,"Custom answer…":`自定义回答…`,Reply:`回复`,"{{name}} owns group chats":`{{name}} 是群主`,"Choose another owner in {{groups}} first.":`请先在「{{groups}}」中更换群主。`,"Export character card":`导出人物卡`,'Exports a SillyTavern V2 PNG: the avatar as image, persona embedded. Restore it in a new member via "Import character card".':`导出 SillyTavern V2 PNG:图片是头像,人设已嵌在其中。可在新建成员时用「导入人物卡」还原。`,'Persona embedded in the PNG. Restore it in a new member via "Import character card".':`人设已嵌在图片里,可在新建成员时用「导入人物卡」还原。`,Profile:`资料`,Abilities:`能力`,Routines:`例行`,History:`历史`,"Used for @ in groups; must be unique":`群内 @ 用,必须唯一`,Title:`头衔`,"Used for routing and the delegation directory":`用于路由和委派目录`,Responsibilities:`职责`,Persona:`人设`,"Avatar color":`头像颜色`,"Archive member":`归档成员`,Tools:`工具`,"All tools":`全部工具`,"Can delegate to":`可委派给`,"Accepts delegation from":`接受来自`,"Long-term memory":`长期记忆`,"No memories yet":`还没有记忆`,Discard:`放弃修改`,"Delete {{name}}?":`彻底删除 {{name}}?`,"Archive {{name}}?":`归档 {{name}}?`,"The member, their private chats, persona, memories and workspace are deleted. This cannot be undone.":`成员本身、与其的私聊、人设、记忆和工作区都会被删除,无法恢复。`,"Archived members stop replying and are hidden from the list. You can restore them later.":`归档后成员不再回复,并从列表隐藏,之后可以恢复。`,"All members":`所有成员`,"Selected members":`指定成员`,"No other members":`没有其他成员`,"Routines are coming soon.":`例行任务即将推出。`,"No routines yet":`还没有例行任务`,"Posts to {{chat}}":`投递到「{{chat}}」`,Paused:`已暂停`,"Conversation {{n}}":`会话 {{n}}`,"Group chats":`群聊`,"New group chat":`新建群聊`,"No group chats yet":`还没有群聊`,Members:`成员`,Member:`成员`,"New member":`新建成员`,"No members yet":`还没有成员`,"Nothing archived":`没有已归档的内容`,"Switch between Code and Bot":`切换 Code / Bot 模式`,"Only when Bot mode is enabled in Experimental settings":`需先在实验设置中开启 Bot 模式`,"Search Code projects or recent folders...":`搜索 Code 项目或最近打开的目录...`,"Chat threads":`聊天`,"Delete group chat?":`删除群聊?`,"The group timeline and its standalone workspace are deleted. Member sessions stay readable in their history.":`群聊记录及其独立工作区会被删除;成员的会话仍可在其历史中只读查看。`,"Archive chat":`归档聊天`,"Delete group chat":`删除群聊`,"Clone group chat":`克隆群聊`,Clone:`克隆`,"{{title}} copy":`{{title}} 的副本`,"Copies the setup of “{{title}}”. The original stays as is; replies in progress are not stopped.":`从「{{title}}」复制配置。原群保持原样,正在跑的回复也不会停。`,"Will copy":`会复制`,"Not copied":`不复制`,Routing:`分派`,"Relay {{hops}} · {{turns}} replies each":`接力 {{hops}} · 每人 {{turns}} 条`,"Same project: {{name}}":`沿用同一项目:{{name}}`,"A new empty folder, separate from the original":`新建空目录,和原群互不影响`,"Chat history, group notes, routines, task board and group memory":`聊天记录(新群是空的)、群笔记、例行任务、任务板、群记忆`,"Cloned. The chat history is empty.":`已克隆。聊天记录是空的。`,Topics:`话题`,"New topic":`新话题`,"Main topic":`主话题`,"Rename topic":`重命名话题`,"Delete topic":`删除话题`,"Delete this topic?":`删除这个话题?`,"Its messages and member sessions are removed; replies in progress are stopped. Group notes, memory and the task board stay.":`话题里的消息和成员会话会被删除,正在进行的回复会停止。群笔记、群记忆和任务看板保留。`,"Could not create topic":`无法新建话题`,"All topics ({{n}})":`全部话题({{n}})`,"Search topics...":`搜索话题...`,"No matching topics":`没有匹配的话题`,"All conversations ({{n}})":`全部对话({{n}})`,"Untitled conversation":`未命名对话`,"Workspace changed; view only":`工作目录已更换,只能查看`,"Switch conversation?":`切换对话?`,"The reply in progress will be stopped.":`正在进行的回复会停止。`,Switch:`切换`,Unread:`未读`,"Earlier conversation · {{n}} messages":`上一段对话 · {{n}} 条`,"Collapse earlier conversation":`收起上一段对话`,"Create members with their own persona, model and tools, then chat with them alone or in groups.":`创建拥有各自人设、模型和工具的成员,然后与他们私聊或拉群协作。`,"Pick a member or a group chat on the left.":`在左侧选择成员或群聊。`,"Group name":`群名`,Owner:`群主`,"Make owner":`设为群主`,"Remove from group":`移出群聊`,"Add member":`添加成员`,"Reply queue":`回复队列`,"relay {{n}}/{{max}}":`@ 接力 {{n}}/{{max}}`,Waiting:`排队`,"Per-member limit":`每人上限`,"{{n}} replies":`{{n}} 次`,Workspace:`工作区`,"Shared by all members":`所有成员共享`,"Routing limits":`路由上限`,"@ relay limit":`@ 接力上限`,"Replies per member":`每人回复次数`,"Group memory":`群记忆`,"No group memories yet":`还没有群记忆`,"Core notes":`核心笔记`,"Group notes":`群笔记`,"Injected into every new conversation":`每次新对话自动带上`,"Edit notes":`编辑笔记`,"Save failed":`保存失败`,"Notes were updated elsewhere; reloaded the latest version":`笔记已被更新,已加载最新版本`,"No notes yet. Key preferences and facts are summarized here automatically after memories are organized.":`还没有笔记。整理记忆后,重要的偏好和事实会自动汇总到这里。`,"No group notes yet. Group conventions and decisions are summarized here automatically after memories are organized.":`还没有群笔记。整理记忆后,群里的约定和决定会自动汇总到这里。`,"Beginning of the chat":`已经到顶了`,"Back to latest":`回到最新`,"Back to latest · {{n}} new":`回到最新 · {{n}} 条新消息`,"Say something. Mention a member with @, or the group owner replies.":`说点什么吧。@ 某个成员,或由群主来回复。`,Replying:`正在回复`,"View live":`实时查看`,Thinking:`思考中`,"Writing reply":`输出中`,"Calling tools":`调用工具`,Retrying:`重试中`,Denied:`已拒绝`,"Queued · concurrency limit reached":`排队中 · 并发已满`,"Queued · waiting for the current turn to finish":`排队中 · 等上一轮结束`,"Queued · checking whether tasks can run in parallel":`排队中 · 正在判断是否可并行`,"Queued · waiting for the member's current task to finish":`排队中 · 等待成员当前任务完成`,"Queued · waiting for the member's earlier tasks":`排队中 · 等待成员前序任务`,"Queued · waiting for the member to stop":`排队中 · 等待成员停止完成`,"Insert into {{name}}’s current task":`插到 {{name}} 当前任务`,Free:`空闲`,Planning:`思考`,Busy:`执行`,"Needs you":`等待`,Stuck:`异常`,Finished:`完成`,"In line":`排队中`,Task:`任务`,From:`谁派的`,Time:`用时`,"Waiting on":`在等`,"Nothing in progress":`没有进行中的事`,"Go handle it":`去处理`,"Your approval: {{title}}":`你批准:{{title}}`,"Your answer: {{title}}":`你回答:{{title}}`,"{{holder}} is editing {{file}}":`{{holder}} 改完 {{file}}`,"{{holder}} is running a workspace-wide command":`{{holder}} 跑完整个仓库的命令`,"A free slot (concurrency limit, not a person)":`空位(并发已满,不是在等某个人)`,"Its previous turn to finish":`上一轮结束`,"Still running, no output for {{time}}":`还在跑,但已经 {{time}} 没有输出`,"{{name}} is using this tab":`{{name}} 正在用这个标签页`,Delegation:`委派`,"In progress":`进行中`,"Running sessions and what needs you":`进行中的会话,以及需要你处理的`,"Today's board; optional date":`今天的看板;可带日期,如 /board 2026-05-20`,"Recent activity, with an older button":`最近的动态,底部可翻更早`,"Open todos":`未完成的待办`,"Scheduled tasks and next run":`定时任务与下次运行时间`,"Memory titles (off by default)":`秘书记得的标题(默认关闭)`,"Replay the last round; /last 3 for three":`回看秘书会话最近一轮;/last 3 看最近三轮`,"Mirror every reply here; /sync off stops it":`把所有回复同步到手机;/sync off 关掉`,"List every command":`列出所有命令`,"Commands you can send":`可以发的命令`,"Only groups on this list reach the secretary, and only messages from the bound account count. Messages from anyone else in the group are not received.":`只有名单里的群会进秘书,而且只认绑定的那个账号。群里其他人的话不会收。`,"No groups yet: group messages are not received.":`名单为空:群消息一律不收。`,"Group chat ID, e.g. -1001234567890":`群 chatId,例如 -1001234567890`,"Add group":`添加`,"Remove {{name}}":`删除 {{name}}`,"Group chat IDs are numbers, e.g. -1001234567890":`群 chatId 是数字,例如 -1001234567890`,"General (default topic)":`General(默认话题)`,"Topic #{{id}}":`话题 #{{id}}`,"Make sure the bot is in this group.":`确认 bot 已经在这个群里。`,"This chat is not a group":`这不是群聊`,"Pick at least one topic":`至少勾选一个话题`,"Another secretary already has this group or one of these topics":`这个群或其中某个话题已经交给别的秘书了`,"Whole group":`整群`,"Groups and topics":`群和话题`,"Pick topics":`选话题`,"Bind another group or topic":`再绑一个群或话题`,"Change topics":`改话题`,"What {{name}} hands to this secretary":`{{name}} 交给这个秘书的范围`,"Add the bot to the group: tap the button, or add @{{bot}} as a member in Telegram. For a forum group, turn on Topics first.":`把 bot 拉进群:点下面的按钮,或在 Telegram 里把 @{{bot}} 加为群成员。论坛群要先开启话题。`,"Send this in the group to hand the whole group to this secretary, or inside a forum topic to hand over only that topic:":`在群里发下面这条,整个群归这个秘书;在论坛话题里发,只把这个话题交给它:`,"<code>":`<绑定码>`,"Verify a bot above first; the binding code shows up here.":`先在上面验证 bot,绑定码会显示在这里。`,"Binding code of this secretary: {{code}}":`这个秘书的绑定码:{{code}}`,"Get a binding code":`生成绑定码`,"Bound groups show up in the list of this section, where you can switch between the whole group and picked topics.":`绑好的群会出现在这一块的群列表里,可以切换「整群」或「选话题」。`,"Claimed by other secretaries on this bot (read only):":`同一个 bot 上其他秘书认领的(只读):`,"belongs to {{owner}}":`归「{{owner}}」`,"Groups and topics: {{count}}":`群和话题:{{count}} 个`,"Or add a group by its chat ID:":`也可以直接填群的 chat ID 添加:`,"Topics: {{names}}":`话题:{{names}}`,"Loading topics…":`正在拉取话题…`,"Could not load topics: {{reason}}":`拉取话题失败:{{reason}}`,"Only topics the bot has seen are listed. If one is missing, send a message in that topic, then refresh. Topics you leave unchecked are ignored.":`列表里只有 bot 见过的话题。缺哪个,就在那个话题里发一句话再点刷新。没勾的话题一律忽略。`,"This group has no topics, so it can only be bound as a whole.":`这个群没开话题,只能整群交给秘书。`,"Allow viewing memory titles on Telegram":`允许在 Telegram 查看记忆标题`,"Off by default. /memory lists titles only, never the memory text.":`默认关闭。/memory 只列标题,不显示记忆正文。`,"Mirroring every conversation to Telegram":`正在把所有对话同步到 Telegram`,"Every reply in the secretary conversation is sent to your phone, not just milestones. Silent turns arrive as a one-line summary. Telegram messages are not end-to-end encrypted and stay on Telegram servers. Send /sync off in Telegram to stop.":`秘书会话里每一轮回复都会发到手机,不再只发里程碑;静默回合只发一行摘要。Telegram 消息不是端到端加密的,会存在 Telegram 的服务器上。在 Telegram 发 /sync off 可以关掉。`,"Only milestones go to Telegram. Send /sync in Telegram to mirror every reply; /last replays the latest round.":`目前只把里程碑发到 Telegram。在 Telegram 发 /sync 可以把每一轮回复都同步过去;/last 回看最近一轮。`,"Followed from the phone: {{count}}":`手机关注的 {{count}} 个任务`,"Clear all":`全部清空`,"What you dispatch or schedule from the phone keeps reporting here until it finishes or fails once, even with /sync off.":`从手机派出的会话或加的定时会一直把结果推到这里,直到完成或失败推过一次,/sync 关着也一样。`,Drop:`取消`,"Telegram messages are not end-to-end encrypted and stay on Telegram servers. /status, /board and /feed show titles and short summaries; /last and /sync send conversation text. Memory text and tool output never leave the app.":`Telegram 消息不是端到端加密的,会存在 Telegram 的服务器上。/status、/board、/feed 只显示标题与简短摘要;/last 与 /sync 会发会话正文。记忆正文与工具输出不会离开应用。`,"Waiting on a background task":`等后台任务`,"Service running":`有常驻服务`,"Done ({{count}} leftover tasks)":`已完成({{count}} 个遗留任务)`,"Stop leftover tasks":`停止遗留任务`,"Stop background task {{task}}":`停止后台任务 {{task}}`,"Stopped {{count}} background tasks":`停止了 {{count}} 个后台任务`,"Stopping…":`正在停止…`,"Persistent service":`常驻服务`,Leftover:`疑似遗留`,Continuing:`续跑中`,"Taken over":`已接管`,"Started {{time}}":`派出于 {{time}}`,Canceled:`已取消`,"No process recorded.":`没有记录到过程。`,"View process":`查看过程`,"Run history":`历次执行`,"+{{n}} appended":`+{{n}} 追加`,Processing:`处理中`,Delivered:`已送达`,"Not delivered":`未送达`,"Merged into the current run":`已并入当前执行`,"Open task card #{{n}}":`打开任务卡 #{{n}}`,"Expand delegation result":`展开委派结果`,"Collapse delegation result":`收起委派结果`,"Merged into the current run of #{{n}}":`已并入 #{{n}} 当前执行`,Delegated:`派活`,Appended:`追加`,"Resumed after reply":`回复后继续`,Rework:`返工`,"Sub-delegation":`转派`,"Run {{n}} · {{source}}":`第 {{n}} 次执行 · {{source}}`,"Queued {{time}}":`排队 {{time}}`,Continue:`继续`,"Start over":`重新开始`,"Will retry automatically":`将自动重试`,"Retrying automatically at {{time}} (attempt {{n}})":`将于 {{time}} 自动重试(第 {{n}} 次)`,"Retrying automatically · attempt {{n}}":`自动重试中 · 第 {{n}} 次`,"Retry #{{n}} · {{source}}":`第 {{n}} 次重试 · {{source}}`,Automatic:`自动`,"By delegator":`委派人`,"Delegator note: {{note}}":`委派人补充:{{note}}`,"Retry now":`立即重试`,"Skip the wait and retry now. The scheduled automatic retry is canceled.":`不再等待,立即重试;已排定的自动重试会取消。`,"Result posted to the group · View":`结果已发到群里 · 查看`,"Delegation result":`委派结果`,"Locate the delegation card":`定位到对应的委派卡片`,"The delegation card is posted after the delegator receives the result.":`委派人收到结果后,委派卡片才会发到群里。`,"The delegation card is not in the loaded messages.":`委派卡片不在已加载的消息里。`,"{{n}} steps":`{{n}} 步`,"Could not locate this reply; showing the latest turn.":`未定位到这条回复,显示最近一轮。`,"No tool calls in this turn.":`这一轮没有工具调用。`,"Open full conversation":`打开完整会话`,"Delete failed":`删除失败`,"Memory not found":`记忆不存在`,"Memory title":`记忆标题`,"Memory content":`记忆内容`,"Switch mode":`切换模式`,"This file is not valid JSON.":`该文件不是有效的 JSON。`,"This file is not a SillyTavern character card.":`该文件不是 SillyTavern 人物卡。`,"Members have their own persona, model, tools and memory. Their name is how you @ them in groups.":`成员拥有各自的人设、模型、工具和记忆;名字用于在群里 @ 他。`,"From template":`从模板`,Blank:`空白`,"Import character card":`导入人物卡(PNG / JSON)`,"Upload avatar":`上传头像`,"Remove avatar":`移除头像`,"Crop avatar":`裁切头像`,Zoom:`缩放`,"Use this avatar":`使用此头像`,"Drag to move, scroll to zoom.":`拖动调整位置,滚轮缩放。`,"This image cannot be used as an avatar.":`该图片无法用作头像。`,"Avatar update failed":`头像更新失败`,"Blank member":`空白成员`,"Create and start chatting":`创建并开始私聊`,"One member replies at a time. Without @, the best-fit member is picked to reply.":`一次只有一位成员回复;没人被 @ 时智能选出最合适的成员回复。`,"Pick at least two, and one owner":`至少选两位,并指定一位群主`,"Create at least two members first.":`请先创建至少两名成员。`,"Shared workspace":`共享工作区`,"Based on a Code project":`基于 Code 项目`,"Members read and write directly in the project folder":`成员直接在项目目录里读写`,"Standalone workspace":`独立工作区`,"A new empty folder for this group, removed with the group":`为这个群新建一个空目录,删除群时一并清理`,"All members share this folder: anyone who can talk to a member can reach its contents through them. You can change it later in group info (members start new conversations).":`群内成员共享这个目录,能和任一成员对话的人,都能经由他触达目录里的内容。创建后可在群信息里改选(成员会各开新会话)。`,"@ relay limit (per message of yours)":`@ 接力上限(你的每条消息之后)`,"Max replies per member":`每个成员最多回复几次`,"This conversation has no history yet.":`这个会话还没有记录。`,"Member's own workspace":`成员自己的工作区`,"Change workspace":`更换工作区`,"Change workspace?":`更换工作区?`,"Members start new conversations in the new workspace. Earlier conversations stay readable in history.":`成员会在新工作区里各开新会话,旧会话保留在历史中只读查看。`,Change:`更换`,"Names can use up to 24 letters, digits, _ or -, without spaces.":`名字最多 24 个字符,只能包含文字、数字、_ 或 -,不能有空格。`,"This name is reserved. Choose another one.":`这个名字是保留名,请换一个。`,"Another member already uses this name.":`已有成员使用这个名字。`,"Another secretary already uses this name.":`已有别的秘书叫这个名字。`,"This member was changed elsewhere. Refresh and try again.":`该成员已在别处被修改,请刷新后重试。`,"This member no longer exists.":`该成员已不存在。`,"Group chat is not available right now.":`群聊暂不可用。`,"This chat was changed elsewhere. Refresh and try again.":`该聊天已在别处被修改,请刷新后重试。`,"Untitled group":`未命名群聊`,"{{name}}'s workspace":`{{name}}的工作区`,"Group workspace":`群工作区`,"Missing project":`项目已不存在`,"Group reply picker model":`群聊选人模型`,"Bot assistant model":`Bot 助理模型`,"Used for helper tasks such as auto-configuring member abilities.":`用于自动设置成员能力等辅助任务。`,"Features still being tested. They may change or be removed.":`仍在测试中的功能,之后可能调整或移除。`,"Bot mode settings":`Bot 模式设置`,"Settings shared by all members and group chats.":`所有成员和群聊共用的设置。`,"Bot concurrency limit":`Bot 并发上限`,"Shared by private chats, group chats, delegations and routines. Lowering it never interrupts running work; raising it may hit model rate limits.":`私聊、群聊、委派和例行任务共用一个上限。调低不会打断进行中的回复;调高可能触发模型限流。`,Apply:`应用`,"None selected":`未选择`,"Suggested changes":`建议的修改`,"Auto-configure abilities":`自动设置能力`,"Let a model suggest abilities from the name, title, responsibilities and persona.":`让模型根据名称、头衔、职责和人设推荐能力配置。`,"Current abilities already match the suggestion.":`当前能力已与推荐一致。`,"No model is available. Set a default model or a Bot assistant model first.":`没有可用的模型,请先设置默认模型或 Bot 助理模型。`,"Generate with AI":`AI 生成`,"Start from a goal":`从目标开始`,"Tell us in one sentence what you want done; we will recommend a member or a team and draft your first message.":`用一句话说说你想做什么,我们推荐一位成员或一个团队,并帮你起草第一条消息。`,"e.g. Track competitor news every week and send me a summary":`例如:每周跟踪竞品动态,给我发一份摘要`,Recommend:`推荐`,"Recommended: one member":`推荐:单个成员`,"Recommended: a team":`推荐:一个团队`,"First message (put into the input box, not sent)":`第一条消息(放进输入框,不会自动发送)`,"Create this member":`创建这位成员`,"Use this member":`用这个成员`,"Create new instead":`还是新建`,"Could not open chat. Try again.":`无法打开私聊,请重试。`,"Create this team":`创建这个团队`,"Fill in a name and title first.":`请先填写名称和头衔。`,"Persona generated":`人设已生成`,"Persona and responsibilities generated":`人设和职责已生成`,Undo:`撤销`,"The model did not answer in time. Try again.":`模型未及时响应,请重试。`,"The model reply could not be understood. Try again.":`无法理解模型的回复,请重试。`,"Fill in a name, title or responsibilities first.":`请先填写名称、头衔或职责。`,"Could not get suggestions":`获取推荐失败`,"Tools, approval, skills, MCP, delegation and memory":`工具、审批、技能、MCP、委派与记忆`,"When nobody is @-mentioned in a smart-routing group, this model picks which member replies.":`在「智能选人」的群里没人被 @ 时,用这个模型选出回复的成员。`,"Default (title model)":`默认(跟随标题总结模型)`,"Fast chat model":`快速聊天模型`,"Falls back to the group owner on timeout, error or an unclear answer.":`超时、出错或回答不明确时由群主回复。`,"Handed to the group owner on timeout.":`超时就交给群主处理。`,"Discussion mode":`讨论模式`,"Experimental feature":`实验性`,"Off: group chats work the same as the stable release. On: in smart-routing groups, discussion-style messages let the judge model pick who speaks next.":`关闭时,群聊流程与正式版一致。打开后,智能选人的群里遇到讨论类消息,会由判断模型挑选下一位发言人。`,"First pick: the group owner replies on timeout, error or an unclear answer. During a discussion, picking the next speaker ends the discussion in these cases.":`首轮选人遇到超时、出错或回答不明确时由群主回复;讨论中判断下一位遇到这些情况时,结束本轮讨论。`,"First pick: handed to the group owner on timeout. Next speaker in a discussion: the discussion ends on timeout.":`首轮选人超时交给群主回复;讨论中判断下一位超时则结束本轮讨论。`,"Uses the primary model on timeout.":`超时就用主模型。`,Timeout:`超时`,"Without @":`不 @ 时`,"Group owner replies":`群主回复`,"Smart pick":`智能选人`,"Search messages":`搜索消息`,"Search group and direct messages…":`搜索群聊与私聊消息…`,"No matching messages":`没有匹配的消息`,"Deleted chat":`已删除的聊天`,"Showing the latest {{n}} matches":`仅显示最近 {{n}} 条匹配`,"Show in Finder":`在访达中显示`,"Open with default app":`用默认应用打开`,"This file type is only shown in Finder":`该类型文件只能在访达中显示`,"Could not open the file":`无法打开文件`,"The file is too large to preview":`文件过大,无法预览`,"Web screenshot":`网页截图`,"Desktop screenshot":`桌面截图`,"Workspace image":`工作区`,"Not sent: still over 10 MiB after compression":`没发出去:压缩后仍超过 10MiB`,"Chat image storage is full (200 MiB); not saved":`群图片空间已满(200 MiB),没收下`,"Desktop screenshots may capture sensitive content from other windows.":`桌面截图可能拍到别的窗口里的敏感内容。`,"Copied into this chat: later edits or deletion of the original do not change it. Deleted together with the chat.":`已复制到聊天目录:原文件后来被改或删,这张不变;删聊天时一起删。`,"Choosing who replies…":`正在选择回复人…`,"Picked automatically because nobody was @-mentioned":`没人被 @,由智能选人选出`,"Smart pick · build":`智能选人 · 执行`,"Smart pick · answer":`智能选人 · 解答`,"Smart pick · discuss":`智能选人 · 讨论`,"Owner summary":`群主汇总`,"Asked to sum up after the assigned members replied":`派出的成员都回复后,提醒群主汇总`,Mute:`静音`,Unmute:`取消静音`,Muted:`静音`,"Replies only when @-mentioned by name":`只有被点名 @ 时才回复`,"Without @, the best-fit member is picked to reply":`不 @ 时智能选出最合适的成员回复`,"Adds a Code | Bot switch to the sidebar. Create members with their own persona, model and tools, and chat with them alone or in groups.":`在侧栏顶部加入 Code | Bot 切换。创建拥有各自人设、模型和工具的成员,与他们私聊或拉群协作。`,Interrupted:`中断`,"The app restarted before this task finished. It was stopped and will not rerun.":`应用重启时任务未完成,已停止,不会自动重做。`,"Timed out after {{n}} minutes.":`超过 {{n}} 分钟未完成,已超时。`,"Denied.":`已被拒绝。`,"Cancel failed":`取消失败`,"Retry failed":`重试失败`,"{{from}} → {{to}} · Delegation":`{{from}} → {{to}} · 委派`,"Check the title, prompt and schedule, and that the member is still in the target chat.":`请检查标题、提示词和时间表,并确认成员仍在目标聊天中。`,"This routine no longer exists.":`该例行任务已不存在。`,"The member or target chat is archived or unavailable.":`成员或目标聊天已归档或不可用。`,"Bot mode is off.":`Bot 模式已关闭。`,"Enter a title.":`请填写标题。`,"Enter what the member should do.":`请填写成员要做的事。`,"Invalid cron expression (minute hour day month weekday).":`cron 表达式无效(分 时 日 月 周)。`,"Choose a target chat.":`请选择目标聊天。`,"Routine not saved":`例行任务未保存`,"Routine started":`例行任务已开始运行`,"Routine task":`例行任务`,"Group messages":`群消息`,"Task from {{name}}":`来自 {{name}} 的委派任务`,"Result from {{name}}":`{{name}} 的结果`,"Delegation results":`委派结果`,"Continue delegated task":`继续委派任务`,"Acceptance check not passed":`验收未通过`,"Routine did not run":`例行任务未能运行`,"Routine not deleted":`例行任务未删除`,"New routine":`新建例行任务`,Enabled:`已启用`,"Target chat missing":`目标聊天已不存在`,"Last run {{time}} · {{result}}":`上次 {{time}} · {{result}}`,Error:`出错`,"Never run":`尚未运行`,"Missed {{n}} times":`错过 {{n}} 次`,"Run now":`立即运行`,'Delete routine "{{title}}"?':`删除例行任务「{{title}}」?`,"It will no longer run. This cannot be undone.":`删除后不再运行,且无法恢复。`,"Group chat":`群聊`,"Private chat":`私聊`,"Edit routine":`编辑例行任务`,"Routine title":`标题`,"Sent to the member as the task each time it runs":`每次运行时作为任务发给成员`,"cron: minute hour day month weekday, local time":`cron:分 时 日 月 周,本地时间`,Schedule:`时间表`,"Next run {{time}}":`下次运行 {{time}}`,"Never runs":`不会触发`,"Approve this routine before running it. You can still do a dry run.":`请先批准该例行任务再运行;仍可以先试运行。`,"This routine is already running.":`该例行任务正在运行。`,"This routine is blocked. Fix the problem and enable it again.":`该例行任务已被阻塞,处理问题后重新启用。`,"The member who runs it was deleted.":`执行成员已被删除。`,"The member who runs it is archived.":`执行成员已归档。`,"The target chat no longer exists.":`目标聊天已不存在。`,"The target chat is archived.":`目标聊天已归档。`,"The member who runs it is no longer in the target chat.":`执行成员已不在目标聊天中。`,"Delegation permissions do not allow that member to run it.":`委派权限不允许由该成员执行。`,"Skipped (still running)":`跳过(上次仍在运行)`,Blocked:`已阻塞`,Running:`运行中`,"Dry run started":`试运行已开始`,"Done by {{name}}":`由 {{name}} 执行`,"Dry run":`试运行`,Reject:`拒绝`,Approve:`批准`,"Enable again":`重新启用`,"Pending approval":`待批准`,"Routine removed":`已删除`,Scheduled:`定时`,Manual:`手动`,"Catch-up":`补跑`,"Routine blocked":`例行任务已阻塞`,"Proposed by {{name}}, waiting for your approval":`{{name}} 提议,等待你批准`,"No catch-up":`不补跑`,"Run once without affecting the schedule":`运行一次,不影响调度`,"No runs yet":`还没有运行记录`,"Open chat":`打开聊天`,"Every day":`每天`,Weekdays:`工作日`,"Every week on":`每周`,Simple:`简单`,"Advanced (cron)":`高级(cron)`,"The member itself":`成员自己`,"Another member of the target chat runs it, as a delegation":`由目标聊天里的另一位成员执行,受委派权限约束`,"Done by":`执行者`,"If the app was closed at the scheduled time, run the latest missed one once on startup":`到点时应用未运行,启动后补跑最近错过的一次`,"Catch up missed runs":`补跑错过的运行`,"Routine dry run":`例行任务试运行`,"Target chat":`目标聊天`,"This member is not in any chat yet. Start a private chat first.":`该成员还不在任何聊天中,请先发起私聊。`,"Daily at 9:00":`每天 9:00`,"Weekdays at 9:00":`工作日 9:00`,"Mondays at 9:00":`每周一 9:00`,Hourly:`每小时`,"Interrupted delegations":`中断的委派`,"Quiet for {{n}}s":`已安静 {{n}} 秒`,Settled:`已搁置`,Settle:`搁置`,"Back to in progress":`回到进行中`,"Remind me later":`稍后提醒`,"In 1 hour":`1 小时后`,"In 3 hours":`3 小时后`,"Tomorrow 9:00":`明天 9:00`,"Remind {{time}}":`{{time}}提醒`,"Mark as unread":`标为未读`,"Move up":`上移`,"Move down":`下移`,"{{name}} is still running but has produced no output for a while":`{{name}} 仍在运行,但已有一段时间没有任何输出`,"View conversation":`查看会话`,"{{name}} on behalf of {{owner}}":`{{name}} 替 {{owner}} 执行`,"Delegations in progress · {{n}}":`进行中的委派 · {{n}}`,"{{name}} (on behalf of {{owner}}) needs you":`{{name}} 替 {{owner}} 执行 · 需要你处理`,"Task board":`看板`,Delegations:`委派`,"New task":`新建任务`,"Edit task #{{n}}":`编辑任务 #{{n}}`,"Task title":`任务标题`,Details:`详情`,"Check the title and details.":`请检查标题和详情。`,"No tasks yet. Members can also add and claim tasks with the board tool.":`还没有任务。成员也可以用看板工具新建和认领任务。`,"To do":`待办`,Doing:`进行中`,"Awaiting review":`待验收`,"Accept result":`验收通过`,Return:`退回`,"Return task #{{n}}":`退回任务 #{{n}}`,"Return task #{{n}} for rework":`退回返工 #{{n}}`,"Return for rework":`退回返工`,"{{name}} continues in the same conversation with this reason, and the result comes back for review.":`{{name}} 会带着退回原因在原会话里接着改,改完回到待验收。`,"Reason for returning":`退回原因`,"Enter a reason.":`请填写原因。`,"The task goes back to To do with this reason and can be reassigned.":`任务会带着原因回到待办,可以重新指派或委派。`,"Returned: {{reason}}":`退回原因:{{reason}}`,"Show all ({{n}})":`显示全部({{n}})`,"Assign to":`指派给`,"Reassign to":`改派给`,"Stuck tasks":`卡住`,"Stuck run":`卡住了`,"Stuck delegated tasks":`卡住的任务`,"Blocked · needs: {{need}}":`卡住·缺:{{need}}`,"Blocked · run failed: {{reason}}":`卡住·执行失败:{{reason}}`,"Answer {{name}}; they continue after your reply…":`回复 {{name}},回复后接着做…`,"Stuck for {{time}}":`已卡 {{time}}`,"Waiting for your reply":`等你回复`,"Waiting for {{name}} to reply":`等 {{name}} 回复`,"Waiting for you to handle it":`等你处理`,"Stuck several times in a row; only you can answer now.":`已连续卡住多次,只能由你回复。`,"Answered; the work continues":`已回复,接着做`,"Open task card":`打开任务卡`,Reassign:`改派`,"Add to the current run…":`补充给当前执行…`,"Comment…":`评论…`,"Send reply":`发送回复`,"Reply not sent":`回复未发送`,"Mark done":`标记完成`,"Move off the board":`移出`,"Model: {{model}}":`模型:{{model}}`,"Undo mark done":`撤销标记`,"Cancel task":`取消任务`,"Acceptance check":`验收条件`,"Acceptance check (optional)":`验收条件(可选)`,"Done only when the member's tool output contains this text, e.g. a command printing ALL_TESTS_PASS.":`成员的工具输出包含这段文字才算完成,例如命令打印 ALL_TESTS_PASS。`,Passed:`通过`,"Not passed":`未通过`,'Acceptance check failed: "{{text}}" not found in tool outputs.':`验收未通过:未在工具输出中看到「{{text}}」`,Unassigned:`未指派`,You:`你`,"Created by {{name}}":`由 {{name}} 创建`,"Task not assigned":`任务未指派`,"Task not updated":`任务未更新`,"Task not deleted":`任务未删除`,"Delete task #{{n}}?":`删除任务 #{{n}}?`,"The task is removed from the board. This cannot be undone.":`任务将从看板移除,且无法恢复。`,"No delegations in this group yet":`本群还没有委派`,"Failed · interrupted · canceled":`失败 · 中断 · 取消`,"Choose a member.":`请选择成员。`,"Create team from template":`从模板创建团队`,"Creates the members and their group chat in one go. Members follow the default model; expand a member to set tools, approval, delegation, skills and MCP, or let AI set them.":`一次性创建成员和群聊。成员跟随默认模型;展开成员可设置工具、审批、委派、技能和 MCP,也可让 AI 自动设置。`,"AI auto-configure":`AI 自动设置`,"No skills or MCP":`未选技能和 MCP`,"{{n}} skills · {{m}} MCP":`{{n}} 个技能 · {{m}} 个 MCP`,"Configured abilities for {{n}} members":`已为 {{n}} 位成员设置能力`,"Suggestions failed for {{n}} members":`{{n}} 位成员的推荐失败`,"Import team (JSON)":`导入团队(JSON)`,"This team file is too large.":`团队文件过大。`,"This team file comes from an unsupported version.":`团队文件版本不受支持。`,"This file is not a valid EnsoCode team file.":`该文件不是有效的 EnsoCode 团队文件。`,"Uncheck members you do not need; the owner stays":`可取消不需要的成员,群主保留`,"Delegates to {{names}}":`可委派给 {{names}}`,'"{{from}}" is taken, renamed to "{{to}}"':`「{{from}}」已被占用,已改名为「{{to}}」`,"Keep the owner and at least one other member.":`至少保留群主和另一名成员。`,"Without @, the best-fit member replies; @ relay limit {{n}}.":`不 @ 时由最合适的成员回复;@ 接力上限 {{n}} 次。`,"Without @, the owner replies; @ relay limit {{n}}.":`不 @ 时由群主回复;@ 接力上限 {{n}} 次。`,"Create team":`创建团队`,Team:`团队`,"Export team":`导出团队`,"Export failed":`导出失败`,"Save as team template":`存为团队模板`,"Saved as team template":`已存为团队模板`,"Could not save as team template":`无法存为团队模板`,"Bot templates":`Bot 模板`,"Templates used when creating members and teams. Built-in templates can be edited, hidden or restored.":`新建成员和团队时使用的模板。内置模板可以修改、隐藏或恢复默认。`,"Member templates":`成员模板`,"Team templates":`团队模板`,"Member template":`成员模板`,"Team template":`团队模板`,"New member template":`新建成员模板`,"New team template":`新建团队模板`,"Could not save templates":`模板保存失败`,"Imported as a custom team template":`已导入为自定义团队模板`,"Duplicate as custom":`复制为自定义`,Show:`显示`,Hide:`隐藏`,"Restore default":`恢复默认`,"{{n}} members":`{{n}} 名成员`,"Export JSON":`导出 JSON`,Modified:`已修改`,Hidden:`已隐藏`,Summary:`摘要`,"Shown on the template card":`显示在模板卡片上`,"Check the template fields":`请检查模板内容`,"Enter a team title":`请填写团队标题`,"A team needs 2–12 members":`团队需要 2–12 名成员`,"Every member needs a valid name":`每个成员都需要合法的名字`,Unnamed:`未命名`,"Group settings and member personas only. Memory, sessions, timeline, tasks, routines, models, skills and MCP are not included.":`只含群配置和成员人设,不含记忆、会话、时间线、看板、例行任务、模型、技能和 MCP。`,"Interface is zoomed to {{percent}}% · {{shortcut}}":`界面已缩放至 {{percent}}% · {{shortcut}}`,"Restore 100%":`恢复 100%`,"Uninstall 'enso' Command from PATH":`卸载 enso 命令`,"Uninstall Finder Quick Action":`卸载访达快速操作`,"Couldn't uninstall the 'enso' command":`无法卸载 enso 命令`,"Shell command 'enso' uninstalled.":`已卸载 enso 命令。`,"Couldn't uninstall the Finder Quick Action":`无法卸载访达快速操作`,"Finder Quick Action uninstalled.":`访达快速操作已卸载。`,"In progress…":`处理中…`,Dispatch:`派活`,"Confirm dispatch":`确认派活`,"Project checkout":`项目目录`,"Waiting for your confirmation":`等待你确认`,"Creating the session…":`正在创建会话…`,"Session created":`已创建会话`,Rejected:`已拒绝`,Expired:`已过期`,"Secretary settings":`秘书设置`,"Re-run setup":`重新设置秘书`,Secretaries:`秘书`,"New secretary":`新建秘书`,"Delete secretary":`删除秘书`,"Delete this secretary?":`删除这个秘书?`,"This cannot be undone. The sessions it manages stay, but nobody manages them afterwards; its contact bindings are released and its private memory is deleted.":`删除后无法恢复。它管的会话会保留,但之后无人管理;它的联系方式绑定会释放,私有记忆会删除。`,"Sessions it manages ({{n}})":`它在管的会话({{n}})`,"Open todos ({{n}})":`未完成的待办({{n}})`,"Schedules ({{n}})":`定时({{n}})`,"Contact bindings ({{n}})":`联系方式绑定({{n}})`,"Private memories: {{n}}":`私有记忆:{{n}} 条`,"Nothing is managed by this secretary.":`这个秘书没有在管的东西。`,"Next: confirm again":`下一步:再确认一次`,"Transfer to…":`转交给…`,"Transferred to {{name}}":`已转交给 {{name}}`,"Transfer to {{name}}":`转交给 {{name}}`,"Transfer failed":`转交失败`,"The other secretary cannot see this project.":`对方秘书看不到这个项目。`,"The other secretary has no conversation yet: open it once first.":`对方秘书还没有会话,先打开它一次。`,"No secretary manages this session.":`这个会话没有秘书在管。`,"This secretary":`本秘书`,"All secretaries":`全部秘书`,"Filter by secretary":`按秘书筛选`,"Bound to groups and topics":`已绑定群与话题`,"Groups and topics bound to this secretary":`绑定到这个秘书的群与话题`,"Messages there go to this secretary only, and its updates are posted there. One bot can serve several secretaries: each chat or forum topic belongs to one of them.":`那里的消息只交给这个秘书,它的提醒也发到那里。一个 bot 可以给多个秘书用:每个 chat 或 forum 话题只归其中一个。`,"Topic {{id}}":`话题 {{id}}`,"Add the bot to a group":`把 bot 拉进群`,"The code works once. Press Start in a private chat with the bot, or send it in a group or forum topic to bind that place to this secretary instead.":`绑定码只能用一次。在与 bot 的私聊里点 Start,或在群、forum 话题里发送它,把那里绑定到这个秘书。`,'Your private chat with this bot already belongs to secretary "{{owner}}". One person has only one private chat with a bot, so bind this secretary to a group or forum topic below, or give it a different bot.':`你和这个 bot 的私聊已经归秘书「{{owner}}」。同一个人和同一个 bot 只有一个私聊,所以请把这个秘书绑到下面的群或论坛话题,或者给它换一个 bot。`,'That group or topic already belongs to secretary "{{owner}}". Send the code in another group or topic.':`那个群或话题已经归秘书「{{owner}}」。换一个群或话题发送绑定码。`,"The code expired. Generate a new one.":`绑定码已过期,请重新生成。`,"The bot got /start without the code. Open the bot with the button or QR code (the link carries the code), or send /start {{code}} yourself.":`bot 收到了不带绑定码的 /start。请用按钮或二维码打开 bot(链接里带着码),或者手动发送 /start {{code}}。`,'Your private chat with this bot already belongs to secretary "{{owner}}". Bind this secretary to a group or forum topic instead.':`你和这个 bot 的私聊已经归秘书「{{owner}}」:这个秘书请绑到群或论坛话题。`,"This code has expired":`绑定码已过期`,"@{{bot}} is shared by {{count}} secretaries":`@{{bot}} 由 {{count}} 个秘书共用`,"Each private chat, group or forum topic belongs to one secretary. A topic bound on its own wins over the whole group. Places nobody bound get no reply.":`每个私聊、群或论坛话题只归一个秘书;单独绑定的话题优先于整群;没人绑定的地方不回话。`,"Private chat with @{{name}}":`与 @{{name}} 的私聊`,"this secretary":`本秘书`,"Telegram off":`Telegram 已关`,"Nothing bound yet":`还没有绑定任何地方`,"taken by {{owner}}":`已归 {{owner}}`,"Waiting for you":`等你回答`,"Waiting on you":`需要你处理`,"Open session":`打开会话`,"Got it":`知道了`,"Show details":`展开详情`,"Hide details":`收起详情`,"Not started":`未开始`,"Add a to-do":`添加待办`,"Back to to-do":`放回待办`,Problem:`出问题`,"The session failed":`会话失败了`,"The session was stopped":`会话已停止`,"The session was deleted":`会话已删除`,"{{n}} waiting":`{{n}} 件等你`,"{{n}} running":`{{n}} 件在跑`,"{{n}} dispatched tasks running":`派出的 {{n}} 件活在跑`,"Unknown source":`未知来源`,"Nothing running":`没有在跑的活`,"Waiting for dependencies":`等依赖`,"After {{ids}}":`等这些会话结束:{{ids}}`,"Waited for {{ids}}":`等过这些会话:{{ids}}`,"from {{ref}}":`基于 {{ref}}`,"Dispatch problem":`派发出问题`,"A dependency failed":`依赖的会话失败了`,"A dependency was stopped":`依赖的会话被停止了`,"A dependency was deleted":`依赖的会话被删除了`,"The dispatch could not start":`依赖都结束了,但派发没建起来`,"The dispatch was cancelled":`这条派发被取消了`,"Cancel waiting dispatch":`取消等依赖的派发`,Cancelled:`已取消`,"Still running":`还在跑`,Checkout:`检出`,Base:`基线`,"New branch":`新分支`,After:`依赖`,"{{n}} min":`{{n}} 分钟`,"Click to finish setup":`点我完成设置`,"Good morning":`早上好`,"Good afternoon":`下午好`,"Good evening":`晚上好`,"Today {{dispatched}} dispatched, {{completed}} completed, {{failed}} failed":`今天派出 {{dispatched}} 件,完成 {{completed}} 件,{{failed}} 件失败`,"Nothing dispatched today":`今天还没派活`,Started:`开始执行`,"Goal complete":`目标完成`,"Turn ended":`这一轮结束`,Stalled:`停滞`,"Stalled, no activity":`已停住`,"Update the secretary profile":`修改秘书档案`,"Recent activity":`动态`,"No earlier activity":`没有更早的动态了`,"{{count}} new updates":`有 {{count}} 条新动态`,"Nothing on your plate":`手上没活`,"Ask {{name}} for work in the chat, or note a to-do first":`在聊天里让{{name}}派活,或者先记一条待办`,"{{name}} remembers":`{{name}}记得的`,"From your projects":`来自你的项目`,"{{name}} can read these but not change them":`{{name}}能查到但不能改`,Schedules:`定时`,"Scheduled by {{name}}":`{{name}}帮你定的`,"To add a schedule, just tell {{name}}":`想加定时,直接跟{{name}}说`,"Every day at {{time}}":`每天 {{time}}`,"Next: {{time}}":`下次:{{time}}`,"Last run {{time}}":`上次:{{time}}`,"From a to-do":`来自待办`,"One-off":`一次性`,Workbench:`工作台`,"Daily board":`看板`,"Previous day":`前一天`,"Next day":`后一天`,Dispatched:`派出`,"Needed you":`需要你`,"To-dos done":`待办完成`,Merged:`合并`,"What got done":`完成了什么`,"Failed or interrupted":`失败或中断`,"Newly dispatched":`新派出`,"To-dos":`待办`,"Settings and capabilities":`设置和能力变更`,"No cards yet":`暂无卡片`,"Nothing happened this day":`这天没有动静`,"Look back to {{day}}":`可回看至 {{day}}`,Branch:`分支`,"Secretary profile updated":`秘书档案已更新`,"Secretary profile reset":`秘书档案已重置`,"Skill deleted":`技能已删除`,"Tool saved":`工具已保存`,"Tool deleted":`工具已删除`,"Takeover granted":`已授权接管`,"Takeover revoked":`已撤销接管`,"The secretary has not saved anything yet.":`秘书还没有保存任何记忆。`,"Dispatched by {{name}}":`由 {{name}} 派出`,"All archived":`全部归档`,"Archived in group “{{name}}”":`范围:分组「{{name}}」的归档`,"Archived in ungrouped projects":`范围:未分组项目的归档`,"Archived sessions dispatched by {{name}}":`范围:{{name}} 派出的已归档会话`,"“Recent” has no archive scope; showing all archived":`范围:全部归档(「最近」不按项目划分)`,"Showing all archived":`范围:全部归档`,"Dispatched by a deleted secretary":`由已删除的秘书派出`,"{{label}} · muted":`{{label}} · 已静音`,"Set up your secretary":`设置你的秘书`,"Open secretary":`打开秘书`,"Only when the secretary agent is enabled in Experimental settings":`仅在实验设置里开启秘书后生效`,"The secretary is not part of any project. It watches your projects, dispatches sessions and reports results back. It never reads or writes code itself.":`秘书不属于任何项目。它替你看各项目进展、派活给新会话、把结果转告你。它自己不读写代码。`,"Set up with a form":`用表单设置`,"Set up by chatting":`和秘书聊着设置`,"The secretary asks a few questions and hands you a profile card to confirm.":`秘书会问你几个问题,最后给你一张配置卡片确认。`,"Use all defaults and start":`全部用默认,直接开始`,"Could not start the secretary. Try again.":`没能启动秘书,请再试一次。`,Autonomy:`自主度`,"Visible projects":`可见项目`,"Selected projects":`勾选的项目`,"Dispatch model":`派出会话模型`,"Dispatch worktree":`派出会话 worktree`,"Running dispatches at most":`进行中派出会话上限`,"Watch running sessions automatically":`自动巡检进行中的会话`,"While anything is running the secretary checks it and only reports an anomaly: a goal session idle for 3 minutes with an unfinished goal and no live background task, idle for 20 minutes with a background task that never woke it, or running for 30 minutes without any event. Every hour it also reports background tasks left running in finished sessions; nothing is killed. Nothing is sent when all is well.":`只要有会话在跑,秘书就定期检查,只在发现异常时推一条:goal 会话空闲 3 分钟、目标没完成且没有在跑的后台任务;空闲 20 分钟、后台任务一直没叫醒它;或运行 30 分钟没有任何事件。每小时还会汇报已完成会话里遗留的后台任务,不杀进程。一切正常时什么都不推。`,"Patrol on":`巡检开`,"Patrol off":`巡检关`,"Clean up without asking":`清理不用确认`,"Off by default. When on, this secretary's cleanup deletes immediately, with no confirmation card: merged local branches and their worktrees. Sessions are only archived, never deleted. Unmerged branches, branches in use, feat/secretary-agent, main, the current branch and worktrees with uncommitted changes are still refused or skipped.":`默认关。打开后,这个秘书的清理直接删除,不再弹确认卡:已合并的本地分支,以及对应的 worktree。会话只是归档,不会删除。没合并的分支、正在使用的分支、feat/secretary-agent、main、当前分支,以及有未提交改动的 worktree,照旧拒绝或跳过。`,"Cleanup without confirmation":`清理不用确认`,"Cleanup asks first":`清理先确认`,"One page: name, avatar, visible projects and patrol. Every field has a default.":`一页填完:名字、头像、可见项目与巡检。每一项都有默认值。`,"Name, avatar, visible projects and patrol.":`名字、头像、可见项目与巡检。`,"Up to {{n}} at a time":`最多同时 {{n}} 个`,"Concurrent dispatch limit":`同时运行的派发会话上限`,"The most dispatched sessions the secretary may run at the same time. Once the limit is reached, new dispatches are refused.":`秘书最多同时运行几个派发会话,超过上限时新派发会被拒绝。`,Confirm:`确认`,"Edit here":`就地修改`,"Profile saved":`配置已保存`,"Saving the profile…":`正在保存配置…`,"Check a plugin to give the secretary its agent tools and skills. Tools that are not read-only ask for your approval on every call.":`勾选插件,秘书就能用它的 Agent 工具与技能。不是只读的工具每次调用都要你确认。`,"No plugins enabled":`没有已启用的插件`,"{{n}} tools":`{{n}} 个工具`,"Sends messages":`会投递消息`,"Skills the secretary may use. It proposes new ones in the chat; you confirm before anything is written.":`秘书可以用的技能。新技能由它在聊天里提案,你确认后才写盘。`,"Secretary skills":`秘书自有技能`,"Global skills":`全局技能`,"Own skills":`秘书专属`,"Shared global skills":`全局共享`,"Nothing here yet":`这里还没有`,"The secretary has no skills yet. Ask it to propose one.":`还没有技能,可以让秘书提议一个。`,"Shown for you only: this content is not an instruction to the secretary.":`这段正文只给你看,不会当成秘书的指令。`,"Delete this skill?":`删除这个技能?`,"Show the content":`查看内容`,"Show the current version":`查看现有版本`,"Skill saved":`技能已保存`,"Saving the skill…":`正在保存技能…`,New:`新建`,"Secretary profile":`秘书档案`,"Upload image":`上传图片`,"Remove image":`移除图片`,"Avatar images must be PNG, JPEG, WebP or GIF, and at most 2 MB.":`头像只接受 PNG、JPEG、WebP、GIF,且不超过 2 MB。`,"The secretary has not been set up yet.":`秘书还没完成初次设置。`,"Style and interruptions":`风格与打扰`,"What it calls you, reply language, style and system notifications.":`对你的称呼、回复语言、沟通风格与系统通知。`,"What to call you":`对你的称呼`,Optional:`可选`,"Reply language":`回复语言`,"Follow the interface language":`跟随界面语言`,Chinese:`中文`,"Communication style":`沟通风格`,Concise:`简洁`,Detailed:`详细`,"System notifications":`系统通知`,"Only what needs you":`仅需要你处理`,"Include finished work":`含完成`,"Daily brief time":`每日简报时间`,"Scheduled tasks":`定时任务`,"Nothing scheduled":`还没有定时`,"Daily brief, to-do reminders and one-off or recurring prompts.":`每日简报、待办提醒,以及一次性或重复的提示。`,"Reset the secretary and start over":`重新设置秘书`,"Sessions and dispatch history are kept either way.":`无论是否清空,会话与派活记录都会保留。`,"Also delete the secretary private memory":`同时清空秘书的私有记忆`,Saved:`已保存`,"Could not save the secretary profile. Try again.":`没能保存秘书档案,请再试一次。`,"Could not reset the secretary. Try again.":`没能重新设置秘书,请再试一次。`,"Look at {{name}}":`查看 {{name}}`,Dimensions:`尺寸`,"File size":`文件大小`,"Image unavailable":`图片无法显示`,"Cleanup candidates · {{count}}":`可清理项 · {{count}}`,"Clean up {{count}} items":`清理 {{count}} 项`,"{{count}} items":`{{count}} 项`,"Cleanup card":`清理卡片`,"Cleaning up…":`正在清理…`,"Cleanup done":`清理完成`,"Confirm cleanup":`确认清理`,"and {{count}} more":`还有 {{count}} 条`,"merged into {{refs}}":`已合入 {{refs}}`,"Not merged yet":`还没合入`,"Currently checked out":`当前检出`,"Used by a worktree":`有 worktree 在用`,"Has uncommitted changes":`有未提交改动`,"Take over":`接管`,"The secretary asks to manage this session: it may message and stop it like its own.":`秘书申请接管这个会话:同意后,它能像对自己派出的会话一样给它发消息、停止它。`,"Handing it over…":`正在交给秘书…`,"Handed over to the secretary":`已交给秘书接管`,"Allow takeover":`同意接管`,"Managed by {{name}}":`{{name}}接管中`,"{{name}} is managing this session: it may message and stop it.":`{{name}}正在接管这个会话,可以给它发消息、停止它。`,"Take back from {{name}}":`取消{{name}}接管`,"Takeover failed":`接管操作失败`,"Sessions it may take over":`可接管的会话`,"Which sessions the secretary may message and stop without asking you first. Everything else still needs a confirmation card from the secretary.":`秘书可以直接给哪些会话发消息、停止它们,不用逐个确认。范围外的会话仍然要秘书提确认卡。`,"One by one":`逐个授权`,"All visible projects":`所有可见项目`,"Pick the projects it may take over":`勾选它可以接管的项目`,"No project in the takeover scope":`还没有项目在接管范围内`,"Sessions handed over":`交给秘书接管的会话`,"Sessions you started and handed to the secretary. It may message and stop them like the ones it dispatched; take one back to remove that right.":`你自己开的、交给秘书接管的会话。秘书可以像对派出的会话一样给它们发消息、停止它们;取消接管就收回这项权限。`,"No sessions handed over":`还没有交给秘书接管的会话`,"Take back":`取消接管`,"Not tracked: the takeover scope no longer covers these sessions. Removing one lets the scope cover it again.":`不再跟踪:接管范围不再覆盖这些会话。移除后范围权限恢复。`,"Track again":`恢复跟踪`,"Send message {{title}}":`发送消息 {{title}}`,"Stop session {{title}}":`停止会话 {{title}}`,"Create session {{title}}":`创建会话 {{title}}`,"Dispatch session {{title}}":`派出会话 {{title}}`,"Update to-do {{text}}":`更新待办 {{text}}`,"Add to-do {{text}}":`添加待办 {{text}}`,"Add schedule {{name}}":`添加定时 {{name}}`,"Remove schedule {{name}}":`删除定时 {{name}}`,"Updated {{count}} to-dos":`更新了 {{count}} 条待办`,"Added {{count}} to-dos":`添加了 {{count}} 条待办`,"Sent {{count}} messages":`发了 {{count}} 条消息`,"Stopped {{count}} sessions":`停止了 {{count}} 个会话`,"Added {{count}} schedules":`添加了 {{count}} 个定时`,"Removed {{count}} schedules":`删除了 {{count}} 个定时`,"Created {{count}} sessions":`创建了 {{count}} 个会话`,"Dispatched {{count}} to-dos":`派出了 {{count}} 条待办`,"{{count}} × {{tool}}":`{{count}} 次 {{tool}}`,"Queued until the current turn ends":`已排队(等对方这一轮结束)`,"Steered into the current turn":`已插话(不等这一轮结束)`,"Delivered as a new turn (the session was idle)":`已作为新一轮发出(会话空闲)`,"Steering…":`插话中`,"Sending…":`发送中`,Refused:`被拒绝`,Stopped:`已停止`,"Waiting on {{card}} {{id}}":`等待确认({{card}} {{id}})`,Confirmed:`已确认`,"Confirmation failed":`确认失败`,"Confirmation expired":`确认已过期`,"Confirming…":`正在确认…`,"Confirmation card":`确认卡`,"Dispatch card":`派活卡`,"Profile card":`档案卡`,"Skill card":`技能卡`,"Tool card":`工具卡`,"Takeover card":`接管卡`,"View raw data":`查看原始数据`,"Show more":`展开`,"Marked done":`标记为完成 ✓`,"Marked not done":`标为未完成`,"Due time":`截止时间`,"To-do text":`待办文字`,"Once at {{time}}":`一次,{{time}}`,"List sessions in {{project}}":`列出 {{project}} 的会话`,"List sessions":`列出会话`,"List to-dos":`列出待办`,"List projects":`列出项目`,"Project {{name}}":`项目 {{name}}`,"Session running":`运行中`,"Session idle":`空闲`,"Session needs you":`需要你`,"Session error":`出错`,"Session not started":`未开始`,"{{count}} pending":`{{count}} 项待处理`,"Pending approvals":`待处理审批`,"Pending questions":`待处理提问`,"Read session {{title}}":`读取会话 {{title}}`,"Read message {{index}} in {{title}}":`读取 {{title}} 的第 {{index}} 条消息`,"More text from character {{next}}":`还有正文,从第 {{next}} 字继续`,"Truncated messages {{indexes}}: read them by index":`被截断的消息 {{indexes}},可用 index 读全文`,Read:`已读取`,"Repository status {{project}}":`仓库状态 {{project}}`,HEAD:`HEAD`,"Working tree":`工作区`,"{{count}} changed files":`{{count}} 个文件有改动`,"Against {{ref}}":`对比 {{ref}}`,"{{ahead}} ahead, {{behind}} behind":`领先 {{ahead}},落后 {{behind}}`,"Contains {{sha}}":`是否包含 {{sha}}`,Yes:`是`,No:`否`,Rebase:`变基`,"Background tasks in {{title}}":`{{title}} 的后台任务`,"{{count}} running":`{{count}} 个在跑`,"{{count}} tasks":`{{count}} 个任务`,"{{count}} calls":`{{count}} 次调用`,"Recent tool calls in {{title}}":`{{title}} 最近的工具调用`,Exited:`已退出`,Killed:`已终止`,Succeeded:`成功`,"ran {{duration}}":`已跑 {{duration}}`,"exit {{code}}":`退出码 {{code}}`,"Process gone":`进程已不在`,"Past its deadline":`已过看门狗截止`,"Unknown task":`未知任务`,"Clean tree":`工作区干净`,"No local branch":`没有本机分支`,"Search memory {{query}} · {{count}}":`搜索记忆 {{query}} · {{count}} 条`,"Delete memory {{title}}":`删除记忆 {{title}}`,"Save memory {{title}}":`记住 {{title}}`,"Memory not written":`没有写入记忆`,"Web search {{query}}":`搜索 {{query}}`,"Fetch {{domain}}":`打开 {{domain}}`,"Custom tool {{name}}":`自造工具 {{name}}`,"Propose profile changes":`提议修改档案`,"Propose skill {{name}}":`提议技能 {{name}}`,"Propose tool {{name}}":`提议工具 {{name}}`,"Ask to take over {{title}}":`申请接管 {{title}}`,Worktree:`工作区`,"Unknown session":`未知会话`,"New session":`新会话`,"Tool failed":`工具失败`,"Not found":`找不到`,"This subagent was started before EnsoCode restarted, and its record was lost in the restart":`这个子代理在 EnsoCode 重启前启动,记录已随重启丢失`,"This subagent belongs to another conversation and cannot be controlled here":`这个子代理属于别的会话,不能在这里操作`,"This conversation has no subagent with this id (mistyped, or agentId and runId mixed up)":`本会话没有这个 id 的子代理(可能抄错,或把 agentId 和 runId 弄混了)`,"Dispatch limit reached":`已达到同时派发上限`,"Project is not visible":`项目不在秘书可见范围内`,"The message changed (the session was rewound or switched branches). List the session again and read it with the new id.":`消息已变化(会话回退或换了分支),请重新分页后用新的 id 读取`,"Only user and assistant messages can be read; tool calls and tool output are not shown.":`只能读取用户和助手的消息,工具调用与工具输出不会显示`,"A project is required":`需要指定项目`,"Invalid schedule":`定时表达式不合法`,"Auto-approved projects":`免确认的项目`,"Dispatch limit":`同时派发上限`,"Run in a worktree":`使用隔离工作区`,"Run in the project checkout":`在项目目录里`,"Created the session":`已创建`,"Handed to {{name}}":`已转给 {{name}}`,"No answer in time":`超时未答`,"{{name}} answered: {{answer}}":`{{name}} 已回答:{{answer}}`,"Answered: {{answer}}":`已回答:{{answer}}`,"Answer {{title}}":`回答 {{title}}`,Answered:`已回答`,"Answering…":`回答中…`,"Answered {{count}} questions":`回答了 {{count}} 个提问`,"Background task wrap-up":`后台任务收尾`,"Stop {{stopped}} · Keep {{kept}}":`停 {{stopped}} · 留 {{kept}}`,"Settling…":`收尾中…`,"Not running":`未在运行`,Kept:`已保留`,"Interrupted by restart":`因重启中断`,Keep:`保留`,Unkeep:`取消保留`,"Idle {{duration}}":`疑似闲置 {{duration}}`,"{{n}} h":`{{n}} 小时`,"{{h}} h {{m}} min":`{{h}} 小时 {{m}} 分钟`,"Kept by you · {{detail}}":`你手动保留 · {{detail}}`,"Kept: {{reason}}":`保留:{{reason}}`,"No new output":`无新输出`,"Port {{ports}}":`端口 {{ports}}`,Ports:`端口`,"No connections":`无连接`,"Not listening":`未监听`,"Running for {{duration}} · Suspected idle tasks are never stopped automatically":`已跑 {{duration}} · 疑似闲置不会自动停止`,"Running for {{duration}}":`已跑 {{duration}}`,"Add a reason (optional)":`补一句保留理由(可选)`,"Kept by the agent at {{time}} when wrapping up":`agent 在 {{time}} 回合收尾时保留`,"Kept by you at {{time}}":`你在 {{time}} 手动保留`,"Recent output":`最近输出`,"{{count}} background tasks are still undeclared; the next message asks the agent to stop each one or state why it keeps running":`还有 {{count}} 个后台任务没表态,下一条消息会要求 agent 逐个停止或写明保留理由`,"{{count}} background tasks to wrap up: stop them or say why they keep running":`有 {{count}} 个后台任务待收尾:停掉或说明保留原因`,"Show in task bar":`在任务条中查看`,"Workspace switched to branch {{branch}}":`工作区已切换到分支 {{branch}}`,"Workspace switched branch":`工作区已切换分支`,"{{count}} suspected idle":`{{count}} 个疑似闲置`,"from {{count}} sessions":`来自 {{count}} 个会话`,"Stop selected":`停止所选`,"No background tasks are running":`没有在跑的后台任务`,"Running for":`已运行`,"Rule: no new output for 30 minutes, no active connections on listening ports, CPU near 0, all at once. Kept tasks are excluded for an hour.":`判定:30 分钟无新输出、监听端口无活跃连接、CPU 近 0,三条同时满足。已保留的任务 1 小时内不计入。`,"Suspected idle only":`只看疑似闲置`,"Select all tasks of this session":`选中这个会话的全部任务`,"Session not open":`会话未打开`,"Select task":`选中任务`,"Stop {{count}} background tasks?":`停止 {{count}} 个后台任务?`,"{{title}} (not open)":`{{title}}(未打开)`,"Stop {{count}}":`停止 {{count}} 个`,"{{count}} background tasks":`{{count}} 个后台任务`,"longest running {{duration}}":`最久的已跑 {{duration}}`,"Stop all":`全部停止`,"{{n}} background tasks running":`{{n}} 个后台任务在跑`,"{{n}} suspected idle":`{{n}} 个疑似闲置`,"Background tasks of {{title}}":`{{title}} 的后台任务`,"Port {{ports}} has no connections · CPU 0%":`端口 {{ports}} 无连接 · CPU 0%`,"All tasks":`全部任务`,"Stop suspected idle leftover tasks":`停止疑似闲置的遗留任务`,Status:`状态`,"Done ({{count}} kept tasks)":`已完成(保留 {{count}} 个任务)`,"This session no longer exists, or you do not have access to it":`这条会话已不存在,或你没有权限查看`,"Archived · read-only":`已归档 · 只读`,"Restore and open":`恢复并打开`,"Needs your approval or answer":`等你审批或回答`,"Back to secretary":`返回秘书`,"PR open":`未合并`,"PR merged":`已合并`,"PR closed":`已关闭`,"No report was saved":`没有存下完成报告`,Screenshots:`截图`,"{{count}} screenshots expired":`{{count}} 张截图已过期`,"{{count}} screenshots were cleaned up":`{{count}} 张截图已在资源页清理`,"Completed {{done}}":`完成于 {{done}}`,"Completed {{done}}, kept for {{days}} days, cleaned up on {{gone}}":`完成于 {{done}},保留 {{days}} 天,已于 {{gone}} 清理`,"Completed {{done}}, cleaned up on {{gone}}":`完成于 {{done}},已于 {{gone}} 清理`,"Cleaned up":`已清理`,"Changed files ({{count}})":`改动文件({{count}})`,Binary:`二进制`,"{{count}} more files":`还有 {{count}} 个文件`,"Report screenshots":`报告截图`,"Copies of screenshots in finished reports, kept for 7 days after completion. Cleaning removes all of them; report text is kept.":`已完成报告里截图的副本,完成后保留 7 天。清理会删掉全部截图,报告文字保留。`};function bs(e){return e&&e.toLowerCase().startsWith(`zh`)?`zh`:`en`}function xs(e,t){return e===`zh`?ys[t]??t:t}function Ss(e,t,n){let r=xs(e,t);return n?r.replace(/\{\{(\w+)\}\}/g,(e,t)=>{let r=n[t];return r===void 0?e:String(r)}):r}var Cs=typeof navigator<`u`&&navigator.language.startsWith(`zh`)?`zh`:`en`;function ws(e,t){return Ss(Cs,e,t)}function Ts(e,t){let n=Ss(Cs,e);return t?n.split(/(\{\{\w+\}\})/g).map(e=>{let n=/^\{\{(\w+)\}\}$/.exec(e);if(!n)return e;let r=t[n[1]];return r===void 0?e:(0,G.jsx)(`span`,{children:r},n[1])}):n}function K(){return{locale:Cs,t:ws,tNode:Ts}}var Es={"external-send":`Protected: external send`,delete:`Protected: delete`,payment:`Protected: payment`,deploy:`Protected: deploy / production`,secret:`Protected: secrets`,destructive:`Protected: destructive command`};function Ds(e,t){return t(Es[e])}var Os={exec:`Isolated sandbox`,codemode:`Isolated sandbox`,tool_search:`Tool search`,apply_patch:`Apply patch`,explore_mark:`Explore mark`,explore_fold:`Explore fold`,turn_discard:`Turn discard`,turn_recall:`Turn recall`,subagent:`Subagent`,workflow:`Workflow`,ask_user:`Ask user`,task_output:`Task output`,task_stop:`Task stop`,task_settle:`Background task wrap-up`,message_coworker:`Message coworker`,message_main_agent:`Message main agent`,recall:`Recall memory`,memory_search:`Memory search`,memory_capture:`Memory capture`,memory_crystallize:`Memory crystallize`,memory_delete:`Memory delete`,browser_navigate:`Browser navigate`,browser_snapshot:`Browser snapshot`,browser_click:`Browser click`,browser_type:`Browser type`,browser_tabs:`Browser tabs`,browser_lock:`Browser lock`,browser_fill:`Browser fill`,browser_press_key:`Browser press key`,browser_scroll:`Browser scroll`,browser_select_option:`Browser select option`,browser_mouse_click_xy:`Browser click xy`,browser_drag:`Browser drag`,browser_highlight:`Browser highlight`,browser_get_bounding_box:`Browser bounding box`,browser_screenshot:`Browser screenshot`,browser_cdp:`Browser CDP`,web_search:`Web search`,web_fetch:`Web fetch`,todo:`Todos`};function ks(e,t){let n=Os[e];return n?t(n):e}var As={report:`Read report`,wait:`Wait`,stop:`Stop`,dismiss:`Dismiss agent`,list:`List agents`,resume:`Resume agent`};function js({text:e,className:t,label:n}){let{t:r}=K(),[i,a]=(0,H.useState)(!1);return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{let t=typeof e==`function`?e():e;navigator.clipboard.writeText(t).then(()=>{a(!0),setTimeout(()=>a(!1),1e3)})},className:W(`flex items-center gap-1 transition-colors hover:text-foreground`,t),title:r(`Copy`),children:[(0,G.jsxs)(`span`,{className:`t-icon-swap`,"data-state":i?`b`:`a`,children:[(0,G.jsx)(`span`,{className:`t-icon inline-flex`,"data-icon":`a`,children:(0,G.jsx)(Mt,{className:`h-3 w-3`})}),(0,G.jsx)(`span`,{className:`t-icon inline-flex`,"data-icon":`b`,children:(0,G.jsx)(mt,{className:`h-3 w-3`})})]}),n]})}function Ms(e,t=0){let[n,r]=(0,H.useState)(()=>Date.now());return(0,H.useEffect)(()=>{if(e===void 0)return;r(Date.now());let t=window.setInterval(()=>r(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),e===void 0?void 0:e+t-n}function Ns({remainingMs:e,expiredLabel:t}){let{t:n}=K();if(e===void 0)return null;if(e<=0)return(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-warning`,children:n(t)});let r=Math.ceil(e/1e3),i=`${Math.floor(r/60)}:${String(r%60).padStart(2,`0`)}`;return(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground tabular-nums`,children:n(`{{time}} left`,{time:i})})}var Ps=Object.defineProperty,Fs=Object.getOwnPropertyDescriptor,Is=Object.getOwnPropertyNames,Ls=Object.prototype.hasOwnProperty,Rs=(e,t)=>{let n={};for(var r in e)Ps(n,r,{get:e[r],enumerable:!0});return t||Ps(n,Symbol.toStringTag,{value:`Module`}),n},zs=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Is(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Ls.call(e,s)&&s!==n&&Ps(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Fs(t,s))||r.enumerable});return e},Bs=(e,t,n)=>(zs(e,t,`default`),n&&zs(n,t,`default`)),Vs=`modulepreload`,Hs=function(e){return`/`+e},Us={},q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Hs(t,n),t=s(t),t in Us)return;Us[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Vs,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ws=[{id:`abap`,name:`ABAP`,import:(()=>q(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>q(()=>import(`./actionscript-3-Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>q(()=>import(`./ada-C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>q(()=>import(`./ahk-CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>q(()=>import(`./ahk2-_6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>q(()=>import(`./angular-html-aPuBvESs.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>q(()=>import(`./angular-ts-ocjSXnvf.js`),__vite__mapDeps([5,0,1,2,3,4,6])))},{id:`apache`,name:`Apache Conf`,import:(()=>q(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>q(()=>import(`./apex-KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>q(()=>import(`./apl-D8Zaj6f9.js`),__vite__mapDeps([7,3,1,4,2,8,9,10])))},{id:`applescript`,name:`AppleScript`,import:(()=>q(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>q(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>q(()=>import(`./asciidoc-SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>q(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>q(()=>import(`./astro-CbVusc_k.js`),__vite__mapDeps([11,3,1,4,10,12,13,14])))},{id:`awk`,name:`AWK`,import:(()=>q(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>q(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>q(()=>import(`./bat-qdxAdBWQ.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>q(()=>import(`./beancount-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>q(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>q(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>q(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>q(()=>import(`./bird2-CYIUgYqB.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>q(()=>import(`./blade-BuKMbjJR.js`),__vite__mapDeps([15,3,1,4,2,8,9,10,16,17])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>q(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([18,19])))},{id:`c`,name:`C`,import:(()=>q(()=>import(`./c-BNQJhXlP.js`).then(e=>e.n),__vite__mapDeps([20,1])))},{id:`c3`,name:`C3`,import:(()=>q(()=>import(`./c3-D0apG41V.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>q(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>q(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([21,22])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>q(()=>import(`./chapel-CFMD-Djs.js`),__vite__mapDeps([23,20,1])))},{id:`clarity`,name:`Clarity`,import:(()=>q(()=>import(`./clarity-CtfBBspg.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>q(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>q(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>q(()=>import(`./cobol-qSrRm_BU.js`),__vite__mapDeps([24,2,1,3,4,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>q(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>q(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>q(()=>import(`./coffee-BP03ytLP.js`),__vite__mapDeps([25,3,1])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>q(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>q(()=>import(`./coq-DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>q(()=>import(`./cpp-CUBNVKxn.js`).then(e=>e.n),__vite__mapDeps([26,1,27,28,20])))},{id:`crystal`,name:`Crystal`,import:(()=>q(()=>import(`./crystal-CCpd0BXH.js`),__vite__mapDeps([29,3,1,4,2,17,20,30])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>q(()=>import(`./csharp-oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>q(()=>import(`./css-DlBQoFxe.js`).then(e=>e.n),__vite__mapDeps([4,1])))},{id:`csv`,name:`CSV`,import:(()=>q(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>q(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>q(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>q(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>q(()=>import(`./dart-CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>q(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>q(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>q(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>q(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>q(()=>import(`./dotenv-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>q(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>q(()=>import(`./edge-k_uo0VIr.js`),__vite__mapDeps([31,2,1,3,4,12,16])))},{id:`elixir`,name:`Elixir`,import:(()=>q(()=>import(`./elixir-CJS91GrO.js`),__vite__mapDeps([32,2,1,3,4])))},{id:`elm`,name:`Elm`,import:(()=>q(()=>import(`./elm-Bmx6Fs0i.js`),__vite__mapDeps([33,28,1,20])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>q(()=>import(`./emacs-lisp-c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>q(()=>import(`./erb-yi0ZozmI.js`),__vite__mapDeps([34,2,1,3,4,35,8,9,17,20,26,27,28,30,36,37,12,14,38,39,40])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>q(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([41,42])))},{id:`fennel`,name:`Fennel`,import:(()=>q(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>q(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>q(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>q(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([43,44])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>q(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>q(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([45,42])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>q(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([46,47,48])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>q(()=>import(`./gdscript-DYvRD3hg.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>q(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>q(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>q(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>q(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([49,50])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>q(()=>import(`./git-rebase-C-RR1FSc.js`),__vite__mapDeps([51,30,1])))},{id:`gleam`,name:`Gleam`,import:(()=>q(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>q(()=>import(`./glimmer-js-Di6EiJvU.js`),__vite__mapDeps([52,3,1,4,2,12])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>q(()=>import(`./glimmer-ts-C2P-EwIP.js`),__vite__mapDeps([53,3,1,4,2,12])))},{id:`glsl`,name:`GLSL`,import:(()=>q(()=>import(`./glsl-CyFpZtQv.js`).then(e=>e.n),__vite__mapDeps([28,1,20])))},{id:`gn`,name:`GN`,import:(()=>q(()=>import(`./gn-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>q(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>q(()=>import(`./go-rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>q(()=>import(`./graphql-BIyAKkG2.js`).then(e=>e.n),__vite__mapDeps([37,1,3,12,14,38])))},{id:`groovy`,name:`Groovy`,import:(()=>q(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>q(()=>import(`./hack-DDi4pUY-.js`),__vite__mapDeps([54,2,1,3,4,17])))},{id:`haml`,name:`Ruby Haml`,import:(()=>q(()=>import(`./haml-Dds4VdNJ.js`).then(e=>e.n),__vite__mapDeps([36,1,3,4])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>q(()=>import(`./handlebars-C81KA5yo.js`),__vite__mapDeps([55,3,1,4,2,40])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>q(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>q(()=>import(`./haxe-C8oCnwJJ.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>q(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>q(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>q(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>q(()=>import(`./html-BsvMqTlf.js`).then(e=>e.n),__vite__mapDeps([2,1,3,4])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>q(()=>import(`./html-derivative-D9FvRNj4.js`),__vite__mapDeps([16,2,1,3,4])))},{id:`http`,name:`HTTP`,import:(()=>q(()=>import(`./http-c4_vT9ST.js`),__vite__mapDeps([56,8,1,9,10,30,37,3,12,14,38])))},{id:`hurl`,name:`Hurl`,import:(()=>q(()=>import(`./hurl-BqZA9I9Q.js`),__vite__mapDeps([57,8,1,9,58,37,3,12,14,38])))},{id:`hxml`,name:`HXML`,import:(()=>q(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([59,60])))},{id:`hy`,name:`Hy`,import:(()=>q(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>q(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>q(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>q(()=>import(`./java-D7h0NA_A.js`).then(e=>e.n),__vite__mapDeps([9,1])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>q(()=>import(`./javascript-DcMHgNcu.js`).then(e=>e.n),__vite__mapDeps([3,1])))},{id:`jinja`,name:`Jinja`,import:(()=>q(()=>import(`./jinja-CixBDh_U.js`),__vite__mapDeps([61,2,1,3,4])))},{id:`jison`,name:`Jison`,import:(()=>q(()=>import(`./jison-Ru_S5AEn.js`),__vite__mapDeps([62,3,1])))},{id:`json`,name:`JSON`,import:(()=>q(()=>import(`./json-DePJdKYk.js`).then(e=>e.n),__vite__mapDeps([10,1])))},{id:`json5`,name:`JSON5`,import:(()=>q(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>q(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>q(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>q(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>q(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>q(()=>import(`./jsx-BUUYi3qs.js`).then(e=>e.n),__vite__mapDeps([38,1])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>q(()=>import(`./julia-CaY0JZD0.js`),__vite__mapDeps([63,3,1,17,22,26,27,28,20,64])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>q(()=>import(`./just-Q4EdCjF5.js`),__vite__mapDeps([65,3,1,12,22,30,35,4,2,8,9,17,20,26,27,28,36,37,14,38,39,40,66])))},{id:`kdl`,name:`KDL`,import:(()=>q(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>q(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>q(()=>import(`./kusto-C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>q(()=>import(`./latex-t1iljvl0.js`),__vite__mapDeps([67,68,1,64])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>q(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>q(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>q(()=>import(`./liquid-DEL4RHa9.js`),__vite__mapDeps([69,3,1,4,2,10])))},{id:`llvm`,name:`LLVM IR`,import:(()=>q(()=>import(`./llvm-DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>q(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>q(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>q(()=>import(`./lua-Z49wBRLR.js`).then(e=>e.n),__vite__mapDeps([39,1,20])))},{id:`luau`,name:`Luau`,import:(()=>q(()=>import(`./luau-C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>q(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>q(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>q(()=>import(`./marko-DYWPPmCl.js`),__vite__mapDeps([70,4,1,6,12,71])))},{id:`matlab`,name:`MATLAB`,import:(()=>q(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>q(()=>import(`./mdc-CsAWFGA9.js`),__vite__mapDeps([72,16,2,1,3,4,40,42])))},{id:`mdx`,name:`MDX`,import:(()=>q(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>q(()=>import(`./mermaid-BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>q(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>q(()=>import(`./mojo-fg40_ntQ.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>q(()=>import(`./moonbit-DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>q(()=>import(`./move-BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>q(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>q(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([73,74])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>q(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>q(()=>import(`./nginx-BrbrEdla.js`),__vite__mapDeps([75,39,1,20])))},{id:`nim`,name:`Nim`,import:(()=>q(()=>import(`./nim-BjwzhXka.js`),__vite__mapDeps([76,3,1,4,2,8,9,20,28,42])))},{id:`nix`,name:`Nix`,import:(()=>q(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>q(()=>import(`./nsis-CjNLYCLg.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>q(()=>import(`./nushell-DHYfO66s.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>q(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>q(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>q(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>q(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>q(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>q(()=>import(`./org-TFl3N09_.js`),__vite__mapDeps([77,3,1,4,2,6,9,8,10,12,14,17,20,22,78,25,27,26,28,30,79,80,50,81,32,39,40,35,36,37,38,42,41,49,51,82,83,84,64,66,67,68,71,85,76,86,87,88,89,90,91,92,93,94])))},{id:`pascal`,name:`Pascal`,import:(()=>q(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>q(()=>import(`./perl-BtArmf81.js`),__vite__mapDeps([66,3,1,4,2,8,9,17])))},{id:`php`,name:`PHP`,import:(()=>q(()=>import(`./php-Cx25uSIP.js`),__vite__mapDeps([88,3,1,4,2,8,9,10,17])))},{id:`pkl`,name:`Pkl`,import:(()=>q(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>q(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>q(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>q(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>q(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>q(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>q(()=>import(`./powershell-CCSX75yM.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>q(()=>import(`./prisma-DMgNhnYS.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>q(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>q(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>q(()=>import(`./pug-B4bk2kWf.js`),__vite__mapDeps([95,3,1,4,2])))},{id:`puppet`,name:`Puppet`,import:(()=>q(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>q(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>q(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>q(()=>import(`./qml-g4UDed-8.js`),__vite__mapDeps([96,3,1])))},{id:`qmldir`,name:`QML Directory`,import:(()=>q(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>q(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>q(()=>import(`./r-CvCSiWB_.js`).then(e=>e.n),__vite__mapDeps([64,1])))},{id:`racket`,name:`Racket`,import:(()=>q(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>q(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>q(()=>import(`./razor-BSt2ayLr.js`),__vite__mapDeps([97,2,1,3,4,79])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>q(()=>import(`./rbs-C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>q(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>q(()=>import(`./regexp-I2jnduhj.js`).then(e=>e.n),__vite__mapDeps([27,1])))},{id:`rel`,name:`Rel`,import:(()=>q(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>q(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>q(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>q(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>q(()=>import(`./rst-BucurtmO.js`),__vite__mapDeps([98,3,1,16,2,4,22,99,26,27,28,20,30,40,35,8,9,17,36,37,12,14,38,39])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>q(()=>import(`./ruby-D1ky9XZ0.js`),__vite__mapDeps([35,3,1,4,2,8,9,17,20,26,27,28,30,36,37,12,14,38,39,40])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>q(()=>import(`./rust-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>q(()=>import(`./sas-CUQt684o.js`),__vite__mapDeps([100,17,1])))},{id:`sass`,name:`Sass`,import:(()=>q(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>q(()=>import(`./scala-BiFt_7mu.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>q(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>q(()=>import(`./scss-BaZL6t2Y.js`).then(e=>e.n),__vite__mapDeps([6,1,4])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>q(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>q(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([101,102])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>q(()=>import(`./shellscript-B51zB43X.js`).then(e=>e.n),__vite__mapDeps([30,1])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>q(()=>import(`./shellsession-B-KBpmJs.js`),__vite__mapDeps([103,30,1])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>q(()=>import(`./smalltalk-BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>q(()=>import(`./smithy-Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>q(()=>import(`./solidity-Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>q(()=>import(`./soy-D5xCHD_M.js`),__vite__mapDeps([104,2,1,3,4])))},{id:`sparql`,name:`SPARQL`,import:(()=>q(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([105,106])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>q(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>q(()=>import(`./sql-DvarVTMJ.js`).then(e=>e.n),__vite__mapDeps([17,1])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>q(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>q(()=>import(`./stata-8TbiBYrm.js`),__vite__mapDeps([107,17,1])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>q(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>q(()=>import(`./surrealql-DalIYx4r.js`),__vite__mapDeps([108,3,1])))},{id:`svelte`,name:`Svelte`,import:(()=>q(()=>import(`./svelte-D4FIy7cP.js`),__vite__mapDeps([109,3,1,4,12,13])))},{id:`swift`,name:`Swift`,import:(()=>q(()=>import(`./swift-CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>q(()=>import(`./system-verilog-Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>q(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>q(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>q(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>q(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>q(()=>import(`./templ-DP4lTcEq.js`),__vite__mapDeps([110,3,1,4,82])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>q(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>q(()=>import(`./tex-JPaUWOrn.js`).then(e=>e.n),__vite__mapDeps([68,1,64])))},{id:`toml`,name:`TOML`,import:(()=>q(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>q(()=>import(`./ts-tags-CNUq3so9.js`),__vite__mapDeps([111,3,1,4,2,8,9,12,17,28,20])))},{id:`tsv`,name:`TSV`,import:(()=>q(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>q(()=>import(`./tsx-DvWhG4dC.js`).then(e=>e.n),__vite__mapDeps([14,1])))},{id:`turtle`,name:`Turtle`,import:(()=>q(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>q(()=>import(`./twig-Chu5fnNS.js`),__vite__mapDeps([112,3,1,4,6,22,35,2,8,9,17,20,26,27,28,30,36,37,12,14,38,39,40,88,10])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>q(()=>import(`./typescript-BTGs5etX.js`).then(e=>e.n),__vite__mapDeps([12,1])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>q(()=>import(`./typespec-BRdr0IET.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>q(()=>import(`./typst--WwEKe8X.js`),__vite__mapDeps([113,3,1,4,2,6,9,8,10,12,14,114,115,17,20,22,78,25,27,26,28,30,79,80,50,81,32,39,40,35,36,37,38,42,41,45,49,51,82,83,55,84,116,64,63,66,67,68,71,117,85,86,88,89,90,91,92,94,118,95,119,120,112,121])))},{id:`v`,name:`V`,import:(()=>q(()=>import(`./v-DBj4K9d_.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>q(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>q(()=>import(`./vb-DOwzaHZ0.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>q(()=>import(`./verilog-B2gwz-sJ.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>q(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>q(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>q(()=>import(`./vue-DjCn01CB.js`),__vite__mapDeps([122,3,1,4,2,10,12,16])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>q(()=>import(`./vue-html-BXjKVtKk.js`),__vite__mapDeps([123,3,1])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>q(()=>import(`./vue-vine-By_xyXdL.js`),__vite__mapDeps([124,3,1,4,6,13,71,125])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>q(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>q(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>q(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>q(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>q(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>q(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>q(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>q(()=>import(`./xml-C01ajBW7.js`).then(e=>e.n),__vite__mapDeps([8,1,9])))},{id:`xsl`,name:`XSL`,import:(()=>q(()=>import(`./xsl-CCLNyvR3.js`),__vite__mapDeps([94,8,1,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>q(()=>import(`./yaml-BWCS3NLV.js`).then(e=>e.n),__vite__mapDeps([40,1])))},{id:`zenscript`,name:`ZenScript`,import:(()=>q(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>q(()=>import(`./zig-CMLA9XwU.js`),[]))}],Gs=Object.fromEntries(Ws.map(e=>[e.id,e.import])),Ks=Object.fromEntries(Ws.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),qs={...Gs,...Ks},Js=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>q(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>q(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>q(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>q(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>q(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>q(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>q(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>q(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>q(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>q(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>q(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>q(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>q(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>q(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>q(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>q(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>q(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>q(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>q(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>q(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>q(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>q(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>q(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>q(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>q(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>q(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>q(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>q(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>q(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>q(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>q(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>q(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>q(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>q(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>q(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>q(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>q(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>q(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>q(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>q(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>q(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>q(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>q(()=>import(`./monokai-B_bV9PQ9.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>q(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>q(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>q(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>q(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>q(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>q(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>q(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>q(()=>import(`./red-DX1BQOs8.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>q(()=>import(`./rose-pine-aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>q(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>q(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>q(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>q(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>q(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>q(()=>import(`./solarized-dark-UdsmMDCL.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>q(()=>import(`./solarized-light-C1IUL_tW.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>q(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>q(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>q(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>q(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>q(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>q(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),Ys=t({createOnigurumaEngine:()=>Cc,getDefaultWasmLoader:()=>Sc,loadWasm:()=>gc,setDefaultWasmLoader:()=>xc}),Xs=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Zs(){return 2147483648}function Qs(){return typeof performance<`u`?performance.now():Date.now()}var $s=(e,t)=>e+(t-e%t)%t;async function ec(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=Zs();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,$s(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Qs,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var tc=Object.defineProperty,nc=(e,t,n)=>t in e?tc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rc=(e,t,n)=>nc(e,typeof t==`symbol`?t:t+``,n),ic=null;function ac(e){throw new Xs(e.UTF8ToString(e.getLastOnigError()))}var oc=class e{constructor(t){rc(this,`utf16Length`),rc(this,`utf8Length`),rc(this,`utf16Value`),rc(this,`utf8Value`),rc(this,`utf16OffsetToUtf8`),rc(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},sc=class e{constructor(t){if(rc(this,`id`,++e.LAST_ID),rc(this,`_onigBinding`),rc(this,`content`),rc(this,`utf16Length`),rc(this,`utf8Length`),rc(this,`utf16OffsetToUtf8`),rc(this,`utf8OffsetToUtf16`),rc(this,`ptr`),!ic)throw new Xs(`Must invoke loadWasm first.`);this._onigBinding=ic,this.content=t;let n=new oc(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=ic.omalloc(1e4),e._sharedPtrInUse=!0,ic.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(ic)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};rc(sc,`LAST_ID`,0),rc(sc,`_sharedPtr`,0),rc(sc,`_sharedPtrInUse`,!1);var cc=sc,lc=class{constructor(e){if(rc(this,`_onigBinding`),rc(this,`_ptr`),!ic)throw new Xs(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new oc(e[r]);t[r]=i.createString(ic),n[r]=i.utf8Length}let r=ic.omalloc(4*e.length);ic.HEAPU32.set(t,r/4);let i=ic.omalloc(4*e.length);ic.HEAPU32.set(n,i/4);let a=ic.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)ic.ofree(t[n]);ic.ofree(i),ic.ofree(r),a===0&&ac(ic),this._onigBinding=ic,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new cc(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function uc(e){return typeof e.instantiator==`function`}function dc(e){return typeof e.default==`function`}function fc(e){return e.data!==void 0}function pc(e){return typeof Response<`u`&&e instanceof Response}function mc(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var hc;function gc(e){if(hc)return hc;async function t(){ic=await ec(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),uc(n)?n=await n.instantiator(t):dc(n)?n=await n.default(t):(fc(n)&&(n=n.data),pc(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await vc(n)(t):await yc(n)(t):mc(n)||n instanceof WebAssembly.Module?n=await _c(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await _c(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return hc=t(),hc}function _c(e){return t=>WebAssembly.instantiate(e,t)}function vc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function yc(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var bc;function xc(e){bc=e}function Sc(){return bc}async function Cc(e){return e&&await gc(e),{createScanner(e){return new lc(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new cc(e)}}}var wc=Rs({});Bs(wc,Ys);var Tc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Ec(e){return Dc(e)}function Dc(e){return Array.isArray(e)?Oc(e):e instanceof RegExp?e:typeof e==`object`?kc(e):e}function Oc(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Dc(e[n]);return t}function kc(e){let t={};for(let n in e)t[n]=Dc(e[n]);return t}function Ac(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function jc(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?jc(e.substring(0,e.length-1)):e.substr(~t+1)}var Mc=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Nc=class{static hasCaptures(e){return e!==null&&(Mc.lastIndex=0,Mc.test(e))}static replaceCaptures(e,t,n){return e.replace(Mc,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Pc(e,t){return e<t?-1:+(e>t)}function Fc(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Pc(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Ic(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Lc(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Rc=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},zc=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Wc(e),t)}static createFromParsedTheme(e,t){return qc(e,t)}_cachedMatchRoot=new Rc(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Vc(e.parent,t.parentScopes));return n?new Uc(n.fontStyle,n.foreground,n.background):null}},Bc=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Vc(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Hc(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Hc(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Uc=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Wc(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&Ic(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Ic(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Gc(l,u,e,o,s,c)}}return n}var Gc=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},Kc=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(Kc||{});function qc(e,t){e.sort((e,t)=>{let n=Pc(e.scope,t.scope);return n!==0||(n=Fc(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Jc(t),o=new Uc(n,a.getId(r),a.getId(i)),s=new Zc(new Xc(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new zc(a,o,s)}var Jc=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Yc=Object.freeze([]),Xc=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Yc,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Zc=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Xc.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Fc(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Xc(e,t,n,r,i))}},Qc=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=el(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function $c(e){return e}function el(e){return e}function tl(e,t){let n=[],r=rl(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(nl(i)){let e=[];do e.push(i),i=r.next();while(nl(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function nl(e){return!!e&&!!e.match(/[\w\.:]+/)}function rl(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function il(e){typeof e.dispose==`function`&&e.dispose()}var al=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ol=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},sl=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},cl=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new al(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new sl;for(let n of e)ll(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof al){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function ll(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof al?dl({baseGrammar:a,selfGrammar:i},r):ul(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new al(e))}function ul(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];fl([r],t,n)}}function dl(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&fl(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&fl(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function fl(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Ac({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&fl(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=vl(i);switch(a.kind){case 0:dl({...t,selfGrammar:t.baseGrammar},n);break;case 1:dl(t,n);break;case 2:ul(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?ul(a.ruleName,i,n):dl(i,n)}else a.kind===4?n.add(new ol(a.scopeName,a.ruleName)):n.add(new al(a.scopeName))}}}var pl=class{kind=0},ml=class{kind=1},hl=class{constructor(e){this.ruleName=e}kind=2},gl=class{constructor(e){this.scopeName=e}kind=3},_l=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function vl(e){if(e===`$base`)return new pl;if(e===`$self`)return new ml;let t=e.indexOf(`#`);return t===-1?new gl(e):t===0?new hl(e.substring(1)):new _l(e.substring(0,t),e.substring(t+1))}var yl=/\\(\d+)/,bl=/\\(\d+)/g,xl=-1,Sl=-2;function Cl(e){return e}function wl(e){return e}var Tl=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Nc.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Nc.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${jc(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Nc.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Nc.replaceCaptures(this._contentName,e,t)}},El=class extends Tl{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Dl=class extends Tl{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ml(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Nl,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ol=class extends Tl{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Nl,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},kl=class extends Tl{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Ml(i,this.id),this.beginCaptures=a,this._end=new Ml(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Nl;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Al=class extends Tl{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Ml(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Ml(o,Sl),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Nl;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Nl,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},jl=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new El(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Dl(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Ac({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Ol(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Al(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new kl(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=vl(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Ol||e instanceof kl||e instanceof Al)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ml=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&yl.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return bl.lastIndex=0,this.source.replace(bl,(e,t)=>Lc(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Nl=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Pl(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Pl(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Pl=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
15
|
-
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Fl=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Il=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Fl(e,8),this._embeddedLanguagesMatcher=new Ll(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Fl(0,0);_getBasicScopeAttributes=new Rc(e=>new Fl(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Ll=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Lc(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Rl=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function zl(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Bl(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Rl(i,!0);f()}return new Rl(i,!1);function f(){let o=Vl(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===xl){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Kl(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof kl){let r=o;Kl(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Al){let r=o;Kl(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Kl(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Bl(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Al&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Gl(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Sl){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Kl(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Vl(e,t,n,r,i,a){let o=Hl(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Ul(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Hl(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Wl(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Ul(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Wl(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Wl(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Gl(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Kl(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));zl(e,p,n&&d.start===0,d.start,f,i,!1,0),il(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new ql(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var ql=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Jl(e,t,n,r,i,a,o,s){return new Ql(e,t,n,r,i,a,o,s)}function Yl(e,t,n,r,i){let a=tl(t,Xl),o=jl.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Xl(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Zl(t[r],e))return n=r+1,!0;return!1})}function Zl(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var Ql=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Il(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=$l(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=tl(e,Xl);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Yl(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Yl(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Cl(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[wl(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=$l(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=jl.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===tu.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Qc.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?eu.createRootAndLookUpScopeName(a,r,this):eu.createRoot(`unknown`,r),t=new tu(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
16
|
-
`;let a=this.createOnigString(e),o=a.content.length,s=new ru(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=zl(this,a,i,0,t,s,!0,r);return il(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function $l(e,t){return e=Ec(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var eu=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Bc.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Bc(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Bc(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Qc.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},tu=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?eu.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:wl(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=eu.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Cl(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,eu.fromExtension(r,n.contentNameScopesList))}},nu=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):tl(e,Xl).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>tl(e,Xl).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},ru=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=Qc.set(n,0,$c(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=Qc.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},iu=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Jl(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},au=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new iu(zc.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(zc.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new nu(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new cl(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},ou=tu.NULL;function su(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function cu(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function lu(e){return Array.isArray(e)?e:[e]}async function uu(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function du(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function fu(e){return e===`ansi`||du(e)}function pu(e){return e===`none`}function mu(e){return pu(e)}var hu=/(\r?\n)/g;function gu(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(hu),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var _u={light:`#333333`,dark:`#bbbbbb`},vu={light:`#fffffe`,dark:`#1e1e1e`},yu=`__shiki_resolved`;function bu(e){if(e?.[yu])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?_u.light:_u.dark,n||=t.type===`light`?vu.light:vu.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,yu,{enumerable:!1,writable:!1,value:!0}),t}async function xu(e){return[...new Set((await Promise.all(e.filter(e=>!fu(e)).map(async e=>await uu(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Su(e){return(await Promise.all(e.map(async e=>mu(e)?null:bu(await uu(e))))).filter(e=>!!e)}function Cu(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Tc(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var wu=class extends au{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=bu(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=zc.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Cu(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new Tc(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Tu=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},Eu=0;function Du(e){Eu+=1,e.warnings!==!1&&Eu>=10&&Eu%10==0&&console.warn(`[Shiki] ${Eu} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Tc("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(bu),i=new wu(new Tu(e.engine,n),r,n,e.langAlias),a;function o(t){return Cu(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new Tc(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new Tc(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await xu(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Su(e))}function g(){if(t)throw new Tc(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Eu)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Ou(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Su(e.themes||[]),xu(e.langs||[]),e.engine]);return Du({...e,themes:t,langs:n,engine:r})}var ku=new WeakMap;function Au(e,t){ku.set(e,t)}function ju(e){return ku.get(e)}var Mu=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(lu(n).map(e=>[e,ou])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Nu(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Nu(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Pu(e,t){if(!(e instanceof Mu))throw new Tc(`Invalid grammar state`);return e.getInternalStack(t)}var Fu=/,/,Iu=/ /;function Lu(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(du(e.resolveLangAlias(n.lang||`text`))||pu(r))return gu(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Tc(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Tc(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return zu(t,o,i,a,n)}function Ru(...e){if(e.length===2)return ju(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(du(i)||pu(a))throw new Tc(`Plain language does not have grammar state`);if(i===`ansi`)throw new Tc(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Mu(Bu(n,c,o,s,r).stateStack,c.name,o.name)}function zu(e,t,n,r,i){let a=Bu(e,t,n,r,i),o=new Mu(a.stateStack,t.name,n.name);return Au(a.tokens,o),a.tokens}function Bu(e,t,n,r,i){let a=su(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=gu(e),u=i.grammarState?Pu(i.grammarState,n.name)??ou:i.grammarContextCode==null?ou:Bu(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=cu(r[Qc.getForeground(s)],a),u=Qc.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=Qc.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Fu).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Iu))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Vu(t.scopes):Hu(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Vu(e){return e.map(e=>({scopeName:e}))}function Hu(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Gu(e,i,t.slice(0,r))}}return n}function Uu(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Wu(e,t,n){if(!Uu(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Uu(e[r],n[i])&&--r,--i;return r===-1}function Gu(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Wu(e,t,n)){r.push(a);break}return r}function Ku(e,t,n,r=Lu){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:ju(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=qu(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Mu(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Au(s,c),s}function qu(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var Ju=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Yu=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Yu.prototype.normal={},Yu.prototype.property={},Yu.prototype.space=void 0;function Xu(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Yu(n,r,t)}function Zu(e){return e.toLowerCase()}var Qu=class{constructor(e,t){this.attribute=t,this.property=e}};Qu.prototype.attribute=``,Qu.prototype.booleanish=!1,Qu.prototype.boolean=!1,Qu.prototype.commaOrSpaceSeparated=!1,Qu.prototype.commaSeparated=!1,Qu.prototype.defined=!1,Qu.prototype.mustUseProperty=!1,Qu.prototype.number=!1,Qu.prototype.overloadedBoolean=!1,Qu.prototype.property=``,Qu.prototype.spaceSeparated=!1,Qu.prototype.space=void 0;var $u=t({boolean:()=>td,booleanish:()=>nd,commaOrSpaceSeparated:()=>od,commaSeparated:()=>ad,number:()=>J,overloadedBoolean:()=>rd,spaceSeparated:()=>id}),ed=0,td=sd(),nd=sd(),rd=sd(),J=sd(),id=sd(),ad=sd(),od=sd();function sd(){return 2**++ed}var cd=Object.keys($u),ld=class extends Qu{constructor(e,t,n,r){let i=-1;if(super(e,t),ud(this,`space`,r),typeof n==`number`)for(;++i<cd.length;){let e=cd[i];ud(this,cd[i],(n&$u[e])===$u[e])}}};ld.prototype.defined=!0;function ud(e,t,n){n&&(e[t]=n)}function dd(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new ld(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Zu(r)]=r,n[Zu(a.attribute)]=r}return new Yu(t,n,e.space)}var fd=dd({properties:{ariaActiveDescendant:null,ariaAtomic:nd,ariaAutoComplete:null,ariaBusy:nd,ariaChecked:nd,ariaColCount:J,ariaColIndex:J,ariaColSpan:J,ariaControls:id,ariaCurrent:null,ariaDescribedBy:id,ariaDetails:null,ariaDisabled:nd,ariaDropEffect:id,ariaErrorMessage:null,ariaExpanded:nd,ariaFlowTo:id,ariaGrabbed:nd,ariaHasPopup:null,ariaHidden:nd,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:id,ariaLevel:J,ariaLive:null,ariaModal:nd,ariaMultiLine:nd,ariaMultiSelectable:nd,ariaOrientation:null,ariaOwns:id,ariaPlaceholder:null,ariaPosInSet:J,ariaPressed:nd,ariaReadOnly:nd,ariaRelevant:null,ariaRequired:nd,ariaRoleDescription:id,ariaRowCount:J,ariaRowIndex:J,ariaRowSpan:J,ariaSelected:nd,ariaSetSize:J,ariaSort:null,ariaValueMax:J,ariaValueMin:J,ariaValueNow:J,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function pd(e,t){return t in e?e[t]:t}function md(e,t){return pd(e,t.toLowerCase())}var hd=dd({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ad,acceptCharset:id,accessKey:id,action:null,allow:null,allowFullScreen:td,allowPaymentRequest:td,allowUserMedia:td,alpha:td,alt:null,as:null,async:td,autoCapitalize:null,autoComplete:id,autoFocus:td,autoPlay:td,blocking:id,capture:null,charSet:null,checked:td,cite:null,className:id,closedBy:null,colorSpace:null,cols:J,colSpan:J,command:null,commandFor:null,content:null,contentEditable:nd,controls:td,controlsList:id,coords:J|ad,crossOrigin:null,data:null,dateTime:null,decoding:null,default:td,defer:td,dir:null,dirName:null,disabled:td,download:rd,draggable:nd,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:td,formTarget:null,headers:id,height:J,hidden:rd,high:J,href:null,hrefLang:null,htmlFor:id,httpEquiv:id,id:null,imageSizes:null,imageSrcSet:null,inert:td,inputMode:null,integrity:null,is:null,isMap:td,itemId:null,itemProp:id,itemRef:id,itemScope:td,itemType:id,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:td,low:J,manifest:null,max:null,maxLength:J,media:null,method:null,min:null,minLength:J,multiple:td,muted:td,name:null,nonce:null,noModule:td,noValidate:td,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:td,optimum:J,pattern:null,ping:id,placeholder:null,playsInline:td,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:td,referrerPolicy:null,rel:id,required:td,reversed:td,rows:J,rowSpan:J,sandbox:id,scope:null,scoped:td,seamless:td,selected:td,shadowRootClonable:td,shadowRootCustomElementRegistry:td,shadowRootDelegatesFocus:td,shadowRootMode:null,shadowRootSerializable:td,shape:null,size:J,sizes:null,slot:null,span:J,spellCheck:nd,src:null,srcDoc:null,srcLang:null,srcSet:null,start:J,step:null,style:null,tabIndex:J,target:null,title:null,translate:null,type:null,typeMustMatch:td,useMap:null,value:nd,width:J,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:id,axis:null,background:null,bgColor:null,border:J,borderColor:null,bottomMargin:J,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:td,declare:td,event:null,face:null,frame:null,frameBorder:null,hSpace:J,leftMargin:J,link:null,longDesc:null,lowSrc:null,marginHeight:J,marginWidth:J,noResize:td,noHref:td,noShade:td,noWrap:td,object:null,profile:null,prompt:null,rev:null,rightMargin:J,rules:null,scheme:null,scrolling:nd,standby:null,summary:null,text:null,topMargin:J,valueType:null,version:null,vAlign:null,vLink:null,vSpace:J,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:td,disablePictureInPicture:td,disableRemotePlayback:td,exportParts:ad,part:id,prefix:null,property:null,results:J,security:null,unselectable:null},space:`html`,transform:md}),gd=dd({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:od,accentHeight:J,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:J,amplitude:J,arabicForm:null,ascent:J,attributeName:null,attributeType:null,azimuth:J,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:J,by:null,calcMode:null,capHeight:J,className:id,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:J,diffuseConstant:J,direction:null,display:null,dur:null,divisor:J,dominantBaseline:null,download:td,dx:null,dy:null,edgeMode:null,editable:null,elevation:J,enableBackground:null,end:null,event:null,exponent:J,externalResourcesRequired:null,fill:null,fillOpacity:J,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ad,g2:ad,glyphName:ad,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:J,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:J,horizOriginX:J,horizOriginY:J,id:null,ideographic:J,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:J,k:J,k1:J,k2:J,k3:J,k4:J,kernelMatrix:od,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:J,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:J,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:J,overlineThickness:J,paintOrder:null,panose1:null,path:null,pathLength:J,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:id,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:J,pointsAtY:J,pointsAtZ:J,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:od,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:od,rev:od,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:od,requiredFeatures:od,requiredFonts:od,requiredFormats:od,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:J,specularExponent:J,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:J,strikethroughThickness:J,string:null,stroke:null,strokeDashArray:od,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:J,strokeOpacity:J,strokeWidth:null,style:null,surfaceScale:J,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:od,tabIndex:J,tableValues:null,target:null,targetX:J,targetY:J,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:od,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:J,underlineThickness:J,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:J,values:null,vAlphabetic:J,vMathematical:J,vectorEffect:null,vHanging:J,vIdeographic:J,version:null,vertAdvY:J,vertOriginX:J,vertOriginY:J,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:J,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:pd}),_d=dd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),vd=dd({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:md}),yd=dd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),bd={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},xd=/[A-Z]/g,Sd=/-[a-z]/g,Cd=/^data[-\w.:]+$/i;function wd(e,t){let n=Zu(t),r=t,i=Qu;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Cd.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Sd,Ed);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Sd.test(e)){let n=e.replace(xd,Td);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=ld}return new i(r,t)}function Td(e){return`-`+e.toLowerCase()}function Ed(e){return e.charAt(1).toUpperCase()}var Dd=Xu([fd,hd,_d,vd,yd],`html`),Od=Xu([fd,gd,_d,vd,yd],`svg`),kd={}.hasOwnProperty;function Ad(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&kd.call(t,e)){let n=String(t[e]);i=kd.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var jd=/["&'<>`]/g,Md=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Nd=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Pd=/[|\\{}()[\]^$+*?.]/g,Fd=new WeakMap;function Id(e,t){if(e=e.replace(t.subset?Ld(t.subset):jd,r),t.subset||t.escapeOnly)return e;return e.replace(Md,n).replace(Nd,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Ld(e){let t=Fd.get(e);return t||(t=Rd(e),Fd.set(e,t)),t}function Rd(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Pd,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var zd=/[\dA-Fa-f]/;function Bd(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!zd.test(String.fromCharCode(t))?r:r+`;`}var Vd=/\d/;function Hd(e,t,n){let r=`&#`+String(e);return n&&t&&!Vd.test(String.fromCharCode(t))?r:r+`;`}var Ud=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Wd={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},Gd=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Kd={}.hasOwnProperty,qd={},Jd;for(Jd in Wd)Kd.call(Wd,Jd)&&(qd[Wd[Jd]]=Jd);var Yd=/[^\dA-Za-z]/;function Xd(e,t,n,r){let i=String.fromCharCode(e);if(Kd.call(qd,i)){let e=qd[i],a=`&`+e;return n&&Ud.includes(e)&&!Gd.includes(e)&&(!r||t&&t!==61&&Yd.test(String.fromCharCode(t)))?a:a+`;`}return``}function Zd(e,t,n){let r=Bd(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Xd(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Hd(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Qd(e,t){return Id(e,Object.assign({format:Zd},t))}var $d=/^>|^->|<!--|-->|--!>|<!-$/g,ef=[`>`],tf=[`<`,`>`];function nf(e,t,n,r){return r.settings.bogusComments?`<?`+Qd(e.value,Object.assign({},r.settings.characterReferences,{subset:ef}))+`>`:`<!--`+e.value.replace($d,i)+`-->`;function i(e){return Qd(e,Object.assign({},r.settings.characterReferences,{subset:tf}))}}function rf(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function af(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function of(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function sf(e){return e.join(` `).trim()}var cf=/[ \t\n\f\r]/g;function lf(e){return typeof e==`object`?e.type===`text`&&uf(e.value):uf(e)}function uf(e){return e.replace(cf,``)===``}var df=mf(1),ff=mf(-1),pf=[];function mf(e){return t;function t(t,n,r){let i=t?t.children:pf,a=(n||0)+e,o=i[a];if(!r)for(;o&&lf(o);)a+=e,o=i[a];return o}}var hf={}.hasOwnProperty;function gf(e){return t;function t(t,n,r){return hf.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var _f=gf({body:bf,caption:vf,colgroup:vf,dd:wf,dt:Cf,head:vf,html:yf,li:Sf,optgroup:Ef,option:Df,p:xf,rp:Tf,rt:Tf,tbody:kf,td:Mf,tfoot:Af,th:Mf,thead:Of,tr:jf});function vf(e,t,n){let r=df(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&lf(r.value.charAt(0)))}function yf(e,t,n){let r=df(n,t);return!r||r.type!==`comment`}function bf(e,t,n){let r=df(n,t);return!r||r.type!==`comment`}function xf(e,t,n){let r=df(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function Sf(e,t,n){let r=df(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Cf(e,t,n){let r=df(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function wf(e,t,n){let r=df(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Tf(e,t,n){let r=df(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Ef(e,t,n){let r=df(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Df(e,t,n){let r=df(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Of(e,t,n){let r=df(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function kf(e,t,n){let r=df(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Af(e,t,n){return!df(n,t)}function jf(e,t,n){let r=df(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Mf(e,t,n){let r=df(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Nf=gf({body:If,colgroup:Lf,head:Ff,html:Pf,tbody:Rf});function Pf(e){let t=df(e,-1);return!t||t.type!==`comment`}function Ff(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function If(e){let t=df(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&lf(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Lf(e,t,n){let r=ff(n,t),i=df(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&_f(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Rf(e,t,n){let r=ff(n,t),i=df(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&_f(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var zf={name:[[`
|
|
17
|
-
\f\r &/=>`.split(``),`
|
|
18
|
-
\f\r "&'/=>\``.split(``)],[`\0
|
|
19
|
-
\f\r "&'/<=>`.split(``),`\0
|
|
20
|
-
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
|
21
|
-
\f\r &>`.split(``),`\0
|
|
22
|
-
\f\r "&'<=>\``.split(``)],[`\0
|
|
23
|
-
\f\r "&'<=>\``.split(``),`\0
|
|
24
|
-
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Bf(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Od);let l=Vf(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Nf(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!_f(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Vf(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Hf(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Hf(e,t,n){let r=wd(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=Qd(r.attribute,Object.assign({},e.settings.characterReferences,{subset:zf.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?of:sf)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Qd(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:zf.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&af(n,o)>af(n,e.alternative)&&(o=e.alternative),s=o+Qd(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?zf.single:zf.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Uf=[`<`,`&`];function Wf(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Qd(e.value,Object.assign({},r.settings.characterReferences,{subset:Uf}))}function Gf(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Wf(e,t,n,r)}function Kf(e,t,n,r){return r.all(e)}var qf=Ad(`type`,{invalid:Jf,unknown:Yf,handlers:{comment:nf,doctype:rf,element:Bf,raw:Gf,root:Kf,text:Wf}});function Jf(e){throw Error("Expected node, not `"+e+"`")}function Yf(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Xf={},Zf={},Qf=[];function $f(e,t){let n=t||Xf,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ep,all:tp,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Ju,characterReferences:n.characterReferences||Zf,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Od:Dd,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function ep(e,t,n){return qf(e,t,n,this)}function tp(e){let t=[],n=e&&e.children||Qf,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var np=/\s+/g;function rp(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(np)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(np);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var ip=/:?lang=["']([^"']+)["']/g,ap=/(?:```|~~~)([\w-]+)/g,op=/\\begin\{([\w-]+)\}/g,sp=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,cp=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function lp(e){let t=gu(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function up(e,t,n){let r=new Set;for(let t of e.matchAll(ip)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(ap)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(op)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(sp)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(cp.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var dp=[`color`,`background-color`];function fp(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function pp(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function mp(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=pp(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return fp(e,a)})):e}function hp(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>gp(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&dp.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new Tc('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function gp(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&Kc.Italic&&(t[`font-style`]=`italic`),e.fontStyle&Kc.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&Kc.Underline&&n.push(`underline`),e.fontStyle&Kc.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function _p(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function vp(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=lp(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new Tc(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new Tc(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new Tc(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));yp(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return mp(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new Tc(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=bp(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new Tc(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new Tc(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&rp(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function yp(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new Tc(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new Tc(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function bp(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(bp).join(``):``}var xp=[vp()];function Sp(e){let t=Cp(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...xp]}function Cp(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var wp=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Tp={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Ep(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Dp(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Op(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)Tp[r]&&t.push({type:`setDecoration`,value:Tp[r]});else if(r<=29){let e=Tp[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:wp[r-30]}});else if(r===38){let n=Dp(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:wp[r-40]}});else if(r===48){let n=Dp(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:wp[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:wp[r-100+8]}})}}return t}function kp(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Ep(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Op(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Ap={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function jp(e=Ap){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<wp.length;e++)r.push(t(wp[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Mp=/#([0-9a-f]{3,8})/i,Np=/var\((--[\w-]+-ansi-[\w-]+)\)/,Pp={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Fp(e,t,n){let r=su(e,n),i=gu(t),a=jp(Object.fromEntries(wp.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Pp[t]]}))),o=kp();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=cu(i,r),o=cu(o,r),n.decorations.has(`dim`)&&(i=Ip(i));let s=Kc.None;return n.decorations.has(`bold`)&&(s|=Kc.Bold),n.decorations.has(`italic`)&&(s|=Kc.Italic),n.decorations.has(`underline`)&&(s|=Kc.Underline),n.decorations.has(`strikethrough`)&&(s|=Kc.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Ip(e){let t=e.match(Mp);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Np);return n?`var(${n[1]}-dim)`:e}function Lp(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!du(r)&&!pu(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Fp(r,t,n)}return Lu(e,t,n)}function Rp(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new Tc("`themes` option must not be empty");let p=Ku(e,t,n,Lp);if(c=ju(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new Tc(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>hp(e,h,u,l,d))),c&&Au(a,c);let g=f.map(e=>su(e.theme,n));i=zp(f,m,g,u,l,`fg`,d),r=zp(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=su(n.theme,n);a=Lp(e,t,n);let l=e.getTheme(n.theme);r=cu(l.bg,s),i=cu(l.fg,s),o=l.name,c=ju(a)}else throw new Tc("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function zp(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=cu(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new Tc('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${cu(t[r][a],n[r])||`inherit`}, ${cu(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Bp=/^\s+$/,Vp=/^(\s*)(.*?)(\s*)$/;function Hp(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Hp(e,t,n),codeToTokens:(t,n)=>Rp(e,t,n)}){let i=t;for(let e of Sp(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Rp(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Wp(a):d===`never`&&(a=Gp(a)),f&&(a=eee(a));let p={...r,get source(){return i}};for(let e of Sp(n))a=e.tokens?.call(p,a)||a;return Up(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Up(e,t,n,r=ju(e)){let i=Sp(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:rp,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
25
|
-
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=_p(a.htmlStyle||gp(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Au(m,r),m}function Wp(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&Kc.Underline||i.fontStyle&Kc.Strikethrough));o&&Bp.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Gp(e){return e.map(e=>e.flatMap(e=>{if(Bp.test(e.content))return e;let t=e.content.match(Vp);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function eee(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=_p(e.htmlStyle||gp(e)),i=_p(n.htmlStyle||gp(n)),a=e.fontStyle&&(e.fontStyle&Kc.Underline||e.fontStyle&Kc.Strikethrough),o=n.fontStyle&&(n.fontStyle&Kc.Underline||n.fontStyle&Kc.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Kp=$f;function qp(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Hp(e,t,n),codeToTokens:(t,n)=>Rp(e,t,n)},i=Kp(Hp(e,t,n,r));for(let e of Sp(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Jp(e){let t=await Ou(e);return{getLastGrammarState:(...e)=>Ru(t,...e),codeToTokensBase:(e,n)=>Lp(t,e,n),codeToTokensWithThemes:(e,n)=>Ku(t,e,n),codeToTokens:(e,n)=>Rp(t,e,n),codeToHast:(e,n)=>Hp(t,e,n),codeToHtml:(e,n)=>qp(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Yp(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,fu(n))return[];let r=t[n];if(!r)throw new Tc(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(mu(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new Tc(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Jp({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Xp(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function Zp(e,t){let n=Xp(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var Qp=Yp({langs:qs,themes:Js,engine:()=>(0,wc.createOnigurumaEngine)(q(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:tee,codeToHast:nee,codeToTokens:ree,codeToTokensBase:iee,codeToTokensWithThemes:aee,getSingletonHighlighter:oee,getLastGrammarState:see}=Zp(Qp,{guessEmbeddedLanguages:up}),$p=4294967295,em=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:$p,end:$p,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function tm(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function nm(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var rm=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),im=String.raw;function am(e,t){if(e==null)throw Error(t??`Value expected`);return e}var om=im`\[\^?`,sm=`c.? | C(?:-.?)?|${im`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${im`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${im`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${im`o\{[^\}]*\}?`}|${im`\d{1,3}`}`,cm=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,lm=new RegExp(im`
|
|
26
|
-
\\ (?:
|
|
27
|
-
${sm}
|
|
28
|
-
| [gk]<[^>]*>?
|
|
29
|
-
| [gk]'[^']*'?
|
|
30
|
-
| .
|
|
31
|
-
)
|
|
32
|
-
| \( (?:
|
|
33
|
-
\? (?:
|
|
34
|
-
[:=!>({]
|
|
35
|
-
| <[=!]
|
|
36
|
-
| <[^>]*>
|
|
37
|
-
| '[^']*'
|
|
38
|
-
| ~\|?
|
|
39
|
-
| #(?:[^)\\]|\\.?)*
|
|
40
|
-
| [^:)]*[:)]
|
|
41
|
-
)?
|
|
42
|
-
| \*[^\)]*\)?
|
|
43
|
-
)?
|
|
44
|
-
| (?:${cm.source})+
|
|
45
|
-
| ${om}
|
|
46
|
-
| .
|
|
47
|
-
`.replace(/\s+/g,``),`gsu`),um=new RegExp(im`
|
|
48
|
-
\\ (?:
|
|
49
|
-
${sm}
|
|
50
|
-
| .
|
|
51
|
-
)
|
|
52
|
-
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
53
|
-
| ${om}
|
|
54
|
-
| &&
|
|
55
|
-
| .
|
|
56
|
-
`.replace(/\s+/g,``),`gsu`);function dm(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=Rm(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(lm.lastIndex=0;s=lm.exec(e);){let t=fm(a,e,s[0],lm.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(lm.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?Bm(e,u):e).flat(),flags:r}}function fm(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=pm(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:_m(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Om(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:vm(n)}}if(a===`K`)return{token:Sm(`keep`,n)};if(a===`N`||a===`R`)return{token:xm(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:xm(`any`,n)};if(a===`X`)return{token:xm(`text_segment`,n)};let e=hm(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:Nm(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Mm(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:Tm(`group`,n)};if(n===`(?>`)return{token:Tm(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:Tm(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:Tm(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:Tm(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:wm(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
|
|
57
|
-
`,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:xm(`dot`,n)}:n===`^`||n===`$`?{token:_m(e.singleline?{"^":im`\A`,$:im`\Z`}[n]:n,n)}:n===`|`?{token:gm(n)}:cm.test(n)?{tokens:Vm(n)}:{token:ym(tm(n),n)}}function pm(e,t,n){let r=[bm(t[1]===`^`,t)],i=1,a;for(um.lastIndex=n;a=um.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(bm(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(ym(93,e));else if(i--,r.push(cee(e)),!i)break}else{let t=mm(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:um.lastIndex||e.length}}function mm(e){if(e[0]===`\\`)return hm(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!rm.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return xm(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?lee(e):e===`&&`?uee(e):ym(tm(e),e)}function hm(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return jm(e);if(`dDhHsSwW`.includes(n))return Fm(e);if(e.startsWith(im`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return Im(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return ym(tm(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return ym(zm(e),e);if(Am.has(n))return ym(Am.get(n),e);if(/\d/.test(n))return Cm(t,e);if(e===`\\`)throw Error(im`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return ym(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function gm(e){return{type:`Alternator`,raw:e}}function _m(e,t){return{type:`Assertion`,kind:e,raw:t}}function vm(e){return{type:`Backreference`,raw:e}}function ym(e,t){return{type:`Character`,value:e,raw:t}}function cee(e){return{type:`CharacterClassClose`,raw:e}}function lee(e){return{type:`CharacterClassHyphen`,raw:e}}function uee(e){return{type:`CharacterClassIntersector`,raw:e}}function bm(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function xm(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function Sm(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:am(n.flags),raw:t}}function Cm(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function wm(e){return{type:`GroupClose`,raw:e}}function Tm(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function Em(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Dm(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function Om(e){return{type:`Subroutine`,raw:e}}var km=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Am=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function jm(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return ym(tm(t.toUpperCase())-64,e)}function Mm(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=Lm(n),o=Lm(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),Sm(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Tm(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function Nm(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=km.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return Em(l,r??null,i?.split(`,`)??null,e)}function Pm(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return Dm(t,n,r,e)}function Fm(e){let t=e[1].toLowerCase();return xm({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function Im(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return xm(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function Lm(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function Rm(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function zm(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Bm(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[vm(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(im`Octal encoded byte above 177 unsupported "${n}"`)}else r=tm(t);a.push(ym(r,(e===0?`\\`:``)+t))}return a}function Vm(e){let t=[],n=new RegExp(cm,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(Pm(e.slice(0,-1)));continue}}}t.push(Pm(e))}return t}function Hm(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function Um(e){return Wm.has(e.type)}var Wm=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function Gm(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=dm(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return th();case`Assertion`:return Km(n);case`Backreference`:return qm(n,a);case`Character`:return ah(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return Jm(n,a,t);case`CharacterClassOpen`:return Ym(n,a,t);case`CharacterSet`:return Xm(n,a);case`Directive`:return lh(n.kind,{flags:n.flags});case`GroupOpen`:return Zm(n,a,t);case`NamedCallout`:return ph(n.kind,n.tag,n.arguments);case`Quantifier`:return Qm(n,a);case`Subroutine`:return $m(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=gh(uh(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(im`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(im`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function Km({kind:e}){return nh(am({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===im`\B`||e===im`\Y`})}function qm({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,rh(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return rh(r)}return i(+r)}function Jm(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),sh(o,e);throw Error(`Invalid character class range`)}return ah(tm(`-`))}function Ym({negate:e},t,n){let{tokens:r,walk:i}=t,a=[oh()],o=r[t.nextIndex],s=wh(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(oh()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=wh(r[t.nextIndex],o)}let c=oh({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function Xm({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=Ch(n);if(rm.has(r)&&!o?.has(r))e=`posix`,n=r;else return vh(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?mh(n,{negate:t}):ch(e,{negate:t})}function Zm(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=dee(e),l=c.type===`AbsenceFunction`,u=Sh(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&nm(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=Th(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(th()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(xh(t)||t.type===`CapturingGroup`)throw Error(e)}else if(xh(t)||Sh(t)&&t.negate)throw Error(e)}}f=Th(r[t.nextIndex])}return t.nextIndex++,c}function Qm({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!Um(a))throw Error(`Quantifier requires a repeatable token`);let o=hh(e,t,n,a);return i.body.pop(),o}function $m({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=_h(i);return r.push(o),o}function eh(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:yh(t?.body)}}function th(e){return{type:`Alternative`,body:bh(e?.body)}}function nh(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function rh(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function ih(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!fee(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:yh(t?.body)}}function ah(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function oh(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:bh(e?.body)}}function sh(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function ch(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function lh(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:am(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function uh(e){return{type:`Flags`,...e}}function dh(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:yh(e?.body)}}function fh(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:yh(e?.body)}}function ph(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function mh(e,t){let n=!!t?.negate;if(!rm.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function hh(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function gh(e,t){return{type:`Regex`,body:yh(t?.body),flags:e}}function _h(e){return{type:`Subroutine`,ref:e}}function vh(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(Ch(e));if(!r){if(n.normalizeUnknownPropertyNames)r=pee(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(im`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function dee({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return eh(`repeater`);case`atomic`:return dh({atomic:!0});case`capturing`:return ih(i,{name:n});case`group`:return dh({flags:e});case`lookahead`:case`lookbehind`:return fh({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function yh(e){if(e===void 0)e=[th()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function bh(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function xh(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function Sh(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function fee(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function pee(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function Ch(e){return e.replace(/[- _]+/g,``).toLowerCase()}function wh(e,t){let n=t;return am(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function Th(e){return am(e,`Unclosed group`)}function Eh(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){Dh(c).splice(Math.max(0,Oh(s)+l),1),l--,u=!0},removeAllNextSiblings(){return Dh(c).splice(Oh(s)+1)},removeAllPrevSiblings(){let e=Oh(s)+l;return l-=e,Dh(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,Oh(s)+l)]=e:am(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(Dh(c).splice(Math.max(0,Oh(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,Oh(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function Dh(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function Oh(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var kh=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Ah(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function jh(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var Mh=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function Nh(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===Mh.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?Mh.CHAR_CLASS:Mh.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function Ph(e,t,n,r){Nh(e,t,n,r)}function Fh(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===Mh.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function Ih(e,t,n){return!!Fh(e,t,0,n)}function Lh(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var Rh=new RegExp(String.raw`(?<noncapturingStart>${kh})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function zh(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(Rh.lastIndex=Number.isNaN(c)?0:c+7;f=Rh.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),Ah(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=Nh(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},Mh.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var Bh=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Vh=new RegExp(String.raw`
|
|
58
|
-
\\(?: \d+
|
|
59
|
-
| c[A-Za-z]
|
|
60
|
-
| [gk]<[^>]+>
|
|
61
|
-
| [pPu]\{[^\}]+\}
|
|
62
|
-
| u[A-Fa-f\d]{4}
|
|
63
|
-
| x[A-Fa-f\d]{2}
|
|
64
|
-
)
|
|
65
|
-
| \((?: \? (?: [:=!>]
|
|
66
|
-
| <(?:[=!]|[^>]+>)
|
|
67
|
-
| [A-Za-z\-]+:
|
|
68
|
-
| \(DEFINE\)
|
|
69
|
-
))?
|
|
70
|
-
| (?<qBase>${Bh})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
71
|
-
| \\?.
|
|
72
|
-
`.replace(/\s+/g,``),`gsu`);function Hh(e){if(!RegExp(`${Bh}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(Vh.lastIndex=0;o=Vh.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=jh(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}Vh.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var Uh=String.raw,Wh=Uh`\(\?R=(?<rDepth>[^\)]+)\)|${Uh`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,Gh=Uh`\(\?<(?![=!])(?<captureName>[^>]+)>`,Kh=Uh`${Gh}|(?<unnamed>\()(?!\?)`,qh=new RegExp(Uh`${Gh}|${Wh}|\(\?|\\?.`,`gsu`),Jh=`Cannot use multiple overlapping recursions`;function Yh(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(Wh,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&Ih(e,Uh`\(\?\(DEFINE\)`,Mh.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=Ih(e,Uh`\\[1-9]`,Mh.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(qh.lastIndex=0;f=qh.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(Xh(m),l)throw Error(Jh);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(qh.lastIndex);if(Ih(s,Wh,Mh.DEFAULT))throw Error(Jh);let c=m-1;e=Zh(t,s,c,!1,n,a,d),i=eg(i,t,c,a.length,0,d);break}if(h){Xh(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(Jh);break}if(!u)throw Error(Uh`Recursive \g cannot be used outside the referenced group "${r===`external`?h:Uh`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=Lh(e,p);if(o&&Ih(m,Uh`${Gh}|\((?!\?)`,Mh.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=Zh(_,v,b,!0,n,a,d);i=eg(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,qh.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),qh.lastIndex),s.set(p,qh.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),qh.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Xh(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function Zh(e,t,n,r,i,a,o){let s=new Set;r&&Ph(e+t,Gh,({groups:{captureName:e}})=>{s.add(e)},Mh.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${Qh(`(?:${e}`,`forward`,...c)}(?:)${Qh(`${t})`,`backward`,...c)}${t}`}function Qh(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=Nh(e,Uh`${Kh}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),$h(i,n),s?e:`(?<${t}${l}>`}return Uh`\k<${c}${l}>`},Mh.DEFAULT)}return c}function $h(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function eg(e,t,n,r,i,a){if(e.size&&r){let o=0;Ph(t,Kh,()=>o++,Mh.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var tg=String.fromCodePoint,ng=String.raw,rg={},ig=globalThis.RegExp;rg.flagGroups=(()=>{try{new ig(`(?i:)`)}catch{return!1}return!0})(),rg.unicodeSets=(()=>{try{new ig(`[[]]`,`v`)}catch{return!1}return!0})(),rg.bugFlagVLiteralHyphenIsRange=rg.unicodeSets?(()=>{try{new ig(ng`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,rg.bugNestedClassIgnoresNegation=rg.unicodeSets&&new ig(`[[^a]]`,`v`).test(`a`);function ag(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function og(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function sg(e,t){return lg[e]>=lg[t]}function cg(e,t){if(e==null)throw Error(t??`Value expected`);return e}var lg={ES2025:2025,ES2024:2024,ES2018:2018},ug={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function dg(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!ug[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=rg.flagGroups?`ES2025`:rg.unicodeSets?`ES2024`:`ES2018`),t}var fg=`[ -\r ]`,pg=new Set([tg(304),tg(305)]),mg=ng`[\p{L}\p{M}\p{N}\p{Pc}]`;function hg(e){if(pg.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=yg.get(n),a=_g.get(n),o=vg.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var gg=new Map(`C Other
|
|
73
|
-
Cc Control cntrl
|
|
74
|
-
Cf Format
|
|
75
|
-
Cn Unassigned
|
|
76
|
-
Co Private_Use
|
|
77
|
-
Cs Surrogate
|
|
78
|
-
L Letter
|
|
79
|
-
LC Cased_Letter
|
|
80
|
-
Ll Lowercase_Letter
|
|
81
|
-
Lm Modifier_Letter
|
|
82
|
-
Lo Other_Letter
|
|
83
|
-
Lt Titlecase_Letter
|
|
84
|
-
Lu Uppercase_Letter
|
|
85
|
-
M Mark Combining_Mark
|
|
86
|
-
Mc Spacing_Mark
|
|
87
|
-
Me Enclosing_Mark
|
|
88
|
-
Mn Nonspacing_Mark
|
|
89
|
-
N Number
|
|
90
|
-
Nd Decimal_Number digit
|
|
91
|
-
Nl Letter_Number
|
|
92
|
-
No Other_Number
|
|
93
|
-
P Punctuation punct
|
|
94
|
-
Pc Connector_Punctuation
|
|
95
|
-
Pd Dash_Punctuation
|
|
96
|
-
Pe Close_Punctuation
|
|
97
|
-
Pf Final_Punctuation
|
|
98
|
-
Pi Initial_Punctuation
|
|
99
|
-
Po Other_Punctuation
|
|
100
|
-
Ps Open_Punctuation
|
|
101
|
-
S Symbol
|
|
102
|
-
Sc Currency_Symbol
|
|
103
|
-
Sk Modifier_Symbol
|
|
104
|
-
Sm Math_Symbol
|
|
105
|
-
So Other_Symbol
|
|
106
|
-
Z Separator
|
|
107
|
-
Zl Line_Separator
|
|
108
|
-
Zp Paragraph_Separator
|
|
109
|
-
Zs Space_Separator
|
|
110
|
-
ASCII
|
|
111
|
-
ASCII_Hex_Digit AHex
|
|
112
|
-
Alphabetic Alpha
|
|
113
|
-
Any
|
|
114
|
-
Assigned
|
|
115
|
-
Bidi_Control Bidi_C
|
|
116
|
-
Bidi_Mirrored Bidi_M
|
|
117
|
-
Case_Ignorable CI
|
|
118
|
-
Cased
|
|
119
|
-
Changes_When_Casefolded CWCF
|
|
120
|
-
Changes_When_Casemapped CWCM
|
|
121
|
-
Changes_When_Lowercased CWL
|
|
122
|
-
Changes_When_NFKC_Casefolded CWKCF
|
|
123
|
-
Changes_When_Titlecased CWT
|
|
124
|
-
Changes_When_Uppercased CWU
|
|
125
|
-
Dash
|
|
126
|
-
Default_Ignorable_Code_Point DI
|
|
127
|
-
Deprecated Dep
|
|
128
|
-
Diacritic Dia
|
|
129
|
-
Emoji
|
|
130
|
-
Emoji_Component EComp
|
|
131
|
-
Emoji_Modifier EMod
|
|
132
|
-
Emoji_Modifier_Base EBase
|
|
133
|
-
Emoji_Presentation EPres
|
|
134
|
-
Extended_Pictographic ExtPict
|
|
135
|
-
Extender Ext
|
|
136
|
-
Grapheme_Base Gr_Base
|
|
137
|
-
Grapheme_Extend Gr_Ext
|
|
138
|
-
Hex_Digit Hex
|
|
139
|
-
IDS_Binary_Operator IDSB
|
|
140
|
-
IDS_Trinary_Operator IDST
|
|
141
|
-
ID_Continue IDC
|
|
142
|
-
ID_Start IDS
|
|
143
|
-
Ideographic Ideo
|
|
144
|
-
Join_Control Join_C
|
|
145
|
-
Logical_Order_Exception LOE
|
|
146
|
-
Lowercase Lower
|
|
147
|
-
Math
|
|
148
|
-
Noncharacter_Code_Point NChar
|
|
149
|
-
Pattern_Syntax Pat_Syn
|
|
150
|
-
Pattern_White_Space Pat_WS
|
|
151
|
-
Quotation_Mark QMark
|
|
152
|
-
Radical
|
|
153
|
-
Regional_Indicator RI
|
|
154
|
-
Sentence_Terminal STerm
|
|
155
|
-
Soft_Dotted SD
|
|
156
|
-
Terminal_Punctuation Term
|
|
157
|
-
Unified_Ideograph UIdeo
|
|
158
|
-
Uppercase Upper
|
|
159
|
-
Variation_Selector VS
|
|
160
|
-
White_Space space
|
|
161
|
-
XID_Continue XIDC
|
|
162
|
-
XID_Start XIDS`.split(/\s/).map(e=>[Ch(e),e])),_g=new Map([[`s`,tg(383)],[tg(383),`s`]]),vg=new Map([[tg(223),tg(7838)],[tg(107),tg(8490)],[tg(229),tg(8491)],[tg(969),tg(8486)]]),yg=new Map([Sg(453),Sg(456),Sg(459),Sg(498),...Cg(8072,8079),...Cg(8088,8095),...Cg(8104,8111),Sg(8124),Sg(8140),Sg(8188)]),bg=new Map([[`alnum`,ng`[\p{Alpha}\p{Nd}]`],[`alpha`,ng`\p{Alpha}`],[`ascii`,ng`\p{ASCII}`],[`blank`,ng`[\p{Zs}\t]`],[`cntrl`,ng`\p{Cc}`],[`digit`,ng`\p{Nd}`],[`graph`,ng`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,ng`\p{Lower}`],[`print`,ng`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,ng`[\p{P}\p{S}]`],[`space`,ng`\p{space}`],[`upper`,ng`\p{Upper}`],[`word`,ng`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,ng`\p{AHex}`]]);function xg(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Sg(e){let t=tg(e);return[t.toLowerCase(),t]}function Cg(e,t){return xg(e,t).map(e=>Sg(e))}var wg=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Tg(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};kg(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:sg(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Eh(e,Eg,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return Eh(e,Dg,a),Eh(e,Og,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var Eg={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=dh();e.body[0].body.push(fh({negate:!0,body:r}),vh(`Any`));let i=dh();i.body[0].body.push(hh(`greedy`,0,1/0,e)),n(Jg(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];og(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Ig(t.get(e));if(n){let t=dh({flags:n});t.body[0].body=e.body,e.body=[Jg(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(Jg(fh({body:[th({body:[nh(`string_end`)]}),th({body:[ah(10)]})]}),t));else if(c===`line_start`)o(Jg(Gg(ng`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&Hg(e))o(Jg(fh({negate:!0}),t));else if(d)throw Error(ng`Uses "\G" in a way that requires a subclass`);else o(qg(nh(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(Jg(Gg(ng`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${mg})(?!${mg})|(?<!${mg})(?=${mg}))`,n=`(?:(?<=${mg})(?=${mg})|(?<!${mg})(?!${mg}))`;o(Jg(Gg(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Wg(n)&&(n=Fg(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Wg(r)&&(r=Fg(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(Jg(oh({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(qg(ch(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(Jg(Kg(Gg(fg),l),t));return}if(s&&(c===`word`||u===`word`)){n(qg(ch(`word`,{negate:l}),t));return}if(c===`any`)n(qg(vh(`Any`),t));else if(c===`digit`)n(qg(vh(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(ng`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=ng`\p{RI}{2}|${e}(?:\u200D${e})*`;n(Jg(Gg(ng`(?>\r\n|${i?ng`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(qg(vh(`AHex`,{negate:l}),t));else if(c===`newline`)n(Jg(Gg(l?`[^
|
|
163
|
-
]`:`(?>\r
|
|
164
|
-
?|[
|
|
165
|
-
\v\f
\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${tg(e.codePointAt(0)-1)}${tg(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Jg(Gg(`[${e}]`),t))}else n(Jg(Kg(Gg(bg.get(u)),l),t))}else if(c===`property`)gg.has(Ch(u))||(e.key=`sc`);else if(c===`space`)n(qg(vh(`space`,{negate:l}),t));else if(c===`word`)n(Jg(Kg(Gg(mg),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=dh({flags:c});e.body[0].body=o(),i(Jg(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Hm(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(ng`Uses "\K" in a way that's unsupported`);let o=fh({behind:!0});o.body[0].body=a(),i(Jg(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Jg(fh({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=dh();t.body[0].body.push(e.body),e.body=Jg(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=zg(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(ng`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Wg(n)&&(n=Fg(n,t),e.ref=n)}},Dg={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=qg(Ng(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&og(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=og(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=ag(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Ng(0):Mg(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Ig(Pg(o,e=>e.type===`Group`&&!!e.flags)),t=e?ag(r.globalFlags,e):r.globalFlags;Ag(t,r.currentFlags)||(l=dh({flags:Lg(t)}),l.body[0].body.push(c))}n(Jg(l,t),{traverse:!s})}},Og={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>jg(t,e));i.length?i.length>1?n(Jg(dh({atomic:!0,body:i.reverse().map(e=>th({body:[rh(e.number)]}))}),t)):e.ref=i[0].number:n(Jg(fh({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=ih();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function kg(e){Eh(e,{"*"({node:e,parent:t}){e.parent=t}})}function Ag(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function jg(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=Rg(n.parent);for(let r of t){if(r===n)break;if(r===e||Bg(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Mg(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Mg(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Ng(e){let t=_h(e);return t.isRecursive=!0,t}function Pg(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Fg(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function Ig(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Lg({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Rg(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function zg(e){let t=e.find(e=>e.kind===`search_start`||Ug(e,{negate:!1})||!Vg(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=zg(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function Bg(e,t){let n=Rg(e)??[];for(let e of n)if(e===t||Bg(e,t))return!0;return!1}function Vg({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function Hg(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function Ug(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Hm(e.body[0],{type:`Assertion`,kind:`search_start`})}function Wg(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Gg(e,t){let n=Gm(e,{...t,unicodePropertyMap:gg}).body;return n.length>1||n[0].body.length>1?dh({body:n}):n[0].body[0]}function Kg(e,t){return e.negate=t,e}function qg(e,t){return e.parent=t,e}function Jg(e,t){return kg(e),e.parent=t,e}function Yg(e,t){let n=dg(t),r=sg(n.target,`ES2024`),i=sg(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];Eh(e,Xg,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,cg(Zg[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&og(f._captureTransfers,e.transferTo,[]).push(t)}),f}var Xg={"*":{enter({node:e},t){if(o_(e)){let n=t.getCurrentModI();t.pushModI(e.flags?ag({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){o_(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){r_(tg(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),i_(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&wg.has(e.value)&&t.setHasCasedChar()}},Zg={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?ng`\B`:ng`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=tg(e),r=a_(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&r_(n)){let e=hg(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);rg.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(s_)&&(o=[ah(45),...o.filter(e=>!s_(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||rg.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=dh(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=th({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(rg.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=a_(n,i),o=a_(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&mee(i_(e)).forEach(e=>{s.add(Array.isArray(e)?`${a_(e[0],i)}-${a_(e[1],i)}`:a_(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:ng`[^\n]`;if(e===`digit`)return t?ng`\D`:ng`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&wg.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?ng`\P`:ng`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?ng`\W`:ng`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=ag(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${hee(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+gee(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:ng`\g<${t}&R=${r}>`}},Qg=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),$g=new Set([`-`,`\\`,`]`,`^`,`[`]),e_=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),t_=new Map([[9,ng`\t`],[10,ng`\n`],[11,ng`\v`],[12,ng`\f`],[13,ng`\r`],[8232,ng`\u2028`],[8233,ng`\u2029`],[65279,ng`\uFEFF`]]),n_=/^\p{Cased}$/u;function r_(e){return n_.test(e)}function i_(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=tg(e);if(!r_(t))continue;let o=hg(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function a_(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(t_.has(e))return t_.get(e);if(e<32||e>126&&e<160||e>262143||t&&_ee(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?e_:$g:Qg,a=tg(e);return(i.has(a)?`\\`:``)+a}function mee(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function hee(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function gee({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function o_({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function _ee(e){return e>47&&e<58}function s_({type:e,value:t}){return e===`Character`&&t===45}var vee=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=bee(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(yee(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=xee(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function yee(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function bee(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)og(n,t,{}).transferTo=e;return n}function xee(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function See(e,t){let n=Cee(e,t);return n.options?new vee(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Cee(e,t){let n=dg(t),r=Tg(Gm(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:gg}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=Yg(r,n),a=Yh(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=zh(Hh(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function wee(e,t){return See(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function c_(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>wee(e,{target:t.target}),{createScanner(e){return new em(e,t)},createString(e){return{content:e}}}}var Tee=[`markdown`,`typescript`,`tsx`,`javascript`,`jsx`,`json`,`css`,`html`,`html-derivative`,`python`,`rust`,`go`,`shellscript`,`yaml`],l_=null;function Eee(){return l_??=Qp({themes:[`github-dark`,`github-light`],langs:[...Tee],engine:c_()}),l_}var Dee=200,Oee=20971520,u_=new Map,d_=0;function kee(e){let t=u_.get(e);return t!==void 0&&(u_.delete(e),u_.set(e,t)),t}function Aee(e,t){if(!u_.has(e))for(u_.set(e,t),d_+=t.length*2;(u_.size>Dee||d_>Oee)&&u_.size>0;){let e=u_.keys().next().value;d_-=(u_.get(e)?.length??0)*2,u_.delete(e)}}async function f_(e,t,n=!0){let r=`${t}${e}`;if(n){let e=kee(r);if(e!==void 0)return e}try{let i=await Eee(),a=i.getLoadedLanguages().includes(t)?t:`text`,o=i.codeToHtml(e,{lang:a,themes:{light:`github-light`,dark:`github-dark`},defaultColor:`light`});return n&&Aee(r,o),o}catch(e){return console.error(`snippet highlight failed:`,e),null}}var jee={command:Un,"file-edit":Rt,"file-write":zt,mcp:wn};function p_({kind:e,summary:t}){let[n,r]=(0,H.useState)(null);(0,H.useEffect)(()=>{if(e!==`command`)return;let n=!0;return f_(t,`shellscript`).then(e=>{n&&r({summary:t,html:e})}),()=>{n=!1}},[e,t]);let i=n?.summary===t?n.html:null,a=(0,G.jsx)(js,{text:t,className:`absolute top-1 right-1 z-10 rounded-md bg-background/80 p-1 text-muted-foreground backdrop-blur`});return e===`command`&&i!=null?(0,G.jsxs)(`div`,{className:`relative mt-1.5`,children:[(0,G.jsx)(`div`,{className:`max-h-24 overflow-auto rounded-md text-xs leading-relaxed [&_pre]:m-0 [&_pre]:py-1.5 [&_pre]:pr-7 [&_pre]:pl-2 [&_pre]:font-mono [&_pre]:whitespace-pre-wrap`,dangerouslySetInnerHTML:{__html:i}}),a]}):(0,G.jsxs)(`div`,{className:`relative mt-1.5`,children:[(0,G.jsx)(`pre`,{className:`max-h-24 overflow-auto rounded-md bg-muted/50 py-1.5 pr-7 pl-2 font-mono text-xs whitespace-pre-wrap`,children:t}),a]})}var m_={timeout:`Auto-managed review timed out. Please decide.`,error:`Auto-managed review failed. Please decide.`,invalid:`Auto-managed review returned no valid decision. Please decide.`},h_=400;function g_({approvals:e,onRespond:t,allowSession:n=!0,handoff:r=!0,clockOffset:i}){let{t:a}=K(),[o,s]=(0,H.useState)(null),[c,l]=(0,H.useState)(null),u=e[0],d=u?.requestId,f=Ms(u?.phase===`reviewing`?void 0:u?.expiresAt,i);if((0,H.useEffect)(()=>{if(!d)return;let e=setTimeout(()=>l(d),h_);return()=>clearTimeout(e)},[d]),!u)return null;let p=jee[u.kind]??Nn,m=u.phase===`reviewing`,h=c!==u.requestId||o===u.requestId||f!==void 0&&f<=0,g=e=>{e!==`review`&&s(u.requestId),t(u.requestId,e)};return(0,G.jsxs)(`div`,{"data-enso":`approval`,className:`mb-1 rounded-lg border border-border/60 bg-muted/20 px-2.5 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(Nn,{className:`h-3.5 w-3.5 shrink-0 text-amber-500`}),(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:a(m?`Assistant reviewing…`:`Approval required`)}),(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-muted-foreground`,children:[(0,G.jsx)(p,{className:`h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate font-mono`,children:u.toolCallId&&vs(u.toolCallId)?`${a(`Isolated sandbox`)} › ${ks(u.tool,a)}`:ks(u.tool,a)})]}),u.protected&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-destructive/15 px-1.5 text-[10px] text-destructive`,children:Ds(u.protected,a)}),(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,G.jsx)(Ns,{remainingMs:f,expiredLabel:`Timed out · denied`}),e.length>1&&(0,G.jsxs)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:[`1/`,e.length]})]})]}),u.reviewFallback&&(0,G.jsx)(`p`,{className:`mt-1 text-[11px] text-amber-600 dark:text-amber-400`,children:a(m_[u.reviewFallback])}),u.guard&&(0,G.jsx)(`p`,{className:`mt-1 text-[11px] text-destructive`,title:u.guard.ruleId,children:a(`dcg: {{reason}}`,{reason:u.guard.reason})}),u.summary&&(0,G.jsx)(p_,{kind:u.kind,summary:u.summary}),!m&&(0,G.jsxs)(`div`,{className:`mt-2 flex items-center justify-end gap-1.5`,children:[r&&u.kind===`command`&&(0,G.jsx)(`button`,{type:`button`,disabled:h,title:a(`Send back for a safer command`),onClick:()=>g(`revise`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:a(`Adjust`)}),r&&(0,G.jsx)(`button`,{type:`button`,disabled:h,title:a(`Let the assistant decide`),onClick:()=>g(`review`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:a(`Assistant review`)}),(0,G.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>g(`deny`),className:`rounded-md px-2.5 py-1 text-xs text-destructive transition-colors hover:bg-destructive/10 disabled:opacity-50`,children:a(`Deny`)}),n&&!u.protected&&!u.mandatory&&(0,G.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>g(`allowSession`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:a(`Always allow this session`)}),(0,G.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>g(`allow`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:a(`Allow`)})]})]})}function __(e){return e>=0&&e<9?String(e+1):null}function v_(e,t){let n=t===void 0?-1:e?.indexOf(t)??-1;return n>=0?n:0}function y_(e,t,n){return n===`ArrowDown`?Math.min(e+1,t-1):n===`ArrowUp`?Math.max(e-1,0):null}function b_({asks:e,onAnswer:t,clockOffset:n,autoFocus:r=!0}){let{t:i}=K(),a=(0,H.useRef)(null),o=(0,H.useRef)([]),[s,c]=(0,H.useState)(``),[l,u]=(0,H.useState)(null),[d,f]=(0,H.useState)(()=>new Set),p=e.filter(e=>e.answered),m=e.find(e=>!e.answered),h=m?.requestId,g=Ms(m?.expiresAt,n),_=h!==void 0&&d.has(h),v=m?.options,y=m?.recommended,b=e=>{let t=o.current[e];v&&e<v.length&&t?t.focus():a.current?.focus()};if((0,H.useEffect)(()=>{if(!r||!h||_)return;let e=v_(v,y),t=o.current[e];v&&e<v.length&&t?t.focus():a.current?.focus()},[r,h,_]),!m)return p.length>0?(0,G.jsx)(x_,{asks:p}):null;let x=l===m.requestId||g!==void 0&&g<=0,S=e=>{e.trim()&&(u(m.requestId),c(``),t(m.requestId,e.trim()))},C=()=>f(e=>e.has(m.requestId)?e:new Set(e).add(m.requestId));return _?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(x_,{asks:p}),(0,G.jsxs)(`button`,{type:`button`,"data-enso":`ask-later`,onClick:()=>f(e=>{let t=new Set(e);return t.delete(m.requestId),t}),className:`mb-1 flex w-full items-center gap-2 rounded-lg border border-dashed border-border/60 px-2.5 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/40 hover:text-foreground`,children:[(0,G.jsx)(sn,{className:`h-3.5 w-3.5 shrink-0 text-blue-500`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:m.question}),e.length>1&&(0,G.jsxs)(`span`,{className:`shrink-0 text-[10px] tabular-nums`,children:[`1/`,e.length]}),(0,G.jsx)(gt,{className:`h-3 w-3 shrink-0`})]})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(x_,{asks:p}),(0,G.jsxs)(`div`,{"data-enso":`ask`,className:`mb-1 rounded-lg border border-border/60 bg-muted/20 px-2.5 py-2`,onKeyDown:e=>{if(e.nativeEvent.isComposing||x)return;if(e.key===`Escape`){e.preventDefault(),C();return}let t=e.target,n=(v?.length??0)+1,r=t===a.current?n-1:o.current.indexOf(t),i=r>=0?y_(r,n,e.key):null;if(i!==null){e.preventDefault(),b(i);return}if(t instanceof HTMLInputElement&&(t.value.length>0||e.key===`Enter`))return;let s=Number(e.key)-1,l=v?.[s];if(__(s)&&l){e.preventDefault(),S(l);return}t instanceof HTMLButtonElement&&r>=0&&(e.key===`Process`?a.current?.focus():e.key.length===1&&e.key!==` `&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&(e.preventDefault(),c(t=>t+e.key),a.current?.focus()))},children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(sn,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-blue-500`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 text-xs leading-relaxed whitespace-pre-wrap`,children:m.question}),m.relay&&(0,G.jsx)(`span`,{"data-enso":`ask-relay`,className:`shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:i(`Handed to {{name}}`,{name:m.relay.name})}),(0,G.jsx)(`button`,{type:`button`,onClick:C,className:`shrink-0 rounded-md px-1.5 py-0.5 text-[10px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:i(`Later`)}),(0,G.jsx)(Ns,{remainingMs:g,expiredLabel:`Timed out · no answer`}),e.length>1&&(0,G.jsxs)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground tabular-nums`,children:[`1/`,e.length]})]}),v&&v.length>0&&(0,G.jsx)(`div`,{className:`mt-2 flex flex-col gap-1.5`,children:v.map((e,t)=>{let n=__(t);return(0,G.jsxs)(`button`,{ref:e=>{o.current[t]=e},type:`button`,disabled:x,onClick:()=>S(e),className:`flex items-center gap-2 rounded-md border border-border/60 px-2 py-1 text-left text-xs text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus:border-ring focus:bg-muted focus:text-foreground disabled:opacity-50`,children:[n&&(0,G.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center rounded bg-muted font-mono text-[10px] text-muted-foreground`,children:n}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:e}),e===y&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-success/15 px-1.5 text-[10px] text-success`,children:i(`Recommended`)})]},e)})}),(0,G.jsxs)(`div`,{className:`mt-2 flex items-center gap-1.5`,children:[(0,G.jsx)(`input`,{ref:a,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&S(s)},disabled:x,placeholder:i(`Type an answer…`),className:`h-7 min-w-0 flex-1 rounded-md border bg-transparent px-2 text-xs outline-none focus:ring-1 focus:ring-ring disabled:opacity-50`}),(0,G.jsx)(`button`,{type:`button`,disabled:x||!s.trim(),onClick:()=>S(s),className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40`,children:(0,G.jsx)(Mn,{className:`h-3.5 w-3.5`})})]})]})]})}function x_({asks:e}){let{t}=K();return e.length===0?null:(0,G.jsx)(`div`,{"data-enso":`ask-settled`,className:`mb-1 space-y-1`,children:e.map(e=>{let n=e.answered;if(!n)return null;let r=n.by===`timeout`?t(`No answer in time`):n.by===`relay`?t(`{{name}} answered: {{answer}}`,{name:n.name??t(`Secretary`),answer:n.answer??``}):t(`Answered: {{answer}}`,{answer:n.answer??``});return(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-dashed border-border/60 px-2.5 py-1.5 text-xs text-muted-foreground`,children:[(0,G.jsx)(sn,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.question}),(0,G.jsx)(`span`,{className:`shrink-0`,children:r})]},e.requestId)})})}var S_=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function C_(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function w_(e){return`nodeType`in e}function T_(e){return e?C_(e)?e:w_(e)?e.ownerDocument?.defaultView??window:window:window}function E_(e){let{Document:t}=T_(e);return e instanceof t}function D_(e){return!C_(e)&&e instanceof T_(e).HTMLElement}function O_(e){return e instanceof T_(e).SVGElement}function k_(e){return e?C_(e)?e.document:w_(e)?E_(e)?e:D_(e)||O_(e)?e.ownerDocument:document:document:document}var A_=S_?H.useLayoutEffect:H.useEffect;function j_(e){let t=(0,H.useRef)(e);return A_(()=>{t.current=e}),(0,H.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function M_(e,t){t===void 0&&(t=[e]);let n=(0,H.useRef)(e);return A_(()=>{n.current!==e&&(n.current=e)},t),n}function N_(e){let t=j_(e),n=(0,H.useRef)(null);return[n,(0,H.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}var P_={};function F_(e,t){return(0,H.useMemo)(()=>{if(t)return t;let n=P_[e]==null?0:P_[e]+1;return P_[e]=n,e+`-`+n},[e,t])}function I_(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var L_=I_(-1);function R_(e){return`clientX`in e&&`clientY`in e}function z_(e){if(!e)return!1;let{TouchEvent:t}=T_(e.target);return t&&e instanceof t}function B_(e){if(z_(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return R_(e)?{x:e.clientX,y:e.clientY}:null}var V_;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(V_||={});function H_(){}var U_=Object.freeze({x:0,y:0}),W_;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(W_||={});var G_=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function K_(e){let{EventTarget:t}=T_(e);return e instanceof t?e:k_(e)}function q_(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var J_;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(J_||={});function Y_(e){e.preventDefault()}function X_(e){e.stopPropagation()}var Z_;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(Z_||={}),Z_.Space,Z_.Enter,Z_.Esc,Z_.Space,Z_.Enter,Z_.Tab;function Q_(e){return!!(e&&`distance`in e)}function $_(e){return!!(e&&`delay`in e)}var ev=class{constructor(e,t,n){n===void 0&&(n=K_(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=k_(i),this.documentListeners=new G_(this.document),this.listeners=new G_(n),this.windowListeners=new G_(T_(i)),this.initialCoordinates=B_(r)??U_,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(J_.Resize,this.handleCancel),this.windowListeners.add(J_.DragStart,Y_),this.windowListeners.add(J_.VisibilityChange,this.handleCancel),this.windowListeners.add(J_.ContextMenu,Y_),this.documentListeners.add(J_.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($_(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Q_(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(J_.Click,X_,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(J_.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=B_(e)??U_,s=L_(n,o);if(!t&&a){if(Q_(a)){if(a.tolerance!=null&&q_(s,a.tolerance))return this.handleCancel();if(q_(s,a.distance))return this.handleStart()}if($_(a)&&q_(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Z_.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},tv={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},nv=class extends ev{constructor(e){let{event:t}=e,n=k_(t.target);super(e,tv,n)}};nv.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var rv={move:{name:`mousemove`},end:{name:`mouseup`}},iv;(function(e){e[e.RightClick=2]=`RightClick`})(iv||={});var av=class extends ev{constructor(e){super(e,rv,k_(e.event.target))}};av.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==iv.RightClick&&(r?.({event:n}),!0)}}];var ov={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},sv=class extends ev{constructor(e){super(e,ov)}static setup(){return window.addEventListener(ov.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ov.move.name,e)};function e(){}}};sv.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var cv;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(cv||={});var lv;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(lv||={}),W_.Backward,W_.Forward,W_.Backward,W_.Forward;var uv;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(uv||={});var dv;(function(e){e.Optimized=`optimized`})(dv||={});function fv(e){let{callback:t,disabled:n}=e,r=j_(t),i=(0,H.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,H.useEffect)(()=>()=>i?.disconnect(),[i]),i}uv.WhileDragging,dv.Optimized;var pv={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:H_,draggableNodes:new Map,over:null,measureDroppableContainers:H_},mv=(0,H.createContext)(pv);({...U_});var hv;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(hv||={});var gv=`Droppable`,_v={timeout:25};function vv(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=F_(gv),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,H.useContext)(mv),u=(0,H.useRef)({disabled:n}),d=(0,H.useRef)(!1),f=(0,H.useRef)(null),p=(0,H.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={..._v,...i},_=M_(h??r),v=fv({callback:(0,H.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=N_((0,H.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=M_(t);return(0,H.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,H.useEffect)(()=>(s({type:V_.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:V_.UnregisterDroppable,key:a,id:r})),[r]),(0,H.useEffect)(()=>{n!==u.current.disabled&&(s({type:V_.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}var yv=/["[\]\n]/g;function bv(e,t){return typeof e==`string`?e.replace(yv,` `).replace(/\s+/g,` `).trim().slice(0,t):``}function xv(e){return`[Selected UI element "${bv(e.label,80)}" — path: ${bv(e.path,300)}; text: ${bv(e.text,200)}]`}var Sv=/^\[Selected UI element "([^"]*)" — path: (.*); text: (.*)\]$/;function Cv(e){let t=Sv.exec(e);return t?{label:t[1],path:t[2],text:t[3]}:null}function wv(e,t){if(t.length===0)return[...e];let n=new Set(t);return e.filter(e=>!e.id||!n.has(e.id))}var Tv=`pasted-text.txt`;function Ev(e){let t=e.replace(/\r\n?/g,`
|
|
166
|
-
`).trim();return t.length>=5e4&&t.length<=2e7?t:null}var Dv=/@((?:\/|[A-Za-z]:\\)[^\n@]*?[\\/]pasted-text[\\/](?:bot-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\\/][0-9a-f]{8}[\\/]pasted-text\.txt)/g;function Ov(e){let t=[],n=0;for(let r of e.matchAll(Dv))r.index>n&&t.push({type:`text`,text:e.slice(n,r.index)}),t.push({type:`file`,path:r[1]}),n=r.index+r[0].length;return(n<e.length||t.length===0)&&t.push({type:`text`,text:e.slice(n)}),t}var kv=`(?<![A-Za-z0-9_])`,Av=`(?![A-Za-z0-9_])`,jv=(e,t,n)=>({kind:`API_KEY`,rule:e,re:RegExp(`${kv}${t}${Av}`,`g`),keep:n}),Mv=/^\{\{[A-Z][A-Z_]*_[a-z2-7]{8}\}\}$/,Nv=/^(?:\$\{.*\}|\$[A-Za-z_]\w*|<[^>]*>|%[\w]+%|process\.env\..*|null|nil|none|true|false|undefined|x{3,}|\*{3,}|changeme|password|secret|your[_-].*)$/i,Pv=e=>e.length>=6&&!Nv.test(e)&&!Mv.test(e),Fv=([e=``])=>/pass|pwd|密码|口令/i.test(e)?`PASSWORD`:/token|令牌/i.test(e)?`TOKEN`:`SECRET`,Iv=[{kind:`PRIVATE_KEY`,rule:`pem`,re:/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,keep:0},jv(`openai`,`sk-[A-Za-z0-9_-]{16,}`,/^sk-(?:ant-(?:api\d+-)?|proj-)?/),jv(`stripe`,`[sr]k_(?:live|test)_[A-Za-z0-9]{10,}`,/^[sr]k_(?:live|test)_/),jv(`github`,`gh[opusr]_[A-Za-z0-9]{20,}`,/^gh[opusr]_/),jv(`github`,`github_pat_[A-Za-z0-9_]{20,}`,/^github_pat_/),jv(`gitlab`,`glpat-[A-Za-z0-9_-]{20,}`,/^glpat-/),jv(`google`,`AIza[0-9A-Za-z_-]{35}`,/^AIza/),jv(`slack`,`xox[abprs]-[A-Za-z0-9-]{10,}`,/^xox[abprs]-/),jv(`aws`,`(?:AKIA|ASIA)[0-9A-Z]{16}`,/^(?:AKIA|ASIA)/),jv(`huggingface`,`hf_[A-Za-z0-9]{20,}`,/^hf_/),jv(`groq`,`gsk_[A-Za-z0-9]{20,}`,/^gsk_/),jv(`xai`,`xai-[A-Za-z0-9]{20,}`,/^xai-/),jv(`npm`,`npm_[A-Za-z0-9]{36}`,/^npm_/),jv(`pypi`,`pypi-[A-Za-z0-9_-]{50,}`,/^pypi-/),jv(`digitalocean`,`do[opr]_v1_[a-f0-9]{64}`,/^do[opr]_v1_/),jv(`sendgrid`,`SG\\.[A-Za-z0-9_-]{22}\\.[A-Za-z0-9_-]{43}`,/^SG\./),{kind:`TOKEN`,rule:`jwt`,re:/(?<![A-Za-z0-9_-])eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,keep:3},{kind:`TOKEN`,rule:`bearer`,re:/\bBearer\s+([A-Za-z0-9._~+/=-]{16,})/dg,group:1,keep:0},{kind:`PASSWORD`,rule:`url`,re:/:(?<=\b[a-z][a-z0-9+.-]*:)\/\/[^\s/:@]+:([^\s/@]+)@/dgi,group:1,keep:0,validate:e=>!Nv.test(e)&&!Mv.test(e)},{kind:Fv,rule:`kv`,re:/\b(?<!(?:^|[^A-Za-z0-9_])(?:[A-Za-z0-9]+[_-])+?)(?:[A-Za-z0-9]+[_-])*(api[_-]?key|secret(?:[_-]?key)?|access[_-]?token|refresh[_-]?token|auth[_-]?token|token|passwd|password|pwd|client[_-]?secret|private[_-]?key)["']?\s*[:=]\s*(?:"((?:\\.|[^"\\\n])*)"|'((?:\\.|[^'\\\n])*)'|([^\s"',;{}[\]]+))/dgi,group:-1,keep:0,validate:Pv},{kind:Fv,rule:`cjk`,re:/(密码|口令|密钥|秘钥|令牌)\s*(?:[::=]|为|是)\s*([^\s,。、,;;"'“”‘’]{6,})/dg,group:2,keep:0,validate:Pv}],Lv=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];function Rv(e){let t=Number(e.slice(10,12)),n=Number(e.slice(12,14));return t<1||t>12||n<1||n>31?!1:`10X98765432`[Lv.reduce((t,n,r)=>t+n*Number(e[r]),0)%11]===e[17].toUpperCase()}function zv(e){let t=0;for(let n=0;n<e.length;n++){let r=Number(e[e.length-1-n]);n%2==1&&(r*=2,r>9&&(r-=9)),t+=r}return t%10==0}var Bv=/(?:^|\.)(?:example\.(?:com|org|net)|example|test|invalid|local|localhost)$/i,Vv={email:{kind:`EMAIL`,rule:`email`,re:/(?<![\w.%+-])[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}(?![\w-])/g,keep:0,validate:e=>!/no-?reply/i.test(e)&&!Bv.test(e.slice(e.indexOf(`@`)+1))},phone:{kind:`PHONE`,rule:`cn-mobile`,re:/(?<![\d+])(?:\+?86[- ]?)?1[3-9]\d{9}(?!\d)/g,keep:0},idCard:{kind:`ID_CARD`,rule:`cn-id`,re:/(?<![\dA-Za-z])\d{17}[\dXx](?![\dA-Za-z])/g,keep:0,validate:Rv},bankCard:{kind:`BANK_CARD`,rule:`luhn`,re:/(?<![\d-])\d(?:[ -]?\d){14,18}(?!\d)/g,keep:0,validate:e=>{let t=e.replace(/[ -]/g,``);return!/^(\d)\1+$/.test(t)&&zv(t)}},ip:{kind:`IP`,rule:`ipv4`,re:/(?<![\d.])(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)(?![\d.])/g,keep:0,validate:e=>!/^(?:127\.|0\.0\.0\.0$|255\.255\.255\.255$)/.test(e)}},Hv=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Uv=e=>`${/^\w/.test(e)?kv:``}${Hv(e)}${/\w$/.test(e)?Av:``}`;function Wv(e,t){let n=e.map(e=>({kind:`CUSTOM`,rule:`word`,re:new RegExp(Uv(e),`gi`),keep:0}));for(let e of t){let t=/^\/(.+)\/([a-z]*)$/s.exec(e);try{n.push(t?{kind:`CUSTOM`,rule:`regex`,re:new RegExp(t[1],`${t[2].replace(/[gyd]/g,``)}g`),keep:0}:{kind:`CUSTOM`,rule:`prefix`,re:RegExp(`${/^\w/.test(e)?kv:``}${Hv(e)}[A-Za-z0-9._-]+`,`g`),keep:e.length})}catch{}}return n}function Gv(e){let t=[];if(e.enabled){if(e.secrets.enabled)for(let n of Iv)t.push({...n,action:e.secrets.action,category:`secret`});if(e.personal.enabled)for(let n of e.personal.kinds)t.push({...Vv[n],action:e.personal.action,category:`personal`});for(let n of Wv(e.custom.words,e.custom.rules))t.push({...n,action:e.custom.action,category:`custom`})}return{active:t.length>0,rules:t,allow:new Set(e.allow.map(e=>e.toLowerCase()))}}var Kv=/\{\{[A-Z][A-Z_]*_[a-z2-7]{8}\}\}/g;function qv(e,t){let n=t.indices;if(!e.group)return[t.index,t.index+t[0].length];if(n){if(e.group>0)return n[e.group];for(let e=2;e<n.length;e++)if(n[e])return n[e]}}function Jv(e,t){if(!t.active||!e)return[];let n=[];for(let t of e.matchAll(Kv))n.push([t.index,t.index+t[0].length]);let r=[];for(let i of t.rules){i.re.lastIndex=0;for(let a=i.re.exec(e);a;a=i.re.exec(e)){if(a[0].length===0){i.re.lastIndex++;continue}let o=qv(i,a);if(!o||o[1]<=o[0])continue;let[s,c]=o,l=e.slice(s,c);if(i.validate&&!i.validate(l)||t.allow.has(l.toLowerCase())||n.some(([e,t])=>s<t&&c>e))continue;let u=typeof i.keep==`number`?i.keep:i.keep?.exec(l)?.[0].length??0;r.push({start:s,end:c,kind:typeof i.kind==`string`?i.kind:i.kind([a[1]??``]),rule:i.rule,action:i.action,category:i.category,keep:Math.min(u,l.length)})}}r.sort((e,t)=>e.start-t.start||t.end-e.end);let i=[];for(let e of r)(!i.length||e.start>=i[i.length-1].end)&&i.push(e);return i}function Yv(e,t){let n=Jv(e,Gv(t));return{masked:n.filter(e=>e.action===`mask`).length,blocked:[...new Set(n.filter(e=>e.action===`block`).map(e=>e.kind))]}}var Xv={"/goal":[{name:`pause`,aliases:[],description:`Pause the current session goal`},{name:`resume`,aliases:[],description:`Resume a paused session goal`},{name:`clear`,aliases:[],description:`Clear the session goal`}]};function Zv(e,t){if(!e)return null;let n=t.trimStart();return n?n.search(/\s/)>=0?null:n:``}function Qv(e,t){if(!e)return[];let n=Xv[e]??[],r=t.trim().toLowerCase();return r?n.filter(e=>e.name.toLowerCase().startsWith(r)||e.aliases.some(e=>e.toLowerCase().startsWith(r))):n}var $v=H.createContext(void 0);function ey(e){let t=H.useContext($v);if(!e&&t===void 0)throw Error(yr(27));return t}var ty=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),ny={"data-starting-style":``},ry={"data-ending-style":``},iy={transitionStatus(e){return e===`starting`?ny:e===`ending`?ry:null}};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=ty.startingStyle]=`startingStyle`,e[e.endingStyle=ty.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var ay={"data-popup-open":``},oy={"data-popup-open":``,"data-pressed":``},sy={"data-open":``},cy={"data-closed":``},ly={"data-anchor-hidden":``},uy={open(e){return e?ay:null}},dy={open(e){return e?oy:null}},fy={open(e){return e?sy:cy},anchorHidden(e){return e?ly:null}},py={...fy,...iy},my=H.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=ey(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Lr(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:py,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})});function hy(){return typeof window<`u`}function gy(e){return yy(e)?(e.nodeName||``).toLowerCase():`#document`}function _y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vy(e){return((yy(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function yy(e){return hy()?e instanceof Node||e instanceof _y(e).Node:!1}function by(e){return hy()?e instanceof Element||e instanceof _y(e).Element:!1}function xy(e){return hy()?e instanceof HTMLElement||e instanceof _y(e).HTMLElement:!1}function Sy(e){return!hy()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof _y(e).ShadowRoot}function Cy(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Py(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function wy(e){return/^(table|td|th)$/.test(gy(e))}function Ty(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ey=/transform|translate|scale|rotate|perspective|filter/,Dy=/paint|layout|strict|content/,Oy=e=>!!e&&e!==`none`,ky;function Ay(e){let t=by(e)?Py(e):e;return Oy(t.transform)||Oy(t.translate)||Oy(t.scale)||Oy(t.rotate)||Oy(t.perspective)||!My()&&(Oy(t.backdropFilter)||Oy(t.filter))||Ey.test(t.willChange||``)||Dy.test(t.contain||``)}function jy(e){let t=Iy(e);for(;xy(t)&&!Ny(t);){if(Ay(t))return t;if(Ty(t))return null;t=Iy(t)}return null}function My(){return ky??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ky}function Ny(e){return/^(html|body|#document)$/.test(gy(e))}function Py(e){return _y(e).getComputedStyle(e)}function Fy(e){return by(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Iy(e){if(gy(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Sy(e)&&e.host||vy(e);return Sy(t)?t.host:t}function Ly(e){let t=Iy(e);return Ny(t)?(e.ownerDocument||e).body:xy(t)&&Cy(t)?t:Ly(t)}function Ry(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ly(e),i=r===e.ownerDocument?.body,a=_y(r);if(i){let e=zy(a);return t.concat(a,a.visualViewport||[],Cy(r)?r:[],e&&n?Ry(e):[])}return t.concat(r,Ry(r,[],n))}function zy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var By={...H},Vy=By.useInsertionEffect,Hy=Vy&&Vy!==By.useLayoutEffect?Vy:e=>e();function Uy(e){let t=xr(Wy).current;return t.next=e,Hy(t.effect),t.trampoline}function Wy(){let e={next:void 0,callback:Gy,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Gy(){}var Y=typeof document<`u`?H.useLayoutEffect:()=>{},Ky=H.createContext(void 0);function qy(e=!1){let t=H.useContext(Ky);if(t===void 0&&!e)throw Error(yr(16));return t}function Jy(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:H.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Yy(e){return e?.ownerDocument||document}function Xy(e,t,{detail:n=0}={}){e.dispatchEvent(new(_y(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Zy(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=H.useRef(null),s=qy(!0),c=a??s!==void 0,{props:l}=Jy({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=H.useCallback(()=>{let e=o.current;Qy(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Y(u,[u]),{getButtonProps:H.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return ir({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(hr(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Qy(r),s=!i&&$y(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Xy(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Xy(r,e)))},onKeyUp(e){if(!t){if(hr(e),a?.(e),e.target===e.currentTarget&&i&&c&&Qy(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Xy(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Uy(e=>{o.current=e,u()})}}function Qy(e){return xy(e)&&e.tagName===`BUTTON`}function $y(e){return xy(e)&&e.tagName===`A`&&!!e.href}var eb=`none`,tb=`trigger-press`,nb=`trigger-hover`,rb=`trigger-focus`,ib=`outside-press`,ab=`item-press`,ob=`close-press`,sb=`focus-out`,cb=`escape-key`,lb=`list-navigation`,ub=`cancel-open`,db=`sibling-open`,fb=`imperative-action`,Mee=`window-resize`;function pb(e,t,n,r){let i=!1,a=!1,o=r??Nr;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var mb=H.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=ey(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Zy({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,pb(ob,e.nativeEvent))}return Lr(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),hb=0;function Nee(e,t=`mui`){let[n,r]=H.useState(e),i=e||n;return H.useEffect(()=>{n??(hb+=1,r(`${t}-${hb}`))},[n,t]),i}var gb=By.useId;function _b(e,t){if(gb!==void 0){let n=gb();return e??(t?`${t}-${n}`:n)}return Nee(e,t)}function vb(e){return _b(e,`base-ui`)}var yb=H.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=ey(),c=vb(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Lr(`p`,e,{ref:t,props:[{id:c},o]})});function bb(e){H.useEffect(e,Mr)}var xb=0,Sb=class e{static create(){return new e}currentId=xb;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=xb,t()},e)}isStarted(){return this.currentId!==xb}clear=()=>{this.currentId!==xb&&(clearTimeout(this.currentId),this.currentId=xb)};disposeEffect=()=>this.clear};function Cb(){let e=xr(Sb.create).current;return bb(e.disposeEffect),e}function Pee(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Fee,platform:Iee,maxTouchPoints:Lee}=Pee(),wb=Fee.toLowerCase(),Tb=Iee.toLowerCase(),Eb=/^i(os$|p)/.test(Tb)||Tb===`macintel`&&Lee>1,Db=`android`,Ob=Tb===Db||wb.includes(Db),kb=!Eb&&Tb.startsWith(`mac`);Tb.startsWith(`win`),!Ob&&/^(linux|chrome os)/.test(Tb);var Ree=kb||Eb,Ab=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Ab&&wb.includes(`firefox`),!Ab&&wb.includes(`chrom`);var zee=Ree,jb=/jsdom|happydom/.test(wb);function Mb(e){e.preventDefault(),e.stopPropagation()}function Bee(e){return`nativeEvent`in e}function Nb(e){return e.pointerType===``&&e.isTrusted?!0:Ob&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Pb(e){return jb?!1:!Ob&&e.width===0&&e.height===0||Ob&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Fb(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Vee(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Hee=`data-base-ui-focusable`,Uee=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Ib=`ArrowLeft`,Lb=`ArrowRight`,Wee=`ArrowUp`,Gee=`ArrowDown`;function Rb(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function zb(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Sy(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Bb(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Vb(e,t){if(!by(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(zb(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Hb(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Ub(e){return e.matches(`html,body`)}function Wb(e){return xy(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Gb(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Uee}`)!=null}function Kb(e){return e?e.getAttribute(`role`)===`combobox`&&Wb(e):!1}function qb(e){if(!e||jb)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Jb(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Yb(e,t){return t!=null&&!Fb(t)?0:typeof e==`function`?e():e}function Xb(e,t,n){let r=Yb(e,n);return typeof r==`number`?r:r?.[t]}function Zb(e){return typeof e==`function`?e():e}function Qb(e,t){return t||e===`click`||e===`mousedown`}function $b(e){return e?.includes(`mouse`)&&e!==`mousedown`}function ex(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function tx(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function nx(e){let t=xr(rx,e).current;return t.next=e,Y(t.effect),t}function rx(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var ix=null;globalThis.requestAnimationFrame;var ax=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},ox=class e{static create(){return new e}static request(e){return ax.request(e)}static cancel(e){return ax.cancel(e)}currentId=ix;request(e){this.cancel(),this.currentId=ax.request(()=>{this.currentId=ix,e()})}cancel=()=>{this.currentId!==ix&&(ax.cancel(this.currentId),this.currentId=ix)};disposeEffect=()=>this.cancel};function sx(){let e=xr(ox.create).current;return bb(e.disposeEffect),e}var cx={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},lx={...cx,position:`fixed`,top:0,left:0},ux={...cx,position:`absolute`},dx=H.forwardRef(function(e,t){let[n,r]=H.useState();Y(()=>{zee&&Ab&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,G.jsx)(`span`,{...e,ref:t,style:lx,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),fx=Math.min,px=Math.max,mx=Math.round,hx=Math.floor,gx=e=>({x:e,y:e}),_x={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function vx(e,t,n){return px(e,fx(t,n))}function yx(e,t){return typeof e==`function`?e(t):e}function bx(e){return e.split(`-`)[0]}function xx(e){return e.split(`-`)[1]}function Sx(e){return e===`x`?`y`:`x`}function Cx(e){return e===`y`?`height`:`width`}function wx(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Tx(e){return Sx(wx(e))}function Ex(e,t,n){n===void 0&&(n=!1);let r=xx(e),i=Tx(e),a=Cx(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Fx(o)),[o,Fx(o)]}function Dx(e){let t=Fx(e);return[Ox(e),t,Ox(t)]}function Ox(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var kx=[`left`,`right`],Ax=[`right`,`left`],jx=[`top`,`bottom`],Mx=[`bottom`,`top`];function Nx(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ax:kx:t?kx:Ax;case`left`:case`right`:return t?jx:Mx;default:return[]}}function Px(e,t,n,r){let i=xx(e),a=Nx(bx(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ox)))),a}function Fx(e){let t=bx(e);return _x[t]+e.slice(t.length)}function Ix(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Lx(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ix(e)}function Rx(e){let{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 zx(e,t){return t<0||t>=e.length}function Bx(e,t){return Hx(e.current,{disabledIndices:t})}function Vx(e,t){return Hx(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Hx(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Ux(e,a,r));return a}function Ux(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Gx(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Wx(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Gx(e,t=e?Py(e):null){return!e||!e.isConnected||!t||Wx(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Kx=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function qx(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Sy(n)?n.host:null}function Jx(e){for(let t of Array.from(e.children))if(gy(t)===`summary`)return t;return null}function Yx(e,t){let n=Jx(t);return!!n&&(e===n||zb(n,e))}function Xx(e){let t=e?gy(e):``;return e!=null&&e.matches(Kx)&&(t!==`summary`||e.parentElement!=null&&gy(e.parentElement)===`details`&&Jx(e.parentElement)===e)&&(t!==`details`||Jx(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Zx(e){if(!Xx(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=qx(t)){let n=t!==e,r=gy(t)===`slot`;if(t.hasAttribute(`inert`)||n&&gy(t)===`details`&&!t.open&&!Yx(e,t)||t.hasAttribute(`hidden`)||!r&&!Qx(t,n))return!1}return!0}function Qx(e,t){let n=Py(e);return t?n.display!==`none`:Gx(e,n)}function $x(e){let t=e.tabIndex;if(t<0){let t=gy(e);if(t===`details`||t===`audio`||t===`video`||xy(e)&&e.isContentEditable)return 0}return t}function eS(e){if(gy(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function tS(e,t){let n=eS(e);if(!n)return!0;let r=t.find(e=>{let t=eS(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=eS(e);return t?.name===n.name&&t.form===n.form})===n}function nS(e){if(xy(e)&&gy(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return xy(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function rS(e,t){nS(e).forEach(e=>{Xx(e)&&t.push(e),rS(e,t)})}function iS(e,t,n){nS(e).forEach(e=>{xy(e)&&e.matches(t)&&n.push(e),iS(e,t,n)})}function aS(e){return Zx(e)&&$x(e)>=0}function oS(e){let t=[];return rS(e,t),t.filter(Zx)}function sS(e){let t=oS(e);return t.filter(e=>$x(e)>=0&&tS(e,t))}function cS(e,t){let n=sS(e),r=n.length;if(r===0)return;let i=Rb(Yy(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function lS(e){return cS(Yy(e).body,1)||e}function uS(e){return cS(Yy(e).body,-1)||e}function dS(e,t){if(!e)return null;let n=sS(Yy(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function fS(e){return dS(e,1)}function pS(e){return dS(e,-1)}function mS(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!zb(n,r)}function hS(e){sS(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function gS(e){let t=[];iS(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function _S(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],..._S(e,t.id,n)])}function vS(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function yS(e){return`data-base-ui-${e}`}var bS=0;function xS(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(bS);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),jr;let o=requestAnimationFrame(a);return bS=o,()=>{bS===o&&(cancelAnimationFrame(o),bS=0)}}var SS={inert:new WeakMap,"aria-hidden":new WeakMap},CS=`data-base-ui-inert`,wS={inert:new WeakSet,"aria-hidden":new WeakSet},TS=new WeakMap,ES=0;function DS(e){return wS[e]}function OS(e){return e?Sy(e)?e.host:OS(e.parentNode):null}var kS=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=OS(t);return e.contains(n)?n:null}).filter(e=>e!=null),AS=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},jS=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{gy(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function MS(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=kS(t,e),l=i?jS(t,AS(c),new Set(c)):[],u=[],d=[];if(a){let e=SS[a],n=DS(a);s=n,o=e;let r=kS(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);jS(t,AS(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(TS.get(e)||0)+1;TS.set(e,t),d.push(e),t===1&&e.setAttribute(CS,``)}),ES+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(TS.get(e)||0)-1;TS.set(e,t),t||e.removeAttribute(CS)}),--ES,ES||(SS.inert=new WeakMap,SS[`aria-hidden`]=new WeakMap,wS.inert=new WeakSet,wS[`aria-hidden`]=new WeakSet,TS=new WeakMap)}}function NS(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Yy(e[0]).body;return MS(e,a,n,r,{mark:i})}var PS={style:{transition:`none`}},FS=`data-base-ui-click-trigger`,IS={fallbackAxisSide:`none`},LS={fallbackAxisSide:`end`},RS={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},zS=H.createContext(null),BS=()=>H.useContext(zS),VS=yS(`portal`);function HS(e={}){let{ref:t,container:n,componentProps:r=Nr,elementProps:i}=e,a=_b(),o=BS()?.portalNode,[s,c]=H.useState(null),[l,u]=H.useState(null),d=Uy(e=>{e!==null&&u(e)}),f=H.useRef(null);Y(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(yy(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Lr(`div`,r,{ref:[t,d],props:[{id:a,[VS]:``},i]}),m=s&&p?Lo.createPortal(p,s):null;return{node:l,nodeId:H.isValidElement(p)?p.props.id:void 0,subtree:m}}var US=H.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=HS({container:o,ref:t,componentProps:e,elementProps:s}),d=H.useRef(null),f=H.useRef(null),p=H.useRef(null),m=H.useRef(null),[h,g]=H.useState(null),_=H.useRef(!1),v=h?.modal,y=h?.open,b=!!h&&!h.modal&&h.open&&!!c;H.useEffect(()=>{if(!c||v)return;function e(e){c&&e.relatedTarget&&mS(e)&&(e.type===`focusin`?_.current&&=(gS(c),!1):(hS(c),_.current=!0))}return tx(ex(c,`focusin`,e,!0),ex(c,`focusout`,e,!0))},[c,v]),Y(()=>{!c||y!==!0||!_.current||(gS(c),_.current=!1)},[y,c]);let x=H.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,G.jsxs)(H.Fragment,{children:[u,(0,G.jsxs)(zS.Provider,{value:x,children:[b&&c&&(0,G.jsx)(dx,{"data-type":`outside`,ref:d,onFocus:e=>{mS(e,c)?p.current?.focus():uS(h?h.domReference:null)?.focus()}}),b&&c&&(0,G.jsx)(`span`,{"aria-owns":l,style:RS}),c&&Lo.createPortal(a,c),b&&c&&(0,G.jsx)(dx,{"data-type":`outside`,ref:f,onFocus:e=>{mS(e,c)?m.current?.focus():(lS(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,pb(`focus-out`,e.nativeEvent)))}})]})]})});function WS(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var GS=class{nodesRef={current:[]};events=WS();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},KS=H.createContext(null),qS=H.createContext(null),JS=()=>H.useContext(KS)?.id||null,YS=e=>{let t=H.useContext(qS);return e??t};function XS(e){let t=_b(),n=YS(e),r=JS();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function ZS(e){let{children:t,id:n}=e,r=JS();return(0,G.jsx)(KS.Provider,{value:H.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function QS(e){let{children:t,externalTree:n}=e,r=xr(()=>n??new GS).current;return(0,G.jsx)(qS.Provider,{value:r,children:t})}function $S(e){return e==null?e:`current`in e?e.current:e}function eC(e,t){let n=_y(Bb(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var tC=20,nC=[];function rC(){nC=nC.filter(e=>e.deref()?.isConnected)}function iC(e){rC(),e&&gy(e)!==`body`&&(nC.push(new WeakRef(e)),nC.length>tC&&(nC=nC.slice(-20)))}function aC(){return rC(),nC[nC.length-1]?.deref()}function oC(e){return e?aS(e)?e:sS(e)[0]||e:null}function sC(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=oS(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return aS(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function cC(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=Uy(()=>b.current.floatingContext?.nodeId),S=i===!1,C=Kb(_)&&S,w=nx(i),T=nx(a),E=nx(l),D=nx(g),O=YS(p),k=BS(),A=H.useRef(!1),j=H.useRef(!1),M=H.useRef(!1),N=H.useRef(null),P=H.useRef(``),F=H.useRef(``),I=H.useRef(null),ee=H.useRef(null),L=Sr(I,f,k?.beforeInsideRef),te=Sr(ee,k?.afterInsideRef),R=Cb(),z=Cb(),ne=sx(),re=k!=null,B=Jb(v),ie=Uy((e=B)=>e?sS(e):[]),ae=Uy(()=>m?.().filter(e=>e!=null)??[]);H.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&zb(B,Rb(Yy(B)))&&ie().length===0&&!C&&Mb(e)}return ex(Yy(B),`keydown`,e)},[r,B,s,C,ie]),H.useEffect(()=>{if(r||!g)return;let e=Yy(B);function t(){M.current=!1}function n(e){let t=Bb(e),n=ae(),r=zb(v,t)||zb(_,t)||zb(k?.portalNode,t)||n.some(e=>e===t||zb(e,t));M.current=!r,F.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0,z.start(0,()=>{j.current=!1}))}function i(){F.current=`keyboard`}return tx(ex(e,`pointerdown`,n,!0),ex(e,`pointerup`,t,!0),ex(e,`pointercancel`,t,!0),ex(e,`keydown`,i,!0),t)},[r,v,_,B,g,k,z,ae]),H.useEffect(()=>{if(r||!c)return;let e=Yy(B);function t(){j.current=!0,z.start(0,()=>{j.current=!1})}function n(e){let t=Bb(e);aS(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Bb(t);s&&n==null&&i!=null&&zb(v,i)&&iC(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=ae(),f=n?.hasAttribute(yS(`focus-guard`))&&[I.current,ee.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,$S(d),$S(u)].includes(n),p=!(zb(_,n)||zb(v,n)||zb(n,v)||zb(k?.portalNode,n)||l.some(e=>e===n||zb(e,n))||c.hasMatchingElement(e=>zb(e,n))||f||O&&(_S(O.nodesRef.current,a).find(e=>zb(e.context?.elements.floating,n)||zb(e.context?.elements.domReference,n))||vS(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,Jb(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&B&&sC(B),o&&r!==_&&!Gx(i)&&Rb(e)===e.body){if(xy(B)&&(B.focus(),o===`popup`)){ne.request(()=>{B.focus()});return}let e=ie(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||B;xy(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!j.current&&(C||n!==aC())&&(A.current=!0,h.setOpen(!1,pb(sb,t)))})}function a(){M.current||(b.current.insideReactTree=!0,R.start(0,()=>{b.current.insideReactTree=!1}))}let l=xy(_)?_:null;if(!(!v&&!l))return tx(l&&ex(l,`focusout`,i),l&&ex(l,`pointerdown`,t),v&&ex(v,`focusin`,n),v&&ex(v,`focusout`,i),v&&k&&ex(v,`focusout`,a,!0))},[r,_,v,B,s,O,k,h,c,o,ie,C,x,b,R,z,ne,u,d,ae]),H.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${yS(`portal`)}]`)||[]),t=(O?vS(O.nodesRef.current,x()):[]).find(e=>Kb(e.context?.elements.domReference||null))?.context?.elements.domReference,n=NS([v,...e,I.current,ee.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...ae(),t,$S(d),$S(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=NS([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,k,C,O,x,u,d,ae]),Y(()=>{if(!g||r||!xy(B))return;P.current=``,F.current=``;let e=Yy(B),t=Rb(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(E.current||``):n;if(r===void 0||r===!1||zb(B,t))return;let i=null,a=()=>(i??=ie(B),i[0]||B),o;o=r===!0||r===null?a():$S(r),o||=a();let s=zb(B,Rb(e));xS(o,{preventScroll:o===B,shouldFocus(){if(!D.current)return!1;if(s)return!0;let t=Rb(e);return!(t!==o&&zb(B,t))}})})},[r,g,B,ie,w,E,D]),Y(()=>{if(r||!B)return;let e=Yy(B),t=Rb(e),n=E.current==null;iC(t);function i(e){if(e.open||(P.current=eC(e.nativeEvent,F.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`){if(e.nested)A.current=!1;else if(Nb(e.nativeEvent)||Pb(e.nativeEvent))A.current=!1;else{let e=!1;Yy(B).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&gy(t)!==`body`?t:null,s=n?o||a:a||o;return s||=aC()||null,typeof i==`boolean`?s:$S(i)||s||null}return()=>{y.off(`openchange`,i);let t=Rb(e),n=ae(),r=zb(v,t)||n.some(e=>e===t||zb(e,t))||O&&_S(O.nodesRef.current,x(),!1).some(e=>zb(e.context?.elements.floating,t)),o=T.current,s=P.current,c=a(s);queueMicrotask(()=>{let n=oC(c),i=typeof o!=`boolean`;if(o&&!A.current&&xy(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}A.current=!1})}},[r,v,B,T,E,y,O,_,x,ae]),Y(()=>{if(!Ab||g||!v)return;let e=Rb(Yy(v));!xy(e)||!Wb(e)||zb(v,e)&&e.blur()},[g,v]),Y(()=>{if(!(r||!k))return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),Y(()=>{if(!(r||!B))return sC(B),()=>{queueMicrotask(rC)}},[r,B]);let oe=!r&&(!s||!C)&&(re||s);return(0,G.jsxs)(H.Fragment,{children:[oe&&(0,G.jsx)(dx,{"data-type":`inside`,ref:L,onFocus:e=>{if(s){let e=ie();xS(e[e.length-1])}else k?.portalNode&&(A.current=!1,mS(e,k.portalNode)?lS(_)?.focus():$S(d??k.beforeOutsideRef)?.focus())}}),n,oe&&(0,G.jsx)(dx,{"data-type":`inside`,ref:te,onFocus:e=>{s?xS(ie()[0]):k?.portalNode&&(c&&(A.current=!0),mS(e,k.portalNode)?uS(_)?.focus():$S(u??k.afterOutsideRef)?.focus())}})]})}function lC(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=tb}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=H.useRef(void 0),f=sx(),p=Cb(),m=H.useMemo(()=>{function e(e,t,n,r){let i=pb(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=Fb(e.pointerType,!0)&&Pb(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||Fb(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=Bb(o);if(Wb(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}Fb(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return H.useMemo(()=>n?{reference:m}:Nr,[n,m])}function uC(){return!1}function dC(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function fC(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=uC,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=YS(c),m=Uy(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=Uy(()=>a),{escapeKey:v,outsidePress:y}=dC(s),b=H.useRef(!1),x=H.useRef(!1),S=H.useRef(!1),C=H.useRef(!1),w=H.useRef(``),T=H.useRef(null),E=Cb(),D=Cb(),O=Uy(()=>{D.clear(),f.current.insideReactTree=!1}),k=Uy(e=>{let t=f.current.floatingContext?.nodeId;return(p?_S(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),A=Uy(e=>Hb(e,l.select(`floatingElement`))||Hb(e,l.select(`domReferenceElement`))),j=Uy(e=>{o()&&l.setOpen(!1,pb(tb,e.nativeEvent))}),M=Uy(e=>{if(!u||!n||!r||e.key!==`Escape`||C.current||!v&&k(`__escapeKeyBubbles`))return;let t=pb(cb,Bee(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!v&&!t.isPropagationAllowed&&e.stopPropagation()}),N=Uy(()=>{f.current.insideReactTree=!0,D.start(0,O)}),P=Uy(e=>{if(!u||!n||e.button!==0)return;let t=Bb(e.nativeEvent);zb(l.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),F=Uy(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});H.useEffect(()=>{if(!u||!n)return O;f.current.__escapeKeyBubbles=v,f.current.__outsidePressBubbles=y;let e=new Sb,t=new Sb;function i(){e.clear(),C.current=!0}function a(){e.start(Ab?5:0,()=>{C.current=!1})}function o(){S.current=!0,t.start(0,()=>{S.current=!1})}function s(){b.current=!1,x.current=!1}function c(){let e=w.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function D(e){let t=f.current.floatingContext?.nodeId,n=p&&_S(p.nodesRef.current,t).some(t=>Hb(e,t.context?.elements.floating));return A(e)||n}function j(e){if(m(e)){e.type!==`click`&&!A(e)&&(t.clear(),S.current=!1),O();return}if(f.current.insideReactTree){O();return}let n=Bb(e),r=`[${yS(`inert`)}]`,i=by(n)?n.getRootNode():null,a=Array.from((Sy(i)?i:Yy(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>zb(e,n))))return;let s=by(n)?n:null;for(;s&&!Ny(s);){let e=Iy(s);if(Ny(e)||!by(e))break;s=e}if(!(a.length&&by(n)&&!Ub(n)&&!zb(n,l.select(`floatingElement`))&&a.every(e=>!zb(s,e)))){if(xy(n)&&!(`touches`in e)){let t=Ny(n),r=Py(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!D(e)){if(c()===`intentional`&&S.current){t.clear(),S.current=!1;return}typeof h==`function`&&!h(e)||k(`__outsidePressBubbles`)||(l.setOpen(!1,pb(ib,e)),O())}}}function N(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||A(e)||j(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||A(e))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=Bb(e);if(!n)return;let r=ex(n,e.type,()=>{t(e),r()})}function I(e){w.current=`touch`,F(e,P)}function ee(e){E.clear(),e.type===`pointerdown`&&(w.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?N(e):j(e)})}function L(e){if(!b.current)return;let n=x.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!D(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,O())}}}function te(e){if(c()!==`sloppy`||!T.current||A(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-T.current.startX),r=Math.abs(t.clientY-T.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(T.current.dismissOnTouchEnd=!0),i>10&&(j(e),E.clear(),T.current=null)}function R(e){F(e,te)}function z(e){c()!==`sloppy`||!T.current||A(e)||(T.current.dismissOnTouchEnd&&j(e),E.clear(),T.current=null)}function ne(e){F(e,z)}let re=Yy(d),B=tx(r&&tx(ex(re,`keydown`,M),ex(re,`compositionstart`,i),ex(re,`compositionend`,a)),g&&tx(ex(re,`click`,ee,!0),ex(re,`pointerdown`,ee,!0),ex(re,`pointerup`,L,!0),ex(re,`pointercancel`,L,!0),ex(re,`mousedown`,ee,!0),ex(re,`mouseup`,L,!0),ex(re,`touchstart`,I,!0),ex(re,`touchmove`,R,!0),ex(re,`touchend`,ne,!0)));return()=>{B(),e.clear(),t.clear(),s(),S.current=!1,O()}},[f,d,r,g,h,u,n,v,y,M,O,_,k,A,p,l,E]);let I=H.useMemo(()=>({onKeyDown:M,onPointerDown:j,onClick:j}),[M,j]),ee=H.useMemo(()=>({onKeyDown:M,onPointerDown:F,onMouseDown:F,onClickCapture:N,onMouseDownCapture(e){N(),P(e)},onPointerDownCapture(e){N(),P(e)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[M,N,P,F]);return H.useMemo(()=>n?{reference:I,floating:ee,trigger:I}:{},[n,I,ee])}function pC(e,t,n){let{reference:r,floating:i}=e,a=wx(t),o=Tx(t),s=Cx(o),c=bx(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=xx(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function mC(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=yx(t,e),p=Lx(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Rx(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Rx(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var hC=50,gC=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:mC},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=pC(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<hC&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=pC(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},_C=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=yx(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=bx(r),_=wx(o),v=bx(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Fx(o)]:Dx(o)),x=p!==`none`;!d&&x&&b.push(...Px(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ex(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===wx(t)||T.every(e=>wx(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=wx(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},vC=new Set([`left`,`top`]);async function yC(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=bx(n),s=xx(n),c=wx(n)===`y`,l=vC.has(o)?-1:1,u=a&&c?-1:1,d=yx(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var bC=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await yC(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},xC=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=yx(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=wx(i),p=Sx(f),m=u[p],h=u[f],g=(e,t)=>vx(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},SC=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=yx(e,t),u={x:n,y:r},d=wx(i),f=Sx(d),p=u[f],m=u[d],h=yx(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=vC.has(bx(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},CC=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=yx(e,t),c=await i.detectOverflow(t,s),l=bx(n),u=xx(n),d=wx(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=fx(p-c[m],g),y=fx(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*px(c.left,c.right):S=p-2*px(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function wC(e){let t=Py(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=xy(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=mx(n)!==a||mx(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function TC(e){return by(e)?e:e.contextElement}function EC(e){let t=TC(e);if(!xy(t))return gx(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=wC(t),o=(a?mx(n.width):n.width)/r,s=(a?mx(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var DC=gx(0);function OC(e){let t=_y(e);return!My()||!t.visualViewport?DC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kC(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===_y(e)}function AC(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=TC(e),o=gx(1);t&&(r?by(r)&&(o=EC(r)):o=EC(e));let s=kC(a,n,r)?OC(a):gx(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=_y(a),t=by(r)?_y(r):r,n=e,i=zy(n);for(;i&&t!==n;){let e=EC(i),t=i.getBoundingClientRect(),r=Py(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=_y(i),i=zy(n)}}return Rx({width:u,height:d,x:c,y:l})}function jC(e,t){let n=Fy(e).scrollLeft;return t?t.left+n:AC(vy(e)).left+n}function MC(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jC(e,n),y:n.top+t.scrollTop}}function NC(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=vy(r),s=t?Ty(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=gx(1),u=gx(0),d=xy(r);if((d||!a)&&((gy(r)!==`body`||Cy(o))&&(c=Fy(r)),d)){let e=AC(r);l=EC(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?MC(o,c):gx(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function PC(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function FC(e){let t=Fy(e),n=e.ownerDocument.body,r=px(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=px(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+jC(e),o=-t.scrollTop;return Py(n).direction===`rtl`&&(a+=px(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var IC=25;function LC(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=_y(e),a=vy(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!My()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(jC(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=IC&&(s-=o)}return{width:s,height:c,x:l,y:u}}function RC(e,t){let n=AC(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=EC(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function zC(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=LC(e,n,t);else if(t===`document`)r=FC(vy(e));else if(by(t))r=RC(t,n);else{let n=OC(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Rx(r)}function BC(e,t){let n=t.get(e);if(n)return n;let r=Ry(e,[],!1).filter(e=>by(e)&&gy(e)!==`body`),i=null,a=Py(e).position===`fixed`,o=a?Iy(e):e;for(;by(o)&&!Ny(o);){let e=Py(o),t=Ay(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Iy(o)}return t.set(e,r),r}function VC(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ty(t)?[]:BC(t,this._c):[].concat(n),r],o=zC(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=zC(t,a[e],i);s=px(n.top,s),c=fx(n.right,c),l=fx(n.bottom,l),u=px(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function HC(e){let{width:t,height:n}=wC(e);return{width:t,height:n}}function UC(e,t,n){let r=xy(t),i=vy(t),a=n===`fixed`,o=AC(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=gx(0);if((r||!a)&&((gy(t)!==`body`||Cy(i))&&(s=Fy(t)),r)){let e=AC(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=jC(i));let l=i&&!r&&!a?MC(i,s):gx(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function WC(e){return Py(e).position===`static`}function GC(e,t){if(!xy(e)||Py(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return vy(e)===n&&(n=n.ownerDocument.body),n}function KC(e,t){let n=_y(e);if(Ty(e))return n;if(!xy(e)){let t=Iy(e);for(;t&&!Ny(t);){if(by(t)&&!WC(t))return t;t=Iy(t)}return n}let r=GC(e,t);for(;r&&wy(r)&&WC(r);)r=GC(r,t);return r&&Ny(r)&&WC(r)&&!Ay(r)?n:r||jy(e)||n}var qC=async function(e){let t=this.getOffsetParent||KC,n=this.getDimensions,r=await n(e.floating);return{reference:UC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function JC(e){return Py(e).direction===`rtl`}var YC={convertOffsetParentRelativeRectToViewportRelativeRect:NC,getDocumentElement:vy,getClippingRect:VC,getOffsetParent:KC,getElementRects:qC,getClientRects:PC,getDimensions:HC,getScale:EC,isElement:by,isRTL:JC};function XC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ZC(e,t,n){let r=null,i,a=vy(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=hx(d),h=hx(a.clientWidth-(u+f)),g=hx(a.clientHeight-(d+p)),_=hx(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:px(0,fx(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!XC(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=_y(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function QC(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=TC(e),u=i||a?[...l?Ry(l):[],...t?Ry(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?ZC(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?AC(e):null;c&&g();function g(){let t=AC(e);h&&!XC(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var $C=bC,ew=xC,tw=_C,nw=CC,rw=SC,iw=(e,t,n)=>{let r=new Map,i=n??{},a={...YC,...i.platform,_c:r};return gC(e,t,{...i,platform:a})},aw=typeof document<`u`?H.useLayoutEffect:function(){};function ow(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ow(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ow(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function sw(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cw(e,t){let n=sw(e);return Math.round(t*n)/n}function lw(e){let t=H.useRef(e);return aw(()=>{t.current=e}),t}function uw(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=H.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=H.useState(r);ow(f,r)||p(r);let[m,h]=H.useState(null),[g,_]=H.useState(null),v=H.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=H.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=H.useRef(null),C=H.useRef(null),w=H.useRef(u),T=c!=null,E=lw(c),D=lw(i),O=lw(l),k=H.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),iw(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!ow(w.current,t)&&(w.current=t,Lo.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);aw(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=H.useRef(!1);aw(()=>(A.current=!0,()=>{A.current=!1}),[]),aw(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=H.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=H.useMemo(()=>({reference:b,floating:x}),[b,x]),N=H.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=cw(M.floating,u.x),r=cw(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...sw(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return H.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var dw=(e,t)=>{let n=$C(e);return{name:n.name,fn:n.fn,options:[e,t]}},fw=(e,t)=>{let n=ew(e);return{name:n.name,fn:n.fn,options:[e,t]}},pw=(e,t)=>({fn:rw(e).fn,options:[e,t]}),mw=(e,t)=>{let n=tw(e);return{name:n.name,fn:n.fn,options:[e,t]}},hw=(e,t)=>{let n=nw(e);return{name:n.name,fn:n.fn,options:[e,t]}};function gw(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function _w(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function vw(e){let t=[],n,r=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of Array.from(e).sort((e,t)=>e.top-t.top)){if(r=Math.min(r,s.left),i=Math.min(i,s.top),a=Math.max(a,s.right),o=Math.max(o,s.bottom),!n||s.top-n.top>n.height/2)t.push(_w(s));else{let e=t[t.length-1];e.left=Math.min(e.left,s.left),e.right=Math.max(e.right,s.right),e.bottom=Math.max(e.bottom,s.bottom),e.width=e.right-e.left,e.height=e.bottom-e.top}n=s}return{lines:t,fallback:gw(r,i,a,o)}}function yw(e,t,n){return e.findIndex(e=>t>e.left-2&&t<e.right+2&&n>e.top-2&&n<e.bottom+2)}function bw(e){return gw(e.left,e.top,e.right,e.bottom)}function xw(e,t,n){let{lines:r}=vw(e.getClientRects());if(r.length<2)return;let i=yw(r,t,n);return{x:t,y:n,lineIndex:i===-1?void 0:i,element:e}}function Sw(e,t,n){let{lines:r,fallback:i}=vw(e.getClientRects());if(r.length<2)return null;let a=n?.x,o=n?.y,s=t[0];if(n?.lineIndex!=null&&r[n.lineIndex])return bw(r[n.lineIndex]);if(a!=null&&o!=null){let e=yw(r,a,o);if(e!==-1)return bw(r[e])}if(r.length===2&&r[0].left>r[1].right&&a!=null&&o!=null)return i;if(s===`t`||s===`b`){let e=r[0],t=r[r.length-1],n=s===`t`?e:t;return gw(n.left,e.top,n.right,t.bottom)}let c=s===`l`,l=r[0].left,u=r[0].right,d=c?1/0:-1/0,f=r[0],p=r[0];for(let e of r){l=Math.min(l,e.left),u=Math.max(u,e.right);let t=c?e.left:e.right;c&&t<d||!c&&t>d?(d=t,f=e,p=e):t===d&&(p=e)}return gw(l,f.top,u,p.bottom)}function Cw(e){return`contextElement`in e&&e.contextElement?e.contextElement:by(e)?e:void 0}function ww(e,t){function n(t){Tw(e,t.currentTarget,t.clientX,t.clientY)}function r(e){t||n(e)}return{onFocus(){e.current=void 0},onMouseEnter:r,onMouseMove:r}}function Tw(e,t,n,r){let i=xw(t,n,r);return e.current=i,i}function Ew(e){return{name:`inline`,async fn(t){let n=t.elements.reference;if(typeof n?.getClientRects!=`function`)return{};let r=Cw(n),i=e.current,a=i?.element===n||i?.element===r?i:void 0,o=Sw(n,t.placement,a);if(!o||typeof t.platform.getElementRects!=`function`)return{};let s=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return o}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===s.reference.x&&t.rects.reference.y===s.reference.y&&t.rects.reference.width===s.reference.width&&t.rects.reference.height===s.reference.height?{}:{reset:{rects:s}}}}}var Dw=n((e=>{var t=_();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Ow=n(((e,t)=>{t.exports=Dw()})),kw=n((e=>{var t=_(),n=Ow();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Aw=n(((e,t)=>{t.exports=kw()})),jw=[],Mw=void 0;function Nw(){return Mw}function Pw(e){jw.push(e)}function Fw(e){let t=(t,n)=>{let r=xr(Lw).current,i;try{Mw=r;for(let e of jw)e.before(r);i=e(t,n);for(let e of jw)e.after(r);r.didInitialize=!0}finally{Mw=void 0}return i};return t.displayName=e.displayName||e.name,t}function Iw(e){return H.forwardRef(Fw(e))}function Lw(){return{didInitialize:!1}}var Rw=Ow(),zw=Aw(),Bw=kr(19)?Uw:Ww;function Vw(e,t,n,r,i){return Bw(e,t,n,r,i)}function Hw(e,t,n,r,i){let a=H.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Rw.useSyncExternalStore)(e.subscribe,a,a)}Pw({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Rw.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Uw(e,t,n,r,i){let a=Nw();if(!a)return Hw(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Ww(e,t,n,r,i){return(0,zw.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Gw=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Vw(this,e,t,n,r)}},Kw=class extends Gw{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){H.useDebugValue(e);let n=this;Y(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Y(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Y(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){H.useDebugValue(e);let n=this,r=t!==void 0;Y(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return H.useDebugValue(e),Vw(this,this.selectors[e],t,n,r)}useContextCallback(e,t){H.useDebugValue(e);let n=Uy(t??jr);this.context[e]=n}useStateSetter(e){let t=H.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},qw={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Jw=class extends Kw{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:WS(),nested:n,triggerElements:i},qw),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Vee(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Yw(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=H.useRef(null);r===void 0&&f.current===null&&(f.current=new Jw({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),Y(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};by(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function Xw(e,t=!1,n=!1){let[r,i]=H.useState(e&&t?`idle`:void 0),[a,o]=H.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Y(()=>{if(!e&&a&&r!==`ending`&&n){let e=ox.request(()=>{i(`ending`)});return()=>{ox.cancel(e)}}},[e,a,r,n]),Y(()=>{if(!e||t)return;let n=ox.request(()=>{i(void 0)});return()=>{ox.cancel(n)}},[t,e]),Y(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=ox.request(()=>{i(`idle`)});return()=>{ox.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Zw(e,t=!1){let n=sx();return Uy((r,i=null)=>{n.cancel();let a=$S(e);if(a==null)return;let o=a,s=()=>{Lo.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function Qw(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Uy(i),o=Zw(r,n);H.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var $w={tabIndex:-1,[Hee]:``};function eT(e){return t=>t!==`touch`||e.current}function tT(e,t=!1){let n=_b(),r=JS()!=null,i=xr(()=>e(n,r)).current;return Yw({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function nT({handle:e,store:t}){return Y(()=>e.attachStore(t),[e,t]),null}function rT(e,t){let n=H.useRef(null),r=H.useRef(null);return H.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function iT(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function aT(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function oT(e,t,n,r={}){let i=n.reason,a=i===nb,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=aT(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),iT(i,t,n.trigger,c()),e.update(i)};a?Lo.flushSync(l):l()}function sT(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=rT(e,n),o=Uy(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=H.useCallback(e=>{a(e),e&&o(e)},[a,o]);return Y(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function cT(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=H.useRef(null),i=e.useState(`open`);Y(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=pb(eb);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function lT(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Xw(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=Uy(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Qw({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function uT(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:Nr,inactiveTriggerProps:Nr,popupProps:Nr})},[e])}function dT(e,t){Y(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Y(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var fT=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function pT(){return new Jw({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new fT,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function mT(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:pT(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Nr,inactiveTriggerProps:Nr,popupProps:Nr}}function hT(e,t,n=!1){return new Jw({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var gT=e=>e.triggerIdProp??e.activeTriggerId,_T=e=>e.openProp??e.open,vT=e=>(e.popupElement?.id??e.floatingId)||void 0;function yT(e,t){return t!==void 0&&_T(e)&&gT(e)===t}function bT(e,t){return yT(e,t)?!0:t!==void 0&&_T(e)&&gT(e)==null&&e.triggerCount===1}var xT={open:_T,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:gT,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:vT,isTriggerActive:(e,t)=>t!==void 0&&gT(e)===t,isOpenedByTrigger:(e,t)=>yT(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&gT(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>bT(e,t)?vT(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function ST(e){let t=H.useCallback(t=>e===void 0?jr:e.subscribeStore(t),[e]),n=H.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Rw.useSyncExternalStore)(t,n,()=>e?.serverStore)}function CT(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=_b(),a=JS()!=null,o=xr(()=>new Jw({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new fT,floatingId:i,syncOnly:!1,nested:a})).current;return Y(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=by(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function wT(e){return Kee(e,e.rootContext)}function Kee(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=H.useState(null),[d,f]=H.useState(void 0),[p,m]=H.useState(void 0),h=H.useRef(null),g=YS(r),_=H.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=uw({...e,elements:{..._,...l&&{reference:l}}}),y=by(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=H.useCallback(e=>{let t=by(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=H.useCallback(e=>{(by(e)||e===null)&&(h.current=e,f(e)),(by(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!by(e))&&v.refs.setReference(e)},[v.refs,f]),C=H.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=H.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=H.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=H.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return Y(()=>{o&&(h.current=o)},[o]),Y(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),H.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}var TT=kb&&Ab;function ET(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=H.useRef(!1),c=H.useRef(null),l=H.useRef(!0),u=Cb();H.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=_y(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&xy(e)&&e===Rb(Yy(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return tx(ex(t,`blur`,r),TT&&ex(t,`keydown`,a,!0),TT&&ex(t,`pointerdown`,o,!0))},[i,n]),H.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);by(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=H.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=Bb(t.nativeEvent);if(by(a)){if(TT&&!t.relatedTarget){if(!l.current&&!Wb(a))return}else if(!qb(a))return}let o=Vb(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,pb(rb,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,pb(rb,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=by(n)&&n.hasAttribute(yS(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=Rb(Yy(e));!n&&t===e||zb(o.current.floatingContext?.refs.floating.current,t)||zb(e,t)||a||Vb(n??t,i.context.triggerElements)||i.setOpen(!1,pb(rb,r))})}}},[o,r,i,u]);return H.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var qee=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Sb,this.restTimeout=new Sb,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},DT=new WeakMap;function OT(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&DT.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),DT.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function kT(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=DT.get(n);a&&a!==e&&OT(a),OT(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,DT.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function AT(e){let t=e.context.dataRef.current,n=xr(()=>t.hoverInteractionState??qee.create()).current;return t.hoverInteractionState||=n,bb(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function jT(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=YS(),d=JS(),f=AT(a),p=Cb(),m=Uy(()=>Qb(l.current.openEvent?.type,f.interactedInside)),h=Uy(()=>$b(l.current.openEvent?.type)),g=Uy(()=>{OT(f)});Y(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),H.useEffect(()=>g,[g]),Y(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&by(c)&&s){let e=c,t=s,n=Yy(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return kT(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),H.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&_S(u.nodesRef.current,d).length>0)}function t(e){let t=Xb(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,pb(nb,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=Bb(e);if(!Gb(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Vb(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&by(o)&&_S(u.nodesRef.current,r,!1).some(e=>zb(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,pb(nb,t)),u.events.emit(`floating.closed`,t)})}let y=s;return tx(y&&ex(y,`mouseenter`,c),y&&ex(y,`mouseleave`,_),y&&ex(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var Jee={current:null};function MT(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Jee,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=YS(l),y=AT(h),b=H.useRef(!1),x=nx(i),S=nx(r),C=nx(o),w=nx(n),T=nx(p),E=nx(f),D=Uy(()=>Qb(g.current.openEvent?.type,y.interactedInside)),O=Uy(()=>T.current?.()!==!1),k=Uy((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!zb(e,t);if(!by(n))return!1;let i=n;return r.hasMatchingElement(e=>zb(e,i))&&(!e||!zb(e,i))}),A=Uy(()=>{y.handler&&=(Yy(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=Uy(()=>{OT(y)});return u&&(y.handleCloseOptions=x.current?.__options),H.useEffect(()=>A,[A]),H.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===nb,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),H.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Xb(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,pb(nb,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,pb(nb,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!by(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Fb(y.pointerType))return;let t=Zb(C.current),n=Xb(S.current,`open`,y.pointerType),r=Bb(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(by(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(zb(e,r)){s=e;break}}by(i)&&by(o)&&!h.context.triggerElements.hasElement(i)&&zb(i,o)&&(s=o);let c=s!=null&&k(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&by(s)&&by(o)&&zb(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){O()&&h.setOpen(!0,pb(nb,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&O()&&h.setOpen(!0,pb(nb,e,s))}):g&&O()&&h.setOpen(!0,pb(nb,e,s)))}function i(t){if(D()){j();return}A();let n=Yy(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!Vb(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){j(),A(),w.current&&!D()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!zb(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){zb(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?ex(t,`mouseout`,o):void 0;return s?tx(ex(t,`mousemove`,r,{once:!0}),ex(t,`mouseenter`,r),ex(t,`mouseleave`,i),l):tx(ex(t,`mouseenter`,r),ex(t,`mouseleave`,i),l)},[A,j,g,S,h,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),H.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=k(r,n,e.target);if(a&&!Fb(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;kT(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Zb(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,D())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&O()&&h.setOpen(!0,pb(nb,t,n))}y.pointerType===`touch`?Lo.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,k,a,h,C,O])}var Yee=`Escape`;function NT(e){return Ab&&e.movementX===0&&e.movementY===0}function PT(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function FT(e,t){return PT(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function IT(e,t,n){return PT(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Xee(e,t,n){return PT(t,n?e===Ib:e===Lb,e===Gee)}function Zee(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===Yee:PT(t,n?e===Lb:e===Ib,e===Wee)}function LT(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),D=C.context.dataRef,O=Jb(T),k=Kb(E),A=nx(O),j=JS(),M=YS(b),N=H.useRef(f),P=H.useRef(o??-1),F=H.useRef(null),I=H.useRef(!0),ee=Uy(e=>{i(P.current===-1?null:P.current,e)}),L=H.useRef(!!T),te=H.useRef(w),R=H.useRef(!1),z=H.useRef(!1),ne=H.useRef(null),re=nx(h),B=nx(w),ie=nx(o),ae=nx(y),oe=sx(),V=sx(),se=Uy(()=>{function e(e){d?M?.events.emit(`virtualfocus`,e):ne.current=xS(e,{sync:R.current,preventScroll:!0})}let t=n.current[P.current],r=z.current;t&&e(t),(R.current?e=>e():e=>oe.request(e))(()=>{let i=n.current[P.current]||t;i&&(t||e(i),pe&&(r||!I.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{D.current.orientation=g},[D,g]),Y(()=>{a&&(w&&T?(P.current=o??-1,N.current&&o!=null&&(z.current=!0,ee())):L.current&&(P.current=-1,ee()))},[a,w,T,o,ee]),Y(()=>{if(a){if(!w){R.current=!1;return}if(T){if(r==null){if(R.current=!1,ie.current!=null)return;if(L.current&&(P.current=-1,se()),(!te.current||!L.current)&&N.current&&(F.current!=null||N.current===!0&&F.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>V.request(e):queueMicrotask)(t),e+=1):(P.current=F.current==null||IT(F.current,g,u)||l?Bx(n):Vx(n),F.current=null,ee())};t()}}else zx(n.current,r)||(P.current=r,se(),z.current=!1)}}},[a,w,T,r,ie,l,n,g,u,ee,se,V]),Y(()=>{if(!a||T||!M||d||!L.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=Rb(Yy(E??t??null)),r=e.some(e=>e.context&&zb(e.context.elements.floating,n));t&&!r&&I.current&&t.focus({preventScroll:!0})},[a,T,E,M,j,d]),Y(()=>{te.current=w,L.current=!!T}),Y(()=>{w||(F.current=null,N.current=f)},[w,f]);let ce=r!=null,le=Uy(e=>{if(!B.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(P.current!==t||r!==t)&&(P.current=t,ee(e))}),ue=Uy(()=>_??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation),de=Uy(()=>Bx(n,re.current)),fe=Uy(e=>{if(I.current=!1,R.current=!0,e.which===229||!B.current&&e.currentTarget===A.current)return;if(l&&Zee(e.key,g,u,S)){FT(e.key,ue())||Mb(e),C.setOpen(!1,pb(lb,e.nativeEvent)),xy(E)&&(d?M?.events.emit(`virtualfocus`,E):E.focus());return}let t=P.current,r=Bx(n,h),i=Vx(n,h);if(k||(e.key===`Home`&&(Mb(e),P.current=r,ee(e)),e.key===`End`&&(Mb(e),P.current=i,ee(e))),x!=null){let t=x(e,P.current,n,g,c,u,h,r,i);if(t!=null&&(P.current=t,ee(e)),g===`both`)return}if(FT(e.key,g)){if(Mb(e),w&&!d&&Rb(e.currentTarget.ownerDocument)===e.currentTarget){P.current=IT(e.key,g,u)?r:i,ee(e);return}IT(e.key,g,u)?c?t>=i?s&&t!==n.current.length?P.current=-1:(R.current=!1,P.current=r):P.current=Hx(n.current,{startingIndex:t,disabledIndices:h}):P.current=Math.min(i,Hx(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?P.current=n.current.length:(R.current=!1,P.current=i):P.current=Hx(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):P.current=Math.max(r,Hx(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),zx(n.current,P.current)&&(P.current=-1),ee(e)}}),pe=H.useMemo(()=>({onFocus(e){R.current=!0,le(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){NT(e)||(R.current=!0,z.current=!1,p&&le(e))},onPointerLeave(e){if(!B.current||!I.current||e.pointerType===`touch`)return;R.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&ae.current&&(ne.current?.(),ne.current=null,P.current=-1,ee(e),!d)){let e=A.current,t=Rb(Yy(e));e&&zb(e,t)&&e.focus({preventScroll:!0})}}}),[le,B,A,p,n,ee,ae,d]),me=H.useMemo(()=>d&&w&&ce&&{"aria-activedescendant":`${v}-${r}`},[d,w,ce,v,r]),he=H.useMemo(()=>({"aria-orientation":g===`both`?void 0:g,...k?{}:me,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=Bb(e.nativeEvent);if(t&&!zb(A.current,t))return;Mb(e),C.setOpen(!1,pb(sb,e.nativeEvent)),xy(E)&&E.focus();return}fe(e)},onPointerMove(e){NT(e)||(I.current=!0)}}),[me,fe,A,g,k,C,w,d,E]),ge=H.useMemo(()=>{function e(e){C.setOpen(!0,pb(lb,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&Nb(e.nativeEvent)&&(N.current=!d)}function n(e){N.current=f,f===`auto`&&Pb(e.nativeEvent)&&(N.current=!0)}return{onKeyDown(t){let n=C.select(`open`);I.current=!1;let r=t.key.startsWith(`Arrow`),i=Xee(t.key,ue(),u),a=FT(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return fe(t);if(!(!n&&!m&&r)){if(o){let e=FT(t.key,ue());F.current=l&&e?null:t.key}if(l){i&&(Mb(t),n?(P.current=de(),ee(t)):e(t));return}a&&(ie.current!=null&&(P.current=ie.current),Mb(t),!n&&m?e(t):fe(t),n&&ee(t))}},onFocus(e){C.select(`open`)&&!d&&(P.current=-1,ee(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[fe,f,de,l,ee,C,m,g,ue,u,ie,d]),_e=H.useMemo(()=>({...me,...ge}),[me,ge]);return H.useMemo(()=>a?{reference:_e,floating:he,item:pe,trigger:ge}:{},[a,_e,he,ge,pe])}function RT(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=Cb(),m=H.useRef(``),h=H.useRef(u??i??-1),g=H.useRef(null),_=Uy(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!Gx(n)||n?.matches(`:disabled`)?!1:o==null||!Ux(Mr,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!c(n)))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Mb(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Mb(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=Uy(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);zb(n,t)||zb(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});Y(()=>{!f&&u!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=H.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return H.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var zT=.1,Qee=zT*zT,BT=.5;function VT(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function HT(e,t,n,r,i,a,o,s,c,l){let u=!1;return VT(e,t,n,r,i,a)&&(u=!u),VT(e,t,i,a,o,s)&&(u=!u),VT(e,t,o,s,c,l)&&(u=!u),VT(e,t,c,l,n,r)&&(u=!u),u}function $ee(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function UT(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function WT(e={}){let{blockPointerEvents:t=!1}=e,n=new Sb,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Qee;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Bb(r),g=r.type===`mouseleave`,_=zb(u,h),v=zb(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&by(r.relatedTarget)&&zb(u,r.relatedTarget))return;function y(){return!!(s&&_S(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=UT(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=UT(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=UT(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=UT(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!$ee(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?BT/2:BT*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+BT+1,o=C||T?S.bottom-BT:S.top,s=C?T?S.bottom-BT:S.top:S.bottom-BT;M=HT(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?BT/2:BT*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-BT,o=C||T?S.top+BT:S.bottom,s=C?T?S.top+BT:S.bottom:S.top+BT;M=HT(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?BT/2:BT*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+BT+1,o=w||E?S.right-BT:S.left,s=w?E?S.right-BT:S.left:S.right-BT;M=HT(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?BT/2:BT*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-BT,o=w||E?S.left+BT:S.right,s=w?E?S.left+BT:S.right:S.left+BT;M=HT(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var GT=H.createContext(void 0);function KT(){let e=H.useContext(GT);if(e===void 0)throw Error(yr(26));return e}var qT=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),JT={...fy,...iy,nestedDialogOpen(e){return e?{"data-nested-dialog-open":``}:null}},YT=H.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=ey(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);KT(),Qw({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?eT(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Lr(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...$w,hidden:!m,onKeyDown(e){qT.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:JT});return(0,G.jsx)(cC,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})});function XT(e){return kr(19)?e:e?`true`:void 0}var ZT=H.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),QT=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=ey(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,G.jsx)(GT.Provider,{value:n,children:(0,G.jsxs)(US,{ref:t,...r,children:[a&&o===!0&&(0,G.jsx)(ZT,{ref:i.context.internalBackdropRef,inert:XT(!s)}),e.children]})}):null}),$T={},eE={},tE=``;function nE(e,t){return Cy(e)?e:t}function rE(e,t,n){return/hidden|clip/.test(e.getComputedStyle(nE(t,n)).overflowY)}function ete(e){if(typeof document>`u`)return!1;let t=Yy(e);return _y(t).innerWidth-t.documentElement.clientWidth>0}function tte(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Yy(e),n=t.documentElement,r=t.body,i=nE(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function nte(e){let t=Yy(e),n=t.documentElement,r=t.body,i=nE(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function rte(e){let t=Yy(e),n=t.documentElement,r=t.body,i=_y(n),a=0,o=0,s=!1,c=ox.create();if(Ab&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,$T={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},tE=n.style.scrollBehavior,eE={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=nE(n,r);if(s=tte(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,$T),Object.assign(r.style,eE),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=tE)}function d(){u(),c.request(l)}l();let f=ex(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var ite=new class{lockCount=0;restore=null;timeoutLock=Sb.create();timeoutUnlock=Sb.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Yy(e),n=t.documentElement,r=t.body,i=_y(n);if(rE(i,n,r)){let t=new i.MutationObserver(()=>{rE(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Eb||!ete(e);this.restore=a?nte(e):rte(e)}};function iE(e=!0,t=null){Y(()=>{if(e)return ite.acquire(t)},[e,t])}function ate({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=H.useState(0),[u,d]=H.useState(0),f=c===0,p=fC(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Bb(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||zb(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return iE(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),Y(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),uT(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var ote={...xT,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},ste=class extends Kw{constructor(e,t,n){let r=new fT,i=cte(e,r,t,n);super(i,lte(r),ote)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};iT(n,e,t.trigger),this.update(n)}};function cte(e,t,n,r=!1){let i={...mT(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e};return i.floatingRootContext=hT(t,n,r),i}function lte(e){return{popupRef:H.createRef(),backdropRef:H.createRef(),internalBackdropRef:H.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function aE(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=ey(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=tT((e,t)=>new ste({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);dT(b,x),cT(b);let{forceUnmount:w}=lT(x,b);H.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,pb(fb))}),[w,b]);let T=x||S;return(0,G.jsxs)($v.Provider,{value:b,children:[u&&(0,G.jsx)(nT,{handle:u,store:b}),T&&(0,G.jsx)(ate,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}function oE(e){return aE(`dialog`,e)}var sE=H.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=KT(),c=ey(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return Lr(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:JT,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),cE=H.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=ey(),c=vb(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Lr(`h2`,e,{ref:t,props:[{id:c},o]})});function ute(e){let t=H.useRef(``),n=H.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:H.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function lE(e,t){let n=H.useRef(e),r=Uy(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function uE(e,t){let{onClick:n,onPointerDown:r}=ute(Uy((n,r)=>{(typeof e==`function`?e():e)||t(r||(Eb?`touch`:``))}));return H.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function dE(e){let[t,n]=H.useState(null),r=uE(e,n);return lE(e,t=>{t&&!e&&n(null)}),H.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var dte=H.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=ey(!0),f=ST(l)??d;if(!f)throw Error(yr(79));let p=vb(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=H.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=sT(p,_,f,{payload:c}),{getButtonProps:b,buttonRef:x}=Zy({disabled:a,native:o}),S=lC(m),C=uE(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),w={disabled:a,open:h},T=f.useState(`triggerProps`,y);return Lr(`button`,e,{state:w,ref:[x,t,v,_],props:[S.reference,T,C,{[FS]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,b],stateAttributesMapping:uy})}),fE=H.createContext(void 0);function pE(){let e=H.useContext(fE);if(e===void 0)throw Error(yr(53));return e}function mE(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=`${t}${n===`x`?`Inline`:`Block`}`,a=parseFloat(r[`${i}Start`]);return n===`x`&&t===`margin`?a*2:a+parseFloat(r[`${i}End`])}var hE=`base-ui-disable-scrollbar`,gE={className:hE,getElement(e){return(0,G.jsx)(`style`,{nonce:e,href:hE,precedence:`base-ui:low`,children:`.${hE}{scrollbar-width:none}.${hE}::-webkit-scrollbar{display:none}`})}},_E=e=>t=>t?{[e]:``}:null,vE={hasOverflowX:_E(`data-has-overflow-x`),hasOverflowY:_E(`data-has-overflow-y`),overflowXStart:_E(`data-overflow-x-start`),overflowXEnd:_E(`data-overflow-x-end`),overflowYStart:_E(`data-overflow-y-start`),overflowYEnd:_E(`data-overflow-y-end`),cornerHidden:()=>null},yE=H.createContext(void 0),bE={disableStyleElements:!1};function xE(){return H.useContext(yE)??bE}var SE={x:0,y:0},CE={width:0,height:0},wE={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},TE={x:!0,y:!0,corner:!0},EE=H.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,style:a,...o}=e,{xStart:s,xEnd:c,yStart:l,yEnd:u}=DE(i),d=vb(),f=Cb(),p=Cb(),{nonce:m,disableStyleElements:h}=xE(),[g,_]=H.useState(!1),[v,y]=H.useState(!1),[b,x]=H.useState(!1),[S,C]=H.useState(!1),[w,T]=H.useState(!1),[E,D]=H.useState(CE),[O,k]=H.useState(CE),[A,j]=H.useState(wE),[M,N]=H.useState(TE),P=H.useRef(null),F=H.useRef(null),I=H.useRef(null),ee=H.useRef(null),L=H.useRef(null),te=H.useRef(null),R=H.useRef(null),z=H.useRef(null),ne=H.useRef(0),re=H.useRef(0),B=H.useRef(0),ie=H.useRef(0),ae=H.useRef(`vertical`),oe=H.useRef(SE),V=H.useRef(null);function se(e){let t=e?x:y,n=e?f:p;t(!0),n.start(500,()=>{t(!1)})}let ce=Uy(e=>{let t=e.x-oe.current.x,n=e.y-oe.current.y;oe.current=e,n!==0&&se(!0),t!==0&&se(!1)}),le=Uy(()=>{let e=F.current;e&&V.current===null&&(V.current=e.style.scrollSnapType,e.style.scrollSnapType=`none`)}),ue=Uy(e=>{if(e.button!==0||z.current!==null&&(ae.current===`vertical`?L.current:te.current)?.hasPointerCapture(z.current))return;z.current=e.pointerId,ne.current=e.clientY,re.current=e.clientX,ae.current=e.currentTarget.getAttribute(`data-orientation`);let t=F.current;t&&(B.current=t.scrollTop,ie.current=t.scrollLeft,le()),(ae.current===`vertical`?L.current:te.current)?.setPointerCapture(e.pointerId)}),de=Uy(e=>{if(e.pointerId!==z.current)return;z.current=null,(ae.current===`vertical`?x:y)(!1),V.current!==null&&(F.current&&(F.current.style.scrollSnapType=V.current),V.current=null);let t=ae.current===`vertical`?L.current:te.current;t?.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)}),fe=Uy(e=>{if(e.pointerId!==z.current)return;if(e.buttons%2==0){de(e);return}let t=F.current;if(!t)return;let n=ae.current===`vertical`,r=n?L.current:te.current,i=n?I.current:ee.current;if(!r||!i)return;let a=n?`y`:`x`,o=mE(i,`padding`,a),s=mE(r,`margin`,a),c=n?r.offsetHeight:r.offsetWidth,l=(n?i.offsetHeight:i.offsetWidth)-c-o-s,u=n?e.clientY-ne.current:e.clientX-re.current,d=l<=0?0:u/l,f=n?t.scrollHeight:t.scrollWidth,p=n?t.clientHeight:t.clientWidth,m=(n?B.current:ie.current)+d*(f-p);n?t.scrollTop=m:t.scrollLeft=m,e.preventDefault(),se(n)});function pe(e){C(e.pointerType===`touch`)}function me(e){if(pe(e),e.pointerType!==`touch`){let t=zb(P.current,e.target);_(t)}}let he=H.useMemo(()=>({scrolling:v||b,hasOverflowX:!M.x,hasOverflowY:!M.y,overflowXStart:A.xStart,overflowXEnd:A.xEnd,overflowYStart:A.yStart,overflowYEnd:A.yEnd,cornerHidden:M.corner}),[v,b,M.x,M.y,M.corner,A]),ge={role:`presentation`,onPointerEnter:me,onPointerMove:me,onPointerDown:pe,onPointerLeave(){_(!1)},style:{position:`relative`,"--scroll-area-corner-height":`${E.height}px`,"--scroll-area-corner-width":`${E.width}px`}},_e=Lr(`div`,e,{state:he,ref:[t,P],props:[ge,o],stateAttributesMapping:vE}),ve=H.useMemo(()=>({handlePointerDown:ue,handlePointerMove:fe,handlePointerUp:de,handleScroll:ce,disableViewportSnap:le,cornerSize:E,setCornerSize:D,thumbSize:O,setThumbSize:k,hasMeasuredScrollbar:w,setHasMeasuredScrollbar:T,touchModality:S,cornerRef:R,scrollingX:v,scrollingY:b,hovering:g,setHovering:_,viewportRef:F,scrollbarYRef:I,scrollbarXRef:ee,thumbYRef:L,thumbXRef:te,rootId:d,hiddenState:M,setHiddenState:N,overflowEdges:A,setOverflowEdges:j,viewportState:he,overflowEdgeThreshold:{xStart:s,xEnd:c,yStart:l,yEnd:u}}),[ue,fe,de,ce,le,E,O,w,S,v,b,g,d,M,A,he,s,c,l,u]);return(0,G.jsxs)(fE.Provider,{value:ve,children:[!h&&gE.getElement(m),_e]})});function DE(e){let t=typeof e==`number`?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,t?.xStart||0),xEnd:Math.max(0,t?.xEnd||0),yStart:Math.max(0,t?.yStart||0),yEnd:Math.max(0,t?.yEnd||0)}}var OE=H.createContext(void 0),kE=H.createContext(void 0);function AE(){return H.useContext(kE)?.direction??`ltr`}function jE(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function ME(e,t){return Math.max(0,e-t)}function NE(e,t){if(t<=0)return 0;let n=jE(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var PE=[`--scroll-area-overflow-x-start`,`--scroll-area-overflow-x-end`,`--scroll-area-overflow-y-start`,`--scroll-area-overflow-y-end`],FE=!1;function IE(){FE||Ab||(typeof CSS<`u`&&`registerProperty`in CSS&&PE.forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),FE=!0)}var LE=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{viewportRef:o,scrollbarYRef:s,scrollbarXRef:c,thumbYRef:l,thumbXRef:u,cornerRef:d,cornerSize:f,setCornerSize:p,setThumbSize:m,rootId:h,setHiddenState:g,hiddenState:_,setHasMeasuredScrollbar:v,handleScroll:y,touchModality:b,setHovering:x,setOverflowEdges:S,overflowEdgeThreshold:C,viewportState:w}=pE(),T=AE(),E=H.useRef(!0),D=H.useRef([NaN,NaN,NaN,NaN]),O=Cb(),k=Cb(),A=Uy(()=>{let e=o.current,t=s.current,n=c.current,r=l.current,i=u.current,a=d.current;if(!e)return;let h=e.scrollHeight,_=e.scrollWidth,y=e.clientHeight,b=e.clientWidth,x=e.scrollTop,w=e.scrollLeft,E=D.current,O=Number.isNaN(E[0]);if(E[0]=y,E[1]=h,E[2]=b,E[3]=_,O&&v(!0),h===0||_===0)return;let k=RE(e),A=k.y,j=k.x,M=b/_,N=y/h,P=Math.max(0,_-b),F=Math.max(0,h-y),I=0,ee=0;j||(I=NE(T===`rtl`?-w:w,P),ee=P-I);let L=A?0:NE(x,F),te=A?0:F-L,R=j?0:b,z=A?0:y,ne=0,re=0;!j&&!A&&(ne=t?.offsetWidth||0,re=n?.offsetHeight||0);let B=f.width===0&&f.height===0,ie=B?ne:0,ae=B?re:0,oe=mE(n,`padding`,`x`),V=mE(t,`padding`,`y`),se=mE(i,`margin`,`x`),ce=mE(r,`margin`,`y`),le=R-oe-se,ue=z-V-ce,de=n?Math.min(n.offsetWidth-ie,le):le,fe=t?Math.min(t.offsetHeight-ae,ue):ue,pe=Math.max(16,de*M),me=Math.max(16,fe*N);if(m(e=>zE(e,{width:pe,height:me})),t&&r){let e=BE(r,`--scroll-area-thumb-height`,x,F,h,me,t.offsetHeight-me-V-ce);r.style.transform=`translate3d(0,${e}px,0)`}if(n&&i){let e=n.offsetWidth-pe-oe-se,t=BE(i,`--scroll-area-thumb-width`,T===`rtl`?-w:w,P,_,pe,e);i.style.transform=`translate3d(${T===`rtl`?-t:t}px,0,0)`}let he=[I,ee,L,te];PE.forEach((t,n)=>{e.style.setProperty(t,`${he[n]}px`)}),a&&p(e=>zE(e,{width:ne,height:re})),g(e=>zE(e,k));let ge={xStart:!j&&I>C.xStart,xEnd:!j&&ee>C.xEnd,yStart:!A&&L>C.yStart,yEnd:!A&&te>C.yEnd};S(e=>zE(e,ge))});Y(()=>{IE()},[]),Y(()=>{queueMicrotask(A)},[A,_,T,C.xStart,C.xEnd,C.yStart,C.yEnd]),Y(()=>{o.current?.matches(`:hover`)&&x(!0)},[o,x]),Y(()=>{let e=o.current;if(typeof ResizeObserver>`u`||!e)return;let t=!1,n=new ResizeObserver(()=>{if(!t){t=!0;let n=D.current;if(n[0]===e.clientHeight&&n[1]===e.scrollHeight&&n[2]===e.clientWidth&&n[3]===e.scrollWidth)return}A()});return n.observe(e),k.start(0,()=>{let t=e.getAnimations({subtree:!0});t.length!==0&&Promise.allSettled(t.map(e=>e.finished)).then(A).catch(()=>{})}),()=>{n.disconnect(),k.clear()}},[A,o,k]);function j(){E.current=!1}let M={role:`presentation`,...h&&{"data-id":`${h}-viewport`},tabIndex:_.x&&_.y?-1:0,className:gE.className,style:{overflow:`scroll`},onScroll(){o.current&&(A(),(b||!E.current)&&y({x:o.current.scrollLeft,y:o.current.scrollTop}),O.start(100,()=>{E.current=!0}))},onWheel:j,onPointerMove:j,onPointerEnter:j,onKeyDown:j},N=Lr(`div`,e,{ref:[t,o],state:w,props:[M,a],stateAttributesMapping:vE}),P=H.useMemo(()=>({computeThumbPosition:A}),[A]);return(0,G.jsx)(OE.Provider,{value:P,children:N})});function RE(e){let t=e.clientHeight>=e.scrollHeight,n=e.clientWidth>=e.scrollWidth;return{y:t,x:n,corner:t||n}}function zE(e,t){for(let n in t)if(e[n]!==t[n])return t;return e}function BE(e,t,n,r,i,a,o){let s=jE(n,0,r),c=n-s,l=Math.max(16,a*i/(i+Math.abs(c)));return e.style.setProperty(t,c?`${l}px`:``),(r?s/r*o:0)+(c>0?a-l:0)}var VE=H.createContext(void 0);function HE(){let e=H.useContext(VE);if(e===void 0)throw Error(yr(54));return e}var UE=H.forwardRef(function(e,t){let{render:n,className:r,orientation:i=`vertical`,keepMounted:a=!1,style:o,...s}=e,{hovering:c,scrollingX:l,scrollingY:u,hiddenState:d,scrollbarYRef:f,scrollbarXRef:p,viewportRef:m,thumbYRef:h,thumbXRef:g,handlePointerDown:_,handlePointerUp:v,handleScroll:y,disableViewportSnap:b,rootId:x,thumbSize:S,hasMeasuredScrollbar:C,viewportState:w}=pE(),T=i===`vertical`,E={...w,hovering:c,scrolling:T?u:l,orientation:i},D=AE(),O=!C&&!a,k=T?d.y:d.x,A=a||!k;H.useEffect(()=>{if(!A)return;let e=m.current,t=T?f.current:p.current;if(!t)return;function n(t){if(!e||t.ctrlKey)return;let n=!T,r=n?`scrollLeft`:`scrollTop`,i=n?t.deltaX:t.deltaY;if(i===0)return;let a=n?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,o=n&&D===`rtl`?-a:0,s=n&&D===`rtl`?0:a,c=e[r];c<=o&&i<0||c>=s&&i>0||(t.preventDefault(),e[r]=Math.min(s,Math.max(o,c+i)),y({x:e.scrollLeft,y:e.scrollTop}))}return ex(t,`wheel`,n,{passive:!1})},[D,y,T,p,f,A,m]);let j={...x&&{"data-id":`${x}-scrollbar`},onPointerDown(e){if(e.button!==0)return;let t=Bb(e.nativeEvent),n=T?h.current:g.current;if(n&&zb(n,t))return;let r=m.current;if(!r)return;let i=T?f.current:p.current;if(!n||!i)return;let a=T?`y`:`x`,o=mE(n,`margin`,a),s=mE(i,`padding`,a),c=T?n.offsetHeight:n.offsetWidth,l=i.getBoundingClientRect(),u=T?e.clientY-l.top-c/2-s+o/2:e.clientX-l.left-c/2-s+o/2,d=T?r.scrollHeight:r.scrollWidth,v=T?r.clientHeight:r.clientWidth,x=(T?i.offsetHeight:i.offsetWidth)-c-s-o;if(x<=0)return;let S=u/x,C=d-v;b(),T?r.scrollTop=S*C:r.scrollLeft=D===`rtl`?-(1-S)*C:S*C,y({x:r.scrollLeft,y:r.scrollTop}),_(e)},onPointerUp:v,onPointerCancel:v,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,visibility:O?`hidden`:void 0,...T?{top:0,bottom:`var(--scroll-area-corner-height)`,insetInlineEnd:0,"--scroll-area-thumb-height":`${S.height}px`}:{insetInlineStart:0,insetInlineEnd:`var(--scroll-area-corner-width)`,bottom:0,"--scroll-area-thumb-width":`${S.width}px`}}},M=Lr(`div`,e,{ref:[t,T?f:p],state:E,props:[j,s],stateAttributesMapping:vE});return A?(0,G.jsx)(VE.Provider,{value:i,children:M}):null}),WE=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{thumbYRef:o,thumbXRef:s,handlePointerDown:c,handlePointerMove:l,handlePointerUp:u,scrollingX:d,scrollingY:f,hasMeasuredScrollbar:p}=pE(),m=HE(),h=m===`vertical`;return Lr(`div`,e,{ref:[t,h?o:s],state:{scrolling:h?f:d,orientation:m},props:[{onPointerDown:c,onPointerMove:l,onPointerUp:u,onPointerCancel:u,style:{visibility:p?void 0:`hidden`,...h?{height:`var(--scroll-area-thumb-height)`}:{width:`var(--scroll-area-thumb-width)`}}},a]})}),GE=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{cornerRef:o,cornerSize:s,hiddenState:c}=pE(),l=Lr(`div`,e,{ref:[t,o],props:[{style:{position:`absolute`,bottom:0,insetInlineEnd:0,width:s.width,height:s.height}},a]});return c.corner?null:l});function KE({className:e,children:t,scrollFade:n=!1,scrollbarGutter:r=!1,...i}){return(0,G.jsxs)(EE,{className:W(`size-full min-h-0`,e),...i,children:[(0,G.jsx)(LE,{className:W(`h-full !overflow-y-auto overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,n&&`mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]`,r&&`data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5`),"data-slot":`scroll-area-viewport`,children:t}),(0,G.jsx)(qE,{orientation:`vertical`}),(0,G.jsx)(qE,{orientation:`horizontal`}),(0,G.jsx)(GE,{"data-slot":`scroll-area-corner`})]})}function qE({className:e,orientation:t=`vertical`,...n}){return(0,G.jsx)(UE,{className:W(`m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100`,e),"data-slot":`scroll-area-scrollbar`,orientation:t,...n,children:(0,G.jsx)(WE,{className:`relative flex-1 rounded-full bg-foreground/20`,"data-slot":`scroll-area-thumb`})})}var JE=e=>{typeof window>`u`||window.electronAPI?.browser?.setOverlayActive(e)},YE=0,XE=!1;function ZE(){let e=YE>0;e!==XE&&(XE=e,JE(XE))}function QE(){YE+=1,ZE()}function $E(){YE=Math.max(0,YE-1),ZE()}function eD(e=!0){(0,H.useLayoutEffect)(()=>{if(e)return QE(),()=>$E()},[e])}function tD(){return eD(),null}var nD=0,rD=!1,iD=!1,aD=!1;function oD(){let e=nD>0&&!iD;e!==rD&&(rD=e,window.electronAPI?.window?.setTrafficLightsVisible(!e))}function sD(){aD||(aD=!0,window.electronAPI?.window?.isFullScreen().then(e=>{iD=e,oD()}).catch(()=>{}),window.electronAPI?.window?.onFullScreenChange(e=>{iD=e,oD()}))}function cD(){window.electronAPI?.env?.platform===`darwin`&&(sD(),nD++,oD())}function lD(){window.electronAPI?.env?.platform===`darwin`&&(nD=Math.max(0,nD-1),oD())}function uD(e){(0,H.useEffect)(()=>{if(e)return cD(),()=>lD()},[e])}var dD={BASE:0,SETTINGS_WINDOW:10,MOBILE_DRAWER:30,DROPDOWN:40,MODAL_BACKDROP:50,MODAL_CONTENT:51,DROPDOWN_IN_MODAL:60,NESTED_MODAL_BACKDROP:70,NESTED_MODAL_CONTENT:71,DROPDOWN_IN_NESTED_MODAL:80,TOOLTIP:100,TOAST:110,DEVTOOLS_OVERLAY:120},fD=(0,H.createContext)(dD.DROPDOWN);function pD(e){return uD(e.open??!1),(0,G.jsx)(oE,{...e})}var mD=QT;function hD(e){return(0,G.jsx)(dte,{"data-slot":`dialog-trigger`,...e})}function gD({className:e,...t}){return(0,G.jsx)(my,{className:W(`fixed inset-0 no-drag bg-black/32 backdrop-blur-sm transition-opacity duration-150 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0`,e),"data-slot":`dialog-backdrop`,"data-enso-float":``,...t})}function _D({className:e,...t}){return(0,G.jsx)(`div`,{className:W(`fixed inset-0 grid grid-rows-[1fr_auto_3fr] justify-items-center p-4 pointer-events-none`,e),"data-slot":`dialog-viewport`,...t})}function vD({className:e,children:t,showCloseButton:n=!0,bottomStickOnMobile:r=!0,disableNestedTransform:i=!1,showBackdrop:a=!0,zIndexLevel:o=`base`,style:s,...c}){let l=i?{...s??{},"--nested-dialogs":0}:s,u=o===`base`?dD.MODAL_CONTENT:dD.NESTED_MODAL_CONTENT,d=o===`base`?dD.MODAL_BACKDROP:dD.NESTED_MODAL_BACKDROP,f=o===`base`?dD.DROPDOWN_IN_MODAL:dD.DROPDOWN_IN_NESTED_MODAL;return(0,G.jsxs)(mD,{children:[(0,G.jsx)(tD,{}),a&&(0,G.jsx)(gD,{style:{zIndex:d}}),(0,G.jsx)(_D,{className:W(r&&`max-sm:grid-rows-[1fr_auto] max-sm:pt-12`),style:{zIndex:u},children:(0,G.jsxs)(YT,{className:W(`-translate-y-[calc(1.25rem*var(--nested-dialogs))] no-drag pointer-events-auto relative row-start-2 flex max-h-full min-h-0 w-full min-w-0 max-w-lg scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border bg-popover bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg transition-[scale,opacity,translate] duration-150 [transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] will-change-transform before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-95 data-starting-style:scale-95 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]`,r&&`max-sm:rounded-none max-sm:border-x-0 max-sm:border-t max-sm:border-b-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:translate-y-4 max-sm:before:hidden max-sm:before:rounded-none`,e),style:l,"data-slot":`dialog-popup`,...c,children:[(0,G.jsx)(fD.Provider,{value:f,children:t}),n&&(0,G.jsx)(mb,{"aria-label":`Close`,className:`absolute end-3 top-2.5 z-50 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors`,children:(0,G.jsx)(er,{className:`h-4 w-4`})})]})})]})}function yD({className:e,...t}){return(0,G.jsx)(`div`,{className:W(`flex flex-col gap-2 p-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-panel])]:pb-3 max-sm:pb-4`,e),"data-slot":`dialog-header`,...t})}function bD({className:e,variant:t=`default`,...n}){return(0,G.jsx)(`div`,{className:W(`flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]`,t==="default"&&`border-t bg-muted/50 py-4`,t===`bare`&&`in-[[data-slot=dialog-popup]:has([data-slot=dialog-panel])]:pt-3 pt-4 pb-6`,e),"data-slot":`dialog-footer`,...n})}function xD({className:e,...t}){return(0,G.jsx)(cE,{className:W(`font-heading text-xl leading-none`,e),"data-slot":`dialog-title`,...t})}function SD({className:e,...t}){return(0,G.jsx)(yb,{className:W(`text-muted-foreground text-sm`,e),"data-slot":`dialog-description`,...t})}var CD=`px-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-header])]:pt-1 in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-header]))]:pt-6 in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-footer]))]:pb-6! in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-footer].border-t))]:pb-1 pb-6`;function wD({className:e,bare:t=!1,...n}){let r=(0,G.jsx)(`div`,{className:W(CD,e),"data-slot":`dialog-panel`,...n});return t?r:(0,G.jsx)(KE,{className:`!h-auto min-h-0 flex-1`,children:r})}var TD=0;function ED(e){return TD+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${TD}`}var DD=H.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=HS({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,G.jsxs)(H.Fragment,{children:[l,c&&Lo.createPortal(n,c)]})}),OD=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=yx(e,t)||{};if(l==null)return{};let f=Lx(u),p={x:n,y:r},m=Tx(i),h=Cx(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=vx(k,j,A),N=!c.arrow&&xx(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),kD=(e,t)=>({...OD(e),options:[e,t]}),AD={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},jD={sideX:`left`,sideY:`top`},MD=`--available-width`,ND=`--available-height`;function PD(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function FD(e,t,n){let{rects:r,placement:i}=e;return{side:PD(t,bx(i),n),align:xx(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function ID(e){return LD(e,wT)}function LD(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=H.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,O=v?.crossAxis??!1,k=v?.rootBoundary,A=typeof n==`function`?n:void 0,j=Uy(A),M=A?j:n,N=nx(n),P=nx(g),F=AE()===`rtl`,I=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[i],ee=o===`center`?I:`${I}-${o}`,L=l;typeof L==`number`?L={top:L,right:L,bottom:L,left:L}:L&&={top:L.top||0,right:L.right||0,bottom:L.bottom||0,left:L.left||0};let te=+(i===`bottom`),R=+(i===`top`),z=+(i===`right`),ne=+(i===`left`),re={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:L},B=H.useRef(null),ie=nx(a),ae=nx(s),oe=typeof a==`function`?0:a,V=typeof s==`function`?0:s,se=[];p&&se.push(p),se.push(dw(e=>{let t=FD(e,i,F),n=typeof ie.current==`function`?ie.current(t):ie.current,r=typeof ae.current==`function`?ae.current(t):ae.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[oe,V,F,i]));let ce=E===`none`&&T!==`shift`,le=!ce&&(u||O||T===`shift`),ue=T===`none`?null:mw({...re,padding:{top:L.top+1+te,right:L.right+1+ne,bottom:L.bottom+1+R,left:L.left+1+z},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),de=ce?null:fw({...re,rootBoundary:k,mainAxis:E!==`none`,crossAxis:le,limiter:u||O?void 0:pw(e=>{if(!B.current)return{};let{width:t,height:n}=B.current.getBoundingClientRect(),r=wx(bx(e.placement)),i=r===`y`?t:n,a=r===`y`?L.left+L.right:L.top+L.bottom;return{offset:i/2+a/2}})},[re,u,O,k,L,E]);T===`shift`||E===`shift`||o===`center`?se.push(de,ue):se.push(ue,de),se.push(hw({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let i=e.style;i.setProperty(MD,`${t}px`),i.setProperty(ND,`${n}px`);let a=_y(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),kD(e=>({element:B.current||Yy(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=bx(r),l=wx(c),u=B.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(FD(e,i,F)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,le&&l===`y`&&b?S:x),{}}},AD,b),Y(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let fe=H.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:pe,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:Se}=t({rootContext:h,open:m?g:void 0,placement:ee,middleware:se,strategy:r,whileElementsMounted:m?void 0:(...e)=>QC(...e,fe),nodeId:y,externalTree:S}),{sideX:Ce,sideY:we}=_e.adaptiveOrigin||jD,Te=xe?r:`fixed`,Ee=H.useMemo(()=>{let e;return e=xe?b?{position:Te,[Ce]:he,[we]:ge}:{...Se,position:Te}:{position:Te,top:0,left:0},e[MD]=`100vw`,e[ND]=`100vh`,xe||(e.opacity=0),e},[b,Te,Ce,he,we,ge,Se,xe]),De=H.useRef(null);Y(()=>{if(!g)return;let e=N.current,t=typeof e==`function`?e():e,n=(RD(t)?t.current:t)||null;n!==De.current&&(pe.setPositionReference(n),De.current=n)},[g,pe,M,N]),H.useEffect(()=>{if(!g)return;let e=N.current;typeof e!=`function`&&RD(e)&&e.current!==De.current&&(pe.setPositionReference(e.current),De.current=e.current)},[g,pe,M,N]),H.useEffect(()=>{if(m&&g&&me.reference&&me.floating)return QC(me.reference,me.floating,ve,fe)},[m,g,me,ve,fe]);let Oe=bx(ye),ke=PD(i,Oe,F),Ae=xx(ye)||`center`,je=!!_e.hide?.referenceHidden;Y(()=>{x&&g&&xe&&Oe!==I&&w(Oe)},[x,g,xe,Oe,I]);let Me=H.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Ne=_e.arrow?.centerOffset!==0;return H.useMemo(()=>({positionerStyles:Ee,arrowStyles:Me,arrowRef:B,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:pe,context:be,isPositioned:xe,update:ve}),[Ee,Me,B,Ne,ke,Ae,Oe,je,pe,be,xe,ve])}function RD(e){return e!=null&&`current`in e}function zD(e){return e===`starting`?PS:Nr}function BD(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Lr(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},zD(r),i],stateAttributesMapping:fy})}function VD(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||ED(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var HD=VD();function UD(e){let t={error:1e4,warning:1e4,loading:0,success:5e3,info:5e3},n=e.type,r=e.timeout??(n?t[n]:5e3),{actions:i,data:a,...o}=e,s=i?{...a,actions:i}:a;return HD.add({...o,data:s,timeout:r})}var WD=[`agents`,`members`,`chats`];function GD(e){return[...WD.flatMap(t=>e[t].map(e=>({candidate:e,group:t}))),...e.files.map(e=>({candidate:e,group:`files`}))]}function KD(e,t){let n=WD.filter(t=>e[t].length>0);return!t.trim()&&n.length>0?[...n.map(e=>({type:`folder`,id:e})),...e.files.map(e=>({type:`item`,candidate:e,group:`files`}))]:GD(e).map(e=>({type:`item`,candidate:e.candidate,group:e.group}))}function qD(e){return e.map(e=>({...e,kind:`agent-type`,id:e.typeKey,label:e.displayName}))}function JD(e){let t=new Set,n=[];for(let r of e)!r.relativePath||t.has(r.relativePath)||(t.add(r.relativePath),n.push({kind:`file`,id:r.relativePath,label:r.name||r.relativePath.split(`/`).at(-1)||r.relativePath,relativePath:r.relativePath}));return n}function YD(e,t,n,r=[]){let i=e.trim().toLocaleLowerCase(),a=i?t.filter(e=>`${e.label}\n${e.description}\n${e.source}\n${e.typeKey}`.toLocaleLowerCase().includes(i)):[...t],o=i?n.filter(e=>`${e.label}\n${e.relativePath}`.toLocaleLowerCase().includes(i)):[...n],s=i?r.filter(e=>e.label.toLocaleLowerCase().includes(i)):[...r];return{agents:a.filter(e=>e.source!==`bot`),members:a.filter(e=>e.source===`bot`),files:o,chats:s}}function XD(e,t,n=[],r={}){let[i,a]=(0,H.useState)([]),[o,s]=(0,H.useState)([]),c=t!==null,{searchFiles:l,agents:u=!0}=r;return(0,H.useEffect)(()=>{if(!c||!u)return;a([]);let e=!1;return window.electronAPI.agentRegistry.list().then(t=>{let n=j(t);e||a(n?qD(n.candidates):[])}).catch(()=>{e||a([])}),()=>{e=!0}},[c,u]),(0,H.useEffect)(()=>{if(t===null||!e&&!l){s([]);return}let n=!1,r=window.setTimeout(()=>{(l?l(t):window.electronAPI.files.search(e,t)).then(e=>{n||s(JD(e))}).catch(()=>{n||s([])})},150);return()=>{n=!0,window.clearTimeout(r)}},[e,t,l]),(0,H.useMemo)(()=>t===null?{agents:[],members:[],files:[],chats:[]}:YD(t,i,o,n),[i,o,n,t])}var ZD=1024,QD=(e,t)=>e<=(t?ZD:767),$D=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches,eO=()=>typeof window<`u`&&typeof window.innerWidth==`number`&&QD(window.innerWidth,$D()),tO=e=>(window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e));function nO(){return(0,H.useSyncExternalStore)(tO,()=>QD(window.innerWidth,$D()),()=>!1)}var rO=`mod+shift+m`,iO=typeof navigator<`u`&&typeof navigator.platform==`string`?navigator.platform.startsWith(`Mac`):process.platform===`darwin`,aO={"toggle-sidebar":`mod+b`,"toggle-app-mode":`mod+e`,"toggle-side-panel":`mod+j`,"toggle-side-panel-fullscreen":`mod+shift+j`,"open-settings":`mod+,`,"open-secretary":`mod+shift+s`,"switch-model":`mod+.`,"focus-composer":`mod+l`,"send-message":`enter`,"find-in-chat":`mod+f`,"search-workspace":`mod+k`,"new-conversation":`mod+n`,"next-tab":iO?`ctrl+tab`:`mod+tab`,"prev-tab":iO?`ctrl+shift+tab`:`mod+shift+tab`,"new-side-tab":`mod+t`,"new-btw-tab":`mod+shift+b`,"close-side-tab":`mod+w`,"toggle-minimize-to-tray":rO};function oO(e){return{...aO,...e}}function sO(e,t){let n=cO(e);if([`meta`,`control`,`alt`,`shift`].includes(n))return null;let r=iO?e.metaKey:e.ctrlKey,i=iO&&e.ctrlKey;if(!(r||i||e.altKey)&&!(t?.allowBare&&n===`enter`))return null;let a=[];return r&&a.push(`mod`),i&&a.push(`ctrl`),e.altKey&&a.push(`alt`),e.shiftKey&&a.push(`shift`),a.push(n),a.join(`+`)}function cO(e){if(e.key===` `||e.key===`\xA0`)return`space`;if(e.altKey){let t=/^(?:Key([A-Z])|Digit([0-9]))$/.exec(e.code??``);if(t)return(t[1]??t[2]??``).toLowerCase()}return e.key.toLowerCase()}function lO(e){let t=e.split(`+`),n=t.at(-1)??``,r=n.length===1?n.toUpperCase():n.charAt(0).toUpperCase()+n.slice(1);return iO?[t.includes(`ctrl`)?`⌃`:``,t.includes(`alt`)?`⌥`:``,t.includes(`shift`)?`⇧`:``,t.includes(`mod`)?`⌘`:``,r].join(``):[t.includes(`mod`)?`Ctrl`:``,t.includes(`alt`)?`Alt`:``,t.includes(`shift`)?`Shift`:``,r].filter(Boolean).join(`+`)}var uO=new Set,dO=!1;function fO(e,t){t?uO.add(e):uO.delete(e);let n=uO.size>0;n!==dO&&(dO=n,window.electronAPI?.updater?.reportUnsentDraft?.(n))}var pO=[],mO=e=>`/${e.pluginId}:${e.id}`;function hO(e){return pO.find(t=>mO(t)===e)??null}function gO(){return pO}async function _O(e,t){let n=await window.electronAPI.extensionPlugins.call({pluginId:e.pluginId,method:`command.run`,payload:{id:e.id},sessionId:t});return n.ok?null:n.error}var vO=null,yO=new Map;function bO(e){return vO=e,()=>{vO===e&&(vO=null)}}function xO(e){let t=yO.get(e);return yO.delete(e),t}var SO=[],CO=0,wO=new Set;function TO(){return CO}function EO(e){return wO.add(e),()=>wO.delete(e)}function DO(e){return SO.filter(t=>t.slot===`message.action`&&t.position===e)}function OO(e){let t=e===`left`?`composer.left`:`composer.right`;return SO.filter(e=>e.slot===t)}function kO(e,t){return SO.find(n=>n.slot===`tool.card`&&n.pluginId===e&&n.toolName===t)}function AO(){return SO.find(e=>e.slot===`thinking.body`)}function jO(){return SO.find(e=>e.slot===`message.leaf`)}function MO(e,t){let n=t.toLowerCase();return SO.find(t=>t.slot===`block`&&t.pluginId===e&&t.language===n)}var NO=/^[a-z][a-z0-9]*(\.[a-z0-9]+)+$/;function PO(e){if(!e)return null;let t=e.indexOf(`:`);if(t<=0)return null;let n=e.slice(0,t),r=e.slice(t+1);return!NO.test(n)||r.length===0?null:{pluginId:n,lang:r}}function FO({entry:e,props:t}){return(0,H.createElement)(e.component,t)}function IO(){return(0,H.useSyncExternalStore)(EO,TO,TO)}var LO=class extends H.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`[plugin] ${this.props.pluginId} 挂点 ${this.props.slot} 渲染失败`,e)}render(){return this.state.failed?this.props.fallback??null:this.props.children}};function RO({entry:e,props:t,fallback:n}){return(0,G.jsx)(LO,{pluginId:e.pluginId,slot:e.slot,fallback:n,children:(0,G.jsx)(FO,{entry:e,props:t})})}function zO({position:e,text:t,messageIndex:n,sessionId:r}){IO();let i=DO(e);return i.length===0?null:(0,G.jsx)(G.Fragment,{children:i.map(i=>(0,G.jsx)(RO,{entry:i,props:{position:e,text:t,messageIndex:n,sessionId:r}},`${i.pluginId}:${i.uid}`))})}function BO({name:e,output:t,state:n}){IO();let r=x(e);if(!r)return null;let i=kO(r.pluginId,r.toolName);return i?(0,G.jsx)(RO,{entry:i,props:{toolName:r.toolName,output:t,state:n}}):null}var VO=[`t-acc-reveal mt-1 ml-[10px] border-l-2 border-border py-0.5 pl-[19px]`,`text-[13px] leading-relaxed text-muted-foreground whitespace-pre-wrap`].join(` `);function HO({text:e,streaming:t,itemKey:n}){IO();let r=AO();return r?(0,G.jsx)(`div`,{className:VO,children:(0,G.jsx)(RO,{entry:r,props:{text:e,streaming:t,itemKey:n},fallback:e},r.uid)}):(0,G.jsx)(`p`,{className:VO,children:e})}function UO({entry:e,source:t,final:n,messageIndex:r,sessionId:i,Markdown:a}){return(0,G.jsx)(RO,{entry:e,props:{source:t,final:n,messageIndex:r,sessionId:i,Markdown:a}})}function WO({pluginId:e,lang:t,source:n}){IO();let r=MO(e,t);return r?(0,G.jsx)(RO,{entry:r,props:{language:t,source:n}}):null}function GO({side:e,sessionId:t,draft:n,busy:r,pluginPresetId:i}){IO();let a=OO(e);return a.length===0?null:(0,G.jsx)(G.Fragment,{children:a.map(a=>(0,G.jsx)(RO,{entry:a,props:{position:e,sessionId:t,draft:n,busy:r,pluginPresetId:i}},`${a.pluginId}:${a.uid}`))})}var KO=[],qO=new Set;function JO(e){return qO.add(e),()=>qO.delete(e)}var YO=()=>KO,XO={neutral:`text-muted-foreground`,accent:`text-primary`,success:`text-emerald-600 dark:text-emerald-400`,warning:`text-amber-600 dark:text-amber-400`,danger:`text-red-600 dark:text-red-400`};function ZO({sessionId:e}){let t=(0,H.useSyncExternalStore)(JO,YO,YO);return t.length===0?null:(0,G.jsx)(G.Fragment,{children:t.map(t=>{let n=t.command?gO().find(e=>e.pluginId===t.pluginId&&e.id===t.command):void 0,r=W(`shrink-0 truncate px-1 text-[11px]`,XO[t.tone]),i=t.tooltip?`${t.tooltip} · ${t.pluginName}`:t.pluginName;return n?(0,G.jsx)(`button`,{type:`button`,title:i,className:W(r,`rounded hover:bg-accent`),onClick:()=>void _O(n,e).then(e=>{e&&UD({title:e})}),children:t.text},`${t.pluginId}:${t.id}`):(0,G.jsx)(`span`,{title:i,className:r,children:t.text},`${t.pluginId}:${t.id}`)})})}var QO=50,$O=64,ek=120,tk=32768,nk=120,rk=[];function ik(e){return/(?:^|\s)#([^\s#]*)$/.exec(e)?.[1]??null}function ak(e,t,n){if(!Array.isArray(n))return[];let r=[];for(let i of n){if(r.length>=QO)break;if(typeof i!=`object`||!i)continue;let{id:n,label:a,detail:o}=i;typeof n!=`string`||!n||typeof a!=`string`||!a||r.push({key:`${e}:${t}:${n}`,pluginId:e,name:t,item:{id:n.slice(0,200),label:a.slice(0,$O),...typeof o==`string`&&o?{detail:o.slice(0,ek)}:{}}})}return r}function ok(e){let t=typeof e==`string`?e:typeof e==`object`&&e?e.text:null;return typeof t==`string`&&t.length<=tk?t:null}var sk=[],ck=new Set;function lk(e){return ck.add(e),()=>ck.delete(e)}var uk=()=>sk;function dk(e,t){let n=(0,H.useSyncExternalStore)(lk,uk,uk),[r,i]=(0,H.useState)(rk);return(0,H.useEffect)(()=>{if(e===null||n.length===0){i(rk);return}let r=!1,a=setTimeout(()=>{Promise.all(n.map(async({pluginId:n,name:r})=>{let i=await window.electronAPI.extensionPlugins.call({pluginId:n,method:`trigger.candidates`,payload:{name:r,query:e},sessionId:t});return i.ok?ak(n,r,i.value):rk})).then(e=>{r||i(e.flat().slice(0,QO))})},nk);return()=>{r=!0,clearTimeout(a)}},[e,n,t]),e===null?rk:r}async function fk(e,t){let n=await window.electronAPI.extensionPlugins.call({pluginId:e.pluginId,method:`trigger.pick`,payload:{name:e.name,item:e.item},sessionId:t});return n.ok?ok(n.value):null}var pk=null,mk=null,hk=null,gk=null,_k=null,vk=null,yk=null,bk=null;function xk(e){return pk=e,()=>{pk===e&&(pk=null)}}function Sk(e){return hk=e,()=>{hk===e&&(hk=null)}}function Ck(e){return mk=e,()=>{mk===e&&(mk=null)}}function wk(){return hk?(hk(),!0):!1}function Tk(e){return bk=e,()=>{bk===e&&(bk=null)}}function Ek(e){return mk?(mk(e),!0):!1}function Dk(e){return gk=e,()=>{gk===e&&(gk=null)}}function Ok(e){return _k=e,()=>{_k===e&&(_k=null)}}function kk(e){return vk=e,()=>{vk===e&&(vk=null)}}function Ak(e){return yk=e,()=>{yk===e&&(yk=null)}}var jk=`composer-drop`,Mk=/^<unattended>\n([\s\S]*?)\n<\/unattended>(?:\n\n|$)/;function Nk(e){let t=Mk.exec(e);return t?{note:/unattended mode is off/i.test(t[1])?`off`:`on`,rest:e.slice(t[0].length)}:{rest:e}}var Pk=`background-tasks-wrap-up`,Fk=RegExp(`^<${Pk}>\\n[\\s\\S]*?\\n</${Pk}>(?:\\n\\n|$)`),Ik=/^- (\S+?): (.*?)(?: \(running ([^()]+)\))?$/;function Lk(e){let t=[];for(let n of e.split(`
|
|
167
|
-
`)){let e=Ik.exec(n);e?.[1]&&t.push({taskId:e[1],command:e[2]??``,...e[3]?{ran:e[3]}:{}})}return t}function Rk(e){let t=Fk.exec(e);return t?{items:Lk(t[0]),rest:e.slice(t[0].length)}:null}function zk(e){let t=e,n,r,i;for(;;){let a=n?{rest:t}:D(t);if(a.note){n=a.note,t=a.rest;continue}let o=i?null:Rk(t);if(o){let n=e.length-t.length;i={items:o.items,start:n,end:n+t.length-o.rest.length},t=o.rest;continue}let s=r?{rest:t}:Nk(t);if(!s.note)break;r=s.note,t=s.rest}return{...n?{plan:n}:{},...r?{unattended:r}:{},wrapUp:i,rest:t}}function Bk(e){let{plan:t,unattended:n,rest:r}=zk(e);return{...t?{plan:t}:{},...n?{unattended:n}:{},rest:r}}function Vk(e){let t=zk(e).wrapUp;return t?{items:t.items}:void 0}function Hk(e){let t=zk(e).wrapUp;return t?e.slice(0,t.start)+e.slice(t.end):e}var Uk=/^\/skill:(\S+)(?:\s+|$)/,Wk=/^<skill name="([^"]+)" location="([^"]*)">\n([\s\S]*?)\n<\/skill>(?:\n\n|$)/;function Gk(e){let t=[],n=e;for(let e=Uk.exec(n);e;e=Uk.exec(n))t.push(e[1]),n=n.slice(e[0].length);return{names:t,rest:t.length>0?n.trim():e}}function Kk(e){let t=[],n=e;for(let e=Wk.exec(n);e;e=Wk.exec(n))t.push({name:e[1],location:e[2],body:e[3]}),n=n.slice(e[0].length);return t.length>0?{skills:t,rest:n.trim()}:null}function qk(e){return e.startsWith(`/skill:`)?`skill`:e===`/goal`?`goal`:`command`}function Jk(e){return e.startsWith(`/skill:`)?e.slice(7):e.replace(/^\//,``)}function Yk(e){let t=/^\/skill:(\S+)(?:\s+([\s\S]*))?$/.exec(e);if(t)return{slash:`/skill:${t[1]}`,rest:t[2]??``};let n=/^\/([A-Za-z][\w:-]*)(?:\s+([\s\S]*))?$/.exec(e);return n?{slash:`/${n[1]}`,rest:n[2]??``}:{slash:null,rest:e}}var Xk={skill:zn,goal:Kn,command:Hn},Zk={skill:`bg-info/15 text-info`,goal:`bg-warning/25 text-warning-foreground dark:bg-warning/15 dark:text-warning`,command:`bg-foreground/10 text-foreground`};function Qk(e,t=!1){return W(`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 align-middle text-xs font-medium`,Zk[e],t&&e===`skill`&&`hover:bg-info/25`,t&&e===`goal`&&`hover:bg-warning/35 dark:hover:bg-warning/25`,t&&e===`command`&&`hover:bg-foreground/15`)}function $k({name:e,className:t,interactive:n=!1,trailing:r}){let i=qk(e),a=Xk[i];return(0,G.jsxs)(`span`,{className:W(Qk(i,n),t),children:[(0,G.jsx)(a,{className:`h-3 w-3`}),Jk(e),r]})}var eA=e=>e.startsWith(`/skill:`);function tA(e,t){return!eA(t)||!e.every(eA)?[t]:e.includes(t)?[...e]:[...e,t]}function nA(e){let t=Gk(e);if(t.names.length>0)return{slashes:t.names.map(e=>`/skill:${e}`),rest:t.rest};let n=Yk(e);return{slashes:n.slash?[n.slash]:[],rest:n.rest}}function rA(e,t,n=!1){let r=e.segments.some(e=>e.type!==`text`||e.text.length>0);if(n&&(r||e.slashes.length>0))return{slashes:e.slashes,segments:[...e.segments,...t.text?[{type:`text`,text:`${r?`
|
|
168
|
-
|
|
169
|
-
`:``}${t.text}`}]:[]],images:[...e.images,...t.images??[]]};let i=nA(t.text??``);return{slashes:i.slashes,segments:i.rest?[{type:`text`,text:i.rest}]:[],images:[...n?e.images:[],...t.images??[]]}}var iA={"agent-type":`bg-purple-500/15 text-purple-600 dark:text-purple-400`,file:`bg-success/15 text-success`,chat:`bg-warning/25 text-warning-foreground dark:bg-warning/15 dark:text-warning`,"ui-element":`bg-purple-500/15 text-purple-600 dark:text-purple-400`};function aA(e){return W(`inline-flex max-w-52 items-center gap-1 rounded-md px-1.5 py-0.5 align-middle text-xs font-medium`,iA[e])}function oA({label:e,onRemove:t}){return(0,G.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-sm opacity-70 transition-opacity hover:opacity-100`,"aria-label":e,children:(0,G.jsx)(er,{className:`h-3 w-3`})})}function sA({recipient:e,onRemove:t}){let{t:n}=K();return(0,G.jsxs)(`span`,{className:W(aA(`agent-type`),`mt-0.5 shrink-0`),children:[(0,G.jsx)(ut,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate`,children:e.label}),(0,G.jsx)(oA,{label:n(`Remove Agent recipient`),onRemove:t}),(0,G.jsx)(`span`,{className:`sr-only`,children:e.typeKey})]})}var cA=[{name:`blue`,rgb:[58,150,221],cssVar:`--cursor-blue`},{name:`purple`,rgb:[155,89,182],cssVar:`--cursor-purple`},{name:`green`,rgb:[39,174,96],cssVar:`--cursor-green`},{name:`orange`,rgb:[242,153,74],cssVar:`--cursor-orange`},{name:`cyan`,rgb:[0,184,169],cssVar:`--cursor-cyan`},{name:`magenta`,rgb:[219,68,134],cssVar:`--cursor-magenta`},{name:`red`,rgb:[235,87,87],cssVar:`--cursor-red`},{name:`yellow`,rgb:[170,175,18],cssVar:`--cursor-yellow`}];cA.map(e=>e.name);function lA(e,t){return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`}cA.map(({rgb:e})=>({fill:lA(e,.04),stroke:lA(e,.5),scribbleStroke:lA(e,.92)})),cA.map(({rgb:e})=>({border:lA(e,1),bg:lA(e,.1),hoverBorder:lA(e,.3),hoverBg:lA(e,.02)}));var{PI:uA}=Math;uA+1e-4;var dA=`CSS edits — `;RegExp(`^${dA}.*$`,`m`),RegExp(`^${dA}`,`gm`);var fA=/\n*```browser_element\n[\s\S]*?```(?=\n|$)/g;function pA(e){return e.replace(fA,``).trimEnd()}var mA=/^<workflow-preset name="([^"]*)">\n(\{.*\})\n<\/workflow-preset>(?:\n\n[\s\S]*)?$/,hA=e=>e.replace(/&(amp|quot|lt|gt);/g,e=>e===`&`?`&`:e===`"`?`"`:e===`<`?`<`:`>`);function gA(e){let t=mA.exec(e);if(!t)return null;let n;try{n=JSON.parse(t[2]??``)}catch{return null}if(!n||typeof n!=`object`||Array.isArray(n))return null;let{preset:r,args:i={}}=n;if(typeof r!=`string`||!r||!i||typeof i!=`object`||Array.isArray(i))return null;let a=Object.entries(i);return a.some(([,e])=>typeof e!=`string`)?null:{id:r,name:hA(t[1]??``),args:a}}var _A=/\[Referenced past chat "(.+?)" — transcript file: (.+?) \(pi session jsonl; read it if relevant\)\]/g,vA=/\[Selected UI element "([^"]*)" — path: (.*?); text: (.*?)\]/g;function yA(e,t){for(let n=t-1;n>=0;n--){let r=e[n];if(r===`@`){let r=n>0?e[n-1]:` `;return r===` `||r===`
|
|
170
|
-
`?e.slice(n+1,t):null}if(r===` `||r===`
|
|
171
|
-
`)return null}return null}function bA(e){let t=Math.max(0,e.containerWidth-e.popupWidth),n=Math.min(Math.max(0,e.anchorLeft),t);return{left:n,flyoutSide:e.containerWidth-n-e.popupWidth-e.flyoutGap>=e.flyoutWidth?`right`:`left`}}function xA(e){if(e.isComposing||e.itemCount===0)return{type:`none`};let t=e.key===`Enter`&&!e.shiftKey||e.key===`Tab`;if(e.folderOpen){if(e.key===`Escape`||e.key===`ArrowLeft`)return{type:`close-folder`};let n=e.folderItemCount??0;if(n===0)return{type:`none`};let r=e.folderIndex??0;return e.key===`ArrowDown`?{type:`move-folder`,index:(r+1)%n}:e.key===`ArrowUp`?{type:`move-folder`,index:(r-1+n)%n}:t?{type:`pick`}:{type:`none`}}return e.activeIsFolder&&(e.key===`ArrowRight`||t)?{type:`open-folder`}:e.key===`ArrowDown`?{type:`move`,index:(e.activeIndex+1)%e.itemCount}:e.key===`ArrowUp`?{type:`move`,index:(e.activeIndex-1+e.itemCount)%e.itemCount}:t?{type:`pick`}:e.key===`Escape`?{type:`close`}:{type:`none`}}function SA(e,t){return`[Referenced past chat "${e.replace(/["[\]\n]/g,` `).replace(/\s+/g,` `).trim()||`untitled`}" — transcript file: ${t} (pi session jsonl; read it if relevant)]`}var CA=/^\[Referenced past chat "(.+)" — transcript file: (.+) \(pi session jsonl; read it if relevant\)\]$/,wA=/^@(\S.*)$/;function TA(e){return e.map(e=>e.type===`text`?e.text:e.type===`file`?/\s/.test(e.path)&&!e.path.includes(`"`)?`@"${e.path}"`:`@${e.path}`:e.type===`chat`?SA(e.label,e.sessionFile):xv(e)).join(``)}function EA(e,t){_A.lastIndex=t,vA.lastIndex=t;let n=_A.exec(e),r=vA.exec(e),i=n?{index:n.index,length:n[0].length,segment:{type:`chat`,label:n[1],sessionFile:n[2]}}:null,a=r?Cv(r[0]):null,o=r&&a?{index:r.index,length:r[0].length,segment:{type:`ui-element`,id:``,...a,imageId:``}}:null;return i&&o?i.index<=o.index?i:o:i??o}function DA(e){let t=[],n=0,r=EA(e,0);for(;r;){let i=e.slice(n,r.index);for(let e of NA(i))(e.type!==`text`||e.text!==``)&&t.push(e);t.push(r.segment),n=r.index+r.length,r=EA(e,n)}let i=e.slice(n);if(i||t.length===0)for(let e of NA(i))e.type===`text`&&e.text===``&&t.length>0||t.push(e);return t}var OA=/^(?:[A-Za-z]:[\\/])?(?:[\p{L}\p{N}_./\\-]*\.[\w-]{1,16}(?:#L\d+(?:-L\d+)?)?|[\p{L}\p{N}_./\\-]+[\\/])$/u,kA=/^"([^"\n]*(?:\.[\w-]{1,16}(?:#L\d+(?:-L\d+)?)?|[\\/]))"/,AA=/#L\d+(?:-L\d+)?$/;function jA(e){return e.replace(AA,``)}function MA(e){return e.replace(/[\\/]+$/,``).split(/[\\/]/).filter(Boolean).at(-1)||e}function NA(e){return Ov(e).flatMap(e=>e.type===`file`?[e]:PA(e.text))}function PA(e){let t=[],n=``,r=0;for(;r<e.length;){let i=e.indexOf(`@`,r);if(i===-1){n+=e.slice(r);break}let a=i>0?e[i-1]:` `,o=a===` `||a===`
|
|
172
|
-
`?kA.exec(e.slice(i+1)):null;if(o){n+=e.slice(r,i),n&&=(t.push({type:`text`,text:n}),``),t.push({type:`file`,path:o[1]}),r=i+1+o[0].length;continue}let s=(/^\S*/.exec(e.slice(i+1))?.[0]??``).replace(/[),.;!?]+$/,``);(a===` `||a===`
|
|
173
|
-
`)&&s&&OA.test(s)?(n+=e.slice(r,i),n&&=(t.push({type:`text`,text:n}),``),t.push({type:`file`,path:s}),r=i+1+s.length):(n+=e.slice(r,i+1),r=i+1)}return n&&t.push({type:`text`,text:n}),t.length>0?t:[{type:`text`,text:e}]}function FA(e){let t={body:e,files:[],chats:[]},n=e.split(`
|
|
174
|
-
`),r=[],i=[],a=n.length-1;for(;a>=0;a--){let e=n[a],t=CA.exec(e);if(t){i.unshift({label:t[1],sessionFile:t[2]});continue}if(wA.test(e)){r.unshift(e.slice(1));continue}break}return r.length+i.length===0||a<0||n[a].trim()!==``?t:{body:n.slice(0,a).join(`
|
|
175
|
-
`).trimEnd(),files:r,chats:i}}function IA(e){let t=TA(e.segments).trim(),n=e.segments.filter(e=>e.type!==`text`).map(e=>e.type===`file`?{kind:`file`,id:e.path,label:MA(e.path),relativePath:jA(e.path)}:e.type===`chat`?{kind:`chat`,id:e.conversationId??e.sessionFile,label:e.label,sessionFile:e.sessionFile}:{kind:`ui-element`,id:e.id,label:e.label,path:e.path,text:e.text,imageId:e.imageId});e.recipient&&n.push(e.recipient);let r=e.slashes.join(` `);return{text:r?t?`${r} ${t}`:r:t,images:e.images.map(({data:e,mimeType:t})=>({data:e,mimeType:t})),mentions:n,...e.recipient?{recipient:e.recipient}:{}}}function LA(e,t){return/(?:^|\s)\$([^\s$]*)$/.exec(e.slice(0,t))?.[1]??null}function RA(e){let t=new Set,n=[];for(let r of e){let e=r.name.trim().toLowerCase();!e||t.has(e)||(t.add(e),n.push(r))}return n}function zA(e,t,n){let r=n??t;if(r===null)return[];let i=r.toLowerCase();return RA(e.filter(e=>n===null?e.name.toLowerCase().includes(i):e.name.startsWith(`/skill:`)&&e.name.slice(7).toLowerCase().includes(i))).slice(0,10)}var BA={file:`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/></svg>`,chat:`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M12 7v5l4 2"/></svg>`,"ui-element":`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 3a2 2 0 0 0-2 2"/><path d="M19 3a2 2 0 0 1 2 2"/><path d="M21 19a2 2 0 0 1-2 2"/><path d="M5 21a2 2 0 0 1-2-2"/><path d="M9 3h1"/><path d="M9 21h1"/><path d="M14 3h1"/><path d="M14 21h1"/><path d="M3 9v1"/><path d="M21 9v1"/><path d="M3 14v1"/><path d="M21 14v1"/></svg>`},VA=`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/></svg>`,HA={file:`bg-success/15 text-success`,chat:`bg-warning/25 text-warning-foreground dark:bg-warning/15 dark:text-warning`,"ui-element":`bg-purple-500/15 text-purple-600 dark:text-purple-400`};function UA(e){let t=document.createElement(`span`);t.contentEditable=`false`,t.dataset.mentionKind=e.type,e.type===`file`?(t.dataset.path=e.path,e.label&&(t.dataset.label=e.label),t.title=e.path):e.type===`chat`?(t.dataset.label=e.label,t.dataset.sessionFile=e.sessionFile,e.conversationId&&(t.dataset.conversationId=e.conversationId)):(t.dataset.id=e.id,t.dataset.label=e.label,t.dataset.path=e.path,t.dataset.text=e.text,t.dataset.imageId=e.imageId,t.title=`${e.path}${e.text?` · ${e.text}`:``}`),t.className=W(`mx-0.5 inline-flex max-w-52 items-center gap-1 rounded-md px-1.5 py-0.5 align-middle text-xs font-medium leading-4 select-none`,HA[e.type]);let n=document.createElement(`span`);n.className=`shrink-0 inline-flex`,n.innerHTML=e.type===`file`&&/[\\/]$/.test(e.path)?VA:BA[e.type],t.appendChild(n);let r=document.createElement(`span`);return r.className=`truncate`,r.textContent=e.type===`file`?e.label??MA(e.path):e.label,t.appendChild(r),t}function WA(e){return e.dataset.mentionKind===`file`&&e.dataset.path?{type:`file`,path:e.dataset.path,...e.dataset.label?{label:e.dataset.label}:{}}:e.dataset.mentionKind===`chat`&&e.dataset.label&&e.dataset.sessionFile?{type:`chat`,label:e.dataset.label,sessionFile:e.dataset.sessionFile,...e.dataset.conversationId?{conversationId:e.dataset.conversationId}:{}}:e.dataset.mentionKind===`ui-element`&&e.dataset.label&&e.dataset.path&&e.dataset.text?{type:`ui-element`,id:e.dataset.id??``,label:e.dataset.label,path:e.dataset.path,text:e.dataset.text,imageId:e.dataset.imageId??``}:null}function GA(e){let t=[],n=e=>{if(!e)return;let n=t.at(-1);n?.type===`text`?n.text+=e:t.push({type:`text`,text:e})},r=e=>{if(e.nodeType===Node.TEXT_NODE){n(e.textContent??``);return}if(e instanceof HTMLElement){if(e.dataset.mentionKind){let n=WA(e);n&&t.push(n);return}if(e.tagName===`BR`){n(`
|
|
176
|
-
`);return}(e.tagName===`DIV`||e.tagName===`P`)&&t.length>0&&n(`
|
|
177
|
-
`);for(let t of e.childNodes)r(t)}};for(let t of e.childNodes)r(t);return t}function KA(e){let t=window.getSelection();if(!t||t.rangeCount===0||!t.isCollapsed)return null;let{anchorNode:n,anchorOffset:r}=t;return!n||!e.contains(n)||n.nodeType!==Node.TEXT_NODE?null:{node:n,offset:r}}function qA(e,t){if(t.rangeCount===0||!t.isCollapsed)return null;let{anchorNode:n,anchorOffset:r}=t;if(!n||n.nodeType===Node.TEXT_NODE||n!==e&&!e.contains(n))return null;let i=n.childNodes,a=i[r],o=r>0?i[r-1]:void 0,s=a?.nodeType===Node.TEXT_NODE?{node:a,offset:0}:o?.nodeType===Node.TEXT_NODE?{node:o,offset:o.length}:null;if(!s)return null;let c=document.createRange();return c.setStart(s.node,s.offset),c.collapse(!0),c}function JA(e){return e instanceof HTMLElement&&!!e.dataset.mentionKind}function YA(e){return e instanceof Text&&!/[^\s\u00a0]/.test(e.textContent??``)}function XA(e,t){let n=window.getSelection();if(!n||n.rangeCount===0||!n.isCollapsed)return null;let{anchorNode:r,anchorOffset:i}=n;if(!r||!e.contains(r))return null;if(r.nodeType===Node.TEXT_NODE){let e=r.textContent??``;if(t===`before`){if(/[^\s\u00a0]/.test(e.slice(0,i)))return null;let t=r.previousSibling;for(;YA(t);)t=t.previousSibling;return JA(t)?t:null}if(/[^\s\u00a0]/.test(e.slice(i)))return null;let n=r.nextSibling;for(;YA(n);)n=n.nextSibling;return JA(n)?n:null}let a=r.childNodes;if(t===`before`){let e=i-1;for(;e>=0&&YA(a[e]);)--e;let t=e>=0?a[e]:null;return JA(t)?t:null}let o=i;for(;o<a.length&&YA(a[o]);)o+=1;let s=a[o];return JA(s)?s:null}function ZA(e,t){let n=e.nextSibling;YA(n)&&n.remove();let r=e.previousSibling;if(e.remove(),r){QA(r);return}let i=window.getSelection();if(!i)return;let a=document.createRange();a.setStart(t,0),a.collapse(!0),i.removeAllRanges(),i.addRange(a)}function QA(e){let t=window.getSelection();if(!t)return;let n=document.createRange();n.setStartAfter(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}var $A=(0,H.forwardRef)(function({placeholder:e,disabled:t,className:n,onStateChange:r,onKeyDown:i,onPaste:a,onPasteText:o,onCompositionStart:s,onCompositionEnd:c,onChipActivate:l,ariaProps:u},d){let f=(0,H.useRef)(null),p=(0,H.useRef)(null);(0,H.useEffect)(()=>{let e=()=>{let e=f.current;if(!e||document.activeElement!==e)return;let t=window.getSelection();if(!t||t.rangeCount===0||!t.isCollapsed)return;let n=t.anchorNode;if(n&&(n===e||e.contains(n))){let r=qA(e,t);r?(t.removeAllRanges(),t.addRange(r)):n.nodeType===Node.TEXT_NODE&&(p.current={node:n,offset:t.anchorOffset});return}let r=p.current,i=document.createRange();r?.node.isConnected&&e.contains(r.node)?(i.setStart(r.node,Math.min(r.offset,r.node.length)),i.collapse(!0)):(i.selectNodeContents(e),i.collapse(!0)),t.removeAllRanges(),t.addRange(i)};return document.addEventListener(`selectionchange`,e),()=>document.removeEventListener(`selectionchange`,e)},[]);let m=(0,H.useCallback)(()=>{let e=f.current;if(!e)return;let t=GA(e),n=t.map(e=>e.type===`text`?e.text:``).join(``),i=t.some(e=>e.type!==`text`),a=null,o=null,s=null,c=null,l=KA(e);if(l){let t=l.node.textContent?.slice(0,l.offset)??``;a=yA(t,t.length),a===null&&(s=LA(t,t.length)),a===null&&s===null&&(c=ik(t)),a===null&&l.node===e.firstChild&&/^\/[^\s]*$/.test(t)&&(o=t.slice(1))}r({plainText:n,hasMentions:i,segments:t,mentionQuery:a,slashQuery:o,skillQuery:s,pluginQuery:c})},[r]),h=(0,H.useCallback)(e=>{let t=f.current;if(!t)return null;let n=KA(t);if(!n)return null;let r=n.node.textContent?.slice(0,n.offset)??``;if(e===`#`){let e=ik(r);return e===null?null:{node:n.node,start:r.length-e.length-1,end:n.offset}}if(e===`@`||e===`$`){let t=e===`@`?yA(r,r.length):LA(r,r.length);return t===null?null:{node:n.node,start:r.length-t.length-1,end:n.offset}}return n.node!==t.firstChild||!/^\/[^\s]*$/.test(r)?null:{node:n.node,start:0,end:n.offset}},[]),g=(0,H.useCallback)((e,t)=>{let n=f.current;if(!n)return;n.focus();let r=document.createRange(),i=t?h(`@`):null;if(i)r.setStart(i.node,i.start),r.setEnd(i.node,i.end),r.deleteContents();else{let e=KA(n);e?(r.setStart(e.node,e.offset),r.collapse(!0)):(r.selectNodeContents(n),r.collapse(!1))}let a=e();r.insertNode(a);let o=document.createTextNode(`\xA0`);a.parentNode?.insertBefore(o,a.nextSibling),QA(o),m()},[h,m]);return(0,H.useImperativeHandle)(d,()=>({focus:()=>f.current?.focus(),isEmpty:()=>{let e=f.current;return!e||!GA(e).some(e=>e.type!==`text`||e.text.trim().length>0)},getSegments:()=>f.current?GA(f.current):[],setSegments:e=>{let t=f.current;if(t){t.textContent=``;for(let n of e)n.type===`text`?t.appendChild(document.createTextNode(n.text)):t.appendChild(UA(n));m()}},clear:()=>{let e=f.current;e&&(e.textContent=``,m())},insertMention:e=>{let t=e.kind===`file`?{type:`file`,path:e.relativePath}:e.kind===`chat`?{type:`chat`,label:e.label,sessionFile:e.sessionFile,conversationId:e.id}:{type:`ui-element`,id:e.id,label:e.label,path:e.path,text:e.text,imageId:e.imageId};g(()=>UA(t),e.kind!==`ui-element`)},consumeToken:e=>{let t=h(e);if(!t)return;let n=document.createRange();n.setStart(t.node,t.start),n.setEnd(t.node,t.end),n.deleteContents(),m()},insertFileChip:(e,t)=>{g(()=>UA({type:`file`,path:e,...t?{label:t}:{}}),!1)},insertText:e=>{g(()=>document.createTextNode(e),!1)},getMentionAnchorRect:()=>{let e=h(`@`);if(!e)return null;let t=document.createRange();return t.setStart(e.node,e.start),t.setEnd(e.node,Math.min(e.start+1,e.node.length)),t.getBoundingClientRect()}}),[h,m,g]),(0,G.jsx)(`div`,{ref:f,contentEditable:!t,role:u?.role??`textbox`,"aria-placeholder":e,"data-placeholder":e,...u,onInput:m,onKeyDown:e=>{if(!e.nativeEvent.isComposing&&(e.key===`Backspace`||e.key===`Delete`)){let t=f.current,n=t&&XA(t,e.key===`Backspace`?`before`:`after`);if(n&&t){e.preventDefault(),ZA(n,t),m();return}}i(e)},onClick:e=>{if(!l)return;let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-mention-kind]`);if(!(n instanceof HTMLElement)||!f.current?.contains(n))return;let r=WA(n);r&&l(r)},onKeyUp:e=>{e.key!==`Escape`&&m()},onMouseUp:m,onPaste:e=>{if(e.clipboardData.files.length>0){a(e);return}e.preventDefault();let t=e.clipboardData.getData(`text/plain`);t&&(o?.(t)||document.execCommand(`insertText`,!1,t))},onCompositionStart:s,onCompositionEnd:()=>{c(),m()},className:W(`max-h-40 min-h-10 min-w-0 flex-1 overflow-y-auto pt-0.5 text-sm break-words whitespace-pre-wrap outline-none`,`empty:before:pointer-events-none empty:before:text-muted-foreground empty:before:content-[attr(data-placeholder)]`,t&&`opacity-60`,n)})}),ej=Jr(`relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button,a&]:cursor-pointer [button,a&]:pointer-coarse:after:absolute [button,a&]:pointer-coarse:after:size-full [button,a&]:pointer-coarse:after:min-h-11 [button,a&]:pointer-coarse:after:min-w-11`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-5.5 min-w-5.5 px-[calc(--spacing(1)-1px)] text-sm sm:h-4.5 sm:min-w-4.5 sm:text-xs`,lg:`h-6.5 min-w-6.5 px-[calc(--spacing(1.5)-1px)] text-base sm:h-5.5 sm:min-w-5.5 sm:text-sm`,sm:`h-5 min-w-5 rounded-[calc(var(--radius-sm)-2px)] px-[calc(--spacing(1)-1px)] text-xs sm:h-4 sm:min-w-4 sm:text-[.625rem]`},variant:{default:`bg-primary text-primary-foreground [button,a&]:hover:bg-primary/90`,destructive:`bg-destructive text-white [button,a&]:hover:bg-destructive/90`,error:`bg-destructive/12 text-destructive dark:bg-destructive/16`,info:`bg-info/12 text-info dark:bg-info/16`,outline:`border-border bg-transparent dark:bg-input/32 [button,a&]:hover:bg-accent/50 dark:[button,a&]:hover:bg-input/48`,secondary:`bg-secondary text-secondary-foreground [button,a&]:hover:bg-secondary/90`,success:`bg-success/12 text-success dark:bg-success/16`,warning:`bg-warning/12 text-warning-foreground dark:bg-warning/16`}}});function tj({className:e,variant:t,size:n,render:r,...i}){return Ur({defaultTagName:`span`,props:ir({className:W(ej({className:e,size:n,variant:t})),"data-slot":`badge`},i),render:r})}var nj=/[\\/]/;function rj(e){return e.split(nj).filter(e=>e.length>0)}function ij(e){let t=new Map,n=e.map(rj),r=n.map(e=>e.join(`/`));for(let i=0;i<e.length;i++){let a=e[i],o=n[i]??[],s=Math.max(0,o.length-3);for(;s>0;){let e=o.slice(s).join(`/`);if(!r.some(t=>t!==r[i]&&(t===e||t.endsWith(`/${e}`))))break;s--}let c=o.slice(s).join(`/`);t.set(a,s>0?`…/${c}`:c)}return t}function aj({groups:e,query:t,activeIndex:n,onActiveIndexChange:r,openFolderId:i,folderIndex:a,onOpenFolderIdChange:o,onFolderIndexChange:s,onSelect:c,id:l=`composer-mention-picker`,left:u=0,flyoutSide:d=`right`}){let{t:f}=K(),p=nO(),m=(0,H.useMemo)(()=>KD(e,t),[e,t]),h=(0,H.useMemo)(()=>ij(e.files.map(e=>e.relativePath)),[e.files]),g=(0,H.useRef)(new Map),_=(0,H.useRef)(new Map),v=m[0]?.type===`folder`;if((0,H.useEffect)(()=>{g.current.get(n)?.scrollIntoView({block:`nearest`})},[n]),(0,H.useEffect)(()=>{i&&_.current.get(a)?.scrollIntoView({block:`nearest`})},[i,a]),m.length===0)return null;let y={agents:f(`Agents`),members:f(`Members`),chats:f(`Chats`)},b={agents:ut,members:Zn,chats:On},x=i?e[i]:[],S=0,C=()=>x.map((e,t)=>(0,G.jsx)(oj,{ref:e=>{e?_.current.set(t,e):_.current.delete(t)},id:`${l}-sub-${t}`,candidate:e,active:t===a,onHover:()=>s(t),onSelect:()=>c(e)},`sub:${e.id}`)),w=!!(p&&i&&x.length>0),T=e=>(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,"data-slot":`mention-sheet-back`,onClick:()=>o(null),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs`,children:[(0,G.jsx)(_t,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 font-medium`,children:y[e]})]}),C()]}),E=(t,i)=>{let a=e[t];if(a.length===0)return null;let s=t===`files`?f(`Files`):y[t];return(0,G.jsxs)(`div`,{role:`group`,"aria-label":s,children:[(0,G.jsx)(`p`,{className:W(`px-2 pb-1 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,i?`pt-2`:`pt-1.5`),children:s}),a.map(e=>{let i=S++;return(0,G.jsx)(oj,{ref:e=>{e?g.current.set(i,e):g.current.delete(i)},id:`${l}-option-${i}`,candidate:e,active:i===n,pathLabel:e.kind===`file`?h.get(e.relativePath):void 0,onHover:()=>{r(i),v&&o(null)},onSelect:()=>c(e)},`${t}:${e.id}`)})]})};return(0,G.jsxs)(`div`,{"data-slot":`mention-picker`,className:p?`absolute inset-x-0 bottom-full z-10 mb-1.5 w-full`:`absolute bottom-full z-10 mb-1.5 max-w-full`,style:p?void 0:{left:u},children:[(0,G.jsx)(`div`,{id:l,role:`listbox`,"aria-label":f(`Mention suggestions`),className:p?`max-h-[50dvh] w-full overflow-y-auto rounded-lg border bg-popover p-1 shadow-md`:`max-h-72 w-80 max-w-full overflow-y-auto rounded-lg border bg-popover p-1 shadow-md`,children:w&&i?T(i):v?(0,G.jsxs)(G.Fragment,{children:[m.filter(e=>e.type===`folder`).map(e=>{let t=S++,a=b[e.id];return(0,G.jsxs)(`button`,{ref:e=>{e?g.current.set(t,e):g.current.delete(t)},id:`${l}-option-${t}`,type:`button`,role:`option`,"aria-selected":n===t,onClick:()=>{r(t),o(e.id),s(0)},onMouseMove:()=>{r(t),!p&&i!==e.id&&(o(e.id),s(0))},className:W(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs`,n===t&&`bg-foreground/10`),children:[(0,G.jsx)(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md border bg-background`,children:(0,G.jsx)(a,{className:`h-3.5 w-3.5 text-muted-foreground`})}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 font-medium`,children:y[e.id]}),(0,G.jsx)(gt,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`})]},`folder:${e.id}`)}),E(`files`,!0)]}):(0,G.jsxs)(G.Fragment,{children:[E(`agents`,!1),E(`members`,e.agents.length>0),E(`chats`,e.agents.length+e.members.length>0),E(`files`,e.agents.length+e.members.length+e.chats.length>0)]})}),!p&&i&&x.length>0&&(0,G.jsx)(`div`,{role:`listbox`,"aria-label":y[i],"data-slot":`mention-flyout`,className:W(`absolute top-0 z-20 max-h-72 w-72 overflow-y-auto rounded-lg border bg-popover p-1 shadow-md`,d===`right`?`left-full ml-1`:`right-full mr-1`),children:C()})]})}function oj({ref:e,id:t,candidate:n,active:r,pathLabel:i,onHover:a,onSelect:o}){let{t:s}=K(),c=sj(n),l=n.kind===`agent-type`?n.source===`bot`?Zn:ut:n.kind===`chat`?On:c?Wt:Bt;return(0,G.jsxs)(`button`,{ref:e,id:t,type:`button`,role:`option`,"aria-selected":r,onClick:o,onMouseMove:a,className:W(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs`,r&&`bg-foreground/10`),children:[(0,G.jsx)(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md border bg-background`,children:(0,G.jsx)(l,{className:`h-3.5 w-3.5 text-muted-foreground`})}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`shrink-0 font-medium`,children:n.label}),(0,G.jsx)(tj,{variant:`outline`,className:`px-1 py-0 text-[9px]`,children:n.kind===`agent-type`?s(n.source===`system`?`System`:n.source===`builtin`?`Built-in`:n.source===`bot`?`Member`:`Custom`):n.kind===`chat`?s(`Chat`):s(c?`Folder`:`File`)}),n.kind===`agent-type`&&n.locked&&(0,G.jsx)(tj,{variant:`secondary`,className:`px-1 py-0 text-[9px]`,children:s(`Locked`)})]}),(0,G.jsx)(`span`,{className:W(`block text-muted-foreground`,n.kind===`file`?`whitespace-normal break-all`:`truncate`),title:n.kind===`file`?n.relativePath:void 0,children:n.kind===`agent-type`?n.source===`bot`?n.description:s(n.description):n.kind===`chat`?n.sessionFile.split(`/`).at(-1):n.kind===`file`?i??n.relativePath:n.path})]})]})}function sj(e){return e.kind===`file`&&/[\\/]$/.test(e.relativePath)}function cj(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function lj(e){return typeof e==`string`&&zo.includes(e)}function uj(e){return typeof e==`string`&&Bo.includes(e)}function dj(e){if(!e)return{};let t={};lj(e.reasoning)&&(t.reasoning=e.reasoning),uj(e.thinkingLevel)&&(t.thinkingLevel=e.thinkingLevel);let n=cj(e.contextWindow);n!==void 0&&(t.contextWindow=n);let r=cj(e.maxTokens);return r!==void 0&&(t.maxTokens=r),t}var fj=`enso-virtual`;function pj(e){return e?.providerId===fj}function mj(e,t){if(!(!t||!pj(t)))return e?.find(e=>e.id===t.modelId)}function hj(e,t){return e?.find(e=>e.id===t)?.name??t}new Set(Object.values({"openrouter.ai":`openrouter`,"opencode.ai":`opencode`,"ai-gateway.vercel.sh":`vercel-ai-gateway`,"api.typesafe.ai":`typesafe`}));function gj(e,t){if(e===void 0)return t.map(e=>({...e}));let n=new Map(t.map(e=>[e.id,e])),r=[];for(let t of e){let e=n.get(t.id);n.delete(t.id);let i={id:t.id};t.label!==void 0&&(i.label=t.label),e&&(e.label!==void 0&&(i.label=e.label),e.enabled!==void 0&&(i.enabled=e.enabled),e.imageGeneration!==void 0&&(i.imageGeneration=e.imageGeneration),Object.assign(i,dj(e))),r.push(i)}for(let e of n.values())r.push({...e});return r}function _j(e,t){if(!t)return[...e];let n=new Map(t.providers.map(e=>[e.key,e]));return e.map(e=>{if(!e.oauthAccountKey)return e;let t=n.get(Ro(e.oauthAccountKey));return t?{...e,models:gj(t.models,e.models)}:e})}var vj=H.createContext(void 0);function yj(e){let t=H.useContext(vj);if(t===void 0&&!e)throw Error(yr(33));return t}var bj=H.createContext(void 0);function xj(e){let t=H.useContext(bj);if(t===void 0&&!e)throw Error(yr(36));return t}var Sj=H.createContext(void 0);function Cj(e=!0){let t=H.useContext(Sj);if(t===void 0&&!e)throw Error(yr(25));return t}var wj=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=xj(),s=o.useState(`open`),c=o.useState(`mounted`),l=o.useState(`transitionStatus`),u=o.useState(`lastOpenChangeReason`),d=Cj(),f={open:s,transitionStatus:l};return Lr(`div`,e,{ref:d?.backdropRef?[t,d.backdropRef]:t,state:f,stateAttributesMapping:py,props:[{role:`presentation`,hidden:!c,style:{pointerEvents:u===`trigger-hover`?`none`:void 0,userSelect:`none`,WebkitUserSelect:`none`}},a]})});function Tj({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=H.useRef(e!==void 0),[a,o]=H.useState(t);return[i?e:a,H.useCallback(e=>{i||o(e)},[])]}function Ej(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=Cj(!0),f=d!==void 0;return H.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:ab})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!kb&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&Xy(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var Dj={type:`regular-item`};function Oj(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=H.useRef(null),{getButtonProps:d,buttonRef:f}=Zy({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Ej({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=H.useCallback(e=>ir(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=Sr(u,f);return H.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var kj=H.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Aj(){return H.useContext(kj)}function jj(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Aj(),u=H.useRef(-1),[d,f]=H.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=H.useRef(null),h=H.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Y(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Mj=H.createContext(void 0);function Nj(){let e=H.useContext(Mj);if(e===void 0)throw Error(yr(31));return e}var Pj=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=H.useState(void 0),c=Lr(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,G.jsx)(Mj.Provider,{value:s,children:c})}),Fj=H.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=vb(a),c=Nj();return Y(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),Lr(`div`,e,{ref:t,props:{id:s,role:`presentation`,...o}})}),Ij=H.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=jj({guess:!0,label:a}),f=yj(!0),p=vb(i),{store:m}=xj(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=Oj({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:Dj});return Lr(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),Lj=H.createContext(void 0);function Rj(e){let t=H.useContext(Lj);if(t===void 0&&!e)throw Error(yr(69));return t}var zj=H.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=xj(),{side:c,align:l}=yj(),u=Rj(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),T=s.useState(`openMethod`),E=_.type===`context-menu`;Qw({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),H.useEffect(()=>{function e(e){s.setOpen(!1,pb(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),jT(b,{enabled:C&&!w&&!E&&_.type!==`menubar`,closeDelay:S});let D=s.useStateSetter(`popupElement`),O=Lr(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,D],stateAttributesMapping:py,props:[p,{onKeyDown(e){u&&qT.has(e.key)&&e.stopPropagation()}},zD(f),o,{"data-rootownerid":y}]}),k=_.type===void 0||E;return(g||_.type===`menubar`&&v!==`outside-press`)&&(k=!0),(0,G.jsx)(cC,{context:b,openInteractionType:T,modal:E,disabled:!m,returnFocus:a===void 0?k:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:O})}),Bj=H.createContext(void 0);function Vj(){let e=H.useContext(Bj);if(e===void 0)throw Error(yr(32));return e}var Hj=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=xj();return i.useState(`mounted`)||n?(0,G.jsx)(Bj.Provider,{value:n,children:(0,G.jsx)(US,{ref:t,...r})}):null});function Uj(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Uy(i),[,o]=H.useState(!1),s=xr(Gj).current,c=xr(Wj).current,l=H.useRef(0),u=H.useRef(!0),d=H.useRef([]),f=H.useRef(null),p=Uy(()=>{u.current||(u.current=!0,o(e=>!e))}),m=Uy((e,t)=>{c.set(e,t),p()}),h=Uy(e=>{c.delete(e),p()}),g=Uy(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Jj(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Yj(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=qj(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=Uy(()=>{let[e,t]=Kj(c),n=g(e);_(t),d.current=e,u.current=!1,s.forEach(e=>e(n)),a(n)});Y(()=>(u.current||g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Y(()=>{u.current&&v()}),Y(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=Uy(e=>(s.add(e),()=>{s.delete(e)})),b=H.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,G.jsx)(kj.Provider,{value:b,children:t})}function Wj(){return new Map}function Gj(){return new Set}function Kj(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Yj(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function qj(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Jj(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Yj(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var Xj=20;function Zj(e,t,n,r){let[i,a]=H.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=Yy(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Xj)},[e,t,n]),iE(e&&(!t||i),r)}var Qj=H.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=IS,style:g,..._}=e,{store:v}=xj(),y=Vj(),b=Cj(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`adaptiveOrigin`),N=v.useState(`lastOpenChangeReason`),P=v.useState(`floatingNodeId`),F=v.useState(`floatingParentNodeId`),I=S.useState(`domReferenceElement`),ee=H.useRef(null),L=Zw(A),te=n,R=c,z=l,ne=s,re=h;x.type===`context-menu`&&(te=n??x.context?.anchor,ne??=`start`,!o&&ne!==`center`&&(z=e.alignOffset??2,R=e.sideOffset??-5));let B=o,ie=ne;x.type===`menu`?(B??=`inline-end`,ie??=`start`,re=e.collisionAvoidance??LS):x.type===`menubar`&&(B??=x.context.orientation===`vertical`?`inline-end`:`bottom`,ie??=`start`);let ae=x.type===`context-menu`,oe=ID({anchor:te,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:B,sideOffset:R,align:ie,alignOffset:z,arrowPadding:ae?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:P,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:re,shift:ae?{crossAxis:!(`side`in re&&re.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:C,adaptiveOrigin:M});H.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===P&&v.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,pb(db)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,P]),H.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,pb(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let V=Cb();H.useEffect(()=>{T||V.clear()},[T,V]),H.useEffect(()=>{function e(e){if(!(!T||e.nodeId!==v.select(`floatingParentNodeId`))){if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?V.isStarted()||V.start(e,()=>{v.setOpen(!1,pb(db))}):v.setOpen(!1,pb(db))}else V.clear()}}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,V]),H.useEffect(()=>{let e={open:T,nodeId:P,parentNodeId:F,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,P,F]),Y(()=>{let e=I,t=ee.current;if(e&&(ee.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return L(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,L,v]);let se={open:T,side:oe.side,align:oe.align,anchorHidden:oe.anchorHidden,nested:x.type===`menu`,instant:j},ce=x.type===`menubar`&&x.context.modal;Zj(T&&(ce||E&&N!==`trigger-hover`),D===`touch`,A,O);let le=BD(e,se,{styles:oe.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),ue=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&N!==`trigger-hover`||x.type===`menubar`&&x.context.modal),de=null;return x.type===`menubar`?de=x.context.contentElement:x.type===void 0&&(de=O),(0,G.jsxs)(vj.Provider,{value:oe,children:[ue&&(0,G.jsx)(ZT,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:XT(!T),cutout:de}),(0,G.jsx)(ZS,{id:P,children:(0,G.jsx)(Uj,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:le})})]})}),$j=H.createContext(null);function eM(e){let t=H.useContext($j);if(t===null&&!e)throw Error(yr(5));return t}var tM={...xT,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},nM=class extends Kw{constructor(e){super({...iM(),...e},rM(),tM),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function rM(){return{positionerRef:H.createRef(),popupRef:H.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:H.createRef(),beforeContentFocusGuardRef:H.createRef(),onOpenChangeComplete:void 0,triggerElements:new fT}}function iM(){return{...mT(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new GS,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Nr,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}var aM=H.createContext(void 0);function oM(){return H.useContext(aM)}var sM=Fw(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=Cj(!0),_=xj(!0),v=eM(!0),y=oM(),b=H.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=cM({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b});x.useControlledProp(`openProp`,n),x.useControlledProp(`triggerIdProp`,p),x.useContextCallback(`onOpenChangeComplete`,i);let S=_b(),C=_b(),w=x.useState(`floatingTreeRoot`),T=XS(w),E=JS(),D=x.useState(`open`),O=x.useState(`activeTriggerElement`),k=x.useState(`positionerElement`),A=x.useState(`hoverEnabled`),j=x.useState(`disabled`),M=x.useState(`lastOpenChangeReason`),N=x.useState(`parent`),P=x.useState(`activeIndex`),F=x.useState(`payload`),I=x.useState(`floatingParentNodeId`),ee=H.useRef(null),L=H.useRef(N.type!==`context-menu`),te=Cb(),R=H.useRef(!0),z=Cb(),ne=I!=null,{openMethod:re,triggerProps:B}=dE(D);x.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:N.type===void 0?s:void 0,openMethod:re,rootId:S}),cT(x);let{forceUnmount:ie}=lT(D,x,()=>{x.set(`allowMouseEnter`,!1)});Y(()=>{g&&!_?x.update({parent:{type:`context-menu`,context:g},floatingNodeId:T,floatingParentNodeId:E}):_&&x.update({floatingNodeId:T,floatingParentNodeId:E})},[g,_,T,E,x]),H.useEffect(()=>{if(D||(ee.current=null),N.type===`context-menu`){if(!D){te.clear(),L.current=!1;return}te.start(500,()=>{L.current=!0})}},[te,D,N.type]),Y(()=>{!D&&!A&&x.set(`hoverEnabled`,!0)},[D,A,x]);let ae=Uy((e,t)=>{let n=t.reason;if(!e&&!x.select(`open`)||D===e&&t.trigger===O&&M===n)return;let i=aT(t);if(!e&&t.trigger==null&&(t.trigger=O??void 0),r?.(e,t),t.isCanceled)return;x.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!R.current)return;e&&n===`trigger-focus`?(R.current=!1,z.start(300,()=>{R.current=!0})):(R.current=!0,z.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null),c={open:e,openChangeReason:n};ee.current=t.event,iT(c,e,t.trigger,i()),x.update(c),N.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?x.set(`instantType`,`group`):o||s?x.set(`instantType`,o?`click`:`dismiss`):x.set(`instantType`,void 0)}),oe=Yw({popupStore:x,floatingId:C,nested:E!=null,onOpenChange:ae}),V=oe.context.events;Y(()=>{let e=({open:e,eventDetails:t})=>ae(e,t);return V.on(`setOpen`,e),()=>{V?.off(`setOpen`,e)}},[V,ae]);let se=H.useCallback(()=>{x.setOpen(!1,pb(fb))},[x]);H.useImperativeHandle(u,()=>({unmount:ie,close:se}),[ie,se]);let ce;N.type===`context-menu`&&(ce=N.context),H.useImperativeHandle(ce?.positionerRef,()=>k,[k]),H.useImperativeHandle(ce?.actionsRef,()=>({setOpen:ae}),[ae]);let le=fC(oe,{enabled:!j,bubbles:{escapeKey:d&&N.type===`menu`},outsidePress(){return N.type!==`context-menu`||ee.current?.type===`contextmenu`||L.current},externalTree:ne?w:void 0}),ue=AE(),de=H.useCallback(e=>{x.select(`activeIndex`)!==e&&x.set(`activeIndex`,e)},[x]),fe=LT(oe,{enabled:!j,listRef:x.context.itemDomElements,activeIndex:P,nested:N.type!==void 0,loopFocus:c,orientation:l,parentOrientation:N.type===`menubar`?N.context.orientation:void 0,rtl:ue===`rtl`,disabledIndices:Mr,onNavigate:de,openOnArrowKeyDown:N.type!==`context-menu`,externalTree:ne?w:void 0,focusItemOnHover:h}),pe=H.useCallback(e=>{x.context.typingRef.current=e},[x]),me=RT(oe,{enabled:!j,listRef:x.context.itemLabels,elementsRef:x.context.itemDomElements,activeIndex:P,resetMs:500,onMatch:e=>{D&&e!==P&&x.set(`activeIndex`,e)},onTyping:pe});uT(x,{floatingRootContext:oe,activeTriggerProps:H.useMemo(()=>{let e=ir(me.reference,fe.reference,le.reference,{onMouseMove(){x.set(`allowMouseEnter`,!0)}},B);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=D,e},[x,me.reference,fe.reference,le.reference,B,D]),inactiveTriggerProps:H.useMemo(()=>{let e=ir(fe.trigger,le.trigger,B);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[fe.trigger,le.trigger,B]),popupProps:H.useMemo(()=>ir($w,{id:C,role:`menu`,"aria-labelledby":O?.id,onMouseMove(){x.set(`allowMouseEnter`,!0),N.type===`menu`&&x.set(`hoverEnabled`,!1)},onClick(){x.select(`hoverEnabled`)&&x.set(`hoverEnabled`,!1)},onKeyDown(e){let t=x.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},me.floating,fe.floating,le.floating),[O,C,N.type,x,me.floating,fe.floating,le.floating]),itemProps:fe.item??Nr});let he=H.useMemo(()=>({store:x,parent:b}),[x,b]),ge=(0,G.jsxs)(bj.Provider,{value:he,children:[f&&(0,G.jsx)(nT,{handle:f,store:x}),typeof t==`function`?t({payload:F}):t]});return N.type===void 0||N.type===`context-menu`?(0,G.jsx)(QS,{externalTree:w,children:ge}):ge});function cM(e){return xr(()=>new nM(e)).current}var lM=5;function uM(e,t){let n=dM(t);return e.clientX>=n.left-lM&&e.clientX<=n.right+lM&&e.clientY>=n.top-lM&&e.clientY<=n.bottom+lM}function dM(e){let t=e.getBoundingClientRect(),n=_y(e);if(jb)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function fM(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=qy(),{ref:i,index:a}=jj(e),o=n===a,s=H.useRef(null),c=Sr(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function pM(e){let{render:t,className:n,style:r,state:i=Nr,props:a=Mr,refs:o=Mr,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=fM({metadata:s});return Lr(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function mM(e){if(xy(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Ny(e))return mM(Iy(e))}function hM(e,t){let n=H.useRef(null);function r(t){Lo.flushSync(()=>{e.setOpen(!1,pb(sb,t.nativeEvent,t.currentTarget))}),pS(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&mS(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Lo.flushSync(()=>{e.setOpen(!1,pb(sb,n.nativeEvent,n.currentTarget))});let i=fS(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&zb(r,i);){let e=i;if(i=lS(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function gM(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=H.useRef(!1);return H.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Yy(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Nr,[t,n,r])}var _M=Iw(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=xj(!0),h=ST(d)??m?.store;if(!h)throw Error(yr(85));let g=vb(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=H.useRef(null),S=fte(),C=qy(!0),w=YS(),T=H.useMemo(()=>w??new GS,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=sT(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:XS(T),floatingParentNodeId:JS(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=Zy({disabled:A,native:o});H.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=H.useRef(null),P=Cb(),F=Uy(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;zb(N.current,t)||zb(h.select(`positionerElement`),t)||t===N.current||(t==null||mM(t)!==h.select(`rootId`))&&(uM(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:ub}))});H.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&Yy(N.current).addEventListener(`mouseup`,F,{once:!0})},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,ee=MT(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:WT({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),L=vM(y,h.select(`lastOpenChangeReason`)),te=lC(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&L}),R=ET(v,{enabled:!A&&I}),z=gM({open:y,enabled:O,mouseDownAction:`open`}),ne=H.useMemo(()=>ir(R.reference,te.reference),[R.reference,te.reference]),re=h.useState(`triggerProps`,D),{preFocusGuardRef:B,handlePreFocusGuardFocus:ie,handleFocusTargetFocus:ae}=hM(h,x),oe={disabled:A,open:y},V=[N,t,M,E,x],se=[ne,ee??Nr,re,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Yy(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},O?{role:`menuitem`}:{},z,p,j],ce=Lr(`button`,e,{enabled:!O,stateAttributesMapping:dy,state:oe,ref:V,props:se});return O?(0,G.jsx)(pM,{tag:`button`,render:n,className:r,style:i,state:oe,refs:V,props:se,stateAttributesMapping:dy}):y?(0,G.jsxs)(H.Fragment,{children:[(0,G.jsx)(dx,{ref:B,onFocus:ie},`${g}-pre-focus-guard`),(0,G.jsx)(H.Fragment,{children:ce},g),(0,G.jsx)(dx,{ref:h.context.triggerFocusTargetRef,onFocus:ae},`${g}-post-focus-guard`)]}):(0,G.jsx)(H.Fragment,{children:ce},g)});function vM(e,t){let n=Cb(),[r,i]=H.useState(!1);return Y(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function fte(){let e=eM(!0);return H.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function yM(e){let[t,n]=H.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function bM(e){let t=Py(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=xy(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(mx(n)!==a||mx(r)!==o)&&(n=a,r=o),{width:n,height:r}}function xM(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,onMeasureLayout:a,onMeasureLayoutComplete:o,side:s,direction:c}=e,l=Zw(t,!0),u=sx(),d=H.useRef(null),f=H.useRef(!0),p=H.useRef(jr),m=Uy(a),h=Uy(o),g=H.useMemo(()=>SM(s,c),[s,c]);Y(()=>{if(!i){p.current=jr,f.current=!0,d.current=null;return}if(!t||!n)return;p.current=wM(t,g),TM(t,`auto`);let e=CM(t,`position`,`static`),r=CM(t,`transform`,`none`),a=CM(t,`scale`,`1`),o=wM(n,{"--available-width":`max-content`,"--available-height":`max-content`});function s(){e(),r(),o()}function c(){s(),a()}if(m?.(),f.current||d.current===null){EM(n,`max-content`);let e=bM(t);return d.current=e,EM(n,e),c(),h?.(null,e),f.current=!1,()=>{p.current(),p.current=jr}}EM(n,`max-content`);let _=d.current,v=bM(t);d.current=v,TM(t,_),c(),h?.(_,v),EM(n,v);let y=new AbortController;return u.request(()=>{TM(t,v),l(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},y.signal)}),()=>{y.abort(),u.cancel(),p.current(),p.current=jr}},[r,t,n,l,u,i,m,h,g])}function SM(e,t){let n=e===`top`,r=e===`left`||e===(t===`rtl`?`inline-end`:`inline-start`);return!n&&!r?Nr:{position:`absolute`,[n?`bottom`:`top`]:`0`,[r?`right`:`left`]:`0`}}function CM(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function wM(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(CM(e,r,i));return n.length?()=>{n.forEach(e=>e())}:jr}function TM(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function EM(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}var DM={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=_y(i),l=c.getComputedStyle(i);if(l.transitionDuration===`0s`||l.transitionDuration===``)return{x:t,y:n,data:jD};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=Yy(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=bx(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:jD.sideX,g=f===`top`?`bottom`:jD.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}},OM={activationDirection:e=>e?{"data-activation-direction":e}:null};function kM(e){let{store:t,side:n,children:r}=e,i=AE(),a=t.useState(`activeTriggerElement`),o=t.useState(`activeTriggerId`),s=t.useState(`open`),c=t.useState(`payload`),l=t.useState(`mounted`),u=t.useState(`popupElement`),d=t.useState(`positionerElement`),f=yM(s?a:null),p=NM(o,c),m=H.useRef(null),[h,g]=H.useState(null),[_,v]=H.useState(null),y=H.useRef(null),b=H.useRef(null),x=Zw(y,!0),S=sx(),C=H.useRef(null),[w,T]=H.useState(null),[E,D]=H.useState(!1);Y(()=>(t.set(`adaptiveOrigin`,DM),()=>{t.set(`adaptiveOrigin`,void 0)}),[t]);let O=Uy(()=>{y.current?.style.setProperty(`animation`,`none`),y.current?.style.setProperty(`transition`,`none`),b.current?.style.setProperty(`display`,`none`)}),k=Uy(e=>{y.current?.style.removeProperty(`animation`),y.current?.style.removeProperty(`transition`),b.current?.style.removeProperty(`display`),e&&T(e)}),A=Uy(()=>{C.current?.abort();let e=new AbortController;C.current=e,x(()=>{g(null),T(null),m.current=null},e.signal)}),j=H.useRef(null);Y(()=>{(!s||!l)&&(j.current=null)},[s,l]),Y(()=>{if(a&&f&&a!==f&&j.current!==a&&m.current){g(m.current),D(!0);let e=MM(f,a);v(e),j.current=a}},[a,f]),Y(()=>{h!=null&&(C.current?.abort(),D(!0),S.request(()=>{Lo.flushSync(()=>{D(!1)}),A()}))},[p,h,A,S]),Y(()=>{let e=y.current;if(!e)return;let t=Yy(e).createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));m.current=t});let M=h!=null,N;N=M?(0,G.jsxs)(H.Fragment,{children:[(0,G.jsx)(`div`,{"data-previous":!0,inert:XT(!0),ref:b,style:{...w?{"--popup-width":`${w.width}px`,"--popup-height":`${w.height}px`}:null,position:`absolute`},"data-ending-style":E?void 0:``},`previous`),(0,G.jsx)(`div`,{"data-current":!0,ref:y,"data-starting-style":E?``:void 0,children:r},p)]}):(0,G.jsx)(`div`,{"data-current":!0,ref:y,children:r},p),Y(()=>{let e=b.current;!e||!h||e.replaceChildren(...Array.from(h.childNodes))},[h]),xM({popupElement:u,positionerElement:d,mounted:l,content:c,onMeasureLayout:O,onMeasureLayoutComplete:k,side:n,direction:i});let P={activationDirection:AM(_),transitioning:M};return{children:N,state:P}}function AM(e){if(e)return`${jM(e.horizontal,5,`right`,`left`)} ${jM(e.vertical,5,`down`,`up`)}`}function jM(e,t,n,r){return e>t?n:e<-t?r:``}function MM(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function NM(e,t){let[n,r]=H.useState(0),i=H.useRef(e),a=H.useRef(t),o=H.useRef(!1);return Y(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}var PM=H.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Lr(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function FM(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var IM=sM,LM=`relative flex not-[class*='w-']:min-w-32 origin-(--transform-origin) rounded-xl border bg-popover bg-clip-padding shadow-xl outline-none transition-[scale,opacity] duration-150 [transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] focus:outline-none has-data-starting-style:scale-95 has-data-starting-style:opacity-0 has-data-ending-style:scale-95 has-data-ending-style:opacity-0 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]`;function RM(e){return(0,G.jsx)(_M,{"data-slot":`menu-trigger`,...e})}function zM({children:e,className:t,sideOffset:n=4,align:r=`center`,alignOffset:i,side:a=`bottom`,zIndex:o,...s}){let c=o??dD.MODAL_BACKDROP;return(0,G.jsxs)(Hj,{children:[(0,G.jsx)(wj,{className:`fixed inset-0`,"data-enso-float":``,style:{zIndex:c-1}}),(0,G.jsx)(Qj,{align:r,alignOffset:i,"data-slot":`menu-positioner`,side:a,sideOffset:n,style:{zIndex:c},children:(0,G.jsx)(zj,{className:W(LM,t),"data-slot":`menu-popup`,...s,children:(0,G.jsx)(`div`,{className:`max-h-(--available-height) w-full overflow-y-auto p-1.5`,children:e})})})]})}var BM=`[&_svg]:-mx-0.5 flex min-h-8 cursor-default select-none items-center gap-2.5 whitespace-nowrap rounded-md px-2 py-1.5 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-inset:ps-8 data-[variant=destructive]:text-destructive data-highlighted:text-accent-foreground data-highlighted:data-[variant=destructive]:bg-destructive/10 data-highlighted:data-[variant=destructive]:text-destructive data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`;function VM(e){return(0,G.jsx)(Pj,{"data-slot":`menu-group`,...e})}function HM({className:e,inset:t,variant:n=`default`,style:r,...i}){return(0,G.jsx)(Ij,{className:W(BM,e),"data-inset":t,"data-slot":`menu-item`,"data-variant":n,style:{WebkitAppRegion:`no-drag`,...r},...i})}function UM({className:e,inset:t,...n}){return(0,G.jsx)(Fj,{className:W(`px-2 py-1.5 font-medium text-muted-foreground text-xs data-inset:ps-9 sm:data-inset:ps-8`,e),"data-inset":t,"data-slot":`menu-label`,...n})}function WM({className:e,...t}){return(0,G.jsx)(PM,{className:W(`mx-2 my-1 h-px bg-border`,e),"data-slot":`menu-separator`,...t})}var GM=H.createContext(void 0);function KM(){let e=H.useContext(GM);if(e===void 0)throw Error(yr(63));return e}var qM={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},JM={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},YM={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},XM={...YM,checked(e){return e?{"data-checked":``}:{"data-unchecked":``}}},ZM={invalid:void 0,name:void 0,validityData:{state:qM,errors:[],error:``,value:``,initialValue:null},setValidityData:jr,disabled:void 0,setTouched:jr,setDirty:jr,setFilled:jr,setFocused:jr,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:JM,registerFieldControl:jr,validation:{getValidationProps:(e,t=Nr)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:jr,getInputControl:()=>null,commit:async()=>{},change:jr}},QM=H.createContext(ZM);function $M(e=!0){let t=H.useContext(QM);if(t.setValidityData===jr&&!e)throw Error(yr(28));return t}function eN(e,t,n,r,i=!0,a){let{registerFieldControl:o}=$M(),s=xr(()=>Symbol());Y(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),Y(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var tN=H.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:jr,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function nN(){return H.useContext(tN)}var rN=H.createContext({controlId:void 0,registerControlId:jr,labelId:void 0,setLabelId:jr,messageIds:[],setMessageIds:jr,getDescriptionProps:e=>e});function iN(){return H.useContext(rN)}function aN(e,t,n,r=!0,i){let[a,o]=H.useState(),s=vb(i?`${i}-label`:void 0),c=e??t??a;return Y(()=>{let i=e||t||!r?void 0:oN(n.current,s);a!==i&&o(i)}),c}function oN(e,t){let n=sN(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function sN(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function cN(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=iN(),o=vb(t),s=n?i:void 0,c=xr(()=>Symbol()),l=H.useRef(!1),u=H.useRef(t!=null),d=Uy(()=>{!l.current||a===jr||(l.current=!1,a(c.current,void 0))});return Y(()=>{if(a===jr)return;let e;if(n){let n=r?.current;e=by(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),H.useEffect(()=>d,[d]),i??o}var lN=H.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...y}=e,{clearErrors:b}=nN(),{state:x,setTouched:S,setDirty:C,validityData:w,setFilled:T,setFocused:E,validationMode:D,disabled:O,name:k,validation:A}=$M(),{labelId:j}=iN(),M=O||m,N=k??l,P=H.useRef(null),F=Sr(P,c,A.inputRef),I=H.useRef(null),ee=vb(),L=cN({id:s,implicit:!1,controlRef:I}),te=u?void 0:L,[R,z]=Tj({controlled:n,default:!!i,name:`Switch`,state:`checked`});eN(I,ee,R,void 0,!M,l),Y(()=>{P.current&&T(P.current.checked)},[T]),lE(R,()=>{b(N),C(R!==w.initialValue),T(R),A.change(R)});let{getButtonProps:ne,buttonRef:re}=Zy({disabled:M,native:u}),B=aN(a,j,P,!u,te),ie={id:u?L:ee,role:`switch`,"aria-checked":R,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":B,onFocus(){M||E(!0)},onBlur(){let e=P.current;!e||M||(S(!0),E(!1),D===`onBlur`&&A.commit(e.checked))},onClick(e){if(f||M)return;e.preventDefault();let t=P.current;t&&Xy(t,e)}},ae={...A.getValidationProps(M),checked:R,disabled:M,form:o,id:te,name:N,required:p,style:N?ux:lx,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:F,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=pb(eb,e.nativeEvent);d?.(t,n),!n.isCanceled&&z(t)},onClick(e){e.stopPropagation()},onFocus(){I.current?.focus()},..._===void 0?Nr:{value:_}},oe=H.useMemo(()=>({...x,checked:R,disabled:M,readOnly:f,required:p}),[x,R,M,f,p]),V=Lr(`span`,e,{state:oe,ref:[t,I,re],props:[ie,y,ne,e=>A.getValidationProps(M,e)],stateAttributesMapping:XM});return(0,G.jsxs)(GM.Provider,{value:oe,children:[V,!R&&N&&g!==void 0&&(0,G.jsx)(`input`,{type:`hidden`,form:o,name:N,value:g,disabled:M}),(0,G.jsx)(`input`,{...ae,suppressHydrationWarning:!0})]})}),uN=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Lr(`span`,e,{state:KM(),ref:t,stateAttributesMapping:XM,props:a})});function dN({className:e,...t}){return(0,G.jsx)(lN,{className:W(`group/switch inset-shadow-[0_1px_--theme(--color-black/4%)] inline-flex h-5.5 w-9.5 shrink-0 items-center rounded-full p-px outline-none transition-all focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:opacity-64 sm:h-4.5 sm:w-7.5`,e),"data-slot":`switch`,...t,children:(0,G.jsx)(uN,{className:W(`pointer-events-none block size-5 rounded-full bg-background shadow-sm transition-[translate,width] group-active/switch:not-data-disabled:w-5.5 data-checked:translate-x-4 data-unchecked:translate-x-0 data-checked:group-active/switch:translate-x-3.5 sm:size-4 sm:data-checked:translate-x-3 sm:group-active/switch:not-data-disabled:w-4.5 sm:data-checked:group-active/switch:translate-x-2.5`),"data-slot":`switch-thumb`})})}var fN=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},pN=(e=>e?fN(e):fN),mN=e=>e;function hN(e,t=mN){let n=H.useSyncExternalStore(e.subscribe,H.useCallback(()=>t(e.getState()),[e,t]),H.useCallback(()=>t(e.getInitialState()),[e,t]));return H.useDebugValue(n),n}var gN=e=>{let t=pN(e),n=e=>hN(t,e);return Object.assign(n,t),n},_N=(e=>e?gN(e):gN);_N(e=>({cache:{},generation:0,put:(t,n)=>e(e=>{let r={...e.cache};for(let e of n)r[`${t}/${e.modelId}`]=e;return{cache:r}}),invalidate:()=>e(e=>({cache:{},generation:e.generation+1}))}));function vN(e){let t=e=>String(e>=100?Math.round(e):Math.round(e*10)/10);return e<1e3?String(e):e<1e6?`${t(e/1e3)}K`:`${t(e/1e6)}M`}function yN(e){let t=e/1e3;if(t<60)return`${Math.round(t*10)/10}s`;let n=Math.round(t);return`${Math.floor(n/60)}m${n%60}s`}var bN=`enso:open-chat-model-picker`;function xN(){window.dispatchEvent(new Event(bN))}function SN(e,t){return e.filter(e=>e!==t)}var CN=new Map,wN=e=>e.images.length>0||e.segments.some(e=>e.type!==`text`||e.text.trim()!==``),TN=()=>!!window.electronAPI?.remote&&window.matchMedia?.(`(pointer: coarse)`).matches===!0;function EN({cwd:e,commands:t,running:n,busy:r,focusKey:i,pluginPresetId:a=null,autoFocus:o=!window.electronAPI?.remote,enterToSend:s=!TN(),toolbar:c,locked:l=!1,injectedDraft:u,injectedImages:d,injectedDraftAppend:f,onDraftConsumed:p,chatCandidates:m,onActivate:h,onSend:g,onAbort:_,queuedCount:v=0,onSteerQueued:y,isolated:b=!1,placeholder:x,planMode:S=!1,savePastedText:C}){let{t:w}=K(),T=nO(),E=Ce(e=>e.keybindings),D=Ce(e=>e.privacyMasking),O=oO(E)[`send-message`],k=(0,H.useId)(),[A,j]=(0,H.useState)([]),[M,N]=(0,H.useState)([]),[P,F]=(0,H.useState)(),I=(0,H.useRef)(i),[ee,L]=(0,H.useState)(!1),{setNodeRef:te,isOver:R}=vv({id:b?`isolated-composer:${i??`side`}`:jk,disabled:b}),[z,ne]=(0,H.useState)(null),[re,B]=(0,H.useState)(null),ie=(0,H.useRef)(new Set),ae=(0,H.useRef)(g);ae.current=g;let oe=(0,H.useRef)(D);oe.current=D,(0,H.useEffect)(()=>{if(b)return;let e=xk(e=>V.current?.insertMention(e)),t=Ck(e=>V.current?.insertText(e)),n=Sk(()=>V.current?.focus()),r=Dk((e,t)=>{t&&j(n=>[...n,{...t,id:e.imageId}]),V.current?.insertMention(e),V.current?.focus()}),i=Ok(e=>{j(t=>[...t,{data:e.data,mimeType:e.mimeType}]),V.current?.focus()}),a=Tk(e=>{if(ue.current)return!1;let t=oe.current,n=t.enabled?Yv(e.text,t).blocked:[];return n.length>0?(UD({type:`error`,title:w(`Message not sent`),description:w(`Privacy masking blocks {{kinds}}. Remove it, or change the action or allow list in Settings → Privacy.`,{kinds:n.join(`, `)})}),!1):ae.current(e)!==!1});return()=>{e(),t(),n(),r(),i(),a()}},[b,w]);let V=(0,H.useRef)(null),se=(0,H.useRef)(null),ce=(0,H.useRef)(null),le=(0,H.useRef)(!1),ue=(0,H.useRef)(l);ue.current=l,(0,H.useEffect)(()=>{if(!(b||!i))return bO({key:i,segments:()=>V.current?.getSegments()??[],insertText:e=>V.current?.insertText(e),setText:e=>V.current?.setSegments(e?[{type:`text`,text:e}]:[]),busy:()=>le.current||ue.current||!V.current})},[b,i]);let[de,fe]=(0,H.useState)({left:0,flyoutSide:`right`}),[pe,me]=(0,H.useState)(``),[he,ge]=(0,H.useState)(!1),_e=(0,H.useRef)(Symbol(`composer`)),ve=pe.trim()!==``||he||A.length>0;(0,H.useEffect)(()=>fO(_e.current,ve),[ve]),(0,H.useEffect)(()=>()=>fO(_e.current,!1),[]);let[ye,be]=(0,H.useState)(null),xe=XD(e,ye,m),Se=(0,H.useMemo)(()=>KD(xe,ye??``),[xe,ye]),[we,Te]=(0,H.useState)(null),[Ee,De]=(0,H.useState)(null),[Oe,ke]=(0,H.useState)(null),Ae=dk(Oe,i??null),[je,Me]=(0,H.useState)(0),[Ne,Pe]=(0,H.useState)(null),[Fe,Ie]=(0,H.useState)(0),Le=(0,H.useRef)(null),Re=(0,H.useCallback)(e=>{(e.plainText.trim()||e.hasMentions)&&h?.(),me(e.plainText),ge(e.hasMentions);let t=new Set(e.segments.filter(e=>e.type===`ui-element`&&e.imageId).map(e=>e.type===`ui-element`?e.imageId:``)),n=[...ie.current].filter(e=>!t.has(e));ie.current=t,n.length>0&&(j(e=>wv(e,n)),ne(e=>e&&n.includes(e.imageId)?null:e)),be(t=>(t!==e.mentionQuery&&(Me(0),Pe(null),Ie(0)),e.mentionQuery)),Te(e.slashQuery),De(e.skillQuery),ke(e.pluginQuery)},[h]);(0,H.useEffect)(()=>{let e=I.current;if(e!==i){if(e){let t={segments:V.current?.getSegments()??[],images:A,slashes:M,recipient:P};CN.set(e,t),fO(`draft:${e}`,wN(t))}let t=i?CN.get(i):void 0;i&&fO(`draft:${i}`,!1);let n=i?xO(i):void 0;V.current?.setSegments(n?[{type:`text`,text:n}]:t?.segments??[]),ie.current=new Set((t?.segments??[]).filter(e=>e.type===`ui-element`&&e.imageId).map(e=>e.type===`ui-element`?e.imageId:``)),j(t?.images??[]),N(t?.slashes??[]),F(t?.recipient),I.current=i,be(null),Te(null),De(null),Me(0),Pe(null),Ie(0)}o&&V.current?.focus()},[i]),(0,H.useEffect)(()=>{if(!u&&!d?.length)return;let e=rA({segments:V.current?.getSegments()??[],images:A,slashes:M},{text:u,images:d},f);N(e.slashes),j(e.images),V.current?.setSegments(e.segments),p?.(),window.setTimeout(()=>V.current?.focus(),0)},[u,d,f]);let ze=M.length===1?M[0]:null,Be=Zv(ze,pe.replaceAll(``,``)),Ve=zA(t,we,Ee),He=we===null&&Ee===null&&Be!==null?Qv(ze,Be):[];(0,H.useEffect)(()=>{Me(0)},[we,Ee,Be,Oe]),(0,H.useEffect)(()=>{(Le.current?.children[je])?.scrollIntoView({block:`nearest`})},[je]);let Ue=(0,H.useCallback)(e=>{if(e.kind===`agent-type`){V.current?.consumeToken(`@`),F(e),be(null);return}V.current?.insertMention(e),be(null)},[]),We=(0,H.useCallback)(e=>{ke(null),fk(e,i??null).then(e=>{let t=V.current;t&&(t.consumeToken(`#`),e&&t.insertText(e))})},[i]),Ge=ye!==null&&Se.length>0?`mention`:Oe!==null&&Ae.length>0?`plugin`:Ve.length>0?`slash`:He.length>0?`slash-sub`:null;(0,H.useLayoutEffect)(()=>{if(Ge!==`mention`)return;let e=se.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect(),n=e.querySelector(`[data-slot="mention-picker"]`),r=n?.querySelector(`[role="listbox"]`),i=n?.querySelector(`[data-slot="mention-flyout"]`),a=V.current?.getMentionAnchorRect(),o=bA({anchorLeft:a?a.left-t.left:0,containerWidth:t.width,popupWidth:r instanceof HTMLElement?r.offsetWidth:280,flyoutWidth:i instanceof HTMLElement?i.offsetWidth:252,flyoutGap:4});fe(e=>e.left===o.left&&e.flyoutSide===o.flyoutSide?e:o)};return t(),window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[ye,pe,Ne,Ge]);let Ke=Ge===`mention`?Se.length:Ge===`plugin`?Ae.length:Ge===`slash-sub`?He.length:Ve.length,qe=(0,H.useCallback)((e,t)=>{let n=[{type:`text`,text:e}];V.current?.setSegments(n),t&&g(IA({segments:n,slashes:M,images:A,recipient:P}))!==!1&&(V.current?.clear(),j([]),N([]),F(void 0),be(null),Te(null),De(null))},[A,g,P,M]),Je=(0,H.useCallback)(e=>{V.current?.consumeToken(Ee===null?`/`:`$`),Te(null),De(null);let t=hO(e);if(!t){N(t=>tA(t,e));return}_O(t,b?null:i??null).then(e=>{e&&UD({type:`error`,title:w(`Plugin command failed`),description:e})})},[Ee,b,i,w]),Ye=(0,H.useCallback)((e=!1)=>{if(Ge===`mention`){if(Ne){let e=xe[Ne][Fe];e&&Ue(e);return}let e=Se[je];e?.type===`item`&&Ue(e.candidate)}else if(Ge===`plugin`){let e=Ae[je];e&&We(e)}else if(Ge===`slash`){let e=Ve[je];e&&Je(e.name)}else if(Ge===`slash-sub`){let t=He[je];if(!t)return;qe(t.name,e)}},[je,Fe,Ne,xe,Se,Ue,We,Ae,Ge,Ve,Je,He,qe]),Xe=pe.replaceAll(``,``).trim(),Ze=!!(Xe||M.length>0||A.length>0||he),Qe=P!==void 0,$e=r&&!Qe,et={sessionId:b?null:i??null,draft:pe.replaceAll(``,``),busy:l,pluginPresetId:a},U=n&&v>0&&y!==void 0&&s&&!!O,tt=U&&!Ze&&!Qe&&!l,nt=(0,H.useMemo)(()=>D.enabled&&Xe?Yv(Xe,D):null,[Xe,D]),rt=()=>{if(!Ze)return;let e=IA({segments:V.current?.getSegments()??[],slashes:M,images:A,recipient:P}),t=D.enabled?Yv(e.text,D).blocked:[];if(t.length>0){UD({type:`error`,title:w(`Message not sent`),description:w(`Privacy masking blocks {{kinds}}. Remove it, or change the action or allow list in Settings → Privacy.`,{kinds:t.join(`, `)})});return}g(e)!==!1&&(V.current?.clear(),j([]),N([]),F(void 0),be(null),Te(null),De(null))},it=(0,H.useCallback)(e=>{for(let t of e){if(t.type.startsWith(`image/`)){let e=new FileReader;e.onload=()=>{let n=e.result,r=n.slice(n.indexOf(`,`)+1);j(e=>[...e,{data:r,mimeType:t.type}])},e.readAsDataURL(t);continue}let e=window.electronAPI.files.pathForFile(t),n=window.electronAPI.remote;if(!e&&n){n.upload(t).then(e=>{e&&V.current?.insertFileChip(e)}).catch(()=>{});continue}e&&V.current?.insertFileChip(e)}},[]);return(0,H.useEffect)(()=>{if(b)return;let e=kk(e=>{it(e),V.current?.focus()}),t=Ak(e=>{for(let t of e)V.current?.insertFileChip(t);V.current?.focus()});return()=>{e(),t()}},[b,it]),(0,G.jsxs)(`div`,{ref:se,className:`relative`,children:[Ge===`mention`&&(0,G.jsx)(aj,{id:k,groups:xe,query:ye??``,activeIndex:je,onActiveIndexChange:Me,openFolderId:Ne,folderIndex:Fe,onOpenFolderIdChange:Pe,onFolderIndexChange:Ie,onSelect:Ue,left:de.left,flyoutSide:de.flyoutSide}),Ge===`plugin`&&(0,G.jsx)(`div`,{ref:Le,role:`listbox`,"aria-label":w(`Plugin suggestions`),className:`absolute bottom-full left-0 z-10 mb-1.5 max-h-64 w-full overflow-y-auto rounded-lg border bg-popover p-1 shadow-md`,children:Ae.map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===je,onMouseDown:e=>e.preventDefault(),onClick:()=>We(e),onMouseMove:()=>Me(t),className:W(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs`,t===je&&`bg-foreground/10`),children:[(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-muted-foreground`,children:`#`}),(0,G.jsx)(`span`,{className:`shrink-0 font-medium`,children:e.item.label}),e.item.detail&&(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:e.item.detail})]},e.key))}),(Ge===`slash`||Ge===`slash-sub`)&&(0,G.jsx)(`div`,{ref:Le,role:`listbox`,"aria-label":w(`Command suggestions`),className:`absolute bottom-full left-0 z-10 mb-1.5 max-h-64 w-full overflow-y-auto rounded-lg border bg-popover p-1 shadow-md`,children:(Ge===`slash`?Ve:He).map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===je,onClick:()=>{Me(t),Ge===`slash`?Je(e.name):qe(e.name,!1)},onMouseMove:()=>Me(t),className:W(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs`,t===je&&`bg-foreground/10`),children:[(0,G.jsx)(Hn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`shrink-0 font-mono font-medium`,children:Ee===null?e.name:`$${e.name.slice(7)}`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:w(e.description)})]},e.name))}),(0,G.jsxs)(`div`,{ref:te,"data-slot":`composer`,"data-enso":`composer`,className:W(`rounded-[24px] border bg-card shadow-[0_2px_6px_rgb(0_0_0/0.03),0_12px_32px_rgb(0_0_0/0.07)] transition-[border-color,box-shadow] duration-200 focus-within:border-foreground/20 [.dark_&]:shadow-[0_2px_6px_rgb(0_0_0/0.2),0_12px_32px_rgb(0_0_0/0.3)]`,(ee||R)&&`border-brand/50 bg-brand/5`,(Qe||S)&&`border-primary/35 shadow-primary/5`),onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),L(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||L(!1)},onDrop:e=>{let t=Array.from(e.dataTransfer.files);t.length!==0&&(e.preventDefault(),L(!1),it(t))},children:[A.filter(e=>!e.id).length>0&&(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2 px-3 pt-3`,children:A.filter(e=>!e.id).map((e,t)=>(0,G.jsxs)(`div`,{className:`group relative`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:()=>B(e),className:`block rounded-md focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,"aria-label":w(`Preview`),children:(0,G.jsx)(`img`,{src:`data:${e.mimeType};base64,${e.data}`,alt:``,className:`h-16 w-16 rounded-md border object-cover`})}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>j(t=>SN(t,e)),className:`absolute -top-1.5 -right-1.5 rounded-full border bg-background p-0.5 text-muted-foreground shadow-sm transition-opacity hover:text-destructive`,children:(0,G.jsx)(er,{className:`h-3 w-3`})})]},t))}),(0,G.jsxs)(`div`,{className:W(`flex items-start gap-1.5 px-4`,A.length>0?`pt-1.5`:`pt-3.5`),children:[P&&(0,G.jsx)(sA,{recipient:P,onRemove:()=>F(void 0)}),M.map(e=>(0,G.jsx)($k,{name:e,className:`mt-0.5 shrink-0`,trailing:(0,G.jsx)(`button`,{type:`button`,onClick:()=>N(t=>t.filter(t=>t!==e)),className:`rounded-sm opacity-70 hover:opacity-100`,"aria-label":w(`Remove`),children:(0,G.jsx)(er,{className:`h-3 w-3`})})},e)),(0,G.jsx)($A,{ref:V,placeholder:M.length>0?``:l?w(`Resolve the pending approval to continue`):Qe?w(`Message the selected Agent…`):U?w(`Press {{key}} to steer the next queued message into this round…`,{key:lO(O)}):x||w(n?`Message will queue until this round finishes…`:`Type @ to choose a file or Agent`),disabled:l,onStateChange:Re,onChipActivate:e=>{e.type===`ui-element`&&ne({kind:`ui-element`,id:e.id,label:e.label,path:e.path,text:e.text,imageId:e.imageId})},onKeyDown:e=>{let t=e.nativeEvent.isComposing||le.current;if(Ge){let n=Ge===`mention`?Se[je]:void 0,r=xA({key:e.key,shiftKey:e.shiftKey,isComposing:t,activeIndex:je,itemCount:Ke,folderOpen:Ge===`mention`&&Ne!==null,activeIsFolder:Ge===`mention`&&n?.type===`folder`,folderIndex:Fe,folderItemCount:Ne?xe[Ne].length:0});if(r.type===`move`){e.preventDefault(),Me(r.index),Pe(null);return}if(r.type===`move-folder`){e.preventDefault(),Ie(r.index);return}if(r.type===`open-folder`){e.preventDefault(),n?.type===`folder`&&Pe(n.id),Ie(0);return}if(r.type===`close-folder`){e.preventDefault(),Pe(null);return}if(r.type===`pick`){e.preventDefault(),Ye(Ge===`slash-sub`&&e.key===`Enter`);return}if(r.type===`close`){e.preventDefault(),be(null),Te(null),De(null),ke(null),Pe(null);return}}if(t)return;let n=sO(e);if(!b&&n&&n===oO(Ce.getState().keybindings)[`switch-model`]){e.preventDefault(),xN();return}if(e.key===`Backspace`&&M.length>0&&Xe.length===0&&!he){e.preventDefault(),N(e=>e.slice(0,-1));return}if(e.key===`Backspace`&&P&&V.current?.isEmpty()&&M.length===0){e.preventDefault(),F(void 0);return}s&&!Ge&&sO(e,{allowBare:!0})===O&&(e.preventDefault(),tt?y?.():rt())},onPasteText:e=>!C||!Ev(e)?!1:(C(e).catch(()=>({ok:!1,error:`unavailable`})).then(t=>{let n=V.current;t.ok?n?.insertFileChip(t.path,`${Tv} · ${w(`{{count}} chars`,{count:t.chars.toLocaleString()})}`):n?.insertText(e)}),!0),onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length!==0&&(e.preventDefault(),it(t))},onCompositionStart:()=>{le.current=!0},onCompositionEnd:()=>{le.current=!1},ariaProps:{role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":Ge!==null,"aria-controls":Ge===`mention`?k:void 0,"aria-activedescendant":Ge===`mention`?Ne?`${k}-sub-${Fe}`:`${k}-option-${je}`:void 0}})]}),Qe&&(0,G.jsx)(`p`,{className:`sr-only`,children:w(`Send only to the selected Agent`)}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5 px-3 pt-0.5 pb-2.5`,children:[(0,G.jsxs)(`div`,{className:W(`flex min-w-0 flex-1 items-center`,T?`gap-0.5 overflow-x-auto [scrollbar-width:none]`:`gap-1 overflow-hidden`),children:[(0,G.jsx)(`input`,{ref:ce,type:`file`,accept:`image/*`,multiple:!0,className:`hidden`,onChange:e=>{it(Array.from(e.target.files??[])),e.target.value=``}}),(0,G.jsx)(`button`,{type:`button`,disabled:l,onClick:()=>ce.current?.click(),"aria-label":w(`Attach image`),title:w(`Attach image`),className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-40 max-md:size-[32px]`,children:(0,G.jsx)(Zt,{className:`h-3.5 w-3.5`})}),(0,G.jsx)(GO,{side:`left`,...et}),c,!b&&(0,G.jsx)(ZO,{sessionId:et.sessionId}),(0,G.jsx)(GO,{side:`right`,...et}),nt&&(nt.blocked.length>0||nt.masked>0)&&(0,G.jsxs)(`span`,{className:W(`flex shrink-0 items-center gap-1 text-[11px]`,nt.blocked.length>0?`text-red-600 dark:text-red-400`:`text-sky-600 dark:text-sky-400`),"data-privacy-precheck":!0,children:[nt.blocked.length>0?(0,G.jsx)(Pn,{className:`size-3.5`}):(0,G.jsx)(Fn,{className:`size-3.5`}),nt.blocked.length>0?w(`Will be blocked: {{kinds}}`,{kinds:nt.blocked.join(`, `)}):w(`{{count}} will be masked`,{count:nt.masked})]})]}),$e&&!Ze?(0,G.jsx)(wa,{variant:`outline`,size:`icon`,className:`size-8 shrink-0 rounded-full`,onClick:_,"aria-label":w(`Stop`),children:(0,G.jsx)(wt,{className:`h-4 w-4`})}):(0,G.jsx)(wa,{size:`icon`,className:`size-8 shrink-0 rounded-full bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-35`,onClick:rt,disabled:!Ze||l,"aria-label":w(Qe?`Send only to the selected Agent`:`Send`),title:Qe?w(`Send only to the selected Agent`):s&&O?`${w(`Send`)} ${lO(O)}`:w(`Send`),children:(0,G.jsx)(ot,{className:`h-4 w-4`})})]})]}),(0,G.jsx)(pD,{open:z!==null,onOpenChange:e=>!e&&ne(null),children:(0,G.jsxs)(vD,{className:`max-w-md`,children:[(0,G.jsx)(yD,{children:(0,G.jsx)(xD,{children:z?.label??w(`Selected UI element`)})}),(0,G.jsx)(wD,{className:`space-y-2 text-xs`,children:z&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`text-muted-foreground break-all`,children:z.path}),z.text&&(0,G.jsx)(`p`,{children:z.text}),(()=>{let e=A.find(e=>e.id===z.imageId);return e?(0,G.jsx)(`img`,{src:`data:${e.mimeType};base64,${e.data}`,alt:``,className:`max-h-72 w-full rounded-md border object-contain`}):null})()]})})]})}),(0,G.jsx)(pD,{open:re!==null,onOpenChange:e=>!e&&B(null),children:(0,G.jsxs)(vD,{className:`max-w-3xl`,children:[(0,G.jsx)(yD,{children:(0,G.jsx)(xD,{children:w(`Preview`)})}),(0,G.jsx)(wD,{children:re&&(0,G.jsx)(`img`,{src:`data:${re.mimeType};base64,${re.data}`,alt:``,className:`max-h-[80vh] w-full rounded-md object-contain`})})]})})]})}var DN=(0,H.createContext)(null);function ON(){return(0,H.useContext)(DN)}function kN({className:e}){return(0,G.jsx)(`svg`,{viewBox:`0 0 64 64`,fill:`none`,"aria-hidden":`true`,className:W(`size-4`,e),children:(0,G.jsx)(`path`,{d:`M 38.96 48.86 A 18.24 18.24 0 1 1 48.19 40.4`,stroke:`currentColor`,strokeWidth:`8.32`,strokeLinecap:`round`})})}var AN={activeId:null,conversations:{},rewind:()=>{},retry:()=>{},forkFromMessage:async()=>null,selectConversation:()=>{},removeQueuedMessage:()=>{},updateQueuedMessage:()=>{},sendQueuedNow:()=>{},interruptAndSendQueued:async()=>{},pauseGoal:()=>{},resumeGoal:()=>{},clearGoal:()=>{}};function jN(e){Object.assign(AN,e)}function MN(e){if(!e){AN.activeId=null,AN.conversations={};return}AN.activeId=e.id,AN.conversations={[e.id]:e}}function NN(e){return e(AN)}NN.getState=()=>AN,NN.subscribe=e=>()=>{};var PN=`rounded-lg border border-border/60 bg-muted/20 px-2.5 py-1.5 text-xs`;function FN({className:e}){return(0,G.jsx)(Kn,{className:W(`h-3.5 w-3.5 shrink-0 text-muted-foreground`,e)})}var IN=`w-full overflow-hidden rounded-lg border border-dashed border-border/60 text-xs text-muted-foreground`,LN=W(IN,`px-3 py-2`),RN=`mt-0.5 h-3.5 w-3.5 shrink-0`,zN={active:`bg-green-500 animate-pulse`,paused:`bg-amber-500`,waiting:`bg-amber-500`,blocked:`bg-destructive`,completed:`bg-blue-500`};function BN({conversationId:e,goal:t}){let{t:n}=K(),r={active:n(`working`),paused:n(`paused`),waiting:n(`waiting`),blocked:n(`blocked`),completed:n(`completed`)};return(0,G.jsxs)(`div`,{className:W(`mb-1 flex items-center gap-2`,PN),children:[(0,G.jsx)(FN,{}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,title:t.note?`${t.text} — ${t.note}`:t.text,children:[t.text,t.note&&(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[` — `,t.note]})]}),(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 shrink-0 rounded-full`,zN[t.status])}),(0,G.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground tabular-nums`,children:[r[t.status],t.status===`active`&&t.autoTurns>0?` · ${t.autoTurns}/25`:``]}),t.status===`active`?(0,G.jsx)(`button`,{type:`button`,title:n(`Pause goal`),onClick:()=>NN.getState().pauseGoal(e),className:`shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground`,children:(0,G.jsx)(bn,{className:`h-3.5 w-3.5`})}):t.status===`completed`?null:(0,G.jsx)(`button`,{type:`button`,title:n(`Resume goal`),onClick:()=>NN.getState().resumeGoal(e),className:`shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground`,children:(0,G.jsx)(Cn,{className:`h-3.5 w-3.5`})}),(0,G.jsx)(`button`,{type:`button`,title:n(`Clear goal`),onClick:()=>NN.getState().clearGoal(e),className:`shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-destructive`,children:(0,G.jsx)(er,{className:`h-3.5 w-3.5`})})]})}function VN(e,t){return e.trim().length>0||t>0}function HN(e,t){return e>0?`${e} ${t}`:null}function UN({conversationId:e,queued:t}){let{t:n}=K(),[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(``);if(t.length===0)return null;let s=t=>{VN(a,t.images?.length??0)&&NN.getState().updateQueuedMessage(e,t.id,a.trim()),i(null)};return(0,G.jsx)(`div`,{className:`mb-1 flex flex-col gap-0.5`,children:t.map(t=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/60 border-dashed bg-muted/20 px-2.5 py-1.5 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground uppercase tracking-wide`,children:n(`Queued`)}),r===t.id?(0,G.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Enter`&&s(t),e.key===`Escape`&&i(null))},autoFocus:!0,className:`h-6 min-w-0 flex-1 rounded border bg-transparent px-1.5 outline-none focus:ring-1 focus:ring-ring`}):(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.text||`[image]`}),HN(t.images?.length??0,n(`attachments`))&&(0,G.jsxs)(`span`,{title:HN(t.images?.length??0,n(`attachments`))??void 0,className:`flex shrink-0 items-center gap-0.5 text-muted-foreground`,children:[(0,G.jsx)($t,{className:`h-3 w-3`}),t.images?.length]}),r===t.id?(0,G.jsx)(`button`,{type:`button`,onClick:()=>s(t),className:`shrink-0 rounded p-0.5 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(mt,{className:`h-3.5 w-3.5`})}):(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,G.jsx)(`button`,{type:`button`,title:n(`Withdraw message`),"aria-label":n(`Withdraw message`),onClick:()=>NN.getState().withdrawMessage(e,{kind:`queue`,id:t.id}),className:`rounded p-0.5 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(Jn,{className:`h-3 w-3`})}),(0,G.jsx)(`button`,{type:`button`,title:n(`Edit`),onClick:()=>{i(t.id),o(t.text)},className:`rounded p-0.5 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(xn,{className:`h-3 w-3`})}),(0,G.jsx)(`button`,{type:`button`,title:n(`Send now`),onClick:()=>NN.getState().sendQueuedNow(e,t.id),className:`rounded p-0.5 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(Mn,{className:`h-3 w-3`})}),(0,G.jsx)(`button`,{type:`button`,title:n(`Interrupt and send now`),onClick:()=>void NN.getState().interruptAndSendQueued(e,t.id),className:`rounded p-0.5 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(Wn,{className:`h-3 w-3`})}),(0,G.jsx)(`button`,{type:`button`,title:n(`Remove`),onClick:()=>NN.getState().removeQueuedMessage(e,t.id),className:`rounded p-0.5 text-muted-foreground hover:text-destructive`,children:(0,G.jsx)(er,{className:`h-3.5 w-3.5`})})]})]},t.id))})}var WN=0,GN=1,KN=2,qN=4;function JN(e){return()=>e}function YN(e){e()}function XN(e,t){return n=>e(t(n))}function ZN(e,t){return()=>e(t)}function QN(e,t){return n=>e(t,n)}function $N(e){return e!==void 0}function eP(...e){return()=>{e.map(YN)}}function tP(){}function nP(e,t){return t(e),e}function rP(e,t){return t(e)}function iP(...e){return e}function aP(e,t){return e(GN,t)}function oP(e,t){e(WN,t)}function sP(e){e(KN)}function cP(e){return e(qN)}function lP(e,t){return aP(e,QN(t,WN))}function uP(e,t){let n=e(GN,e=>{n(),t(e)});return n}function dP(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function fP(e,t){return e===t}function pP(e=fP){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function mP(e){return t=>n=>{e(n)&&t(n)}}function hP(e){return t=>XN(t,e)}function gP(e){return t=>()=>{t(e)}}function X(e,...t){let n=xP(...t);return((t,r)=>{switch(t){case KN:sP(e);return;case GN:return aP(e,n(r))}})}function _P(e,t){return n=>r=>{n(t=e(t,r))}}function vP(e){return t=>n=>{e>0?e--:t(n)}}function yP(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function bP(...e){let t=Array.from({length:e.length}),n=0,r=null,i=2**e.length-1;return e.forEach((e,a)=>{let o=2**a;aP(e,e=>{let s=n;n|=o,t[a]=e,s!==i&&n===i&&r&&(r(),r=null)})}),e=>a=>{let o=()=>{e([a].concat(t))};n===i?o():r=o}}function xP(...e){return t=>e.reduceRight(rP,t)}function SP(e){let t,n,r=()=>t?.();return function(i,a){switch(i){case GN:return a?n===a?void 0:(r(),n=a,t=aP(e,a),t):(r(),tP);case KN:r(),n=null;return}}}function Z(e){let t=e,n=wP();return((e,r)=>{switch(e){case WN:t=r;break;case GN:r(t);break;case qN:return t}return n(e,r)})}function CP(e,t){return nP(Z(t),t=>lP(e,t))}function wP(){let e=[];return((t,n)=>{switch(t){case WN:e.slice().forEach(e=>{e(n)});return;case KN:e.splice(0);return;case GN:return e.push(n),()=>{let t=e.indexOf(n);t>-1&&e.splice(t,1)}}})}function TP(e){return nP(wP(),t=>lP(e,t))}var EP={singleton:!0};function DP(e,t=[],n=EP){let{singleton:r}=n;return{constructor:e,dependencies:t,id:OP(),singleton:r}}var OP=()=>Symbol(`id`);function kP(e){let t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:a})=>{if(a&&t.has(i))return t.get(i);let o=e(r.map(e=>n(e)));return a&&t.set(i,o),o};return n(e)}function AP(...e){let t=wP(),n=Array.from({length:e.length}),r=0,i=2**e.length-1;return e.forEach((e,a)=>{let o=2**a;aP(e,e=>{n[a]=e,r|=o,r===i&&oP(t,n)})}),function(e,a){switch(e){case KN:sP(t);return;case GN:return r===i&&a(n),aP(t,a)}}}function jP(e,t=fP){return X(e,pP(t))}function MP(...e){return function(t,n){switch(t){case KN:return;case GN:return eP(...e.map(e=>aP(e,n)))}}}var NP={DEBUG:0,INFO:1,WARN:2,ERROR:3},PP={[NP.DEBUG]:`debug`,[NP.ERROR]:`error`,[NP.INFO]:`log`,[NP.WARN]:`warn`},FP=()=>typeof globalThis>`u`?window:globalThis,IP=DP(()=>{let e=Z(NP.ERROR);return{log:Z((t,n,r=NP.INFO)=>{r>=(FP().VIRTUOSO_LOG_LEVEL??cP(e))&&console[PP[r]](`%creact-virtuoso: %c%s %o`,`color: #0253b3; font-weight: bold`,`color: initial`,t,n)}),logLevel:e}},[],{singleton:!0});function LP(e){return`self`in e?e.document.documentElement:e}function RP(e){let t=LP(e);return t.ownerDocument.defaultView.getComputedStyle(t).direction===`rtl`}function zP(e,t){return RP(e)?-t:t}function BP(e,t){return RP(e)?-t:t}function VP(e,t,n){return HP(e,t,n).callbackRef}function HP(e,t,n){let r=H.useRef(null),i=e=>{},a=H.useMemo(()=>typeof ResizeObserver<`u`?new ResizeObserver(t=>{let r=()=>{let n=t[0].target;n.offsetParent!==null&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return i=e=>{e&&t?(a?.observe(e),r.current=e):(r.current&&a?.unobserve(r.current),r.current=null)},{callbackRef:i,ref:r}}function UP(e,t,n,r,i,a,o,s,c){return HP(H.useCallback(n=>{let c=WP(n.children,t,s?`offsetWidth`:`offsetHeight`,i),l=n.parentElement;for(;l.dataset.virtuosoScroller===void 0;)l=l.parentElement;let u=l.lastElementChild?.dataset.viewportType===`window`,d;u&&(d=l.ownerDocument.defaultView);let f=o?s?o.scrollWidth:o.scrollHeight:u?s?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight:s?l.scrollWidth:l.scrollHeight,p=o?s?o.offsetWidth:o.offsetHeight:u?s?d.innerWidth:d.innerHeight:s?l.offsetWidth:l.offsetHeight,m=o?s?zP(o,o.scrollLeft):o.scrollTop:u?s?zP(d,d.scrollX||d.document.documentElement.scrollLeft):d.scrollY||d.document.documentElement.scrollTop:s?zP(l,l.scrollLeft):l.scrollTop;r({scrollHeight:f,scrollTop:Math.max(m,0),viewportHeight:p}),a?.(s?GP(`column-gap`,getComputedStyle(n).columnGap,i):GP(`row-gap`,getComputedStyle(n).rowGap,i)),c!==null&&e(c)},[e,t,i,a,o,r,s]),n,c)}function WP(e,t,n,r){let i=e.length;if(i===0)return null;let a=[];for(let o=0;o<i;o++){let i=e.item(o);if(i.dataset.index===void 0)continue;let s=parseInt(i.dataset.index,10),c=parseFloat(i.dataset.knownSize),l=t(i,n);if(l===0&&r(`Zero-sized element, this should not happen`,{child:i},NP.ERROR),l===c)continue;let u=a[a.length-1];a.length===0||u.size!==l||u.endIndex!==s-1?a.push({endIndex:s,size:l,startIndex:s}):a[a.length-1].endIndex++}return a}function GP(e,t,n){return t!==`normal`&&t?.endsWith(`px`)!==!0&&n(`${e} was not resolved to pixel value correctly`,t,NP.WARN),t===`normal`?0:parseInt(t??`0`,10)}function KP(e,t,n){let r=H.useRef(null),i=H.useCallback(n=>{if(!n?.offsetParent)return;let i=n.getBoundingClientRect(),a=i.width,s,c;if(t){let e=t.getBoundingClientRect(),n=i.top-e.top;c=e.height-Math.max(0,n),s=n+t.scrollTop}else{let e=o.current.ownerDocument.defaultView;c=e.innerHeight-Math.max(0,i.top),s=i.top+e.scrollY}r.current={listHeight:i.height,offsetTop:s,visibleHeight:c,visibleWidth:a},e(r.current)},[e,t]),{callbackRef:a,ref:o}=HP(i,!0,n),s=H.useCallback(()=>{i(o.current)},[i,o]);return H.useEffect(()=>{if(t){t.addEventListener(`scroll`,s);let e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>{t.removeEventListener(`scroll`,s),e.unobserve(t)}}let e=o.current?.ownerDocument.defaultView;return e?.addEventListener(`scroll`,s),e?.addEventListener(`resize`,s),()=>{e?.removeEventListener(`scroll`,s),e?.removeEventListener(`resize`,s)}},[s,t,o]),a}var qP=DP(()=>{let e=wP(),t=wP(),n=Z(0),r=wP(),i=Z(0),a=wP(),o=wP(),s=Z(0),c=Z(0),l=Z(0),u=Z(0),d=wP(),f=wP(),p=Z(!1),m=Z(!1),h=Z(!1);return lP(X(e,hP(({scrollTop:e})=>e)),t),lP(X(e,hP(({scrollHeight:e})=>e)),o),lP(t,i),{deviation:n,fixedFooterHeight:l,fixedHeaderHeight:c,footerHeight:u,headerHeight:s,horizontalDirection:m,scrollBy:f,scrollContainerState:e,scrollHeight:o,scrollingInProgress:p,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:h,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:a}},[],{singleton:!0}),JP={lvl:0};function YP(e,t){let n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]),a=[];for(let o=1;o<n;o++){let{index:n,value:s}=t(e[o]);a.push({end:n-1,start:r,value:i}),r=n,i=s}return a.push({end:1/0,start:r,value:i}),a}function XP(e){return e===JP}function ZP(e,t){if(!XP(e))return t===e.k?e.v:t<e.k?ZP(e.l,t):ZP(e.r,t)}function QP(e,t,n=`k`){if(XP(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){let r=QP(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return QP(e.l,t,n)}function $P(e,t,n){return XP(e)?uF(t,n,1):t===e.k?oF(e,{k:t,v:n}):t<e.k?dF(oF(e,{l:$P(e.l,t,n)})):dF(oF(e,{r:$P(e.r,t,n)}))}function eF(){return JP}function tF(e,t,n){if(XP(e))return[];let r=QP(e,t)[0];return mF(iF(e,r,n))}function nF(e,t){if(XP(e))return JP;let{k:n,l:r,r:i}=e;if(t===n){if(XP(r))return i;if(XP(i))return r;let[t,n]=lF(r);return aF(oF(e,{k:t,l:sF(r),v:n}))}return aF(t<n?oF(e,{l:nF(r,t)}):oF(e,{r:nF(i,t)}))}function rF(e){return XP(e)?[]:[...rF(e.l),{k:e.k,v:e.v},...rF(e.r)]}function iF(e,t,n){if(XP(e))return[];let{k:r,l:i,r:a,v:o}=e,s=[];return r>t&&(s=s.concat(iF(i,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(iF(a,t,n))),s}function aF(e){let{l:t,lvl:n,r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(cF(t))return fF(oF(e,{lvl:n-1}));if(!XP(t)&&!XP(t.r))return oF(t.r,{l:oF(t,{r:t.r.l}),lvl:n,r:oF(e,{l:t.r.r,lvl:n-1})});throw Error(`Unexpected empty nodes`)}if(cF(e))return pF(oF(e,{lvl:n-1}));if(!XP(r)&&!XP(r.l)){let t=r.l,i=cF(t)?r.lvl-1:r.lvl;return oF(t,{l:oF(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:pF(oF(r,{l:t.r,lvl:i}))})}throw Error(`Unexpected empty nodes`)}function oF(e,t){return uF(t.k===void 0?e.k:t.k,t.v===void 0?e.v:t.v,t.lvl===void 0?e.lvl:t.lvl,t.l===void 0?e.l:t.l,t.r===void 0?e.r:t.r)}function sF(e){return XP(e.r)?e.l:aF(oF(e,{r:sF(e.r)}))}function cF(e){return XP(e)||e.lvl>e.r.lvl}function lF(e){return XP(e.r)?[e.k,e.v]:lF(e.r)}function uF(e,t,n,r=JP,i=JP){return{k:e,l:r,lvl:n,r:i,v:t}}function dF(e){return pF(fF(e))}function fF(e){let{l:t}=e;return!XP(t)&&t.lvl===e.lvl?oF(t,{r:oF(e,{l:t.r})}):e}function pF(e){let{lvl:t,r:n}=e;return!XP(n)&&!XP(n.r)&&n.lvl===t&&n.r.lvl===t?oF(n,{l:oF(e,{r:n.l}),lvl:t+1}):e}function mF(e){return YP(e,({k:e,v:t})=>({index:e,value:t}))}function hF(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function gF(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}var _F=DP(()=>({recalcInProgress:Z(!1)}),[],{singleton:!0});function vF(e,t,n){return e[yF(e,t,n)]}function yF(e,t,n,r=0){let i=e.length-1;for(;r<=i;){let a=Math.floor((r+i)/2),o=e[a],s=n(o,t);if(s===0)return a;if(s===-1){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw Error(`Failed binary finding record in array - ${e.join(`,`)}, searched for ${t}`)}function bF(e,t,n,r){let i=yF(e,t,r),a=yF(e,n,r,i);return e.slice(i,a+1)}function xF(e,t){return Math.round(e.getBoundingClientRect()[t])}function SF(e){return!XP(e.groupOffsetTree)}function CF({index:e},t){return t===e?0:t<e?-1:1}function pte(){return{groupIndices:[],groupOffsetTree:eF(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:eF()}}function mte(e,t){let n=XP(e)?0:1/0;for(let r of t){let{endIndex:t,size:i,startIndex:a}=r;if(n=Math.min(n,a),XP(e)){e=$P(e,0,i);continue}let o=tF(e,a-1,t+1);if(o.some(xte(r)))continue;let s=!1,c=!1;for(let{end:n,start:r,value:a}of o)s?(t>=r||i===a)&&(e=nF(e,r)):(c=a!==i,s=!0),n>t&&t>=r&&a!==i&&(e=$P(e,t+1,a));c&&(e=$P(e,a,i))}return[e,n]}function hte(e){return e.groupIndex!==void 0}function gte({offset:e},t){return t===e?0:t<e?-1:1}function wF(e,t,n){if(t.length===0)return 0;let{index:r,offset:i,size:a}=vF(t,e,CF),o=e-r,s=a*o+(o-1)*n+i;return s>0?s+n:s}function TF(e,t){if(!SF(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function EF(e,t,n){if(hte(e))return t.groupIndices[e.groupIndex]+1;let r=TF(e.index===`LAST`?n:e.index,t);return r=Math.max(0,Math.min(n,r)),r}function _te(e,t,n,r=0){return r>0&&(t=Math.max(t,vF(e,r,CF).offset)),YP(bF(e,t,n,gte),bte)}function vte(e,[t,n,r,i]){t.length>0&&r(`received item sizes`,t,NP.DEBUG);let a=e.sizeTree,o=a,s=0;if(n.length>0&&XP(a)&&t.length===2){let e=t[0].size,r=t[1].size;o=n.reduce((t,n)=>$P($P(t,n,e),n+1,r),o)}else[o,s]=mte(o,t);if(o===a)return e;let{lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d}=OF(e.offsetTree,s,o,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>$P(e,t,wF(t,d,i)),eF()),lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d,sizeTree:o}}function yte(e){return rF(e).map(({k:e,v:t},n,r)=>{let i=r[n+1];return{endIndex:i===void 0?1/0:i.k-1,size:t,startIndex:e}})}function DF(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function OF(e,t,n,r){let i=e,a=0,o=0,s=0,c=0;if(t===0)i=[];else{c=yF(i,t-1,CF),s=i[c].offset;let e=QP(n,t-1);a=e[0],o=e[1],i.length&&i[c].size===QP(n,t)[1]&&--c,i=i.slice(0,c+1)}for(let{start:e,value:c}of tF(n,t,1/0)){let t=e-a,n=t*o+s+t*r;i.push({index:e,offset:n,size:c}),a=e,s=n,o=c}return{lastIndex:a,lastOffset:s,lastSize:o,offsetTree:i}}function bte(e){return{index:e.index,value:e}}function xte(e){let{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}var Ste={offsetHeight:`height`,offsetWidth:`width`},kF=DP(([{log:e},{recalcInProgress:t}])=>{let n=wP(),r=wP(),i=CP(r,0),a=wP(),o=wP(),s=Z(0),c=Z([]),l=Z(void 0),u=Z(void 0),d=Z(void 0),f=Z(void 0),p=Z((e,t)=>xF(e,Ste[t])),m=Z(void 0),h=Z(0),g=pte(),_=CP(X(n,bP(c,e,h),_P(vte,g),pP()),g),v=CP(X(c,pP(),_P((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),hP(({prev:e})=>e)),[]);lP(X(c,mP(e=>e.length>0),bP(_,h),hP(([e,t,n])=>{let r=e.reduce((e,r,i)=>$P(e,r,wF(r,t.offsetTree,n)||i),eF());return{...t,groupIndices:e,groupOffsetTree:r}})),_),lP(X(r,bP(_),mP(([e,{lastIndex:t}])=>e<t),hP(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),lP(l,u);let y=CP(X(l,hP(e=>e===void 0)),!0);lP(X(u,mP(e=>e!==void 0&&XP(cP(_).sizeTree)),hP(e=>{let t=cP(d),n=cP(c).length>0;return t!==void 0&&t!==0?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),lP(X(f,mP(e=>e!==void 0&&e.length>0&&XP(cP(_).sizeTree)),hP(e=>{let t=[],n=e[0],r=0;for(let i=1;i<e.length;i++){let a=e[i];a!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=a,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),lP(X(c,bP(d,u),mP(([,e,t])=>e!==void 0&&t!==void 0),hP(([e,t,n])=>{let r=[];for(let i=0;i<e.length;i++){let a=e[i],o=e[i+1];r.push({startIndex:a,endIndex:a,size:t}),o!==void 0&&r.push({startIndex:a+1,endIndex:o-1,size:n})}return r})),n);let b=TP(X(n,bP(_),_P(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:g}),hP(e=>e.changed)));aP(X(s,_P((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),hP(e=>e.diff)),e=>{let{groupIndices:n}=cP(_);if(e>0)oP(t,!0),oP(a,e+DF(e,n));else if(e<0){let t=cP(v);t.length>0&&(e-=DF(-e,t)),oP(o,e)}}),aP(X(s,bP(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},NP.ERROR)});let x=TP(a);lP(X(a,bP(_),hP(([e,t])=>{let n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){let n=ZP(t.sizeTree,0),a=0,o=0;for(;a<e;){let e=t.groupIndices[o],s=t.groupIndices.length===o+1?1/0:t.groupIndices[o+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+s-1,size:i,startIndex:e+1}),o++,a+=s+1}let s=rF(t.sizeTree);return a!==e&&s.shift(),s.reduce((t,{k:n,v:r})=>{let i=t.ranges;return t.prevSize!==0&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return rF(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:i,ranges:[]}).ranges})),n);let S=TP(X(o,bP(_,h),hP(([e,{offsetTree:t},n])=>wF(-e,t,n))));return lP(X(o,bP(_,h),hP(([e,t,n])=>{if(t.groupIndices.length>0){if(XP(t.sizeTree))return t;let r=eF(),i=cP(v),a=0,o=0,s=0;for(;a<-e;){s=i[o];let e=i[o+1]-s-1;o++,a+=e+1}if(r=rF(t.sizeTree).reduce((t,{k:n,v:r})=>$P(t,Math.max(0,n+e),r),r),a!==-e){let n=ZP(t.sizeTree,s);r=$P(r,0,n);let i=QP(t.sizeTree,-e+1)[1];r=$P(r,1,i)}return{...t,sizeTree:r,...OF(t.offsetTree,0,r,n)}}let r=rF(t.sizeTree).reduce((t,{k:n,v:r})=>$P(t,Math.max(0,n+e),r),eF());return{...t,sizeTree:r,...OF(t.offsetTree,0,r,n)}})),_),{beforeUnshiftWith:x,data:m,defaultItemSize:u,firstItemIndex:s,fixedItemSize:l,fixedGroupSize:d,gap:h,groupIndices:c,heightEstimates:f,itemSize:p,listRefresh:b,shiftWith:o,shiftWithOffset:S,sizeRanges:n,sizes:_,statefulTotalCount:i,totalCount:r,trackItemSizes:y,unshiftWith:a}},iP(IP,_F),{singleton:!0});function Cte(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}var AF=DP(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{let a=wP(),o=wP(),s=TP(X(a,hP(Cte)));return lP(X(s,hP(e=>e.totalCount)),n),lP(X(s,hP(e=>e.groupIndices)),e),lP(X(AP(i,t,r),mP(([e,t])=>SF(t)),hP(([e,t,n])=>QP(t.groupOffsetTree,Math.max(e-n,0),`v`)[0]),pP(),hP(e=>[e])),o),{groupCounts:a,topItemsIndexes:o}},iP(kF,qP)),jF=DP(([{log:e}])=>{let t=Z(!1),n=TP(X(t,mP(e=>e),pP()));return aP(t,t=>{t&&cP(e)(`props updated`,{},NP.DEBUG)}),{didMount:n,propsReady:t}},iP(IP),{singleton:!0}),wte=typeof document<`u`&&`scrollBehavior`in document.documentElement.style;function MF(e){let t=typeof e==`number`?{index:e}:{...e};return t.align||=`start`,(!t.behavior||!wte)&&(t.behavior=`auto`),t.offset===void 0&&(t.offset=0),t}var NF=DP(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:a,footerHeight:o,headerHeight:s,scrollingInProgress:c,scrollTo:l,smoothScrollTargetReached:u,viewportHeight:d},{log:f}])=>{let p=wP(),m=wP(),h=Z(0),g=null,_=null,v=null;function y(){g!==null&&(g(),g=null),v!==null&&(v(),v=null),_&&=(clearTimeout(_),null),oP(c,!1)}return lP(X(p,bP(n,d,r,h,s,o,f),bP(e,a,i),hP(([[e,n,r,i,a,o,s,l],d,f,h])=>{let b=MF(e),{align:x,behavior:S,offset:C}=b,w=i-1,T=EF(b,n,w),E=wF(T,n.offsetTree,d)+o;x===`end`?(E+=f+QP(n.sizeTree,T)[1]-r+h,T===w&&(E+=s)):x===`center`?E+=(f+QP(n.sizeTree,T)[1]-r+h)/2:E-=a,C!==void 0&&C!==0&&(E+=C);let D=t=>{y(),t?(l(`retrying to scroll to`,{location:e},NP.DEBUG),oP(p,e)):(oP(m,!0),l(`list did not change, scroll successful`,{},NP.DEBUG))};if(y(),S===`smooth`){let e=!1;v=aP(t,t=>{e||=t}),g=uP(u,()=>{D(e)})}else g=uP(X(t,Tte(150)),D);return _=setTimeout(()=>{y()},1200),oP(c,!0),l(`scrolling from index to`,{behavior:S,index:T,top:E},NP.DEBUG),{behavior:S,top:E}})),l),{scrollTargetReached:m,scrollToIndex:p,topListHeight:h}},iP(kF,qP,IP),{singleton:!0});function Tte(e){return t=>{let n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}function PF(e,t){e===0?t():requestAnimationFrame(()=>{PF(e-1,t)})}function FF(e,t){if(e===void 0)return 0;let n=t-1,r=typeof e==`number`?e:e.index===`LAST`?n:e.index;return Math.max(0,Math.min(r,n))}function IF(e){return e===void 0?!0:typeof e==`number`?e===0:e.index===0&&(e.align===void 0||e.align===`start`)&&(e.offset===void 0||e.offset===0)}var LF=DP(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:a},{didMount:o}])=>{let s=Z(!0),c=Z(0),l=Z(!0);return lP(X(o,bP(c),mP(([e,t])=>!IF(t)),gP(!1)),s),lP(X(o,bP(c),mP(([e,t])=>!IF(t)),gP(!1)),l),aP(X(AP(t,o),bP(s,n,e,l),mP(([[,e],t,{sizeTree:n},r,i])=>e&&(!XP(n)||$N(r))&&!t&&!i),bP(c)),([,e])=>{if(e===void 0){oP(s,!0),oP(l,!0);return}uP(i,()=>{oP(l,!0)}),PF(4,()=>{uP(r,()=>{oP(s,!0)}),oP(a,e)})}),{initialItemFinalLocationReached:l,initialTopMostItemIndex:c,scrolledToInitialItem:s}},iP(kF,qP,NF,jF),{singleton:!0});function RF(e,t){return Math.abs(e-t)<1.01}var zF=`up`,BF=`down`,Ete=`none`,Dte={atBottom:!1,notAtBottomBecause:`NOT_SHOWING_LAST_ITEM`,state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Ote=0,VF=DP(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:a}])=>{let o=Z(!1),s=Z(!0),c=wP(),l=wP(),u=Z(4),d=Z(Ote),f=CP(X(MP(X(jP(i),vP(1),gP(!0)),X(jP(i),vP(1),gP(!1),dP(100))),pP()),!1),p=CP(X(MP(X(n,gP(!0)),X(n,gP(!1),dP(200))),pP()),!1);lP(X(AP(jP(i),jP(d)),hP(([e,t])=>e<=t),pP()),s),lP(X(s,yP(50)),l);let m=TP(X(AP(r,jP(a),jP(t),jP(e),jP(u)),_P((e,[{scrollHeight:t,scrollTop:n},r,i,a,o])=>{let s=n+r-t>-o,c={scrollHeight:t,scrollTop:n,viewportHeight:r};if(s){let t,r;return n>e.state.scrollTop?(t=`SCROLLED_DOWN`,r=e.state.scrollTop-n):(t=`SIZE_DECREASED`,r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:c}}let l;return l=c.scrollHeight>e.state.scrollHeight?`SIZE_INCREASED`:r<e.state.viewportHeight?`VIEWPORT_HEIGHT_DECREASING`:n<e.state.scrollTop?`SCROLLING_UPWARDS`:`NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM`,{atBottom:!1,notAtBottomBecause:l,state:c}},Dte),pP((e,t)=>e!==void 0&&e.atBottom===t.atBottom))),h=CP(X(r,_P((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(!RF(e.scrollHeight,t)){let i=t-(n+r)<1;return e.scrollTop!==n&&i?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}return{changed:!1,jump:0,scrollHeight:t,scrollTop:n}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),mP(e=>e.changed),hP(e=>e.jump)),0);lP(X(m,hP(e=>e.atBottom)),o),lP(X(o,yP(50)),c);let g=Z(BF);lP(X(r,hP(({scrollTop:e})=>e),pP(),_P((e,t)=>cP(p)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?zF:BF,prevScrollTop:t},{direction:BF,prevScrollTop:0}),hP(e=>e.direction)),g),lP(X(r,yP(50),gP(Ete)),g);let _=Z(0);return lP(X(f,mP(e=>!e),gP(0)),_),lP(X(i,yP(100),bP(f),mP(([e,t])=>t),_P(([e,t],[n])=>[t,n],[0,0]),hP(([e,t])=>t-e)),_),{atBottomState:m,atBottomStateChange:c,atBottomThreshold:u,atTopStateChange:l,atTopThreshold:d,isAtBottom:o,isAtTop:s,isScrolling:f,lastJumpDueToItemResize:h,scrollDirection:g,scrollVelocity:_}},iP(qP)),HF=`top`,UF=`bottom`,WF=`none`;function GF(e,t,n){return typeof e==`number`?n===zF&&t===HF||n===BF&&t===UF?e:0:n===zF?t===HF?e.main:e.reverse:t===UF?e.main:e.reverse}function KF(e,t){return typeof e==`number`?e:e[t]??0}var qF=DP(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{let a=wP(),o=Z(0),s=Z(0),c=Z(0);return{increaseViewportBy:s,listBoundary:a,overscan:c,topListHeight:o,visibleRange:CP(X(AP(jP(r),jP(i),jP(n),jP(a,gF),jP(c),jP(o),jP(t),jP(e),jP(s)),hP(([e,t,n,[r,i],a,o,s,c,l])=>{let u=e-c,d=o+s,f=Math.max(n-u,0),p=WF,m=KF(l,HF),h=KF(l,UF);return r-=c,r+=n+s,i+=n+s,i-=c,r>e+d-m&&(p=zF),i<e-f+t+h&&(p=BF),p===WF?null:[Math.max(u-n-GF(a,HF,p)-m,0),u-f-s+t+GF(a,UF,p)+h]}),mP(e=>e!==null),pP(gF)),[0,0])}},iP(qP),{singleton:!0});function kte(e,t,n){if(SF(t)){let r=TF(e,t);return[{index:QP(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}var JF={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function YF(e,t,n,r,i,a){let{lastIndex:o,lastOffset:s,lastSize:c}=i,l=0,u=0;if(e.length>0){l=e[0].offset;let t=e[e.length-1];u=t.offset+t.size}let d=n-o,f=s+d*c+(d-1)*r,p=l,m=f-u;return{bottom:u,firstItemIndex:a,items:ZF(e,i,a),offsetBottom:m,offsetTop:l,top:p,topItems:ZF(t,i,a),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function XF(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(let t of n.groupIndices){if(t-o>=e)break;o++}let s=e+o,c=FF(t,s);return YF(Array.from({length:s}).map((e,t)=>({data:a[t+c],index:t+c,offset:0,size:0})),[],s,i,n,r)}function ZF(e,t,n){if(e.length===0)return[];if(!SF(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));let r=e[0].index,i=e[e.length-1].index,a=[],o=tF(t.groupOffsetTree,r,i),s,c=0;for(let r of e){(!s||s.end<r.index)&&(s=o.shift(),c=t.groupIndices.indexOf(s.start));let e;e=r.index===s.start?{index:c,type:`group`}:{groupIndex:c,index:r.index-(c+1)+n},a.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return a}function QF(e,t){return e===void 0?0:typeof e==`number`?e:e[t]??0}var $F=DP(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},a,{listBoundary:o,topListHeight:s,visibleRange:c},{initialTopMostItemIndex:l,scrolledToInitialItem:u},{topListHeight:d},f,{didMount:p},{recalcInProgress:m}])=>{let h=Z([]),g=Z(0),_=wP(),v=Z(0);lP(a.topItemsIndexes,h);let y=CP(X(AP(p,m,jP(c,gF),jP(i),jP(r),jP(l),u,jP(h),jP(t),jP(n),jP(v),e),mP(([e,t,,n,,,,,,,,r])=>{let i=r!==void 0&&r.length!==n;return e&&!t&&!i}),hP(([,,[e,t],n,r,i,a,o,s,c,l,u])=>{let d=r,{offsetTree:f,sizeTree:p}=d,m=cP(g);if(n===0)return{...JF,totalCount:n};if(e===0&&t===0)return m===0?{...JF,totalCount:n}:XF(m,i,r,s,c,u||[]);if(XP(p))return m>0?null:YF(kte(FF(i,n),d,u),[],n,c,d,s);let h=[];if(o.length>0){let e=o[0],t=o[o.length-1],n=0;for(let r of tF(p,e,t)){let i=r.value,a=Math.max(r.start,e),o=Math.min(r.end,t);for(let e=a;e<=o;e++)h.push({data:u?.[e],index:e,offset:n,size:i}),n+=i}}if(!a)return YF([],h,n,c,d,s);let _=o.length>0?o[o.length-1]+1:0,v=_te(f,e,t,_);if(v.length===0)return null;let y=n-1,b=nP([],n=>{for(let r of v){let i=r.value,a=i.offset,o=r.start,s=i.size;if(i.offset<e){o+=Math.floor((e-i.offset+c)/(s+c));let t=o-r.start;a+=t*s+t*c}o<_&&(a+=(_-o)*s,o=_);let l=Math.min(r.end,y);for(let e=o;e<=l&&!(a>=t);e++)n.push({data:u?.[e],index:e,offset:a,size:s}),a+=s+c}}),x=QF(l,HF),S=QF(l,UF);if(b.length>0&&(x>0||S>0)){let e=b[0],t=b[b.length-1];if(x>0&&e.index>_){let t=Math.min(x,e.index-_),n=[],r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){let t=tF(p,i,i)[0]?.value??e.size;r-=t+c,n.unshift({data:u?.[i],index:i,offset:r,size:t})}b.unshift(...n)}if(S>0&&t.index<y){let e=Math.min(S,y-t.index),n=t.offset+t.size+c;for(let r=t.index+1;r<=t.index+e;r++){let e=tF(p,r,r)[0]?.value??t.size;b.push({data:u?.[r],index:r,offset:n,size:e}),n+=e+c}}}return YF(b,h,n,c,d,s)}),mP(e=>e!==null),pP()),JF);lP(X(e,mP($N),hP(e=>e?.length)),i),lP(X(y,hP(e=>e.topListHeight)),d),lP(d,s),lP(X(y,hP(e=>[e.top,e.bottom])),o),lP(X(y,hP(e=>e.items)),_);let b=TP(X(y,mP(({items:e})=>e.length>0),bP(i,e),mP(([{items:e},t])=>e[e.length-1].originalIndex===t-1),hP(([,e,t])=>[e-1,t]),pP(gF),hP(([e])=>e))),x=TP(X(y,yP(200),mP(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),hP(({items:e})=>e[0].index),pP()));return{endReached:b,initialItemCount:g,itemsRendered:_,listState:y,minOverscanItemCount:v,rangeChanged:TP(X(y,mP(({items:e})=>e.length>0),hP(({items:e})=>{let t=0,n=e.length-1;for(;e[t].type===`group`&&t<n;)t++;for(;e[n].type===`group`&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),pP(hF))),startReached:x,topItemsIndexes:h,...f}},iP(kF,AF,qF,LF,NF,VF,jF,_F),{singleton:!0}),eI=DP(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{let a=wP(),o=CP(X(AP(n,e,r,t,i),hP(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return lP(jP(o),a),{totalListHeight:o,totalListHeightChanged:a}},iP(qP,$F),{singleton:!0}),Ate=DP(([{viewportHeight:e},{totalListHeight:t}])=>{let n=Z(!1);return{alignToBottom:n,paddingTopAddition:CP(X(AP(n,e,t),mP(([e])=>e),hP(([,e,t])=>Math.max(0,e-t)),yP(0),pP()),0)}},iP(qP,eI),{singleton:!0}),tI=DP(()=>({context:Z(null)})),jte=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:a,viewportTop:o})=>t<o?{...i,align:n??`start`,...r===void 0?{}:{behavior:r}}:e>a?{...i,align:n??`end`,...r===void 0?{}:{behavior:r}}:null,nI=DP(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:a,scrollingInProgress:o,scrollTop:s,viewportHeight:c},{scrollToIndex:l}])=>{let u=wP();return lP(X(u,bP(t,c,n,a,i,r,s),bP(e),hP(([[e,t,n,r,i,a,s,c],l])=>{let{calculateViewLocation:u=jte,done:d,...f}=e,p=EF(e,t,r-1),m=wF(p,t.offsetTree,l)+i+a,h=m+QP(t.sizeTree,p)[1],g=c+a,_=u({itemBottom:h,itemTop:m,locationParams:f,viewportBottom:c+n-s,viewportTop:g});return _===null?d?.():d&&uP(X(o,mP(e=>!e),vP(cP(o)?1:2)),d),_}),mP(e=>e!==null)),l),{scrollIntoView:u}},iP(kF,qP,NF,$F,IP),{singleton:!0});function rI(e){return e===!1?!1:e===`smooth`?`smooth`:`auto`}var Mte=(e,t)=>typeof e==`function`?rI(e(t)):t&&rI(e),Nte=DP(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:a},{scrollToIndex:o},{scrolledToInitialItem:s},{didMount:c,propsReady:l},{log:u},{scrollingInProgress:d},{context:f},{scrollIntoView:p}])=>{let m=Z(!1),h=wP(),g=null;function _(e){oP(o,{align:`end`,behavior:e,index:`LAST`})}aP(X(AP(X(jP(t),vP(1)),c),bP(jP(m),a,s,d),hP(([[e,t],n,r,i,a])=>{let o=t&&i,s=`auto`;return o&&(s=Mte(n,r||a),o&&=s!==!1),{followOutputBehavior:s,shouldFollow:o,totalCount:e}}),mP(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{g!==null&&(g(),g=null),cP(n)===void 0?g=uP(e,()=>{cP(u)(`following output to `,{totalCount:r},NP.DEBUG),_(t),g=null}):requestAnimationFrame(()=>{cP(u)(`following output to `,{totalCount:r},NP.DEBUG),_(t)})});function v(e){let t=uP(i,t=>{e&&!t.atBottom&&t.notAtBottomBecause===`SIZE_INCREASED`&&g===null&&(cP(u)(`scrolling to bottom due to increased size`,{},NP.DEBUG),_(`auto`))});setTimeout(t,100)}aP(X(AP(jP(m),t,l),mP(([e,,t])=>e!==!1&&t),_P(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),mP(({refreshed:e})=>e),bP(m,t)),([,e])=>{cP(s)&&v(e!==!1)}),aP(h,()=>{v(cP(m)!==!1)}),aP(AP(jP(m),i),([e,t])=>{e!==!1&&!t.atBottom&&t.notAtBottomBecause===`VIEWPORT_HEIGHT_DECREASING`&&_(`auto`)});let y=Z(null),b=wP();return lP(MP(X(jP(r),hP(e=>e?.length??0)),X(jP(t))),b),aP(X(AP(X(b,vP(1)),c),bP(jP(y),s,d,f),hP(([[e,t],n,r,i,a])=>t&&r&&n?.({context:a,totalCount:e,scrollingInProgress:i})),mP(e=>!!e),yP(0)),t=>{g!==null&&(g(),g=null),cP(n)===void 0?g=uP(e,()=>{cP(u)(`scrolling into view`,{}),oP(p,t),g=null}):requestAnimationFrame(()=>{cP(u)(`scrolling into view`,{}),oP(p,t)})}),{autoscrollToBottom:h,followOutput:m,scrollIntoViewOnChange:y}},iP(kF,VF,NF,LF,jF,IP,qP,tI,nI)),Pte=DP(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(lP(X(s,bP(a),mP(([,e])=>e!==0),bP(i,r,t,n,e),hP(([[,e],t,n,r,i,a=[]])=>XF(e,t,n,r,i,a))),o),{}),iP(kF,LF,$F,jF),{singleton:!0}),Fte=DP(([{didMount:e},{scrollTo:t},{listState:n}])=>{let r=Z(0);return aP(X(e,bP(r),mP(([,e])=>e!==0),hP(([,e])=>({top:e}))),e=>{uP(X(n,vP(1),mP(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{oP(t,e)})})}),{initialScrollTop:r}},iP(jF,qP,$F),{singleton:!0}),iI=DP(([{scrollVelocity:e}])=>{let t=Z(!1),n=wP(),r=Z(!1);return lP(X(e,bP(r,t,n),mP(([e,t])=>t!==!1&&t!==void 0),hP(([e,t,n,r])=>{let{enter:i,exit:a}=t;if(n){if(a(e,r))return!1}else if(i(e,r))return!0;return n}),pP()),t),aP(X(AP(t,e,n),bP(r)),([[e,t,n],r])=>{e&&r!==!1&&r!==void 0&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},iP(VF),{singleton:!0}),aI=DP(([{scrollContainerState:e,scrollTo:t}])=>{let n=wP(),r=wP(),i=wP(),a=Z(!1),o=Z(void 0);return lP(X(AP(n,r),hP(([{scrollTop:e,viewportHeight:t},{offsetTop:n,listHeight:r}])=>({scrollHeight:r,scrollTop:Math.max(0,e-n),viewportHeight:t}))),e),lP(X(t,bP(r),hP(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:o,useWindowScroll:a,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},iP(qP)),Ite=DP(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:a},{useWindowScroll:o,windowScrollContainerState:s,windowViewportRect:c}])=>{let l=wP(),u=Z(void 0),d=Z(null),f=Z(null);return lP(s,d),lP(c,f),aP(X(l,bP(t,r,o,d,f,n)),([e,t,n,r,i,a,o])=>{let s=yte(t.sizeTree);r&&i!==null&&a!==null&&(n=i.scrollTop-a.offsetTop),n-=o,e({ranges:s,scrollTop:n})}),lP(X(u,mP($N),hP(Lte)),i),lP(X(a,bP(u),mP(([,e])=>e!==void 0),pP(),hP(([,e])=>e.ranges)),e),{getState:l,restoreStateFrom:u}},iP(kF,qP,LF,jF,aI));function Lte(e){return{align:`start`,index:0,offset:e.scrollTop}}var Rte=DP(([{topItemsIndexes:e}])=>{let t=Z(0);return lP(X(t,mP(e=>e>=0),hP(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},iP($F));function oI(e){let t=!1,n;return(()=>(t||(t=!0,n=e()),n))}var zte=oI(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),sI=DP(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:a,groupIndices:o,heightEstimates:s,itemSize:c,sizeRanges:l,sizes:u,statefulTotalCount:d,totalCount:f,trackItemSizes:p},{initialItemFinalLocationReached:m,initialTopMostItemIndex:h,scrolledToInitialItem:g},_,v,y,b,{scrollToIndex:x},S,{topItemCount:C},{groupCounts:w},T])=>{let{listState:E,minOverscanItemCount:D,topItemsIndexes:O,rangeChanged:k,...A}=b;return lP(k,T.scrollSeekRangeChanged),lP(X(AP(T.windowViewportRect,_.headerHeight,_.fixedHeaderHeight),hP(([e,t,n])=>Math.max(t+n+1,e.visibleHeight))),_.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:a,groupCounts:w,heightEstimates:s,initialItemFinalLocationReached:m,initialTopMostItemIndex:h,scrolledToInitialItem:g,sizeRanges:l,topItemCount:C,topItemsIndexes:O,totalCount:f,...y,groupIndices:o,itemSize:c,listState:E,minOverscanItemCount:D,scrollToIndex:x,statefulTotalCount:d,trackItemSizes:p,rangeChanged:k,...A,...T,..._,sizes:u,...v}},iP(kF,LF,qP,Ite,Nte,$F,NF,DP(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:a,lastJumpDueToItemResize:o,scrollDirection:s},{listState:c},{beforeUnshiftWith:l,gap:u,shiftWithOffset:d,sizes:f},{log:p},{recalcInProgress:m}])=>{let h=TP(X(c,bP(o),_P(([,e,t,n],[{bottom:r,items:i,offsetBottom:a,totalCount:o},s])=>{let c=r+a,l=0;return t===o&&e.length>0&&i.length>0&&(i[0].originalIndex===0&&e[0].originalIndex===0||(l=c-n,l!==0&&(l+=s))),[l,i,o,c]},[0,[],0,0]),mP(([e])=>e!==0),bP(r,s,n,i,p,m),mP(([,e,t,n,,,r])=>!r&&!n&&e!==0&&t===zF),hP(([[e],,,,,t])=>(t(`Upward scrolling compensation`,{amount:e},NP.DEBUG),e))));function g(n){n>0?(oP(t,{behavior:`auto`,top:-n}),oP(e,0)):(oP(e,0),oP(t,{behavior:`auto`,top:-n}))}return aP(X(h,bP(e,a)),([t,n,r])=>{r&&zte()?oP(e,n-t):g(-t)}),aP(X(AP(CP(a,!1),e,m),mP(([e,t,n])=>!e&&!n&&t!==0),hP(([e,t])=>t),yP(1)),g),lP(X(d,hP(e=>({top:-e}))),t),aP(X(l,bP(f,u),hP(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function a(e){return e*(n+i)}if(t.length===0)return a(e);let o=0,s=ZP(r,0),c=0,l=0;for(;c<e;){c++,o+=s;let n=t.length===l+1?1/0:t[l+1]-t[l]-1;c+n>e&&(o-=s,n=e-c+1),c+=n,o+=a(n),l++}return o})),n=>{oP(e,n),requestAnimationFrame(()=>{oP(t,{top:n}),requestAnimationFrame(()=>{oP(e,0),oP(m,!1)})})}),{deviation:e}},iP(qP,VF,$F,kF,IP,_F)),Rte,AF,DP(([e,t,n,r,i,a,o,s,c,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...c,...l,...u}),iP(qF,Pte,jF,iI,eI,Fte,Ate,aI,nI,IP,tI))));function Bte(e,t){let n={},r={},i=0,a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(let e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}var cI=typeof document>`u`?H.useEffect:H.useLayoutEffect;function lI(e,t,n){let r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),s=H.createContext({});function c(e,n){e.propsReady!==void 0&&oP(e.propsReady,!1);for(let i of r){let r=e[t.required[i]];oP(r,n[i])}for(let r of i)if(r in n){let i=e[t.optional[r]];oP(i,n[r])}e.propsReady!==void 0&&oP(e.propsReady,!0)}function l(e){return a.reduce((n,r)=>(n[r]=n=>{let i=e[t.methods[r]];oP(i,n)},n),{})}function u(e){return o.reduce((n,r)=>(n[r]=SP(e[t.events[r]]),n),{})}return{Component:H.forwardRef(function(t,a){let{children:d,...f}=t,[p]=H.useState(()=>nP(kP(e),e=>{c(e,f)})),[m]=H.useState(ZN(u,p));cI(()=>{for(let e of o)e in f&&aP(m[e],f[e]);return()=>{Object.values(m).map(sP)}},[f,m,p]),cI(()=>{c(p,f)}),H.useImperativeHandle(a,JN(l(p)));let h=n;return(0,G.jsx)(s.Provider,{value:p,children:n===void 0?d:(0,G.jsx)(h,{...Bte([...r,...i,...o],f),children:d})})}),useEmitter:(e,t)=>{let n=H.useContext(s)[e];cI(()=>aP(n,t),[t,n])},useEmitterValue:e=>{let t=H.useContext(s)[e],n=H.useCallback(e=>aP(t,e),[t]);return H.useSyncExternalStore(n,()=>cP(t),()=>cP(t))},usePublisher:e=>{let t=H.useContext(s);return H.useCallback(n=>{oP(t[e],n)},[t,e])}}}var uI=H.createContext(void 0),dI=H.createContext(void 0),fI=`-webkit-sticky`,pI=`sticky`,mI=oI(()=>{if(typeof document>`u`)return pI;let e=document.createElement(`div`);return e.style.position=fI,e.style.position===fI?fI:pI}),hI=typeof document>`u`?H.useEffect:H.useLayoutEffect;function gI(e){return`self`in e}function Vte(e){return`body`in e}function _I(e,t,n,r=tP,i,a){let o=H.useRef(null),s=H.useRef(null),c=H.useRef(null),l=H.useCallback(n=>{let r,i,o,l=n.target;if(Vte(l)||gI(l)){let e=gI(l)?l:l.defaultView;o=a===!0?zP(e,e.scrollX):e.scrollY,r=a===!0?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=a===!0?e.innerWidth:e.innerHeight}else o=a===!0?zP(l,l.scrollLeft):l.scrollTop,r=a===!0?l.scrollWidth:l.scrollHeight,i=a===!0?l.offsetWidth:l.offsetHeight;let u=()=>{e({scrollHeight:r,scrollTop:Math.max(o,0),viewportHeight:i})};n.suppressFlushSync===!0?u():Lo.flushSync(u),s.current!==null&&(o===s.current||o<=0||o===r-i)&&(s.current=null,t(!0),c.current&&=(clearTimeout(c.current),null))},[e,t,a]);H.useEffect(()=>{let e=i??o.current;return r(i??o.current),l({suppressFlushSync:!0,target:e}),e.addEventListener(`scroll`,l,{passive:!0}),()=>{r(null),e.removeEventListener(`scroll`,l)}},[o,l,n,r,i]);function u(n){let r=o.current;if(!r||(a===!0?`offsetWidth`in r&&r.offsetWidth===0:`offsetHeight`in r&&r.offsetHeight===0))return;let i=n.behavior===`smooth`,l,u,d;gI(r)?(u=Math.max(xF(r.document.documentElement,a===!0?`width`:`height`),a===!0?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),l=a===!0?r.innerWidth:r.innerHeight,d=a===!0?zP(r,r.scrollX):r.scrollY):(u=r[a===!0?`scrollWidth`:`scrollHeight`],l=xF(r,a===!0?`width`:`height`),d=a===!0?zP(r,r.scrollLeft):r.scrollTop);let f=u-l;if(n.top===void 0){r.scrollTo(n);return}let p=Math.ceil(Math.max(Math.min(f,n.top),0));if(n.top=p,RF(l,u)||p===d){e({scrollHeight:u,scrollTop:d,viewportHeight:l}),i&&t(!0);return}i?(s.current=p,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,s.current=null,t(!0)},1e3)):s.current=null,a===!0&&(n={...n.behavior===void 0?{}:{behavior:n.behavior},left:BP(r,p)}),r.scrollTo(n)}function d(e){a===!0&&(e={...e.behavior===void 0?{}:{behavior:e.behavior},...e.top===void 0?{}:{left:BP(o.current,e.top)}}),o.current.scrollBy(e)}return{scrollByCallback:d,scrollerRef:o,scrollToCallback:u}}function vI(e){return e}var Hte=DP(([e,t])=>({...e,...t}),iP(sI,DP(()=>{let e=Z(e=>`Item ${e}`),t=Z(e=>`Group ${e}`),n=Z({}),r=Z(vI),i=Z(`div`),a=Z(tP),o=(e,t=null)=>CP(X(n,hP(t=>t[e]),pP()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:o(`EmptyPlaceholder`),FooterComponent:o(`Footer`),GroupComponent:o(`Group`,`div`),groupContent:t,HeaderComponent:o(`Header`),HeaderFooterTag:i,ItemComponent:o(`Item`,`div`),itemContent:e,ListComponent:o(`List`,`div`),ScrollerComponent:o(`Scroller`,`div`),scrollerRef:a,ScrollSeekPlaceholder:o(`ScrollSeekPlaceholder`),TopItemListComponent:o(`TopItemList`)}}))),Ute=({height:e})=>(0,G.jsx)(`div`,{style:{height:e}}),Wte={overflowAnchor:`none`,position:mI(),zIndex:1},yI={overflowAnchor:`none`},Gte={...yI,display:`inline-block`,height:`100%`},bI=H.memo(function({showTopList:e=!1}){let t=OI(`listState`),n=kI(`sizeRanges`),r=OI(`useWindowScroll`),i=OI(`customScrollParent`),a=kI(`windowScrollContainerState`),o=kI(`scrollContainerState`),s=i||r?a:o,c=OI(`itemContent`),l=OI(`context`),u=OI(`groupContent`),d=OI(`trackItemSizes`),f=OI(`itemSize`),p=OI(`log`),m=kI(`gap`),h=OI(`horizontalDirection`),{callbackRef:g}=UP(n,f,d,e?tP:s,p,m,i,h,OI(`skipAnimationFrameInResizeObserver`)),[_,v]=H.useState(0);DI(`deviation`,e=>{_!==e&&v(e)});let y=OI(`EmptyPlaceholder`),b=OI(`ScrollSeekPlaceholder`)??Ute,x=OI(`ListComponent`),S=OI(`ItemComponent`),C=OI(`GroupComponent`),w=OI(`computeItemKey`),T=OI(`isSeeking`),E=OI(`groupIndices`).length>0,D=OI(`alignToBottom`),O=OI(`initialItemFinalLocationReached`),k=e?{}:{boxSizing:`border-box`,...h?{display:`inline-block`,height:`100%`,marginInlineStart:_===0?D?`auto`:0:_,paddingInlineEnd:t.offsetBottom,paddingInlineStart:t.offsetTop,whiteSpace:`nowrap`}:{marginTop:_===0?D?`auto`:0:_,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...O?{}:{visibility:`hidden`}};return!e&&t.totalCount===0&&y!=null?(0,G.jsx)(y,{...CI(y,l)}):(0,G.jsx)(x,{...CI(x,l),"data-testid":e?`virtuoso-top-item-list`:`virtuoso-item-list`,ref:g,style:k,children:(e?t.topItems:t.items).map(e=>{let n=e.originalIndex,r=w(n+t.firstItemIndex,e.data,l);return T?(0,H.createElement)(b,{...CI(b,l),height:e.size,index:e.index,key:r,type:e.type||`item`,...e.type===`group`?{}:{groupIndex:e.groupIndex}}):e.type===`group`?(0,H.createElement)(C,{...CI(C,l),"data-index":n,"data-item-index":e.index,"data-known-size":e.size,key:r,style:Wte},u(e.index,l)):(0,H.createElement)(S,{...CI(S,l),...wI(S,e.data),"data-index":n,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:h?Gte:yI},E?c(e.index,e.groupIndex,e.data,l):c(e.index,e.data,l))})})}),Kte={height:`100%`,outline:`none`,overflowY:`auto`,position:`relative`,WebkitOverflowScrolling:`touch`},qte={outline:`none`,overflowX:`auto`,position:`relative`},xI=e=>({height:`100%`,position:`absolute`,top:0,width:`100%`,...e?{display:`flex`,flexDirection:`column`}:void 0}),SI=(e,t,n=0)=>({...xI(e),position:t?`relative`:`absolute`,top:t?-n:0}),Jte={position:mI(),top:0,width:`100%`,zIndex:1};function CI(e,t){if(typeof e!=`string`)return{context:t}}function wI(e,t){return{item:typeof e==`string`?void 0:t}}var Yte=H.memo(function(){let e=OI(`HeaderComponent`),t=kI(`headerHeight`),n=OI(`HeaderFooterTag`),r=VP(H.useMemo(()=>e=>{t(xF(e,`height`))},[t]),!0,OI(`skipAnimationFrameInResizeObserver`)),i=OI(`context`);return e==null?null:(0,G.jsx)(n,{ref:r,children:(0,G.jsx)(e,{...CI(e,i)})})}),Xte=H.memo(function(){let e=OI(`FooterComponent`),t=kI(`footerHeight`),n=OI(`HeaderFooterTag`),r=VP(H.useMemo(()=>e=>{t(xF(e,`height`))},[t]),!0,OI(`skipAnimationFrameInResizeObserver`)),i=OI(`context`);return e==null?null:(0,G.jsx)(n,{ref:r,children:(0,G.jsx)(e,{...CI(e,i)})})});function TI({useEmitter:e,useEmitterValue:t,usePublisher:n}){return H.memo(function({children:r,style:i,context:a,...o}){let s=n(`scrollContainerState`),c=t(`ScrollerComponent`),l=n(`smoothScrollTargetReached`),u=t(`scrollerRef`),d=t(`horizontalDirection`)||!1,{scrollByCallback:f,scrollerRef:p,scrollToCallback:m}=_I(s,l,c,u,void 0,d);return e(`scrollTo`,m),e(`scrollBy`,f),(0,G.jsx)(c,{"data-testid":`virtuoso-scroller`,"data-virtuoso-scroller":!0,ref:p,style:{...d?qte:Kte,...i},tabIndex:0,...o,...CI(c,a),children:r})})}function EI({useEmitter:e,useEmitterValue:t,usePublisher:n}){return H.memo(function({children:r,style:i,context:a,...o}){let s=n(`windowScrollContainerState`),c=t(`ScrollerComponent`),l=n(`smoothScrollTargetReached`),u=t(`totalListHeight`),d=t(`deviation`),f=t(`customScrollParent`),p=H.useRef(null),{scrollByCallback:m,scrollerRef:h,scrollToCallback:g}=_I(s,l,c,t(`scrollerRef`),f);return hI(()=>(h.current=f??p.current?.ownerDocument.defaultView,()=>{h.current=null}),[h,f]),e(`windowScrollTo`,g),e(`scrollBy`,m),(0,G.jsx)(c,{ref:p,"data-virtuoso-scroller":!0,style:{position:`relative`,...i,...u===0?void 0:{height:u+d}},...o,...CI(c,a),children:r})})}var Zte=({children:e})=>{let t=H.useContext(uI),n=kI(`viewportHeight`),r=kI(`fixedItemHeight`),i=OI(`alignToBottom`),a=OI(`horizontalDirection`),o=VP(H.useMemo(()=>XN(n,e=>xF(e,a?`width`:`height`)),[n,a]),!0,OI(`skipAnimationFrameInResizeObserver`));return H.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,G.jsx)(`div`,{"data-viewport-type":`element`,ref:o,style:xI(i),children:e})},Qte=({children:e})=>{let t=H.useContext(uI),n=kI(`windowViewportRect`),r=kI(`fixedItemHeight`),i=OI(`customScrollParent`),a=OI(`useWindowScroll`),o=OI(`topListHeight`),s=KP(n,i,OI(`skipAnimationFrameInResizeObserver`)),c=OI(`alignToBottom`);return H.useEffect(()=>{t&&(r(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,G.jsx)(`div`,{"data-viewport-type":`window`,ref:s,style:SI(c,a,o),children:e})},$te=({children:e})=>{let t=OI(`TopItemListComponent`)??`div`,n=OI(`headerHeight`),r={...Jte,marginTop:`${n}px`},i=OI(`context`);return(0,G.jsx)(t,{style:r,...CI(t,i),children:e})},{Component:ene,useEmitter:DI,useEmitterValue:OI,usePublisher:kI}=lI(Hte,{optional:{restoreStateFrom:`restoreStateFrom`,context:`context`,followOutput:`followOutput`,scrollIntoViewOnChange:`scrollIntoViewOnChange`,itemContent:`itemContent`,groupContent:`groupContent`,overscan:`overscan`,increaseViewportBy:`increaseViewportBy`,minOverscanItemCount:`minOverscanItemCount`,totalCount:`totalCount`,groupCounts:`groupCounts`,topItemCount:`topItemCount`,firstItemIndex:`firstItemIndex`,initialTopMostItemIndex:`initialTopMostItemIndex`,components:`components`,atBottomThreshold:`atBottomThreshold`,atTopThreshold:`atTopThreshold`,computeItemKey:`computeItemKey`,defaultItemHeight:`defaultItemHeight`,fixedGroupHeight:`fixedGroupHeight`,fixedItemHeight:`fixedItemHeight`,heightEstimates:`heightEstimates`,itemSize:`itemSize`,scrollSeekConfiguration:`scrollSeekConfiguration`,headerFooterTag:`HeaderFooterTag`,data:`data`,initialItemCount:`initialItemCount`,initialScrollTop:`initialScrollTop`,alignToBottom:`alignToBottom`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`,horizontalDirection:`horizontalDirection`,skipAnimationFrameInResizeObserver:`skipAnimationFrameInResizeObserver`},methods:{scrollToIndex:`scrollToIndex`,scrollIntoView:`scrollIntoView`,scrollTo:`scrollTo`,scrollBy:`scrollBy`,autoscrollToBottom:`autoscrollToBottom`,getState:`getState`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,totalListHeightChanged:`totalListHeightChanged`,itemsRendered:`itemsRendered`,groupIndices:`groupIndices`}},H.memo(function(e){let t=OI(`useWindowScroll`),n=OI(`topItemsIndexes`).length>0,r=OI(`customScrollParent`),i=OI(`context`);return(0,G.jsxs)(r||t?jI:AI,{...e,context:i,children:[n&&(0,G.jsx)($te,{children:(0,G.jsx)(bI,{showTopList:!0})}),(0,G.jsxs)(r||t?Qte:Zte,{children:[(0,G.jsx)(Yte,{}),(0,G.jsx)(bI,{}),(0,G.jsx)(Xte,{})]})]})})),AI=TI({useEmitter:DI,useEmitterValue:OI,usePublisher:kI}),jI=EI({useEmitter:DI,useEmitterValue:OI,usePublisher:kI}),MI=ene,NI=DP(([e,t])=>({...e,...t}),iP(sI,DP(()=>{let e=Z(e=>(0,G.jsxs)(`td`,{children:[`Item $`,e]})),t=Z(null),n=Z(e=>(0,G.jsxs)(`td`,{colSpan:1e3,children:[`Group `,e]})),r=Z(null),i=Z(null),a=Z({}),o=Z(vI),s=Z(tP),c=(e,t=null)=>CP(X(a,hP(t=>t[e]),pP()),t);return{components:a,computeItemKey:o,context:t,EmptyPlaceholder:c(`EmptyPlaceholder`),FillerRow:c(`FillerRow`),fixedFooterContent:i,fixedHeaderContent:r,itemContent:e,groupContent:n,ScrollerComponent:c(`Scroller`,`div`),scrollerRef:s,ScrollSeekPlaceholder:c(`ScrollSeekPlaceholder`),TableBodyComponent:c(`TableBody`,`tbody`),TableComponent:c(`Table`,`table`),TableFooterComponent:c(`TableFoot`,`tfoot`),TableHeadComponent:c(`TableHead`,`thead`),TableRowComponent:c(`TableRow`,`tr`),GroupComponent:c(`Group`,`tr`)}}))),PI=({height:e})=>(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{style:{height:e}})}),FI=({height:e})=>(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{style:{border:0,height:e,padding:0}})}),II={overflowAnchor:`none`},LI={position:mI(),zIndex:2,overflowAnchor:`none`},RI=H.memo(function({showTopList:e=!1}){let t=UI(`listState`),n=UI(`computeItemKey`),r=UI(`firstItemIndex`),i=UI(`context`),a=UI(`isSeeking`),o=UI(`fixedHeaderHeight`),s=UI(`groupIndices`).length>0,c=UI(`itemContent`),l=UI(`groupContent`),u=UI(`ScrollSeekPlaceholder`)??PI,d=UI(`GroupComponent`),f=UI(`TableRowComponent`),p=(e?t.topItems:[]).reduce((e,t,n)=>(n===0?e.push(t.size):e.push(e[n-1]+t.size),e),[]);return(e?t.topItems:t.items).map(t=>{let m=t.originalIndex,h=n(m+r,t.data,i),g=e?m===0?0:p[m-1]:0;return a?(0,H.createElement)(u,{...CI(u,i),height:t.size,index:t.index,key:h,type:t.type||`item`}):t.type===`group`?(0,H.createElement)(d,{...CI(d,i),"data-index":m,"data-item-index":t.index,"data-known-size":t.size,key:h,style:{...LI,top:o}},l(t.index,i)):(0,H.createElement)(f,{...CI(f,i),...wI(f,t.data),"data-index":m,"data-item-index":t.index,"data-known-size":t.size,"data-item-group-index":t.groupIndex,key:h,style:e?{...LI,top:o+g}:II},s?c(t.index,t.groupIndex,t.data,i):c(t.index,t.data,i))})}),zI=H.memo(function(){let e=UI(`listState`),t=UI(`topItemsIndexes`).length>0,n=WI(`sizeRanges`),r=UI(`useWindowScroll`),i=UI(`customScrollParent`),a=WI(`windowScrollContainerState`),o=WI(`scrollContainerState`),s=i||r?a:o,c=UI(`trackItemSizes`),{callbackRef:l,ref:u}=UP(n,UI(`itemSize`),c,s,UI(`log`),void 0,i,!1,UI(`skipAnimationFrameInResizeObserver`)),[d,f]=H.useState(0);HI(`deviation`,e=>{d!==e&&(u.current.style.marginTop=`${e}px`,f(e))});let p=UI(`EmptyPlaceholder`),m=UI(`FillerRow`)??FI,h=UI(`TableBodyComponent`),g=UI(`paddingTopAddition`),_=UI(`statefulTotalCount`),v=UI(`context`);if(_===0&&p!=null)return(0,G.jsx)(p,{...CI(p,v)});let y=(t?e.topItems:[]).reduce((e,t)=>e+t.size,0),b=e.offsetTop+g+d-y,x=e.offsetBottom,S=b>0?(0,G.jsx)(m,{context:v,height:b},`padding-top`):null,C=x>0?(0,G.jsx)(m,{context:v,height:x},`padding-bottom`):null;return(0,G.jsxs)(h,{"data-testid":`virtuoso-item-list`,ref:l,...CI(h,v),children:[S,t&&(0,G.jsx)(RI,{showTopList:!0}),(0,G.jsx)(RI,{}),C]})}),BI=({children:e})=>{let t=H.useContext(uI),n=WI(`viewportHeight`),r=WI(`fixedItemHeight`),i=VP(H.useMemo(()=>XN(n,e=>xF(e,`height`)),[n]),!0,UI(`skipAnimationFrameInResizeObserver`));return H.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,G.jsx)(`div`,{"data-viewport-type":`element`,ref:i,style:xI(!1),children:e})},VI=({children:e})=>{let t=H.useContext(uI),n=WI(`windowViewportRect`),r=WI(`fixedItemHeight`),i=UI(`customScrollParent`),a=UI(`useWindowScroll`),o=KP(n,i,UI(`skipAnimationFrameInResizeObserver`));return H.useEffect(()=>{t&&(r(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,G.jsx)(`div`,{"data-viewport-type":`window`,ref:o,style:SI(!1,a),children:e})},{Component:tne,useEmitter:HI,useEmitterValue:UI,usePublisher:WI}=lI(NI,{optional:{restoreStateFrom:`restoreStateFrom`,context:`context`,followOutput:`followOutput`,firstItemIndex:`firstItemIndex`,itemContent:`itemContent`,groupContent:`groupContent`,fixedHeaderContent:`fixedHeaderContent`,fixedFooterContent:`fixedFooterContent`,overscan:`overscan`,increaseViewportBy:`increaseViewportBy`,minOverscanItemCount:`minOverscanItemCount`,totalCount:`totalCount`,topItemCount:`topItemCount`,initialTopMostItemIndex:`initialTopMostItemIndex`,components:`components`,groupCounts:`groupCounts`,atBottomThreshold:`atBottomThreshold`,atTopThreshold:`atTopThreshold`,computeItemKey:`computeItemKey`,defaultItemHeight:`defaultItemHeight`,fixedGroupHeight:`fixedGroupHeight`,fixedItemHeight:`fixedItemHeight`,itemSize:`itemSize`,scrollSeekConfiguration:`scrollSeekConfiguration`,data:`data`,initialItemCount:`initialItemCount`,initialScrollTop:`initialScrollTop`,alignToBottom:`alignToBottom`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`},methods:{scrollToIndex:`scrollToIndex`,scrollIntoView:`scrollIntoView`,scrollTo:`scrollTo`,scrollBy:`scrollBy`,getState:`getState`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,totalListHeightChanged:`totalListHeightChanged`,itemsRendered:`itemsRendered`,groupIndices:`groupIndices`}},H.memo(function(e){let t=UI(`useWindowScroll`),n=UI(`customScrollParent`),r=WI(`fixedHeaderHeight`),i=WI(`fixedFooterHeight`),a=UI(`fixedHeaderContent`),o=UI(`fixedFooterContent`),s=UI(`context`),c=VP(H.useMemo(()=>XN(r,e=>xF(e,`height`)),[r]),!0,UI(`skipAnimationFrameInResizeObserver`)),l=VP(H.useMemo(()=>XN(i,e=>xF(e,`height`)),[i]),!0,UI(`skipAnimationFrameInResizeObserver`)),u=n||t?KI:GI,d=n||t?VI:BI,f=UI(`TableComponent`),p=UI(`TableHeadComponent`),m=UI(`TableFooterComponent`),h=a?(0,G.jsx)(p,{ref:c,style:{position:`sticky`,top:0,zIndex:2},...CI(p,s),children:a()},`TableHead`):null,g=o?(0,G.jsx)(m,{ref:l,style:{bottom:0,position:`sticky`,zIndex:1},...CI(m,s),children:o()},`TableFoot`):null;return(0,G.jsx)(u,{...e,...CI(u,s),children:(0,G.jsx)(d,{children:(0,G.jsxs)(f,{style:{borderSpacing:0,overflowAnchor:`none`},...CI(f,s),children:[h,(0,G.jsx)(zI,{},`TableBody`),g]})})})})),GI=TI({useEmitter:HI,useEmitterValue:UI,usePublisher:WI}),KI=EI({useEmitter:HI,useEmitterValue:UI,usePublisher:WI}),qI={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},JI={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:YI,floor:XI,max:ZI,min:QI,round:$I}=Math;function eL(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:n===null?null:n[r+e],index:r+e}))}function tL(e){return{...JI,items:e}}function nL(e,t){return e!==void 0&&e.width===t.width&&e.height===t.height}function rL(e,t){return e!==void 0&&e.column===t.column&&e.row===t.row}var iL=DP(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:a,scrollBy:o,scrollContainerState:s,scrollTo:c,scrollTop:l,smoothScrollTargetReached:u,viewportHeight:d},f,p,{didMount:m,propsReady:h},{customScrollParent:g,useWindowScroll:_,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:b},x])=>{let S=Z(0),C=Z(0),w=Z(qI),T=Z({height:0,width:0}),E=Z({height:0,width:0}),D=wP(),O=wP(),k=Z(0),A=Z(null),j=Z({column:0,row:0}),M=wP(),N=wP(),P=Z(!1),F=Z(0),I=Z(!0),ee=Z(!1),L=Z(!1);aP(X(m,bP(F),mP(([e,t])=>!IF(t))),()=>{oP(I,!1)}),aP(X(AP(m,I,E,T,F,ee),mP(([e,t,n,r,,i])=>e&&!t&&n.height!==0&&r.height!==0&&!i)),([,,,,e])=>{if(e===void 0){oP(I,!0);return}oP(ee,!0),PF(1,()=>{oP(D,e)}),uP(X(l),()=>{oP(t,[0,0]),oP(I,!0)})}),lP(X(N,mP(e=>e!=null&&e.scrollTop>0),gP(0)),C),aP(X(m,bP(N),mP(([,e])=>e!=null)),([,e])=>{e&&(oP(T,e.viewport),oP(E,e.item),oP(j,e.gap),e.scrollTop>0&&(oP(P,!0),uP(X(l,vP(1)),e=>{oP(P,!1)}),oP(c,{top:e.scrollTop})))}),lP(X(T,hP(({height:e})=>e)),d),lP(X(AP(jP(T,nL),jP(E,nL),jP(j,(e,t)=>e!==void 0&&e.column===t.column&&e.row===t.row),jP(l)),hP(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),M),lP(X(AP(jP(S),r,jP(j,rL),jP(E,nL),jP(T,nL),jP(A),jP(C),jP(P),jP(I),jP(F)),mP(([,,,,,,,e])=>!e),hP(([e,[t,n],r,i,a,o,s,,c,l])=>{let{column:u,row:d}=r,{height:f,width:p}=i,{width:m}=a;if(s===0&&(e===0||m===0))return qI;if(p===0){let t=FF(l,e);return tL(eL(t,t+Math.max(s-1,0),o))}let h=aL(m,p,u),g,_;c?t===0&&n===0&&s>0?(g=0,_=s-1):(g=h*XI((t+d)/(f+d)),_=h*YI((n+d)/(f+d))-1,_=QI(e-1,ZI(_,h-1)),g=QI(_,ZI(0,g))):(g=0,_=-1);let v=eL(g,_,o),{bottom:y,top:b}=oL(a,r,i,v),x=YI(e/h);return{bottom:y,itemHeight:f,items:v,itemWidth:p,offsetBottom:x*f+(x-1)*d-y,offsetTop:b,top:b}})),w),lP(X(A,mP(e=>e!==null),hP(e=>e.length)),S),lP(X(AP(T,E,w,j),mP(([e,t,{items:n}])=>n.length>0&&t.height!==0&&e.height!==0),hP(([e,t,{items:n},r])=>{let{bottom:i,top:a}=oL(e,r,t,n);return[a,i]}),pP(gF)),t);let te=Z(!1);lP(X(l,bP(te),hP(([e,t])=>t||e!==0)),te);let R=TP(X(AP(w,S),mP(([{items:e}])=>e.length>0),bP(te),mP(([[e,t],n])=>{let r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&e.offsetBottom===0&&e.items.length===t)&&r}),hP(([[,e]])=>e-1),pP())),z=TP(X(jP(w),mP(({items:e})=>e.length>0&&e[0].index===0),gP(0),pP())),ne=TP(X(jP(w),bP(P),mP(([{items:e},t])=>e.length>0&&!t),hP(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),pP(hF),yP(0)));lP(ne,p.scrollSeekRangeChanged),lP(X(D,bP(T,E,S,j),hP(([e,t,n,r,i])=>{let a=MF(e),{align:o,behavior:s,offset:c}=a,l=a.index;l===`LAST`&&(l=r-1),l=ZI(0,l,QI(r-1,l));let u=sL(t,i,n,l);return o===`end`?u=$I(u-t.height+n.height):o===`center`&&(u=$I(u-t.height/2+n.height/2)),c!==void 0&&c!==0&&(u+=c),{behavior:s,top:u}})),c);let re=CP(X(w,hP(e=>e.offsetBottom+e.bottom)),0);return lP(X(b,hP(e=>({height:e.visibleHeight,width:e.visibleWidth}))),T),{customScrollParent:g,data:A,deviation:k,footerHeight:i,gap:j,headerHeight:a,increaseViewportBy:e,initialItemCount:C,itemDimensions:E,overscan:n,restoreStateFrom:N,scrollBy:o,scrollContainerState:s,scrollHeight:O,scrollTo:c,scrollToIndex:D,scrollTop:l,smoothScrollTargetReached:u,totalCount:S,useWindowScroll:_,viewportDimensions:T,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:b,...p,gridState:w,horizontalDirection:L,initialTopMostItemIndex:F,totalListHeight:re,...f,endReached:R,propsReady:h,rangeChanged:ne,startReached:z,stateChanged:M,stateRestoreInProgress:P,...x}},iP(qF,qP,VF,iI,jF,aI,IP));function aL(e,t,n){return ZI(1,XI((e+n)/(XI(t)+n)))}function oL(e,t,n,r){let{height:i}=n;if(i===void 0||r.length===0)return{bottom:0,top:0};let a=sL(e,t,n,r[0].index);return{bottom:sL(e,t,n,r[r.length-1].index)+i,top:a}}function sL(e,t,n,r){let i=XI(r/aL(e.width,n.width,t.column)),a=i*n.height+ZI(0,i-1)*t.row;return a>0?a+t.row:a}var cL=DP(([e,t])=>({...e,...t}),iP(iL,DP(()=>{let e=Z(e=>`Item ${e}`),t=Z({}),n=Z(null),r=Z(`virtuoso-grid-item`),i=Z(`virtuoso-grid-list`),a=Z(vI),o=Z(`div`),s=Z(tP),c=(e,n=null)=>CP(X(t,hP(t=>t[e]),pP()),n),l=Z(!1),u=Z(!1);return lP(jP(u),l),{components:t,computeItemKey:a,context:n,FooterComponent:c(`Footer`),HeaderComponent:c(`Header`),headerFooterTag:o,itemClassName:r,ItemComponent:c(`Item`,`div`),itemContent:e,listClassName:i,ListComponent:c(`List`,`div`),readyStateChanged:l,reportReadyState:u,ScrollerComponent:c(`Scroller`,`div`),scrollerRef:s,ScrollSeekPlaceholder:c(`ScrollSeekPlaceholder`,`div`)}}))),lL=H.memo(function(){let e=hL(`gridState`),t=hL(`listClassName`),n=hL(`itemClassName`),r=hL(`itemContent`),i=hL(`computeItemKey`),a=hL(`isSeeking`),o=gL(`scrollHeight`),s=hL(`ItemComponent`),c=hL(`ListComponent`),l=hL(`ScrollSeekPlaceholder`),u=hL(`context`),d=gL(`itemDimensions`),f=gL(`gap`),p=hL(`log`),m=hL(`stateRestoreInProgress`),h=gL(`reportReadyState`),g=VP(H.useMemo(()=>e=>{let t=e.parentElement.parentElement.scrollHeight;o(t);let n=e.firstChild;if(n!==null){let{height:e,width:t}=n.getBoundingClientRect();d({height:e,width:t})}f({column:yL(`column-gap`,getComputedStyle(e).columnGap,p),row:yL(`row-gap`,getComputedStyle(e).rowGap,p)})},[o,d,f,p]),!0,!1);return hI(()=>{e.itemHeight>0&&e.itemWidth>0&&h(!0)},[e]),m?null:(0,G.jsx)(c,{className:t,ref:g,...CI(c,u),"data-testid":`virtuoso-item-list`,style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(t=>{let o=i(t.index,t.data,u);return a?(0,G.jsx)(l,{...CI(l,u),height:e.itemHeight,index:t.index,width:e.itemWidth},o):(0,H.createElement)(s,{...CI(s,u),className:n,"data-index":t.index,key:o},r(t.index,t.data,u))})})}),uL=H.memo(function(){let e=hL(`HeaderComponent`),t=gL(`headerHeight`),n=hL(`headerFooterTag`),r=VP(H.useMemo(()=>e=>{t(xF(e,`height`))},[t]),!0,!1),i=hL(`context`);return e==null?null:(0,G.jsx)(n,{ref:r,children:(0,G.jsx)(e,{...CI(e,i)})})}),dL=H.memo(function(){let e=hL(`FooterComponent`),t=gL(`footerHeight`),n=hL(`headerFooterTag`),r=VP(H.useMemo(()=>e=>{t(xF(e,`height`))},[t]),!0,!1),i=hL(`context`);return e==null?null:(0,G.jsx)(n,{ref:r,children:(0,G.jsx)(e,{...CI(e,i)})})}),fL=({children:e})=>{let t=H.useContext(dI),n=gL(`itemDimensions`),r=gL(`viewportDimensions`),i=VP(H.useMemo(()=>e=>{r(e.getBoundingClientRect())},[r]),!0,!1);return H.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),(0,G.jsx)(`div`,{ref:i,style:xI(!1),children:e})},pL=({children:e})=>{let t=H.useContext(dI),n=gL(`windowViewportRect`),r=gL(`itemDimensions`),i=hL(`customScrollParent`),a=hL(`useWindowScroll`),o=KP(n,i,!1);return H.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),(0,G.jsx)(`div`,{ref:o,style:SI(!1,a),children:e})},{Component:nne,useEmitter:mL,useEmitterValue:hL,usePublisher:gL}=lI(cL,{optional:{context:`context`,totalCount:`totalCount`,overscan:`overscan`,itemContent:`itemContent`,components:`components`,computeItemKey:`computeItemKey`,data:`data`,initialItemCount:`initialItemCount`,scrollSeekConfiguration:`scrollSeekConfiguration`,headerFooterTag:`headerFooterTag`,listClassName:`listClassName`,itemClassName:`itemClassName`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`,restoreStateFrom:`restoreStateFrom`,initialTopMostItemIndex:`initialTopMostItemIndex`,increaseViewportBy:`increaseViewportBy`},methods:{scrollTo:`scrollTo`,scrollBy:`scrollBy`,scrollToIndex:`scrollToIndex`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,stateChanged:`stateChanged`,readyStateChanged:`readyStateChanged`}},H.memo(function({...e}){let t=hL(`useWindowScroll`),n=hL(`customScrollParent`),r=n||t?vL:_L,i=n||t?pL:fL,a=hL(`context`);return(0,G.jsx)(r,{...e,...CI(r,a),children:(0,G.jsxs)(i,{children:[(0,G.jsx)(uL,{}),(0,G.jsx)(lL,{}),(0,G.jsx)(dL,{})]})})})),_L=TI({useEmitter:mL,useEmitterValue:hL,usePublisher:gL}),vL=EI({useEmitter:mL,useEmitterValue:hL,usePublisher:gL});function yL(e,t,n){return t!==`normal`&&t?.endsWith(`px`)!==!0&&n(`${e} was not resolved to pixel value correctly`,t,NP.WARN),t===`normal`?0:parseInt(t??`0`,10)}function bL({name:e,color:t}){return(0,G.jsx)(jo,{name:e,variant:`beam`,colors:$a(t),size:`100%`,className:`absolute inset-0 h-full w-full`})}var xL=2e3,SL=6e4;function CL(){let e=globalThis[C];return typeof e==`string`?e:null}function wL(e,t,n){let r=xL,i=!1,a,o=()=>{t(e).then(e=>{if(!i){if(e)return n();r=Math.min(r*2,SL),a=setTimeout(o,r)}})};return a=setTimeout(o,r),()=>{i=!0,clearTimeout(a)}}var TL=e=>new Promise(t=>{let n=new Image;n.onload=()=>t(!0),n.onerror=()=>t(!1),n.src=e});function EL(e){let t=CL();!t||typeof caches>`u`||ge(caches,t,e).catch(()=>{})}var DL=`#7c5cff`;function OL({name:e,color:t,image:n,className:r,enso:i}){let[a,o]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!(!n||a!==n||!CL()))return wL(n,TL,()=>o(null))},[a,n]),n&&a!==n?(0,G.jsx)(`img`,{"data-enso":i,"data-image":`true`,src:n,alt:``,draggable:!1,onError:()=>o(n),className:W(`object-cover`,r),style:t?{backgroundColor:t}:void 0}):(0,G.jsx)(`span`,{"data-enso":i,"data-generated":`true`,className:W(`relative block shrink-0 overflow-hidden`,r),children:(0,G.jsx)(bL,{name:e.trim()||`secretary`,color:t??DL})})}var kL={xs:`size-6 rounded-[8px] text-[11.5px]`,sm:`size-[22px] rounded-[7px] text-[11.5px]`,md:`size-7 rounded-[9px] text-[13px]`,lg:`size-11 rounded-[13px] text-base`};function AL({name:e,color:t,image:n,needsYou:r,running:i,size:a=`md`,enso:o=`secretary-avatar`}){let s=r>0?`warn`:i>0?`run`:null;return(0,G.jsxs)(`span`,{"data-enso":o,"data-image":n?`true`:void 0,className:W(`relative flex shrink-0`,kL[a]),children:[(0,G.jsx)(OL,{name:e,color:t,image:n,enso:`${o}-face`,className:`size-full overflow-hidden rounded-[inherit]`}),s&&(0,G.jsx)(`span`,{"data-enso":`secretary-pip`,"data-tone":s,className:W(`absolute -top-1 -right-1 size-2.5 rounded-full border-2 border-background`,s===`warn`?`bg-warning`:`bg-success`)})]})}var jL=e=>e===`oauth-credentials-unloaded`||e===`oauth-credentials-loading`||e===`oauth-credentials-error`;function ML(e){switch(e.oauthCredentials.status){case`unloaded`:return{reason:`oauth-credentials-unloaded`,suggestedAction:`load-oauth-credentials`};case`loading`:return{reason:`oauth-credentials-loading`,suggestedAction:`wait-for-oauth-credentials`};case`error`:return{reason:`oauth-credentials-error`,suggestedAction:`retry-oauth-credentials`,credentialError:e.oauthCredentials.error};case`ready`:return null}}function NL(e,t,n,r){if(!e)return`missing-selection`;if(pj(e)){if(!r)return`provider-missing`;let i=mj(r,e);return i?i.enabled?NL(i.primary,t,n):`model-disabled`:`model-missing`}let a=t.find(t=>t.id===e.providerId);if(!a)return`provider-missing`;if(!a.enabled)return`provider-disabled`;if(y(a))return`classifier-only`;let o=a.models.find(t=>t.id===e.modelId);return o?o.enabled===!1?`model-disabled`:a.oauthAccountPool!==void 0&&!i(a)?`oauth-account-missing`:a.oauthAccountKey?n.oauthCredentials.status===`ready`?i(a)?me(a,e.modelId,t,n.oauthCredentials.authenticatedAccountKeys).length>0?`usable`:`oauth-account-missing`:n.oauthCredentials.authenticatedAccountKeys.has(a.oauthAccountKey)?`usable`:`oauth-account-missing`:ML(n)?.reason??`oauth-credentials-error`:a.apiKey?`usable`:`api-key-missing`:`model-missing`}function PL(e,t){let n=e?.groupId?t.find(t=>t.id===e.groupId):void 0;return{projectDefaultModel:e?.defaultModel??null,groupDefaultModel:n?.defaultModel??null,projectReasoningEnabled:e?.defaultReasoningEnabled,projectThinkingLevel:e?.defaultThinkingLevel,groupReasoningEnabled:n?.defaultReasoningEnabled,groupThinkingLevel:n?.defaultThinkingLevel}}function FL(e){let t=NL(e.defaultModel,e.providers,e.credentials,e.virtualModels),n=e.defaultModel!==null&&t!==`usable`&&!jL(t),r=[{selection:e.lastProviderId&&e.lastModelId?{providerId:e.lastProviderId,modelId:e.lastModelId}:null,source:`session`},{selection:e.projectDefaultModel??null,source:`project`},{selection:e.groupDefaultModel??null,source:`group`},{selection:e.defaultModel,source:`default`}];for(let t of r){let r=NL(t.selection,e.providers,e.credentials,e.virtualModels);if(r===`usable`&&t.selection)return{...t.selection,source:t.source,invalidDefault:t.source!=="default"&&n};if(jL(r)){let t=ML(e.credentials);if(t)return{providerId:null,modelId:null,source:`none`,invalidDefault:n,...t}}}return{providerId:null,modelId:null,source:`none`,invalidDefault:n,...(jL(t)?ML(e.credentials):null)??{reason:`no-usable-model`}}}var IL={revision:0,availability:{status:`unloaded`}},LL=_N(()=>({snapshot:IL}));function RL(e){return{oauthCredentials:e.availability}}var zL=_N(()=>({snapshot:void 0}));function BL(){return _j(Ce.getState().providers,zL.getState().snapshot)}function VL(e){new Set(e)}function HL(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var UL=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return UL(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return UL(t)(e)}}}},WL=(e,t)=>(n,r,i)=>{let a={storage:HL(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return UL(u.getItem.bind(u))(a.name).then(e=>{if(e){if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state]}return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{++s,u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p},GL=e=>{if(typeof e!=`string`||!e.startsWith(`plugin:`))return!1;let t=e.indexOf(`:`,7);return t>7&&t<e.length-1};function KL(e,t,n){if(!t)return!1;let r=e.uiByConversation[t]?.open;return r===void 0?!n&&e.liveGlobalTabs.length>0:r}function qL(e){let t=Array.isArray(e.globalTabs)?e.globalTabs.filter(GL):[],n=e.globalScopeOverrides,r={};if(n&&typeof n==`object`&&!Array.isArray(n))for(let[e,t]of Object.entries(n))GL(e)&&(t===`global`||t===`session`)&&(r[e]=t);return{globalTabs:[...new Set(t)],globalScopeOverrides:r}}function JL(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function YL(e,t){if(JL(e)){if(e.type===`leaf`){let n=JL(e.data)?e.data:void 0,r=Array.isArray(n?.views)?n.views.filter(e=>typeof e==`string`&&t.has(e)):[];if(r.length===0)return;let i=typeof n?.activeView==`string`&&t.has(n.activeView)?n.activeView:r[0];return{type:`leaf`,data:{...n,views:r,activeView:i},size:e.size}}if(e.type===`branch`){let n=Array.isArray(e.data)?e.data.flatMap(e=>{let n=YL(e,t);return n?[n]:[]}):[];return n.length===0?void 0:{type:`branch`,data:n,size:e.size}}}}function XL(e,t){return!e||!JL(e.panels)||!(t in e.panels)?e:ZL(e,e=>e!==t)}function ZL(e,t){if(!JL(e)||!JL(e.panels))return;let n={};for(let[r,i]of Object.entries(e.panels))t(r,i)&&(n[r]=i);let r=new Set(Object.keys(n));if(r.size===0)return;let i=JL(e.grid)?e.grid:void 0,a=i?YL(i.root,r):void 0;if(a)return{...e,panels:n,grid:{...i,root:a}}}var QL=4,$L=e=>{if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null};function eR(e){if(!$L(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(!$L(r))continue;let e={};for(let[t,n]of Object.entries(r))typeof n==`string`&&(e[t]=n);Object.keys(e).length>0&&(t[n]=e)}return t}function tR(e,t){let n=$L(e)?e:{};if(t<2)return{state:{uiByConversation:{},layouts:{}},snapshots:{}};if(t<QL)return{state:{uiByConversation:t<3?{}:n.uiByConversation??{},layouts:n.layouts??{},changesModeByConversation:n.changesModeByConversation??{}},snapshots:eR(n.snapshotsByConversation)};let{snapshotsByConversation:r,...i}=n;return{state:i,snapshots:{}}}function nR(e,t){let{state:n,snapshots:r}=tR(e,t);return{state:{...n,...qL(n)},snapshots:r}}function rR(e){return typeof e!=`number`||!Number.isFinite(e)?224:Math.min(480,Math.max(160,e))}function iR(e,t){let n=rR(e);if(t<=0)return n;let r=Math.max(224,t-240-1);return Math.min(n,r)}function aR(e,t,n){let r=iR(e,n),i=iR(r+t,n);return i===r?rR(e):i}function oR(e,t,n=1){let r=Math.max(280,e);if(t<=0)return r;let i=Math.max(0,t-360-n);return Math.min(i,r)}function sR(e,t,n,r=1){let i=oR(e,n,r),a=oR(i+t,n,r);return a===i?e:a}function cR(){return NN.getState().activeId??void 0}function lR(e,t){return e.uiByConversation[t]??{width:e.lastWidth}}function uR(e,t){return KL(e,t,eO())}function dR(e,t,n){return{...e.fullscreenByConversation,[t]:n}}function fR(e,t,n){return{...e.uiByConversation,[t]:{...lR(e,t),...n}}}var pR=_N()(WL((e,t)=>({fullscreen:!1,fullscreenByConversation:{},lastWidth:360,filesTreeWidth:224,uiByConversation:{},browserHoles:{},layouts:{},pinnedTabs:[],globalTabs:[],globalScopeOverrides:{},liveGlobalTabs:[],changesModeByConversation:{},snapshotsByConversation:{},toggleOpen:()=>{let n=cR();if(!n)return;let r=!uR(t(),n);e({uiByConversation:fR(t(),n,{open:r}),fullscreen:r?t().fullscreen:!1,fullscreenByConversation:dR(t(),n,r?t().fullscreen:!1)})},reconcileForActiveConversation:()=>{let n=cR(),r=n?t().fullscreenByConversation[n]??!1:!1;r!==t().fullscreen&&e({fullscreen:r})},ensureOpen:n=>{let r=n??cR();!r||lR(t(),r).open||e({uiByConversation:fR(t(),r,{open:!0})})},nudgeWidth:(n,r,i)=>{let a=cR();if(!a)return;let o=sR(lR(t(),a).width,n,r,i);e({uiByConversation:fR(t(),a,{width:o}),lastWidth:o})},nudgeFilesTreeWidth:(n,r=0)=>{let i=aR(t().filesTreeWidth,n,r);i!==t().filesTreeWidth&&e({filesTreeWidth:i})},resetFilesTreeWidth:()=>e({filesTreeWidth:224}),toggleFullscreen:()=>{let n=cR();if(!n)return;let{fullscreen:r}=t();if(!uR(t(),n)){e({uiByConversation:fR(t(),n,{open:!0}),fullscreen:!0,fullscreenByConversation:dR(t(),n,!0)});return}e({fullscreen:!r,fullscreenByConversation:dR(t(),n,!r)})},setFullscreen:n=>{let r=cR();if(n&&r){e({fullscreen:!0,uiByConversation:fR(t(),r,{open:!0}),fullscreenByConversation:dR(t(),r,!0)});return}e({fullscreen:n,...r?{fullscreenByConversation:dR(t(),r,n)}:{}})},togglePinnedTab:n=>{let r=t().pinnedTabs,i=Array.isArray(r)?r:[];e({pinnedTabs:i.includes(n)?i.filter(e=>e!==n):[...i,n]})},setBrowserHole:(n,r)=>{let{[n]:i,...a}=t().browserHoles;!r&&!i||e({browserHoles:r?{...a,[n]:r}:a})},setGlobalTabs:t=>e({globalTabs:t}),setGlobalScopeOverride:(n,r)=>{let{[n]:i,...a}=t().globalScopeOverrides;e({globalScopeOverrides:r?{...a,[n]:r}:a})},setLiveGlobalTabs:n=>{let r=t().liveGlobalTabs;r.length===n.length&&r.every((e,t)=>e===n[t])||e({liveGlobalTabs:n})},dropPanelFromLayouts:(n,r)=>{let{layouts:i,uiByConversation:a}=t(),o={...i},s={...a},c=!1;for(let[e,t]of Object.entries(i)){if(r.has(e))continue;let i=XL(t,n);if(i===t)continue;c=!0,o[e]=i;let l=a[e];!i&&l?.open===!0&&(s[e]={...l,open:!1})}c&&e({layouts:o,uiByConversation:s})},saveLayout:(n,r)=>{NN.getState().conversations[n]&&e({layouts:{...t().layouts,[n]:r}})},forgetConversation:n=>{let{[n]:r,...i}=t().layouts,{[n]:a,...o}=t().uiByConversation,{[n]:s,...c}=t().fullscreenByConversation,{[n]:l,...u}=t().changesModeByConversation,{[n]:d,...f}=t().snapshotsByConversation;e({layouts:i,uiByConversation:o,fullscreenByConversation:c,changesModeByConversation:u,snapshotsByConversation:f})},setChangesMode:(n,r)=>{e({changesModeByConversation:{...t().changesModeByConversation,[n]:r}})},saveSnapshots:(n,r)=>{e({snapshotsByConversation:{...t().snapshotsByConversation,[n]:r}}),window.electronAPI.changes.writeSnapshots({conversationId:n,snapshots:r})},loadSnapshots:n=>{if(n in t().snapshotsByConversation)return;let r=r=>{n in t().snapshotsByConversation||e({snapshotsByConversation:{...t().snapshotsByConversation,[n]:r}})};window.electronAPI.changes.readSnapshots({conversationId:n}).then(r,()=>r({}))}}),{name:`enso-side-panel`,version:5,storage:HL(()=>localStorage),partialize:e=>({lastWidth:e.lastWidth,filesTreeWidth:e.filesTreeWidth,uiByConversation:e.uiByConversation,fullscreenByConversation:e.fullscreenByConversation,layouts:e.layouts,pinnedTabs:e.pinnedTabs,globalTabs:e.globalTabs,globalScopeOverrides:e.globalScopeOverrides,changesModeByConversation:e.changesModeByConversation}),merge:(e,t)=>{let n=e&&typeof e==`object`?e:{};return{...t,...n,...qL(n)}},migrate:(e,t)=>{let{state:n,snapshots:r}=nR(e,t),i=window.electronAPI?.changes;if(i)for(let[e,t]of Object.entries(r))i.writeSnapshots({conversationId:e,snapshots:t});return n}})),mR=`Let's set you up. Ask me a few questions about what to call me, which model you should use, and how much you may do on your own. Then submit the draft with secretary_profile_propose and wait for my confirmation.`,hR={enabled:!1,projectId:null,profile:null,persona:``,board:{needsYou:[],running:[],done:[],todos:[]},proposals:{},takeovers:[]};function gR(e,t){return t&&e.some(e=>e.id===t)?t:e[0]?.id??null}function _R(e){VL(Object.values(e).flatMap(e=>e.takeovers.map(e=>e.conversationId)))}function vR(e){return e?yR.getState().secretaries.find(t=>t.projectId===e)?.id??null:null}var yR=_N()((e,t)=>({secretary:hR,secretaries:[],states:{},focusedId:null,resolving:{},welcomeOpen:!1,focusProposal:null,focus:n=>{let{states:r,focusedId:i}=t();i===n&&r[n]||(e({focusedId:n,secretary:r[n]??hR,welcomeOpen:!1}),r[n]||window.electronAPI.secretary.getState(n).then(t=>{e(e=>({states:{...e.states,[n]:t},...e.focusedId===n?{secretary:t}:{}}))}).catch(()=>void 0))},createSecretary:async()=>{let n=await window.electronAPI.secretary.create();return n.ok?(e({secretaries:await window.electronAPI.secretary.list()}),t().focus(n.secretaryId),e({welcomeOpen:!0}),n.secretaryId):null},openWelcome:()=>e({welcomeOpen:!0}),closeWelcome:()=>e({welcomeOpen:!1}),focusProposalCard:t=>e({focusProposal:{proposalId:t,at:Date.now()}}),clearFocusProposal:()=>e({focusProposal:null}),bind:()=>{let n=new Set,r=!0,i=n=>{let r=n.secretaryId??t().focusedId;r&&e(e=>{let t={...e.states,[r]:n};_R(t);let i=gR(e.secretaries,e.focusedId)??r;if(i!==r)return{states:t,focusedId:i};let a=e.states[r]??e.secretary;return{states:t,focusedId:i,secretary:n,welcomeOpen:n.profile?!1:a.profile!==null&&a.enabled?!0:e.welcomeOpen}})},a=window.electronAPI.secretary.onStateChanged(e=>{e.secretaryId&&n.add(e.secretaryId),i(e)}),o=window.electronAPI.secretary.onListChanged(t=>{EL(t.map(e=>e.id)),e(e=>{let n=new Set(t.map(e=>e.id)),r=Object.fromEntries(Object.entries(e.states).filter(([e])=>n.has(e))),i=gR(t,e.focusedId);return _R(r),{secretaries:t,states:r,focusedId:i,secretary:i&&r[i]||(i===e.focusedId?e.secretary:hR)}})});window.electronAPI.secretary.list().then(async t=>{if(r){EL(t.map(e=>e.id)),e(e=>({secretaries:t,focusedId:gR(t,e.focusedId)}));for(let e of t){let t=await window.electronAPI.secretary.getState(e.id);!r||n.has(e.id)||i({...t,secretaryId:t.secretaryId??e.id})}}}).catch(()=>void 0);let s=window.electronAPI.secretary.onOpenConversation(e=>{NN.getState().selectConversation(e.conversationId),pR.getState().ensureOpen(e.conversationId),e.proposalId&&t().focusProposalCard(e.proposalId)}),c=NN.subscribe((e,n)=>{if(e.activeId===n.activeId)return;let r=vR(e.activeId?e.conversations[e.activeId]?.projectId:void 0);r&&t().focus(r)});return()=>{r=!1,a(),o(),s(),c(),VL([]),e({secretary:hR,secretaries:[],states:{},focusedId:null,welcomeOpen:!1,focusProposal:null})}},newSecretaryConversation:async e=>{let{states:n,secretary:r,secretaries:i}=t(),a=e?.secretaryId?n[e.secretaryId]:r;e?.secretaryId&&t().focus(e.secretaryId);let o=a?.projectId??(e?.secretaryId?i.find(t=>t.id===e.secretaryId)?.projectId:null);if(!o)return null;let s=Ce.getState().projects.find(e=>e.id===o);if(!s)return null;let c=e?.greeting?bR(o):null;if(e?.greeting&&!c)return null;let l=NN.getState(),u=await l.newConversation(o);if(!u)return null;if(c){let e=bs(Ce.getState().language);await l.send(Ss(e,mR),{...c,cwd:s.path},void 0,u)}return u},resolveProposal:async(n,r,i,a)=>{e({resolving:{...t().resolving,[n]:!0}});try{await window.electronAPI.secretary.resolveProposal(n,r,i,a)}catch{}finally{let r={...t().resolving};delete r[n],e({resolving:r})}}}));function bR(e){let t=Ce.getState(),n=t.projects.find(t=>t.id===e);if(!n)return null;let r=FL({defaultModel:t.defaultModel,...PL(n,t.projectGroups),providers:BL(),credentials:RL(LL.getState().snapshot),virtualModels:t.virtualModels});return r.source===`none`?null:{providerId:r.providerId,modelId:r.modelId}}function xR(){let e=yR(e=>e.secretary.enabled?e.secretary.profile:null),t=yR(e=>e.secretary.secretaryId??void 0);if(!e)return null;let n=e.avatar.imageVersion;return{name:e.name.trim()||`·`,color:e.avatar.color,...n?{image:k(n,e.avatar.imageHash,t)}:{}}}function SR(e){return typeof e!=`number`||!Number.isInteger(e)?5:e<1?1:e>60?60:e}function CR(e){return SR(e)*1e3}var wR=new Set(`ls.tree.pwd.cd.cat.bat.head.tail.wc.nl.tac.less.more.rg.grep.egrep.fgrep.ag.find.fd.fdfind.which.type.file.stat.du.df.sort.uniq.cut.tr.awk.sed.diff.jq.yq.echo.printf.basename.dirname.realpath.readlink.printenv.date.whoami.uname.column.true.test.[.git`.split(`.`)),TR=new Set([`status`,`log`,`diff`,`show`,`blame`,`grep`,`ls-files`,`ls-tree`,`rev-parse`,`describe`,`shortlog`,`reflog`,`cat-file`,`name-rev`,`remote`,`config`,`branch`,`tag`]),ER={sed:/^(-[a-zA-Z]*i|--in-place)|\/[a-zA-Z]*e[a-zA-Z]*['"]?$|^['"]?e\b/,awk:/^-[a-zA-Z]*[fiE]|^--(file|include|exec)/,yq:/^-[a-zA-Z]*[is]|^--(inplace|split-exp)/,sort:/^-[a-zA-Z]*o|^--(output|compress-program)/,find:/^-(exec|execdir|ok|okdir|delete|fprint|fprintf|fprint0|fls)$/,git:/^--(output|ext-diff|textconv|filters|exec-path)/,rg:/^--pre($|=)/,fd:/^-[a-zA-Z0-9]*[xX]|^--exec/,fdfind:/^-[a-zA-Z0-9]*[xX]|^--exec/,ag:/^--pager/,bat:/^--pager/,tree:/^-o$|^--output/,file:/^-[a-zA-Z]*C/,date:/^(-s|--set)/},DR={branch:/^-(d|D|m|M|c|C|u|f|-delete|-move|-copy|-set-upstream-to|-unset-upstream|-force)/,tag:/^-(a|s|d|f|m|F|-annotate|-sign|-delete|-force|-message)/,config:/^(-e|--edit|--unset|--unset-all|--add|--replace-all|--rename-section|--remove-section)$/,remote:/^(add|remove|rm|rename|set-url|set-head|set-branches|prune|update)$/,reflog:/^(expire|delete)$/,grep:/^(-O|--open-files-in-pager)/},OR=/^\/(usr\/(local\/)?)?s?bin\/[^/]+$|^\/opt\/homebrew\/bin\/[^/]+$/,kR=new Set([`--no-pager`,`-P`,`--no-optional-locks`]),AR=/^(LC_[A-Z_]+|LANG|LANGUAGE|TZ|NO_COLOR|FORCE_COLOR|CLICOLOR(_FORCE)?|COLUMNS|TERM)=/,jR=new Set([`node`,`npm`,`pnpm`,`yarn`,`bun`,`deno`,`python`,`python3`,`pip`,`pip3`,`ruby`,`go`,`cargo`,`rustc`,`java`,`javac`]),MR=/^['"]?((\d+|\$)(,(\d+|\$))?|\/[^/]*\/)p['"]?$/,NR=new Set([`-n`,`-E`,`-r`,`--quiet`,`--silent`]);function PR(e){let t=e.trim().split(/\s+/),n=0;for(;n<t.length&&/^[A-Za-z_][A-Za-z0-9_]*=/.test(t[n]);)n+=1;return{env:t.slice(0,n),tokens:t.slice(n)}}function FR(e){let t=PR(e).tokens[0]??``;return t.slice(t.lastIndexOf(`/`)+1)}function IR(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31&&n!==10)return!0}return!1}function LR(e){let t=e.find(e=>!NR.has(e));return!t||!MR.test(t)?!1:e.slice(0,e.indexOf(t)).every(e=>NR.has(e))}function RR(e){let t=1;for(;t<e.length&&e[t].startsWith(`-`);)if(e[t]===`-C`){if(t+1>=e.length)return!1;t+=2}else if(kR.has(e[t]))t+=1;else return!1;if(t>=e.length)return!1;let n=e[t];if(!TR.has(n))return!1;let r=e.slice(t+1),i=DR[n];return!(i&&r.some(e=>i.test(e))||n===`config`&&!r.some(e=>/^(--get|--get-all|--list|-l|--get-regexp)$/.test(e))||(n===`branch`||n===`tag`)&&r.some(e=>!e.startsWith(`-`))&&!r.some(e=>e===`-l`||e===`--list`))}function zR(e){let t=e.trim();if(!t||/\$\(|<\(|`/.test(t)||IR(t))return!1;let n=t.replace(/2>&1|[12]?>\s*\/dev\/null/g,``);if(n.includes(`>`))return!1;let r=n.split(/\|\|?|&&?|;|\n/);for(let e of r){let t=e.trim();if(!t)continue;let{env:n,tokens:r}=PR(t);if(n.some(e=>!AR.test(e)))return!1;let i=FR(t),a=r[0]??``;if(a.includes(`/`)&&!OR.test(a))return!1;let o=r.slice(1);if(jR.has(i)){if(o.length!==1||![`--version`,`-v`,`-V`].includes(o[0]))return!1;continue}if(!wR.has(i))return!1;let s=ER[i];if(s&&o.some(e=>s.test(e))||i===`awk`&&/system\s*\(/.test(o.join(` `))||i===`sed`&&!LR(o)||i===`git`&&!RR(r)||i===`uniq`&&o.filter(e=>!e.startsWith(`-`)).length>1)return!1}return!0}function BR(e){let t=/^mcp__(.+?)__(.+)$/.exec(e);return t?{server:t[1],tool:t[2]}:null}function VR(e){let t=e;if(typeof e==`string`)try{t=JSON.parse(e)}catch{return null}return t&&typeof t==`object`&&!Array.isArray(t)?t:null}function HR(e){let t=[e.tool,e.name].find(e=>typeof e==`string`&&e);if(typeof t==`string`)return t.startsWith(`mcp__`)||typeof e.server!=`string`||!e.server?t:`mcp__${e.server}__${t}`}function UR(e,t){if(e!==`mcp`)return{name:e,args:t};let n=VR(t);if(!n)return{name:e,args:t};let r=HR(n);return n.action===`list`?{name:e,args:t,summary:typeof n.server==`string`&&n.server?n.server:`list`}:n.action===`describe`&&r?{name:e,args:t,summary:r}:n.action===`call`&&r&&BR(r)?{name:r,args:VR(n.arguments)??{}}:{name:e,args:t}}function WR(e,t,n){let r=[];for(let i=0;i<e.length;){let a=e[i];if(a.kind!==`tool`||!a.name||!t(a.name)){r.push(a),i+=1;continue}let o=i+1;for(;o<e.length&&e[o].kind===`tool`&&e[o].name===a.name;)o+=1;r.push(o-i>=2?n(a,e.slice(i+1,o)):a),i=o}return r}var GR=[`日`,`一`,`二`,`三`,`四`,`五`,`六`],KR=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function qR(e){let t=e.trim();return t.length<=8?t:`${t.slice(0,8)}…`}function JR(e,t){return t?.trim()||(e?qR(e):``)}function YR(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function XR(e){return String(e).padStart(2,`0`)}function ZR(e,t){return`${XR(e)}:${XR(t)}`}function QR(e,t,n){return e.length===n-t+1&&e[0]===t&&e[e.length-1]===n}function $R(e,t){if(e.length<2||e[0]!==0)return;let n=e[1]-e[0];if(!(n<1)){for(let t=1;t<e.length;t+=1)if(e[t]-e[t-1]!==n)return;return e[e.length-1]+n>=t?n:void 0}}function ez(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function tz(e,t){let n=Io(e);if(!n)return e.trim();let r=QR(n.dayOfMonth,1,31)&&QR(n.month,1,12)&&QR(n.dayOfWeek,0,6);if(r&&QR(n.hour,0,23)){let e=$R(n.minute,60);if(e===1)return t===`zh`?`每分钟`:`every minute`;if(e)return t===`zh`?`每 ${e} 分钟`:`every ${e} minutes`}if(n.minute.length!==1||n.hour.length!==1||!QR(n.month,1,12))return n.source;let i=ZR(n.hour[0],n.minute[0]);if(r)return t===`zh`?`每天 ${i}`:`every day at ${i}`;if(QR(n.dayOfMonth,1,31)&&ez(n.dayOfWeek,[1,2,3,4,5]))return t===`zh`?`每个工作日 ${i}`:`weekdays at ${i}`;if(QR(n.dayOfMonth,1,31)&&n.dayOfWeek.length===1){let e=n.dayOfWeek[0];return t===`zh`?`每周${GR[e]} ${i}`:`every ${KR[e]} at ${i}`}return n.source}var nz=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function rz(e){if(!e)return null;try{let t=JSON.parse(e);return nz(t)?t:null}catch{return null}}function iz(e,t){if(!Array.isArray(e))return null;let n=[];for(let r of e){if(!nz(r)||typeof r.id!=`string`||!r.id||typeof r.title!=`string`||typeof r.content!=`string`)return null;let{spaceId:e,[t]:i}=r;n.push({id:r.id,title:r.title,content:r.content,unitType:typeof r.unitType==`string`&&r.unitType?r.unitType:null,space:e===`global`?`global`:typeof e==`string`&&e.startsWith(`proj:`)?`project`:null,relevance:typeof i==`number`&&Number.isFinite(i)?i:null})}return n}function az(e){let t=rz(e);return t?iz(t.results,`relevance`):null}function oz(e,t){let n=rz(e);if(n?.status===`candidates_found`){let e=iz(n.candidates,`similarity`);return e?{written:!1,candidates:e}:null}if(n?.status!==`inserted`||!nz(n.memory)||!t)return null;let r=iz([{...n.memory,content:t}],`relevance`)?.[0];return r?{written:!0,deduplicated:n.deduplicated===!0,memory:r}:null}var sz=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function cz(e){for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(!(e.type!==`image`||typeof e.data!=`string`||!e.data)&&typeof e.mimeType==`string`&&sz.has(e.mimeType))return e}}var lz=e=>typeof e==`number`?e:null;function uz(e){let t=e?.split(`
|
|
178
|
-
`,1)[0]?.trim();if(!t?.startsWith(`{`))return null;let n;try{n=JSON.parse(t)}catch{return null}if(!n||typeof n!=`object`)return null;let r=n;return{path:typeof r.path==`string`&&r.path?r.path:null,size:lz(r.size),width:lz(r.width),height:lz(r.height)}}var dz=/^(?:\/|[A-Za-z]:[\\/]|\\\\)/u;function fz(e,t,n){return n?e?`data:${e.mimeType};base64,${e.data}`:t&&dz.test(t)?m(t):null:null}var pz=new Set([...Oe,`memory_search`,`memory_capture`,`memory_delete`,`memory_crystallize`,`web_search`,`web_fetch`]);function mz(e,t=!1){return e===`task_settle`?!0:t?pz.has(e)||e.startsWith(`my_`)||BR(e)!==null:!1}var hz=new Map;function gz(e,t){hz.set(e,t)}function _z(e,t){return(hz.get(e.name)??rB)(e,t)}var vz={todo_item_update:`Updated {{count}} to-dos`,todo_item_add:`Added {{count}} to-dos`,session_send:`Sent {{count}} messages`,session_stop:`Stopped {{count}} sessions`,session_task_stop:`Stopped {{count}} background tasks`,session_archive:`Archived {{count}} sessions`,result_mark_done:`Marked {{count}} sessions done`,result_mark_undo:`Undid {{count}} marks`,session_answer:`Answered {{count}} questions`,session_create:`Created {{count}} sessions`,todo_item_dispatch:`Dispatched {{count}} to-dos`,schedule_add:`Added {{count}} schedules`,schedule_remove:`Removed {{count}} schedules`};function yz(e,t){let n=e.map(e=>_z(e,t));if(n.length<=1)return{grouped:!1,title:n[0]?.title??``,cards:n};let r=e[0]?.name??``,i=vz[r];return{grouped:!0,title:i?t.t(i,{count:n.length}):t.t(`{{count}} × {{tool}}`,{count:n.length,tool:bz(r,t)}),cards:n}}function bz(e,t){if(e.startsWith(`my_`))return t.t(`Custom tool {{name}}`,{name:e.slice(3).replaceAll(`-`,` `)});let n=BR(e);if(n)return`${n.tool.replaceAll(`_`,` `)} · ${n.server}`;let r=Os[e];return r?t.t(r):e.replaceAll(`_`,` `)}function xz(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Q(e){return xz(e)?e:null}function Sz(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Cz(e){let t=Sz(e);return t===null?Sz(e?.split(`
|
|
179
|
-
`,1)[0]??null):t}function $(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function wz(e){let t=$(e);if(!t)return;let n=t.match(/^<untrusted-content\b[^>]*>([\s\S]*)<\/untrusted-content>$/u);return(n?n[1]:t).trim()||void 0}function Tz(e){return e.length>280||e.split(`
|
|
180
|
-
`).length>6}function Ez(e){let t=``;try{t=typeof e.args==`string`?e.args:JSON.stringify(e.args,null,2)??``}catch{t=String(e.args)}return{rawArgs:t,rawOutput:e.output??``}}function Dz(e,t,n,r){return{name:e.name,title:t,state:e.state,blocks:n,...r?{status:r}:{},...Ez(e)}}var Oz={"dispatch-limit":`Dispatch limit reached`,"project-not-visible":`Project is not visible`,"project-required":`A project is required`,"not-found":`Not found`,"invalid-cron":`Invalid schedule`,"invalid-at":`Invalid schedule`,"at-in-past":`Invalid schedule`,"exactly-one-of-at-or-cron":`Invalid schedule`,"stale-index":`The message changed (the session was rewound or switched branches). List the session again and read it with the new id.`,"not-readable":`Only user and assistant messages can be read; tool calls and tool output are not shown.`};function kz(e,t){if(e.state!==`error`)return null;let n=e.output?.trim()??``;if(!n)return t.t(`Tool failed`);let r=Oz[n]??Oz[/^([a-z][a-z-]*):\s/u.exec(n)?.[1]??``];return r?t.t(r):n}function Az(e,t){return e?JR(e,t.lookup?.sessionTitle?.(e)):t.t(`Unknown session`)}function jz(e,t){return e?JR(e,t.lookup?.projectName?.(e)):t.t(`Not set`)}function Mz(e,t){if(e==null||e===``)return t.t(`Not set`);if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Nz(e,t){return Object.entries(e).map(([e,n])=>({label:e,value:Mz(n,t)}))}var Pz={running:{key:`Session running`,tone:`ok`},idle:{key:`Session idle`,tone:`neutral`},waiting:{key:`Session needs you`,tone:`pending`},error:{key:`Session error`,tone:`error`},"not-started":{key:`Session not started`,tone:`neutral`}};function Fz(e,t){let n=typeof e==`string`?Pz[e]:void 0;return n?{badge:t.t(n.key),badgeTone:n.tone}:{badge:typeof e==`string`?e:``,badgeTone:`neutral`}}function Iz(e){let t=Q(e);return(typeof t?.approvals==`number`?t.approvals:0)+(typeof t?.asks==`number`?t.asks:0)}function Lz(e){return e.replace(/<untrusted-content[^>]*>/gu,``).replace(/<\/untrusted-content>/gu,``).trim()}function Rz(e){let t=Lz(e).split(`
|
|
181
|
-
`).map(e=>e.trim()).find(Boolean)??``;return t.length>120?`${t.slice(0,120)}…`:t}var zz={dispatch:`Dispatch card`,profile:`Profile card`,skill:`Skill card`,tool:`Tool card`,takeover:`Takeover card`,cleanup:`Cleanup card`};function Bz(e,t){if(e?.status!==`awaiting_confirmation`)return;let n=$(e.proposalId)??``,r=n?t.lookup?.proposal?.(n):void 0,i=r?.status??`pending`,a=t.t(zz[r?.kind??``]??`Confirmation card`);return i===`pending`||i===`executing`?{tone:`pending`,label:t.t(`Waiting on {{card}} {{id}}`,{card:a,id:n?qR(n):t.t(`Not set`)})}:i===`succeeded`?{tone:`ok`,label:t.t(`Confirmed`)}:i===`rejected`?{tone:`error`,label:t.t(`Rejected`)}:i===`failed`?{tone:`error`,label:t.t(`Confirmation failed`)}:i===`expired`?{tone:`neutral`,label:t.t(`Confirmation expired`)}:{tone:`pending`,label:t.t(`Waiting on {{card}} {{id}}`,{card:a,id:qR(n)})}}function Vz(e,t){let n=$(e?.conversationId);return e?.status!==`created`||!n?null:{kind:`session`,id:n,label:Az(n,t)}}gz(`session_send`,(e,t)=>{let n=Q(e.args),r=Q(Sz(e.output)),i=$(n?.conversationId),a=$(n?.mode)===`steer`,o=t.t(`Send message {{title}}`,{title:Az(i,t)}),s=[],c=$(n?.goal);c&&s.push({kind:`kv`,rows:[{label:t.t(`Goal`),value:c,display:`long`}]});let l=$(n?.message);l&&s.push({kind:`prompt`,label:t.t(`Message`),text:l});let u=kz(e,t);u&&s.unshift({kind:`error`,text:u});let d;u?d={tone:`error`,label:t.t(`Refused`)}:r?.status===`steered`?d={tone:`ok`,label:t.t(`Steered into the current turn`)}:r?.status===`queued`?d={tone:`queued`,label:t.t(`Queued until the current turn ends`)}:r?.status===`sent`?d={tone:`ok`,label:a?t.t(`Delivered as a new turn (the session was idle)`):t.t(`Delivered`)}:e.state===`running`&&(d={tone:`neutral`,label:a?t.t(`Steering…`):t.t(`Sending…`)});let f=i?{kind:`session`,id:i,label:Az(i,t)}:null;return f&&s.unshift(f),Dz(e,o,s,d)}),gz(`session_answer`,(e,t)=>{let n=Q(e.args),r=Q(Sz(e.output)),i=$(n?.conversationId),a=$(n?.answer),o=kz(e,t);return Dz(e,t.t(`Answer {{title}}`,{title:Az(i,t)}),[...i?[{kind:`session`,id:i,label:Az(i,t)}]:[],...a?[{kind:`note`,text:a}]:[],...o?[{kind:`error`,text:o}]:[]],o?{tone:`error`,label:t.t(`Refused`)}:r?.status===`answered`?{tone:`ok`,label:t.t(`Answered`)}:e.state===`running`?{tone:`neutral`,label:t.t(`Answering…`)}:void 0)}),gz(`task_settle`,(e,t)=>{let n=Q(Sz(e.output)),r=(Array.isArray(n?.settled)?n.settled:Array.isArray(Q(e.args)?.tasks)?Q(e.args)?.tasks:[]).flatMap(e=>{let t=Q(e),r=t?.action;return!t||r!==`stop`&&r!==`keep`?[]:[{item:t,action:r,done:n?t.ok!==!1:void 0}]}),i=r.filter(e=>e.action===`stop`&&e.done).length,a=r.filter(e=>e.action===`keep`&&e.done).length,o=kz(e,t);return Dz(e,t.t(`Background task wrap-up`),[...r.length>0?[{kind:`list`,items:r.map(({item:e,action:n,done:r})=>({title:$(e.command)??$(e.taskId)??``,badge:r===!1?t.t(`Not running`):n===`stop`?t.t(`Stopped`):t.t(`Kept`),badgeTone:n===`keep`&&r!==!1?`pending`:`neutral`,...$(e.reason)?{detail:$(e.reason)}:{}}))}]:[],...o?[{kind:`error`,text:o}]:[]],o?{tone:`error`,label:t.t(`Failed`)}:n?{tone:`neutral`,label:t.t(`Stop {{stopped}} · Keep {{kept}}`,{stopped:i,kept:a})}:e.state===`running`?{tone:`neutral`,label:t.t(`Settling…`)}:void 0)}),gz(`session_task_stop`,(e,t)=>{let n=Q(e.args),r=$(n?.conversationId),i=$(n?.taskId),a=Q(Sz(e.output)),o=kz(e,t);return Dz(e,t.t(`Stop background task {{task}}`,{task:i??``}),[...r?[{kind:`session`,id:r,label:Az(r,t)}]:[],...i?[{kind:`note`,text:i}]:[],...o?[{kind:`error`,text:o}]:[]],o?{tone:`error`,label:t.t(`Refused`)}:a?.status===`stopped`?{tone:`ok`,label:t.t(`Stopped`)}:e.state===`running`?{tone:`neutral`,label:t.t(`Stopping…`)}:void 0)}),gz(`session_stop`,(e,t)=>{let n=$(Q(e.args)?.conversationId),r=Q(Sz(e.output)),i=kz(e,t),a=r?.status===`running`,o=r?.status===`cancelled`,s=$(r?.note);return Dz(e,o?t.t(`Cancel waiting dispatch`):t.t(`Stop session {{title}}`,{title:Az(n,t)}),[...n?[{kind:`session`,id:n,label:Az(n,t)}]:[],...s?[{kind:`note`,text:s}]:[],...i?[{kind:`error`,text:i}]:[]],i?{tone:`error`,label:t.t(`Refused`)}:a?{tone:`queued`,label:t.t(`Still running`)}:o?{tone:`ok`,label:t.t(`Cancelled`)}:{tone:`ok`,label:t.t(`Stopped`)})});function Hz(e,t,n){let r=Q(e.args),i=Q(Sz(e.output)),a=$(r?.projectId),o=$(r?.title)??(n===`dispatch`?t.lookup?.todoText?.($(r?.todoId)??``):void 0)??$(i?.conversationId)?JR($(i?.conversationId),$(r?.title)??(n===`dispatch`?t.lookup?.todoText?.($(r?.todoId)??``):void 0)):t.t(`New session`),s=[...a?[{label:t.t(`Project`),value:jz(a,t)}]:[],{label:t.t(`Worktree`),value:r?.worktree===!0?t.t(`Run in a worktree`):t.t(`Run in the project checkout`)},...$(r?.checkout)?[{label:t.t(`Checkout`),value:$(r?.checkout),display:`path`}]:[],...$(r?.baseRef)?[{label:t.t(`Base`),value:$(r?.baseRef)}]:[],...$(r?.branch)?[{label:t.t(`New branch`),value:$(r?.branch)}]:[],...Array.isArray(r?.after)&&r.after.length>0?[{label:t.t(`After`),value:r.after.map(String).join(`, `)}]:[],...$(r?.model)?[{label:t.t(`Model`),value:$(r?.model)}]:[],...$(r?.goal)?[{label:t.t(`Goal`),value:$(r?.goal),display:`long`}]:[]],c=$(r?.prompt),l=kz(e,t),u=Vz(i,t),d=[...l?[{kind:`error`,text:l}]:[],...s.length>0?[{kind:`kv`,rows:s}]:[],...c?[{kind:`prompt`,label:t.t(`Dispatch instructions`),text:c}]:[],...u?[u]:[]],f=n===`dispatch`?`Dispatch session {{title}}`:`Create session {{title}}`;return Dz(e,t.t(f,{title:o||t.t(`New session`)}),d,l?{tone:`error`,label:t.t(`Refused`)}:i?.status===`waiting`?{tone:`queued`,label:t.t(`Waiting for dependencies`)}:Bz(i,t)??(u?{tone:`ok`,label:t.t(`Created the session`)}:void 0))}gz(`session_create`,(e,t)=>Hz(e,t,`create`)),gz(`todo_item_dispatch`,(e,t)=>Hz(e,t,`dispatch`)),gz(`todo_item_add`,(e,t)=>{let n=Q(e.args),r=Q(Sz(e.output)),i=$(r?.text)??$(n?.text)??t.t(`Not set`),a=[...typeof r?.dueAt==`number`||typeof n?.dueAt==`number`?[{label:t.t(`Due time`),value:YR(Number(r?.dueAt??n?.dueAt))}]:[],...$(n?.projectId)?[{label:t.t(`Project`),value:jz($(n?.projectId),t)}]:[]];return Dz(e,t.t(`Add to-do {{text}}`,{text:i}),a.length?[{kind:`kv`,rows:a}]:[])});function Uz(e,t){let n=Q(e.args),r=Q(Sz(e.output)),i=Q(r?.after),a=Q(r?.before),o=$(n?.todoId)??$(r?.todoId)??``;return $(i?.text)??$(a?.text)??$(n?.text)??(o?t.lookup?.todoText?.(o):void 0)??(o?qR(o):t.t(`Not set`))}gz(`todo_item_update`,(e,t)=>{let n=Q(e.args),r=Q(Sz(e.output)),i=Q(r?.before),a=Q(r?.after),o=[],s=kz(e,t);if(s&&o.push({kind:`error`,text:s}),i&&a){let e=i.done===!0,n=a.done===!0;e!==n&&o.push({kind:`note`,text:n?t.t(`Marked done`):t.t(`Marked not done`)});let r=[];$(i.text)!==$(a.text)&&(i.text!==void 0||a.text!==void 0)&&String(i.text??``)!==String(a.text??``)&&r.push({label:t.t(`To-do text`),before:String(i.text??``),after:String(a.text??``)}),(i.dueAt??null)!==(a.dueAt??null)&&r.push({label:t.t(`Due time`),before:typeof i.dueAt==`number`?YR(i.dueAt):t.t(`Not set`),after:typeof a.dueAt==`number`?YR(a.dueAt):t.t(`Not set`)}),String(i.projectId??``)!==String(a.projectId??``)&&r.push({label:t.t(`Project`),before:jz($(i.projectId),t),after:jz($(a.projectId),t)}),r.length>0&&o.push({kind:`diff`,rows:r})}else n?.done===!0?o.push({kind:`note`,text:t.t(`Marked done`)}):n?.done===!1&&o.push({kind:`note`,text:t.t(`Marked not done`)});return Dz(e,t.t(`Update to-do {{text}}`,{text:Uz(e,t)}),o,s?{tone:`error`,label:t.t(`Refused`)}:void 0)});var Wz={todo:`To do`,active:`In progress`,problem:`Problem`,done:`Done`};gz(`todo_list`,(e,t)=>{let n=Q(Sz(e.output)),r=(Array.isArray(n?.todos)?n.todos:[]).flatMap(e=>{let n=Q(e);if(!n)return[];let r=$(n.status),i=r?t.t(Wz[r]??r):void 0;return[{title:wz(n.text)??t.t(`Not set`),...i?{badge:i}:{}}]}),i=kz(e,t);return Dz(e,t.t(`List to-dos`),[...i?[{kind:`error`,text:i}]:[],...r.length>0?[{kind:`list`,items:r}]:[]],i?{tone:`error`,label:t.t(`Refused`)}:void 0)});function Gz(e,t){let n=$(e?.cron);if(n)return tz(n,t.locale);let r=$(e?.at);if(!r)return t.t(`Not set`);let i=Date.parse(r);return t.t(`Once at {{time}}`,{time:Number.isNaN(i)?r:YR(i)})}gz(`schedule_add`,(e,t)=>{let n=Q(e.args),r=Q(Sz(e.output)),i=$(n?.name)??$(r?.name)??t.t(`Not set`),a=$(n?.prompt),o=kz(e,t),s=[...o?[{kind:`error`,text:o}]:[],{kind:`note`,text:Gz(n,t)},...typeof r?.nextRunAt==`number`?[{kind:`note`,text:t.t(`Next run {{time}}`,{time:YR(r.nextRunAt)})}]:[],...a?[{kind:`markdown`,text:a,collapsed:!0}]:[]];return Dz(e,t.t(`Add schedule {{name}}`,{name:i}),s,o?{tone:`error`,label:t.t(`Refused`)}:void 0)}),gz(`schedule_remove`,(e,t)=>{let n=Q(e.args),r=Q(Sz(e.output)),i=$(n?.scheduleId)??$(r?.scheduleId)??``,a=$(r?.name)??$(n?.name)??(i?qR(i):t.t(`Not set`)),o=kz(e,t);return Dz(e,t.t(`Remove schedule {{name}}`,{name:a}),o?[{kind:`error`,text:o}]:[],o?{tone:`error`,label:t.t(`Refused`)}:void 0)}),gz(`session_list`,(e,t)=>{let n=Q(e.args),r=Q(Sz(e.output)),i=$(n?.projectId),a=i?jz(i,t):``,o=(Array.isArray(r?.sessions)?r.sessions:[]).flatMap(e=>{let n=Q(e);if(!n)return[];let r=Iz(n.pending),i=Fz(n.state,t);return[{title:$(n.title)??Az($(n.conversationId),t),badge:i.badge,badgeTone:i.badgeTone,...r>0?{detail:t.t(`{{count}} pending`,{count:r})}:{},...$(n.conversationId)?{sessionId:$(n.conversationId)}:{}}]});return Dz(e,a?t.t(`List sessions in {{project}}`,{project:a}):t.t(`List sessions`),o.length>0?[{kind:`list`,items:o}]:[])}),gz(`session_read`,(e,t)=>{let n=Q(Sz(e.output)),r=$(n?.conversationId)??$(Q(e.args)?.conversationId),i=$(n?.title)??Az(r,t),a=kz(e,t);if(typeof n?.index==`number`){let r=wz(n.text)??``,o=[];a&&o.push({kind:`error`,text:a}),r&&o.push({kind:`markdown`,text:r,collapsed:Tz(r)});let s=typeof n.nextOffset==`number`?n.nextOffset:void 0;return s!==void 0&&o.push({kind:`note`,text:t.t(`More text from character {{next}}`,{next:s})}),Dz(e,t.t(`Read message {{index}} in {{title}}`,{index:String(n.index),title:i}),o,a?{tone:`error`,label:t.t(`Refused`)}:{tone:`neutral`,label:t.t(`Read`)})}let o=Fz(n?.state,t),s={tone:o.badgeTone,label:o.badge},c=Q(n?.pending),l=typeof c?.approvals==`number`?c.approvals:0,u=typeof c?.asks==`number`?c.asks:0,d=Array.isArray(n?.messages)?n.messages:[],f=d.flatMap(e=>{let t=Q(e);return t?.truncated===!0&&typeof t.index==`number`?[t.index]:[]}),p=d.flatMap(e=>{let n=Q(e),r=$(n?.text);return!n||!r?[]:[`${n.role===`assistant`?t.t(`Assistant`):t.t(`User`)}: ${Rz(r)}`]}).join(`
|
|
182
|
-
`),m=[...a?[{kind:`error`,text:a}]:[],...l>0||u>0?[{kind:`kv`,rows:[{label:t.t(`Pending approvals`),value:String(l)},{label:t.t(`Pending questions`),value:String(u)}]}]:[]];return p&&m.push({kind:`markdown`,text:p,collapsed:!0}),f.length>0&&m.push({kind:`note`,text:t.t(`Truncated messages {{indexes}}: read them by index`,{indexes:f.map(e=>`#${e}`).join(`, `)})}),Dz(e,t.t(`Read session {{title}}`,{title:i}),m,a?{tone:`error`,label:t.t(`Refused`)}:s)});function Kz(e,t){let n=Q(e.git),r=[];return n?(r.push($(n.branch)??t.t(`No local branch`)),r.push(n.dirty===!0?t.t(`Uncommitted changes`):t.t(`Clean tree`))):r.push(t.t(`No local branch`)),r.join(` · `)}gz(`project_list`,(e,t)=>{let n=Array.isArray(Q(Sz(e.output))?.projects)?Q(Sz(e.output))?.projects:[];return Dz(e,t.t(`List projects`),[{kind:`list`,items:n.flatMap(e=>{let n=Q(e);return n?[{title:$(n.name)??jz($(n.projectId),t),detail:Kz(n,t)}]:[]})}])}),gz(`project_info`,(e,t)=>{let n=Q(Sz(e.output))??{},r=$(n.name)??jz($(n.projectId)??$(Q(e.args)?.projectId),t);return Dz(e,t.t(`Project {{name}}`,{name:r}),[{kind:`note`,text:Kz(n,t)}])});function qz(e){let t=Math.max(0,Math.round(e/1e3)),n=Math.floor(t/60);return n>=60?`${Math.floor(n/60)}h ${n%60}m`:n>0?`${n}m ${t%60}s`:`${t}s`}var Jz={running:{key:`Running`,tone:`ok`},exited:{key:`Exited`,tone:`neutral`},killed:{key:`Killed`,tone:`error`}};gz(`repo_status`,(e,t)=>{let n=Q(Sz(e.output))??{},r=jz($(n.projectId)??$(Q(e.args)?.projectId),t),i=kz(e,t),a=$(n.branch),o=Q(n.head),s=Q(n.changes),c=Q(n.operation),l=Q(n.base),u=Q(n.contains),d=[];i&&d.push({kind:`error`,text:i});let f=typeof s?.total==`number`?s.total:0,p=[{label:t.t(`Branch`),value:a??t.t(`No local branch`)}];if(o){let e=wz(o.subject)??``;p.push({label:t.t(`HEAD`),value:`${$(o.sha)??``} ${e}`.trim()})}p.push({label:t.t(`Working tree`),value:f===0?t.t(`Clean tree`):t.t(`{{count}} changed files`,{count:f})}),l&&p.push({label:t.t(`Against {{ref}}`,{ref:$(l.ref)??``}),value:t.t(`{{ahead}} ahead, {{behind}} behind`,{ahead:typeof l.ahead==`number`?l.ahead:0,behind:typeof l.behind==`number`?l.behind:0})}),u&&p.push({label:t.t(`Contains {{sha}}`,{sha:$(u.sha)??``}),value:u.inHead===!0?t.t(`Yes`):t.t(`No`)});let m=[...c?.merge===!0?[t.t(`Merge`)]:[],...c?.rebase===!0?[t.t(`Rebase`)]:[]];m.length>0&&p.push({label:t.t(`In progress`),value:m.join(` · `)}),d.push({kind:`kv`,rows:p});let h=Array.isArray(n.commits)?n.commits:[];h.length>0&&d.push({kind:`list`,items:h.flatMap(e=>{let t=Q(e),n=$(t?.sha);if(!t||!n)return[];let r=wz(t.subject)??``,i=[wz(t.author)??``,typeof t.at==`number`?YR(t.at):``].filter(Boolean).join(` · `);return[{title:`${n} ${r}`.trim(),...i?{detail:i}:{}}]})});let g=Array.isArray(s?.files)?s.files:[];g.length>0&&d.push({kind:`list`,items:g.flatMap(e=>{let t=Q(e),n=$(t?.path);return!t||!n?[]:[{title:n,badge:$(t.status)??``}]})});let _=Array.isArray(n.worktrees)?n.worktrees:[];return _.length>1&&d.push({kind:`list`,items:_.flatMap(e=>{let n=Q(e),r=$(n?.path);return!n||!r?[]:[{title:r,detail:[$(n.branch)??t.t(`No local branch`),$(n.head)??``].filter(Boolean).join(` · `)}]})}),Dz(e,t.t(`Repository status {{project}}`,{project:r}),d,i?{tone:`error`,label:t.t(`Refused`)}:{tone:`neutral`,label:a??t.t(`No local branch`)})}),gz(`session_tasks`,(e,t)=>{let n=Q(Sz(e.output)),r=Az($(n?.conversationId)??$(Q(e.args)?.conversationId),t),i=kz(e,t),a=Array.isArray(n?.tasks)?n.tasks:[],o=a.filter(e=>Q(e)?.state===`running`).length,s=[];return i&&s.push({kind:`error`,text:i}),a.length>0&&s.push({kind:`list`,items:a.flatMap(e=>{let n=Q(e);if(!n)return[];let r=$(n.state)??``,i=Jz[r],a=[typeof n.ranMs==`number`?t.t(`ran {{duration}}`,{duration:qz(n.ranMs)}):``,typeof n.exitCode==`number`?t.t(`exit {{code}}`,{code:n.exitCode}):``,n.alive===!1?t.t(`Process gone`):n.stalled===!0?t.t(`Past its deadline`):``,n.persistent===!0?t.t(`Persistent service`):``,$(n.leftover)?t.t(`Leftover`):``].filter(Boolean).join(` · `);return[{title:Rz(wz(n.command)??``)||$(n.taskId)||t.t(`Unknown task`),badge:i?t.t(i.key):r,badgeTone:i?.tone??`neutral`,...a?{detail:a}:{}}]})}),Dz(e,t.t(`Background tasks in {{title}}`,{title:r}),s,i?{tone:`error`,label:t.t(`Refused`)}:o>0?{tone:`ok`,label:t.t(`{{count}} running`,{count:o})}:{tone:`neutral`,label:t.t(`{{count}} tasks`,{count:a.length})})}),gz(`session_activity`,(e,t)=>{let n=Q(Sz(e.output)),r=Az($(n?.conversationId)??$(Q(e.args)?.conversationId),t),i=kz(e,t),a=Array.isArray(n?.calls)?n.calls:[],o=a.filter(e=>{let t=Q(e);return t?.ok===!1&&t.pending!==!0}).length,s=[];return i&&s.push({kind:`error`,text:i}),a.length>0&&s.push({kind:`list`,items:a.flatMap(e=>{let n=Q(e),r=$(n?.name);if(!n||!r)return[];let i=n.pending===!0,a=n.ok===!0,o=[typeof n.durationMs==`number`?qz(n.durationMs):``,typeof n.at==`number`?YR(n.at):``,Rz(wz(n.command)??``)].filter(Boolean);return[{title:bz(r,t),badge:i?t.t(`Running`):a?t.t(`Succeeded`):t.t(`Failed`),badgeTone:i?`pending`:a?`ok`:`error`,...o.length>0?{detail:o.join(` · `)}:{}}]})}),Dz(e,t.t(`Recent tool calls in {{title}}`,{title:r}),s,i?{tone:`error`,label:t.t(`Refused`)}:o>0?{tone:`error`,label:t.t(`{{count}} failed`,{count:o})}:{tone:`ok`,label:t.t(`{{count}} calls`,{count:a.length})})});var Yz={name:`Name`,avatarColor:`Avatar color`,model:`Model`,autonomy:`Autonomy`,autoApproveProjectIds:`Auto-approved projects`,visibleProjectIds:`Visible projects`,dispatchModel:`Dispatch model`,dispatchWorktree:`Dispatch worktree`,maxRunningDispatches:`Dispatch limit`,addressAs:`What to call you`,replyLanguage:`Reply language`,style:`Communication style`,notify:`System notifications`,dailyBriefAt:`Daily brief time`,persona:`Persona`};gz(`secretary_profile_propose`,(e,t)=>{let n=Q(Sz(e.output)),r=(Array.isArray(n?.changes)?n.changes:[]).flatMap(e=>{let n=Q(e),r=$(n?.field);return!n||!r?[]:[{label:t.t(Yz[r]??r),before:Mz(n.before,t),after:Mz(n.after,t)}]}),i=kz(e,t);return Dz(e,t.t(`Propose profile changes`),[...i?[{kind:`error`,text:i}]:[],...r.length>0?[{kind:`diff`,rows:r}]:[]],i?{tone:`error`,label:t.t(`Refused`)}:Bz(n,t))});function Xz(e,t,n){let r=Q(e.args),i=Q(Sz(e.output)),a=$(r?.name)??t.t(`Not set`),o=$(r?.description),s=$(r?.body)??$(r?.code),c=kz(e,t);return Dz(e,t.t(n,{name:a}),[...c?[{kind:`error`,text:c}]:[],...o?[{kind:`note`,text:o}]:[],...s?[{kind:`markdown`,text:s,collapsed:!0}]:[]],c?{tone:`error`,label:t.t(`Refused`)}:Bz(i,t))}gz(`skill_propose`,(e,t)=>Xz(e,t,`Propose skill {{name}}`)),gz(`tool_propose`,(e,t)=>Xz(e,t,`Propose tool {{name}}`)),gz(`session_takeover_propose`,(e,t)=>{let n=Q(e.args),r=$(n?.conversationId),i=$(n?.reason),a=Q(Sz(e.output)),o=kz(e,t);return Dz(e,t.t(`Ask to take over {{title}}`,{title:Az(r,t)}),[...o?[{kind:`error`,text:o}]:[],...i?[{kind:`note`,text:i}]:[]],o?{tone:`error`,label:t.t(`Refused`)}:Bz(a,t))});function Zz(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}var Qz={branch:`Branch`,worktree:`Worktree`,session:`Session`};function $z(e){return e.split(/[\\/]/u).filter(Boolean).at(-1)??e}var eB={"not-merged":`Not merged yet`,"current-branch":`Currently checked out`,"used-by-worktree":`Used by a worktree`,"detached-head":`Detached HEAD`,"uncommitted-changes":`Has uncommitted changes`};function tB(e,t){let n=$(e.kind)??``,r=$(e.blocked),i=Array.isArray(e.mergedInto)?e.mergedInto.filter(e=>typeof e==`string`):[],a=typeof e.sizeBytes==`number`?e.sizeBytes:null,o=[];return i.length>0&&o.push(t.t(`merged into {{refs}}`,{refs:i.join(`, `)})),a!==null&&o.push(Zz(a)),r&&o.push(t.t(eB[r]??r)),{title:$(e.name)??t.t(`Not set`),badge:t.t(Qz[n]??n),badgeTone:r?`error`:`ok`,...o.length>0?{detail:o.join(` · `)}:{}}}gz(`image_view`,(e,t)=>{let n=Q(e.args),r=kz(e,t),i=r?null:uz(e.output),a=i?.path??$(n?.path)??``,{width:o,height:s,size:c}=i??{width:null,height:null,size:null},l=a?$z(a):t.t(`Not set`),u=[];r?u.push({kind:`error`,text:r}):(e.image||i?.path)&&u.push({kind:`image`,...e.image?{image:e.image}:{},...i?.path?{path:i.path}:{},alt:l});let d=[];return i?.path&&d.push({label:t.t(`Path`),value:i.path}),o&&s&&d.push({label:t.t(`Dimensions`),value:`${o} × ${s}`}),c!==null&&d.push({label:t.t(`File size`),value:Zz(c)}),d.length>0&&u.push({kind:`kv`,rows:d}),Dz(e,t.t(`Look at {{name}}`,{name:l}),u,r?{tone:`error`,label:t.t(`Refused`)}:void 0)}),gz(`cleanup_list`,(e,t)=>{let n=Q(Cz(e.output)),r=Array.isArray(n?.items)?n.items.map(Q).filter(e=>e!==null):[],i=typeof n?.total==`number`?n.total:r.length,a=kz(e,t);return Dz(e,t.t(`Cleanup candidates · {{count}}`,{count:i}),[...a?[{kind:`error`,text:a}]:[],...r.length>0?[{kind:`list`,items:r.map(e=>tB(e,t))}]:[]],a?{tone:`error`,label:t.t(`Refused`)}:void 0)}),gz(`cleanup_apply`,(e,t)=>{let n=Q(e.args),r=Q(Cz(e.output)),i=Array.isArray(n?.ids)?n.ids.length:0,a=typeof r?.total==`number`?r.total:i,o=kz(e,t);return Dz(e,t.t(`Clean up {{count}} items`,{count:a}),o?[{kind:`error`,text:o}]:[],o?{tone:`error`,label:t.t(`Refused`)}:Bz(r,t))}),gz(`memory_search`,(e,t)=>{let n=$(Q(e.args)?.query)??``,r=az(e.output)??[];return Dz(e,t.t(`Search memory {{query}} · {{count}}`,{query:n,count:r.length}),[{kind:`list`,items:r.map(e=>({title:e.title||qR(e.id)}))}])}),gz(`memory_capture`,(e,t)=>{let n=oz(e.output,$(Q(e.args)?.content));return n?n.written?Dz(e,t.t(`Save memory {{title}}`,{title:n.memory.title}),[{kind:`note`,text:Rz(n.memory.content)}]):Dz(e,t.t(`Memory not written`),[{kind:`list`,items:n.candidates.map(e=>({title:e.title,detail:Rz(e.content)}))}]):rB(e,t)}),gz(`memory_delete`,(e,t)=>{let n=Q(Sz(e.output)),r=$(n?.id)??$(Q(e.args)?.id)??``,i=$(n?.title)??(r?qR(r):t.t(`Not set`)),a=$(n?.content),o=kz(e,t);return Dz(e,t.t(`Delete memory {{title}}`,{title:i}),[...o?[{kind:`error`,text:o}]:[],...a?[{kind:`note`,text:Rz(a)}]:[]],o?{tone:`error`,label:t.t(`Refused`)}:void 0)});function nB(e){if(!e)return[];let t=[];for(let n of e.matchAll(/^\d+\.\s+\[([^\]]+)\]\((https?:\/\/[^)]+)\)/gmu))t.push({title:n[1],url:n[2]});return t}gz(`web_search`,(e,t)=>{let n=$(Q(e.args)?.query)??``,r=nB(e.output);return Dz(e,t.t(`Web search {{query}}`,{query:n}),[{kind:`list`,items:r.map(e=>({title:e.title,detail:e.url}))}])}),gz(`web_fetch`,(e,t)=>{let n=e.output??``,r=$(Q(e.args)?.url),i=/^Fetched (\S+)/u.exec(n)?.[1],a=r??i??``,o=a;try{o=new URL(a).host}catch{o=a||t.t(`Not set`)}let s=/^Title: (.+)$/mu.exec(n)?.[1]?.trim();return Dz(e,t.t(`Fetch {{domain}}`,{domain:o}),s?[{kind:`note`,text:s}]:[])});function rB(e,t){let n=Q(e.args),r=Sz(e.output),i=[],a=kz(e,t);return a&&i.push({kind:`error`,text:a}),n&&Object.keys(n).length>0&&i.push({kind:`kv`,rows:Nz(n,t)}),xz(r)?i.push({kind:`kv`,rows:Nz(r,t)}):typeof e.output==`string`&&e.output.trim()&&!a&&i.push({kind:`note`,text:e.output.trim(),collapsed:Tz(e.output)}),Dz(e,bz(e.name,t),i,a?{tone:`error`,label:t.t(`Refused`)}:void 0)}function iB(e){return e.some(e=>e===`error`)?`error`:e.some(e=>e===`running`||e===`reviewing`)?`running`:`ok`}function aB(e){let t=(e,t)=>`${e}:\n${t.length>0?t.map(e=>`- ${e}`).join(`
|
|
183
|
-
`):`(none)`}`;return[`Patch ${e.status}.`,t(`Applied`,e.applied),t(`Failed paths`,e.failed),...e.error?[`Error: ${e.error}`]:[],t(`Unattempted`,e.unattempted),t(`Uncertain`,e.uncertain),...e.status===`success`?[]:[`Re-read failed or uncertain paths before retrying.`],...e.input?[`Input:\n${e.input}`]:[]].join(`
|
|
184
|
-
`)}function oB(e,t){return!t&&e.kind===`tool`&&e.name===`apply_patch`&&!!e.fileChanges?.length}function sB(e,t,n){return e===null?n&&t:e}function cB(e){return e.kind===`tool`&&e.name===`apply_patch`&&!!e.fileChanges?.length&&!!e.output}var lB=[`path`,`file_path`,`command`,`pattern`,`query`,`url`,`description`,`summary`,`reason`,`goal`],uB=new Set([`path`,`file_path`]),dB=/^\[(.+)#([0-9A-Fa-f]{4})\]$/,fB=/^\*\*\* (?:(?:Add|Delete|Update) File|Move to): (.+)$/;function pB(e){let t=e.replaceAll(`\\`,`/`),n=/^[A-Za-z]:(\/.*)?$/.exec(t);return n?n[1]&&n[1].length>0?n[1]:`/`:t}function mB(e,t){if(!t)return e;let n=pB(t).replace(/\/+$/,``),r=pB(e);if(!n)return r;if(r===n)return`.`;let i=n.endsWith(`/`)?n:`${n}/`;return r.startsWith(i)?r.slice(i.length):r===e?e:r}var hB=new Set(fe);function gB(e){return e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)}function _B(e,t){if(!e||typeof e!=`object`)return null;let n=e,r=``;for(let e of[`path`,`file_path`]){let t=n[e];if(typeof t==`string`&&t){r=t;break}}if(!r||!hB.has(T(r))||r.startsWith(`\\\\`)||r.startsWith(`//`))return null;if(gB(r))return r;if(!t)return null;let i=t.includes(`\\`)&&!t.includes(`/`)?`\\`:`/`;return`${t.replace(/[\\/]+$/,``)}${i}${r.replace(/^[\\/]+/,``)}`}function vB(e){if(typeof e==`string`)for(let t of e.split(`
|
|
185
|
-
`)){let e=t.trim();if(e)return dB.exec(e)?.[1]}}function yB(e){if(!e||typeof e!=`object`)return null;let t=e.input;if(typeof t!=`string`)return null;let n=new Set;for(let e of t.split(`
|
|
186
|
-
`)){let t=fB.exec(e.trim())?.[1];t&&n.add(t)}return[...n]}function bB(e,t){if(!e||typeof e!=`object`)return``;let n=e;for(let e of lB){let r=n[e];if(typeof r==`string`&&r)return uB.has(e)?mB(r,t):r}let r=vB(n.input);if(r)return mB(r,t);let i=JSON.stringify(n);return i===`{}`?``:i.slice(0,80)}function xB(e,t,n,r=!1,i=!1){return e?t?`loading`:n&&i?`more`:n===!1&&r?`start`:`none`:`none`}function SB(e,t,n,r,i=80){return e&&!t&&n<=r+i}function CB(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=[t.code,t.command].find(e=>typeof e==`string`&&e.trim());return typeof n==`string`?n:null}function wB(e){let t=e.split(`
|
|
187
|
-
`).map(e=>e.trim()).find(Boolean)??``;return t.length>72?`${t.slice(0,72)}…`:t}function TB(e){let t=new Map;for(let n of e)t.set(n.name,(t.get(n.name)??0)+1);return[...t].map(([e,t])=>`${e} ×${t}`).join(` `)}var EB=e=>e===`exec`||e===`codemode`,DB=/^Script (?:completed|failed)\nWall time [^\n]*\nOutput:\n/;function OB(e){return e===null?null:e.replace(DB,``)||null}var kB=/(?:^|\n)<console_output>\n([\s\S]*?)\n<\/console_output>(?:\n|$)/;function AB(e){let t=kB.exec(e);return t?{body:[e.slice(0,t.index),e.slice(t.index+t[0].length)].filter(Boolean).join(`
|
|
188
|
-
`),console:t[1]}:{body:e}}function jB(e,t,n){let{body:r,console:i}=AB(e??``),a=i===void 0?{}:{console:i};return t?{status:`failed`,error:r,...a,calls:[...n??[]]}:{status:`completed`,value:r,...a,calls:[...n??[]]}}function MB(e){if(!e?.trim())return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;if(n.status!==`completed`&&n.status!==`failed`)return null;let r=Array.isArray(n.calls)?n.calls.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e;return typeof t.name!=`string`||!t.name?[]:[{name:t.name,ok:t.ok===!0,...typeof t.error==`string`?{error:t.error}:{},...typeof t.summary==`string`?{summary:t.summary}:{}}]}):[];return{status:n.status,...n.status===`failed`&&typeof n.error==`string`?{error:n.error}:{},...n.status===`completed`?{value:n.value}:{},calls:r}}catch{return null}}function NB(e,t){if(e!==`submit_plan`||!t||typeof t!=`object`)return null;let{title:n,plan:r}=t;return typeof n==`string`&&typeof r==`string`&&r.trim()?{title:n.trim(),text:r.trim()}:null}function PB(e,t){if(e!==`write`||!t||typeof t!=`object`)return null;let n=t.content;return typeof n==`string`&&n?n:null}var FB=new Map([[`message_main_agent`,e=>[e.message]],[`message_coworker`,e=>[e.text,e.to]],[`subagent`,(e,t)=>e.operation===`send`?[e.message,t.get(String(e.agentId))]:e.operation===`message`?[e.text,t.get(String(e.to))]:[]]]),IB=/(?:^|\n)\((?:delivered to |the main agent is blocked waiting )[^\n]*\)\s*$/,LB=new Set([`agentId`,`runId`,`delivery`,`status`]);function RB(e,t,n){let r=FB.get(e);if(!r||!t||typeof t!=`object`)return null;let[i,a]=r(t,n);if(typeof i!=`string`||!i.trim())return null;let o=i.trim();return{text:o,summary:typeof a==`string`&&a.trim()?`${a.trim()} · ${o}`:o}}function zB(e,t){if(e!==`subagent`||!t||typeof t!=`object`)return null;let{operation:n,prompt:r}=t;return n===`spawn`&&typeof r==`string`&&r.trim()?r.trim():null}function BB(e){if(!e)return null;let t=e.startsWith(`{`)?0:e.lastIndexOf(`
|
|
189
|
-
{`)+1;try{let n=JSON.parse(e.slice(t));return n&&typeof n==`object`&&!Array.isArray(n)?{head:e.slice(0,t).trimEnd(),value:n}:null}catch{return null}}function VB(e){let t=BB(e);return(t&&Object.keys(t.value).every(e=>LB.has(e))?t.head:e?.replace(IB,``))?.trimEnd()||null}var HB=new Set([`spawn`,`send`,`message`,`resume`]);function UB(e,t,n,r){if(!n||typeof n!=`object`)return;let{operation:i,name:a,description:o}=n;if(!HB.has(i))return;let{agentId:s,runId:c}=BB(r)?.value??{};if(typeof s!=`string`||(typeof c==`string`&&t.set(c,s),i!==`spawn`))return;let l=[a,o].find(e=>typeof e==`string`&&e.trim());typeof l==`string`&&e.set(s,l.trim())}var WB=new Set([`report`,`wait`,`stop`,`dismiss`,`list`,`resume`]);function GB(e,t){if(!t||typeof t!=`object`)return null;let n=t;return e===`task_output`?typeof n.timeout_ms==`number`&&n.timeout_ms>0?`task`:null:e===`subagent`&&(n.operation===`wait`||(n.operation===`spawn`||n.operation===`send`)&&n.wait===!0)?`subagent`:null}function KB(e,t,n){if(!e||typeof e!=`object`)return null;let{operation:r,name:i,description:a,agentId:o,runId:s,runIds:c}=e;if(r===`spawn`){if(typeof i!=`string`||!i.trim())return null;let e=[i,a].flatMap(e=>typeof e==`string`&&e.trim()?[e.trim()]:[]);return{title:[...new Set(e)].join(` · `)}}if(!WB.has(r))return null;if(r===`list`)return t.size>0?{op:`list`,title:``,titles:Object.fromEntries(t)}:{op:`list`,title:``};let l=r===`dismiss`||r===`resume`?[o]:[s,...Array.isArray(c)?c:[]].map(e=>typeof e==`string`?n.get(e):void 0),u={};for(let e of l){if(typeof e!=`string`)continue;let n=t.get(e);n&&(u[e]=n)}let d=[...new Set(Object.values(u))].join(`, `);return r===`wait`&&d?{op:`wait`,title:d,titles:u}:{op:r,title:d}}function qB(e,t){if(e!==`memory_capture`||!t||typeof t!=`object`)return null;let{title:n,content:r}=t;if(typeof r!=`string`||!r.trim())return null;let i=r.trim();return{title:(typeof n==`string`?n.trim():``)||i.split(`
|
|
190
|
-
`,1)[0].trim(),content:i}}var JB=/^\s*<(system-reminder|background-task-update)>[\s\S]*?<\/\1>/,YB=/ \(auto-selected: no response in time\)$/;function XB(e,t,n,r){if(e!==`ask_user`||!t||typeof t!=`object`)return null;let{question:i,options:a}=t;if(typeof i!=`string`||!i.trim())return null;let o=Array.isArray(a)?a.slice(0,4).flatMap(e=>typeof e==`string`&&e.trim()?[e.trim()]:[]):[],s={question:i.trim(),options:o,answer:null,autoSelected:!1};if(!r||!n)return{ask:s,output:n};let c=n,l=[];for(let e=JB.exec(c);e;e=JB.exec(c))l.push(e[0].trim()),c=c.slice(e[0].length);let u=c.trim(),d=u.replace(YB,``);return{ask:{...s,answer:d||null,autoSelected:d!==u},output:l.join(`
|
|
191
|
-
|
|
192
|
-
`)||null}}function ZB(e,t){if(e!==`edit`||!t||typeof t!=`object`)return null;let n=t;if(!(`edits`in n)&&typeof n.oldText==`string`&&typeof n.newText==`string`)return eV(n,n.oldText,n.newText);let r=n.edits;if(typeof r==`string`)try{r=JSON.parse(r)}catch{return null}return!Array.isArray(r)||r.length===0?null:r.every(e=>e&&typeof e==`object`&&typeof e.oldText==`string`&&typeof e.newText==`string`)?r:null}function QB(e,t){return e!==`edit`||!t||typeof t.oldText!=`string`||typeof t.newText!=`string`?null:eV(t,t.oldText,t.newText)}var $B=new WeakMap;function eV(e,t,n){let r=$B.get(e);return r||(r=[{oldText:t,newText:n}],$B.set(e,r)),r}var tV=e=>e.content.map(e=>e.type===`text`?e.text:``).join(``),nV=/(?:^|\n)<source_reference type="(?:file|web)" (?:path|url)="[^"\n]*" \/>(?:\n<source_reference type="(?:file|web)" (?:path|url)="[^"\n]*" \/>)*$/,rV=e=>e.content.map(e=>e.type===`text`?e.text.replace(nV,``):``).join(``);function iV(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`text`&&n.text.trim()||n.type===`thinking`&&n.text||n.type===`toolCall`||n.type===`image`)return t}return-1}function aV(e){let t=e.timing;if(t?.completedMs)return typeof e.duration==`number`&&e.duration>0?e.duration:Math.max(0,t.completedMs-t.stepStartMs)}function oV(e,t){let n=e.timing,r=aV(e);if(!n||r===void 0)return;let{stepStartMs:i,firstTokenMs:a}=n,o=e.usage?.output??0,s=typeof e.ttft==`number`&&e.ttft>0?e.ttft:a===void 0?void 0:Math.max(0,a-i);return{runMs:r,...t===void 0?{}:{turnMs:t},...s===void 0?{}:{ttftMs:s},...o>0&&r>0?{tps:o/(r/1e3)}:{}}}var sV=`<thinking>`,cV=`</thinking>`;function lV(e){let t=[],n=(e,n)=>{let r=n.trim();r&&t.push({kind:e,text:r})},r=0;for(;r<e.length;){let t=e.indexOf(sV,r);if(t===-1){n(`text`,e.slice(r));break}t>r&&n(`text`,e.slice(r,t));let i=t+10,a=e.indexOf(cV,i);if(a===-1){n(`thinking`,e.slice(i));break}n(`thinking`,e.slice(i,a)),r=a+11}return t}function uV(e){let t=new Set;for(let n of e??[])if(n.phase===`reviewing`&&n.toolCallId){t.add(n.toolCallId);let e=_s(n.toolCallId);e&&t.add(e)}return t}function dV(e,t){return(t??[]).filter(t=>t.toolCallId&&_s(t.toolCallId)===e).length}function fV(e,t,n,r,i,a,o=0,s,c=!1,l){let u=uV(i),d=new Map;for(let t of e)t.role===`toolResult`&&t.toolCallId&&d.set(t.toolCallId,{output:rV(t),isError:t.isError===!0,todos:t.todos??null,durationMs:t.toolDurationMs??null,agentMeta:t.subagentMeta??null,editDiff:t.editDiff??null,fileChanges:t.fileChanges??null,applyPatchOutcome:t.applyPatchOutcome??null,codemodeCalls:t.codemodeCalls??null,rtk:t.rtk,approvalReview:t.approvalReview,backgroundTaskId:t.backgroundTaskId,shellFailure:t.shellFailure,pluginArtifacts:t.pluginArtifacts,generatedImages:t.generatedImages,image:cz(t.content)});let f=-1;for(let t=e.length-1;t>=0;t--)if(!e[t].optimistic&&e[t].role!==`toolResult`){f=t;break}let p=[],m=new Map,h=new Map,g=Array(e.length);for(let t=e.length-1,n;t>=0;t--)g[t]=n,!e[t].optimistic&&e[t].role!==`toolResult`&&(n=e[t].role);let _=e.findLastIndex(e=>e.role===`user`&&!e.optimistic),v=e.findLastIndex(e=>!e.optimistic),y=0,b=0,x=!1,S,C=!1,w;return e.forEach((T,E)=>{let D=E===v,O=o+E;if(T.role===`user`&&T.optimistic){p.push({kind:`user`,key:`${O}`,text:tV(T),images:T.content.filter(e=>e.type===`image`),timestamp:T.timestamp,canCollapse:!1,deliveryState:T.deliveryRejected?T.rejectedReason===`turn-stuck`?`stuck`:`rejected`:`pending`});return}if(T.role===`user`){S=T.timestamp,C=!1,y=0,b=0,x=!1;let n=tV(T),r=T.content.filter(e=>e.type===`image`),i=/^<background-task-update>\n?([\s\S]*?)\n?<\/background-task-update>\s*$/.exec(n.trim());if(i&&r.length===0){let e=i[1].trim();p.push({kind:`task-note`,key:`${O}`,summary:e.split(`
|
|
193
|
-
`,1)[0]??e,detail:e}),w=void 0;return}if(n||r.length>0){let i=E+1;for(;e[i]?.role===`system`||e[i]?.optimistic;)i++;let a=i<e.length&&e[i].role!==`user`&&!(t&&E===_),o={kind:`user`,key:`${O}`,text:n,images:r,timestamp:T.timestamp,canCollapse:a};p.push(o),w=o}return}if(T.role===`custom`){T.pluginSource&&p.push({kind:`plugin-message`,key:`${O}`,text:tV(T),...T.pluginSource});return}if(T.role===`compactionSummary`){p.push({kind:`compaction`,key:`${O}`,summary:tV(T),tokensBefore:T.tokensBefore??null,...T.verified?{verified:!0}:{},...T.memory?{memory:!0}:{}});return}if(T.role===`toolResult`){T.toolName===`ask_user`&&(C=!0),b>0&&T.toolName!==`ask_user`&&typeof T.toolDurationMs==`number`&&Number.isFinite(T.toolDurationMs)&&T.toolDurationMs>0&&(y+=T.toolDurationMs);return}if(T.role!==`assistant`)return;b+=1,w&&T.model&&(b===1||x)&&(w.replyModel=T.model,x=T.stopReason===`error`),b===1&&w&&T.timestamp!==void 0&&(w.replyAt=T.timestamp),w&&T.privacyMask&&(w.replyPrivacyMask=F(w.replyPrivacyMask,T.privacyMask));let k=aV(T);k!==void 0&&(y+=k);let A=g[E]===void 0||g[E]===`user`,j=A&&b>1?y:void 0,M=!(g[E]===void 0&&(t||T.stopReason===`pending`)),N;if(A&&M){if(y>0)N=y;else if(!C){let e=T.timing?.completedMs??T.timestamp;typeof S==`number`&&typeof e==`number`&&e>S&&(N=e-S)}w&&N!==void 0&&(w.turnDurationMs=N)}if(T.restartResumed){p.push(pV(T,O,n));return}let P=iV(T.content);if(T.content.forEach((e,o)=>{let l=`${O}-${o}`,g=D&&o===P,_=!!T.stopReason&&T.stopReason!==`pending`,v=t&&g&&!_;switch(e.type){case`text`:{if(!e.text.trim())return;let t=lV(e.text);if(t.length===0)return;if(t.length===1&&t[0].kind===`text`){let t=A&&!v;p.push({kind:`text`,key:l,text:e.text,streaming:v,timestamp:T.timestamp,perf:oV(T,j),...t?{turnEnd:!0,...N===void 0?{}:{turnDurationMs:N}}:{}});return}t.forEach((e,n)=>{let r=t.length===1?l:`${l}-${n}`,i=v&&n===t.length-1;if(e.kind===`thinking`){p.push({kind:`thinking`,key:r,text:e.text,streaming:i,durationMs:null});return}let a=A&&!i&&n===t.length-1;p.push({kind:`text`,key:r,text:e.text,streaming:i,timestamp:T.timestamp,perf:oV(T,j),...a?{turnEnd:!0,...N===void 0?{}:{turnDurationMs:N}}:{}})});return}case`thinking`:if(e.text){let t=T.timing,n=t?.thinkingEndMs??t?.completedMs;p.push({kind:`thinking`,key:l,text:e.text,streaming:v,durationMs:t&&n!==void 0?Math.max(0,n-t.stepStartMs):null,...t?{startedAt:t.stepStartMs}:{}})}return;case`toolCall`:{let o=d.get(e.id),g=r?.[e.id],_=EB(e.name),v=_?CB(e.arguments):null,y=o?o.applyPatchOutcome?aB(o.applyPatchOutcome):o.output:(g??null)||null,b=e.name===`codemode`?OB(y):y,x=e.name===`exec`?MB(b):e.name===`codemode`&&o?jB(b,o.isError,o.codemodeCalls):null,S=UR(e.name,e.arguments);e.name===`subagent`&&UB(m,h,e.arguments,o?.output);let C=e.name===`subagent`?KB(e.arguments,m,h):null,w=RB(e.name,e.arguments,m),T=w?.text??zB(e.name,e.arguments),D=qB(e.name,e.arguments),O=XB(e.name,e.arguments,b,!!(o&&!o.isError)),k=e.name===`apply_patch`?o?.fileChanges?.length?o.fileChanges.map(e=>e.path):yB(e.arguments):null,A=!o&&t&&E===f,j=A&&(e.name===`bash`||e.name===`powershell`),M=A?GB(e.name,e.arguments):null,N=e.name===`read`&&!o?.isError?_B(e.arguments,n):null;p.push({kind:`tool`,key:l,name:S.name,...mz(S.name,c)?{args:S.args??null}:{},summary:v?wB(v):k?k.length>1?`${k.length} files`:mB(k[0]??``,n):w?.summary??D?.title??O?.ask.question??C?.title??S.summary??bB(S.args,n),source:v,output:w?VB(b):O?O.output:b,nestedPending:dV(e.id,i)||void 0,...N?{imagePath:N}:{},...e.name===`image_view`&&o?.image&&!o.isError?{image:o.image}:{},...o?.generatedImages?.length?{generatedImages:o.generatedImages}:{},..._?{sandbox:x}:{},state:o?o.isError||x?.status===`failed`?`error`:`ok`:t&&E===f?u.has(e.id)?`reviewing`:`running`:t?`ok`:`error`,edits:o?.isError?null:ZB(e.name,e.arguments)??QB(e.name,o?.editDiff),writeContent:PB(e.name,e.arguments),fileChanges:o?.fileChanges??null,todos:o?.todos??null,durationMs:o?.durationMs??null,agentMeta:o?.agentMeta??null,...o?.rtk?{rtk:o.rtk}:{},...o?.approvalReview?{approvalReview:o.approvalReview}:{},...j||M?{callId:e.id}:{},...M?{waiting:M}:{},...o?.backgroundTaskId?{backgroundTaskId:o.backgroundTaskId}:{},...o?.shellFailure?{shellFailure:o.shellFailure}:{},...e.name===`submit_plan`?{plan:NB(e.name,e.arguments)}:{},...T?{sentMessage:T}:{},...D?{memoryContent:D.content}:{},...O?{ask:O.ask}:{},...C?.op?{subagentOp:C.op}:{},...C?.titles?{subagentTitles:C.titles}:{},...o?.pluginArtifacts?{pluginArtifacts:o.pluginArtifacts}:{},...s?.has(e.id)?{batchLabel:s.get(e.id)}:{},...o||!a?{}:{startedAt:a[e.id]??null}});return}default:return}}),T.errorMessage){let n=E+1;for(;e[n]?.role===`system`;)n++;let r=e[n]?.role===`assistant`,i=t&&E===e.length-1,a=l!==void 0&&T.errorMessage===l;!r&&!i&&!a&&p.push({kind:`error`,key:`${O}-err`,text:T.errorMessage})}}),p}function pV(e,t,n){let r=t=>e.content.flatMap(e=>e.type===t&&e.text.trim()?[e.text.trim()]:[]).join(`
|
|
194
|
-
|
|
195
|
-
`);return{kind:`resumed-reply`,key:`${t}-resumed`,thinking:r(`thinking`),text:r(`text`),tools:e.content.flatMap(e=>e.type===`toolCall`?[{name:e.name,summary:bB(e.arguments,n)}]:[]),expanded:!1}}var mV=e=>e.kind===`capability-receipt`?e.receipt.occurredAt:e.at,hV=`<${Pk}>`;function gV(e){return e.content.map(e=>e.type===`text`?e.text:``).join(`
|
|
196
|
-
`).trim()}function _V(e){if(!e.includes(hV))return!1;if(Vk(e))return!0;let t=Kk(e);return!!(t&&Vk(t.rest))}function vV(e,t,n){let r=new Set,i=t.filter(e=>e.kind===`task-wrap-up-nudge`).map(e=>e.at).sort((e,t)=>e-t);if(i.length===0)return r;let a=0,o=!1;return e.forEach((e,t)=>{if(e.optimistic)return;let s=e.timestamp??-1/0;for(;a<i.length&&(i[a]??0)<=s;)o=!0,a+=1;if(!o||e.role!==`user`&&e.role!==`toolResult`)return;let c=gV(e);if(e.role===`toolResult`){c.includes(hV)&&(o=!1);return}_V(c)&&(r.add(n+t),o=!1)}),r}var yV=e=>{let t=e.key.indexOf(`-`),n=Number.parseInt(t===-1?e.key:e.key.slice(0,t),10);return Number.isInteger(n)?n:-1},bV=(e,t,n=0)=>{let r=yV(e)-n;return r>=0?t[r]?.timestamp??-1/0:-1/0};function xV(e,t){let n=e.findLast(e=>e.kind===`compaction`);if(!n||t<=yV(n))return e;let r=e.length;for(let n=0;n<e.length;n++)if(yV(e[n])>=t){r=n;break}if(r===e.length&&yV(e.at(-1)??e[0])+1<t||e[r-1]?.kind===`compaction`)return e;let i={kind:`compaction-notice`,key:`compaction-notice:${n.key}`,summary:n.summary,tokensBefore:n.tokensBefore,...n.tokensAfter===void 0?{}:{tokensAfter:n.tokensAfter},...n.verified?{verified:!0}:{},...n.memory?{memory:!0}:{}};return[...e.slice(0,r),i,...e.slice(r)]}function SV(e,t){if(t===void 0)return e;let n=e.findLastIndex(e=>e.kind===`compaction`),r=e[n];if(r?.kind!==`compaction`)return e;let i=[...e];return i[n]={...r,tokensAfter:t},i}function CV(e,t,n,r){let i=SV(e,r),a=n===void 0?i:xV(i,n);return t?[...a,{kind:`compaction-progress`,key:`compaction:${t}`,state:t}]:a}function wV(e,t,n=[],r,i){let a=i?.historyBaseIndex??0,o=new Map,s=[];for(let e of n)e.kind===`tool-batch-label`?o.set(e.callId,e.label):s.push(e);let c=fV(e,t,r,i?.toolOutputs,i?.pendingApprovals,i?.toolStartedAt,a,o,i?.secretarySession===!0,i?.interrupted?.suppressedError),l=vV(e,s,a),u=l.size===0?c:c.map(e=>e.kind===`user`&&!e.deliveryState&&l.has(yV(e))?{...e,hostTaskWrapUp:!0}:e),d=s.length===0?u:[...u.map((t,n)=>({item:t,at:bV(t,e,a),order:n})),...s.map((e,t)=>({item:{kind:`session-custom`,key:e.kind===`capability-receipt`?`custom:receipt:${e.receipt.receiptId}`:e.kind===`oauth-account-selected`?`custom:${e.kind}:${e.accountKey}:${e.at}:${t}`:e.kind===`task-wrap-up-nudge`?`custom:${e.kind}:${e.at}:${t}`:`custom:${e.kind}:${e.child.generation}:${e.at}:${t}`,entry:e},at:mV(e),order:u.length+t}))].sort((e,t)=>e.at-t.at||e.order-t.order).map(({item:e})=>e),f=u.filter(e=>e.kind===`user`&&e.deliveryState),p=f.length?d.filter(e=>!(e.kind===`user`&&e.deliveryState)):d;for(let e of f){let t=e.kind===`user`?e.timestamp:void 0,n=t!==void 0&&Number.isFinite(t)?p.findIndex(e=>e.kind===`user`&&!e.deliveryState&&e.timestamp!==void 0&&Number.isFinite(e.timestamp)&&e.timestamp>t):-1;p.splice(n<0?p.length:n,0,e)}let m=CV(i?.runDividers?.length?EV(p,i.runDividers,t=>t.kind===`session-custom`?mV(t.entry):bV(t,e,a),a===0):p,i?.compaction,i?.compactionNoticeAt,i?.compactionTokensAfter);return i?.interrupted?[...m,{kind:`interrupted`,key:`interrupted`,at:i.interrupted.at,exitKind:i.interrupted.kind,unfinishedTools:i.interrupted.unfinishedTools}]:m}var TV=1e4;function EV(e,t,n,r){let i=[...e],a=-1;for(let e of t){let t=i.findIndex((t,r)=>r>a&&n(t)>=e.at);if(t<0&&(t=i.length),!r&&!i.slice(0,t).some(t=>n(t)<e.at))continue;let o=i[t-1];t-1>a&&o.kind===`user`&&e.at-n(o)<=TV&&--t,i.splice(t,0,{kind:`divider`,key:e.key,text:e.text}),a=t+1}return i}var DV=3;function OV(e){switch(e.kind){case`compaction`:case`compaction-notice`:case`compaction-progress`:case`error`:case`divider`:case`plugin-message`:case`discarded-turn`:case`interrupted`:return!1;default:return!0}}var kV=new Set([`grep`,`find`,`glob`,`ls`]);function AV(e,t,n,r){e===`read`?n.reads+=1:kV.has(e)?n.searches+=1:e===`bash`?!r||!zR(t)?n.commands+=1:NV.has(FR(t))?n.reads+=1:n.searches+=1:n.others+=1}var jV=new Set([`read`,...kV]);function MV(e){let t=[],n=e=>{e.kind===`tool-group`?e.children.forEach(n):e.kind===`tool`&&e.batchLabel&&!t.includes(e.batchLabel)&&t.push(e.batchLabel)};return e.forEach(n),t.length>0?t.join(` · `):void 0}var NV=new Set([`cat`,`bat`,`head`,`tail`,`less`,`more`,`nl`,`tac`]);function PV(e){return jV.has(e.name)||e.name===`bash`&&zR(e.summary)}function FV(e){let t=[];for(let n of e){let e=t.at(-1);n.kind===`thinking`&&e?.kind===`thinking`&&yV(n)>=0&&yV(e)===yV(n)?t[t.length-1]={...e,text:`${e.text}\n\n${n.text}`,streaming:e.streaming||n.streaming,durationMs:e.durationMs??n.durationMs,startedAt:e.startedAt??n.startedAt}:t.push(n)}return t}var IV=new Set([`explore_mark`,`explore_fold`]),LV=/^Explore folded\.[^\n]*\n*/,RV=e=>`${e}:steps`;function zV(e,t,n){let r=[],i=-1;for(let a of e){if(a.kind!==`tool`&&a.kind!==`thinking`&&a.kind!==`text`)i=-1;else if(a.kind===`tool`&&a.state===`ok`){if(a.name===`explore_fold`&&i>=0){let e=[...r.splice(i),a],o=e[0],s={commands:0,reads:0,searches:0,others:0},c=0;for(let t of e)t.kind!==`tool`||IV.has(t.name)||(AV(t.name,t.summary,s,n),c+=1);let l=`explore-${o.key}`,u=t.has(l);r.push({kind:`tool-group`,key:l,expanded:u,count:c,stats:s,exploring:!1,explore:{goal:o.summary,report:(a.output??``).replace(LV,``).trim(),steps:u&&t.has(RV(l))},children:e}),i=-1;continue}a.name===`explore_mark`&&i<0&&(i=r.length)}r.push(a)}return r}var BV=/^Turn discarded[:.]?\s*/;function VV(e,t){let n=[];for(let r of e){if(r.kind===`tool`&&r.name===`turn_discard`&&r.state===`ok`){let e=n.length;for(;e>0&&(n[e-1].kind===`thinking`||n[e-1].kind===`text`||n[e-1].kind===`tool`);)e--;let i=e;for(;e>0&&n[e-1].kind===`plugin-message`;)e--;if(e<i){let i=n.splice(e),a=i.filter(e=>e.kind===`plugin-message`),o=`discard-${a[0].key}`;n.push({kind:`discarded-turn`,key:o,reason:r.output==null?r.summary:r.output.replace(BV,``).trim(),pluginId:a[0].pluginId,pluginName:a[0].pluginName,messages:a.map(e=>e.text),tools:i.flatMap(e=>e.kind===`tool`?[{name:e.name,summary:e.summary}]:[]),expanded:t.has(o)});continue}}n.push(r)}return n}function HV(e){return e.kind===`tool-group`&&e.explore?.steps?[e,...e.children]:[e]}function UV(e,t,n=!1){if(e.length<2)return e.flatMap(HV);let r={commands:0,reads:0,searches:0,others:0},i=0,a=0,o=0;for(let t of e.flatMap(e=>e.kind===`tool-group`?e.children:[e]))t.kind===`thinking`?i+=1:t.kind===`tool`&&(AV(t.name,t.summary,r,!1),o+=1),(t.kind===`thinking`||t.kind===`tool`)&&(a+=t.durationMs??0);let s=`group-${e[0].key}`,c=t.has(s),l=MV(e),u={kind:`tool-group`,key:s,expanded:c,count:o,stats:r,exploring:!1,activity:{thinking:i,workedMs:a},...n?{live:!0}:{},...l?{summary:l}:{},children:e};return c?[u,...e.flatMap(HV)]:[u]}var WV={signature:``,closedAt:null,held:[]};function GV(e){return e.kind===`tool-group`&&e.children[0]?e.children[0].key:e.key}function KV(e,t){return e.kind===`tool`&&e.generatedImages?.length||e.kind===`tool`&&mz(e.name,t)?!1:e.kind===`thinking`||e.kind===`tool-group`||e.kind===`tool`&&e.state===`ok`&&!e.name.startsWith(`goal_`)&&e.name!==`submit_plan`}function qV(e,t,n,r){let i=VV(e,n),a=r.autoCollapseCompletedTurns===!0,o=r.turnOverrides,s=i.findLastIndex(e=>e.kind===`user`&&!e.deliveryState),c=i;if(a||o&&o.size>0){let e=[],n=0;for(;n<i.length;){let r=i[n];if(r.kind===`user`){let c=n===s,l=a&&!c&&r.canCollapse===!0,u=!r.deliveryState&&!(t&&c)&&(o?.get(r.key)??l);if(e.push(u?{...r,collapsed:!0}:r),n+=1,u)for(;n<i.length&&i[n].kind!==`user`;){let t=i[n];OV(t)||e.push(t),n+=1}}else e.push(r),n+=1}c=e}c=zV(c,n,r.compact===!0);let l=c.findLastIndex(e=>e.kind===`user`&&!e.deliveryState),u=Math.max(l,c.findLastIndex(e=>e.kind===`text`));return{sourceItems:c,lastUserIndex:l,liveFrom:u}}function JV(e,t,n){if(n.collapseLiveActivity!==!0||!t)return null;let{sourceItems:r,liveFrom:i}=qV(e,t,new Set,n),a=n.readableToolCards===!0,o=[],s=!1,c=0;for(;c<r.length;){if(!(c>i)||!KV(r[c],a)){c+=1;continue}let e=[],t=c;for(;t<r.length&&KV(r[t],a);){let n=r[t];if(n.kind===`thinking`&&n.streaming){s=!0;break}e.push(GV(n)),t+=1}for(e.length>0&&o.push(e);t<r.length&&KV(r[t],a);)t+=1;c=t}return o.length===0?null:{segments:o,blocked:s}}function YV(e,t,n,r,i){let a=JV(e,t,n);if(!a)return{witness:WV,released:new Set,wakeAt:null};let{segments:o,blocked:s}=a,c=new Set(r.held),l=[],u=[],d=!0;for(let e of o)for(let t of e)d&&c.has(t)?l.push(t):(d=!1,u.push(t));let f=new Set(l);if(s)return{witness:{signature:``,closedAt:null,held:l},released:f,wakeAt:null};let p=o.some(e=>e.filter(e=>!f.has(e)).length>0&&e.length>=2);if(u.length===0||!p)return{witness:{signature:``,closedAt:null,held:l},released:f,wakeAt:null};let m=u.join(`\0`),h=r.signature===m&&r.closedAt!==null?r.closedAt:i,g=h+CR(n.liveActivityFoldDelaySec);if(i<g)return{witness:{signature:m,closedAt:h,held:l},released:f,wakeAt:g};let _=[...l,...u];return{witness:{signature:``,closedAt:null,held:_},released:new Set(_),wakeAt:null}}function XV(e,t,n,r,i,a,o,s,c,l){let u=e=>e.kind===`tool`&&c?.has(e.key)===!0,d=e=>e.kind===`tool`&&mz(e.name,l),f=e=>i&&!(t&&e>s),p=n=>{if(!a||!t||!(n>s)||!KV(e[n],l)||u(e[n])||!a.has(GV(e[n])))return n;let r=n;for(;r<e.length&&KV(e[r],l)&&!u(e[r])&&a.has(GV(e[r]));)r+=1;return r-n>=2?r:n},m=(e,t)=>!d(e)&&!u(e)&&!(e.kind===`tool`&&e.generatedImages?.length)&&(e.kind===`thinking`||e.kind===`tool-group`&&f(t)||e.kind===`tool`&&(f(t)?e.state===`ok`&&!e.name.startsWith(`goal_`)&&e.name!==`submit_plan`:!r||PV(e))),h=[],g=0;for(;g<e.length;){let i=e[g],a=p(g);if(a>g){h.push(...UV(FV(e.slice(g,a)),n,!0)),g=a;continue}if(!m(i,g)){h.push(...HV(i)),g+=1;continue}let s=g;for(;s<e.length&&m(e[s],s)&&p(s)===s;)s+=1;let c=FV(e.slice(g,s));if(f(g)){h.push(...UV(c,n)),g=s;continue}let l=!r&&t&&o>=0&&g>o,u=e=>e.kind===`tool`?e.edits!==null||e.writeContent||e.fileChanges?.length||e.imagePath&&e.state!==`error`||e.name===`todo`||e.name===`submit_plan`?!0:e.state!==`running`&&e.state!==`reviewing`?!1:!(r&&PV(e)):!1,d=c.filter(u),_=c.filter(e=>!u(e)),v=_.filter(e=>e.kind===`tool`).length;if(l||v<DV)h.push(...c);else{let i={commands:0,reads:0,searches:0,others:0};for(let e of _)e.kind===`tool`&&AV(e.name,e.summary,i,r);let a=`group-${c[0].key}`,o=n.has(a),l=MV(_);h.push({kind:`tool-group`,key:a,expanded:o,count:v,stats:i,exploring:r&&(t&&s===e.length||_.some(e=>e.kind===`tool`&&(e.state===`running`||e.state===`reviewing`))),...l?{summary:l}:{},children:_}),o?h.push(...c):h.push(...d)}g=s}return h}function ZV(e){return e.kind===`user`&&!e.deliveryState}function QV(e){return e.kind===`text`&&je(e.text)}function $V(e){return e.kind===`text`&&e.text.trim().length>0&&!je(e.text)}function eH(e,t){for(let n of e)n.kind===`tool`?t(n):n.kind===`tool-group`&&eH(n.children,t)}function tH(e,t,n){if(e.length===0)return[];let r={commands:0,reads:0,searches:0,others:0},i=0,a=0,o=0;eH(e,e=>{AV(e.name,e.summary,r,!1),i+=1,o+=e.durationMs??0});for(let t of e)t.kind===`thinking`&&(a+=1,o+=t.durationMs??0);let s=`${n?`silent`:`group`}-${e[0].key}`,c=t.has(s),l=MV(e),u={kind:`tool-group`,key:s,expanded:c,count:i,stats:r,exploring:!1,activity:{thinking:a,workedMs:o},...n?{notice:n}:{},...l&&!n?{summary:l}:{},children:e};return c?[u,...e]:[u]}function nH(e){return/<secretary-schedule>/.test(e)&&!/<session-updates>/.test(e)?`patrol`:`seen`}function rH(e){let t=!1;return eH(e,e=>{e.name===`silence_turn`&&(t=!0)}),t||e.some(QV)}function iH(e,t,n,r){let i=[],a=0;for(;a<e.length;){if(!ZV(e[a])){i.push(e[a]),a+=1;continue}let o=a+1;for(;o<e.length&&!ZV(e[o]);)o+=1;let s=e.slice(a,o),c=t&&o===e.length;i.push(...aH(s,c,n,r)),a=o}return i}function aH(e,t,n,r){let i=e[0];if(t||i?.kind!==`user`)return e;let a=e.slice(1).filter(e=>!QV(e));if(ie(i.text)&&rH(e.slice(1))){let e=nH(i.text);return tH([{...i,canCollapse:!1},...a],n,e)}if(!r||a.some($V))return e;let o=!1,s=0;return eH(a,e=>{s+=1,e.state!==`ok`&&(o=!0)}),o||s<1||a.some(e=>e.kind!==`tool`&&e.kind!==`thinking`&&e.kind!==`tool-group`)?e:[{...i,canCollapse:!1},...tH(a,n)]}function oH(e,t,n,r={}){let{sourceItems:i,lastUserIndex:a,liveFrom:o}=qV(iH(e.map(e=>e.kind===`resumed-reply`?{...e,expanded:n.has(e.key)}:e),t,n,r.foldToolOnlyTurns===!0),t,n,r),s=r.readableToolCards===!0,c=WR(i,e=>mz(e,s),(e,t)=>e.kind===`tool`?{...e,cardPeers:t.flatMap(e=>e.kind===`tool`?[{key:e.key,args:e.args??null,output:e.output,state:e.state,...e.image?{image:e.image}:{}}]:[])}:e),l=r.collapseLiveActivity===!0?r.releasedLiveActivity??null:null;return XV(c,t,n,r.compact===!0,r.collapseCompletedActivity===!0,l,a,o,r.heldOpenTools??null,s)}var sH={rows:new Set,expanded:new Set};function cH(e,t,n){let r=[],i=[],a=new Map,o=new Set;for(let s of t){if(s.kind!==`tool-group`||!s.explore)continue;let t=e.rows.has(s.key);if(s.explore.steps){o.add(s.key),t&&!e.expanded.has(s.key)&&i.push(s.key),s.children.forEach((e,t)=>{a.set(e.key,{group:s.key,index:t})});continue}let c=s.children[0]?.key??``,l=s.children.at(-1)?.key??``,u=!t&&e.rows.has(c)&&e.rows.has(l);if(!u&&!e.expanded.has(s.key))continue;let d=n(u?c:s.key,l);d>0&&r.push({key:s.key,height:d,pair:u})}return{collapses:r,expands:i,children:a,next:{rows:new Set(t.map(e=>e.key)),expanded:o}}}function lH({loading:e=!1,runStartedAt:t}){if(!e)return t}var uH=(0,H.createContext)({query:``,activeKey:``,activeNth:-1});function dH(){return(0,H.useContext)(uH)}var fH=`rounded-[2px] px-0.5 py-px`,pH=`${fH} bg-yellow-300 text-foreground dark:bg-yellow-500/80`,mH=`${fH} bg-orange-600 text-white dark:bg-orange-500`;function hH(e,t,n,r){let i=t.trim();if(!i)return e;let a=e.toLowerCase(),o=i.toLowerCase(),s=0,c=a.indexOf(o,s);if(c<0)return e;let l=[];for(;c>=0;){c>s&&l.push(e.slice(s,c));let t=r.n++;l.push((0,G.jsx)(`mark`,{className:t===n?mH:pH,children:e.slice(c,c+i.length)},t)),s=c+i.length,c=a.indexOf(o,s)}return s<e.length&&l.push(e.slice(s)),l}function gH(e,t,n,r){return e==null||typeof e==`boolean`?e:typeof e==`string`||typeof e==`number`?hH(String(e),t,n,r):Array.isArray(e)?e.map((e,i)=>(0,G.jsx)(H.Fragment,{children:gH(e,t,n,r)},i)):e}function _H(e){return e===`right`||e===`off`?e:`left`}function vH(e,t,n){return e!==`off`&&!t&&n>=2}var yH=40;function bH({items:e,activeKey:t,onJump:n}){let r=Ce(e=>e.chatWide),i=_H(Ce(e=>e.navRailSide)),[a,o]=(0,H.useState)(null);if(!vH(i,r,e.length))return null;let s=i===`right`,c=Math.max(0,e.findIndex(e=>e.key===t)),l=Math.min(Math.max(0,c-Math.floor(yH/2)),Math.max(0,e.length-yH)),u=e.slice(l,l+yH),d=l>0,f=l+yH<e.length,p=(e,t)=>{let n=t?24:12;if(a===null)return n;let r=Math.abs(e-a);return n+Math.max(0,16-r*6)};return(0,G.jsx)(`div`,{className:W(`group/rail absolute top-0 z-10 hidden h-full w-14 @min-[52rem]:block`,s?`right-0`:`left-0`),children:(0,G.jsx)(`div`,{className:W(`absolute top-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-200 group-hover/rail:opacity-100`,s?`right-2`:`left-2`),onMouseLeave:()=>o(null),children:(0,G.jsxs)(`div`,{className:`relative flex flex-col justify-center gap-[5px]`,style:{maskImage:d||f?`linear-gradient(to bottom, ${d?`transparent, black 24px`:`black`}, ${f?`black calc(100% - 24px), transparent`:`black`})`:void 0},children:[u.map((e,r)=>{let i=e.key===t,c=r===a;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>n(e.key),onMouseEnter:()=>o(r),className:W(`flex h-[7px] w-10 items-center`,s&&`justify-end`),children:(0,G.jsx)(`span`,{className:W(`rounded-full transition-all duration-150`,i||c?`h-[3px] bg-foreground`:`h-[2px] bg-muted-foreground/40`),style:{width:p(r,i)}})},e.key)}),a!==null&&u[a]&&(0,G.jsxs)(`div`,{className:W(`pointer-events-none absolute w-72 -translate-y-1/2 rounded-xl border bg-popover p-3 shadow-lg`,s?`right-10`:`left-10`),style:{top:`${(a+.5)/u.length*100}%`},children:[(0,G.jsx)(`p`,{className:`line-clamp-2 text-xs font-semibold`,children:u[a].question}),u[a].answer&&(0,G.jsx)(`p`,{className:`mt-1 line-clamp-3 text-xs text-muted-foreground`,children:u[a].answer})]})]})})})}var xH=/\n*<chat-reference id="([^"]*)" title="([^"]*)" kind="(?:direct|group)">\n[\s\S]*?\n<\/chat-reference>/g;function SH(e){let t=[],n=e.replace(xH,(e,n,r)=>(t.push({id:n,title:r}),``));return t.length?{body:n.trim(),refs:t}:{body:e,refs:t}}var CH={zh:`这是同一件事的补充,保留原目标,把它并进这一轮的结果;不要单独回一句「收到」。只有明确说换掉或取消才改目标。
|
|
197
|
-
补充内容:
|
|
198
|
-
`,en:`This adds to the same request. Keep the original goal and fold it into this turn's result; do not reply with a standalone "got it". Only change the goal if explicitly told to replace or cancel it.
|
|
199
|
-
Addition:
|
|
200
|
-
`};function wH(e){for(let t of Object.values(CH))if(e.startsWith(t))return e.slice(t.length);return e}var TH=/^\s*<notes-updated>[\s\S]*?<\/notes-updated>\s*/;function EH(e){return wH(e.replace(TH,``))}var DH={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`},OH=e=>e.replace(/&(?:amp|lt|gt|quot|apos);/g,e=>DH[e]);function kH(e){let t=Object.create(null);return e.replace(/\s+([\w-]+)="([^"]*)"/g,(e,n,r)=>(t[n]=OH(r),``)).trim()?null:t}function AH(e){let t=EH(e).trim(),n=jH(t);if(n||t.startsWith(`<group`)||t.startsWith(`(`))return n;for(let e of t.matchAll(/\n(?=<group-info>|<group-state>|<group-context>\n|<group-message |(省略了 \d+ 条)/g)){let n=jH(t.slice(0,e.index).trim()),r=jH(t.slice(e.index).trim());if(n&&n.kind!==`group`&&r?.kind===`group`)return{...n,group:r.messages}}return null}function jH(e){let t=/^(省略了 \d+ 条更早的消息)\s*/,n=/^<group-context>\n([\s\S]*)\n<\/group-context>$/.exec(e);if(n){let e=n[1].search(/^(?:<group-message |(省略了 \d+ 条)/m);if(e<0)return null;let r=jH(n[1].slice(e).replace(t,``).trim());return r?.kind===`group`&&!r.instruction&&!r.note&&!r.refs?{kind:`group`,messages:r.messages,instruction:``}:null}if(e.startsWith(`<group-info>`)||e.startsWith(`<group-state>`)||e.startsWith(`<group-message `)||t.test(e)){let n=e.replace(/^<group-info>[\s\S]*?<\/group-info>\s*/,``).replace(/^<group-state>[\s\S]*?<\/group-state>\s*/,``),r=t.exec(n)?.[0].trim();n=n.replace(t,``);let i=[];for(;n.startsWith(`<group-message `);){let e=/^<group-message([^>]*)>([\s\S]*?)<\/group-message>\s*/.exec(n);if(!e)return null;let t=kH(e[1]);if(!t?.from)return null;i.push({from:t.from,text:OH(e[2].trim())}),n=n.slice(e[0].length)}if(!i.length)return null;let a=/\n*<routing-note>([\s\S]*?)<\/routing-note>\s*$/.exec(n);a&&(n=n.slice(0,a.index));let{body:o,refs:s}=SH(n);return{kind:`group`,messages:i,instruction:OH([r,o.trim()].filter(Boolean).join(`
|
|
201
|
-
`)),...a?{note:OH(a[1].trim())}:{},...s.length?{refs:s}:{}}}let r=/^<delegation-results(\s[^>]*)?>([\s\S]*)<\/delegation-results>$/.exec(e);if(r){if(!kH(r[1]??``))return null;let e=r[2].trim(),t=[];for(;e;){let n=/^<delegation-result([^>]*)>([\s\S]*?)<\/delegation-result>\s*/.exec(e),r=n&&kH(n[1]);if(!n||!r?.from)return null;t.push({from:r.from,status:r.status??``,text:OH(n[2].trim())}),e=e.slice(n[0].length)}return t.length?{kind:`delegation-results`,results:t}:null}let i=/^<(routine|delegation-task|delegation-result|delegation-retry|delegation-check-failed)(\s[^>]*)?>([\s\S]*)<\/\1>$/.exec(e);if(!i)return null;let a=kH(i[2]??``);if(!a)return null;let o=i[3].trim();if(i[1]===`delegation-retry`||i[1]===`delegation-check-failed`)return!a.id||/[<>]/.test(o)?null:{kind:i[1],text:OH(o)};if(i[1]===`routine`){if(!a.title)return null;if(a[`dry-run`]!==`true`)return{kind:`routine`,title:a.title,prompt:OH(o)};let e=OH(o.replace(/^\[Dry run\][^\n]*\n*/,``));return{kind:`routine`,title:a.title,prompt:e,dryRun:!0}}if(!a.from)return null;if(i[1]===`delegation-result`)return{kind:`delegation-result`,from:a.from,status:a.status??``,text:OH(o)};let s=o.replace(/\s*<previous-runs>[\s\S]*<\/previous-runs>$/,``).replace(/\s*<acceptance-check>[\s\S]*<\/acceptance-check>$/,``),c=/\s*<context>([\s\S]*)<\/context>$/.exec(s);return!c&&/<\/?context>/.test(s)?null:{kind:`delegation-task`,from:a.from,task:OH((c?s.slice(0,c.index):s).trim()),context:OH(c?.[1].trim()??``)}}var MH=`You are a side conversation attached to a coding session. The main agent cannot see this thread. Do not continue the main task unless the user asks you to. Follow the same tool and skill constraints as the main session. Do not spawn subagents, coworkers, or workflows. Answer the user directly.`;function NH(e){return e.startsWith(MH)}function PH(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var FH={zh:{quit:`被关闭`,update:`被关闭(安装更新)`},en:{quit:`was closed`,update:`was closed (installing an update)`}};function IH(e){let t=PH(e.at),n=[...new Set(e.unfinishedTools)];return e.lang===`en`?`${`The app ${FH.en[e.kind]} at ${t} and this turn was interrupted.`}${n.length>0?` ${n.length} tool call(s) never returned (${n.join(`, `)}) and may have run halfway — check the result before continuing.`:``}`.trim():`${`应用在 ${t} ${FH.zh[e.kind]},这一轮被中断。`}${n.length>0?`中断时有 ${n.length} 个工具调用没有结果(${n.join(`、`)}),可能只执行了一半,继续前请先检查。`:``}`}function LH(e){let t=IH(e);return e.lang===`en`?`${t} You can retry to continue.`:`${t}可以点重试继续。`}var RH={"too-large":`超过 10MB,没有保存`,"not-image":`不是 png / jpeg / webp / gif 图片,没有保存`,unavailable:`没能保存`},zH=String.raw`\[图片 \d+(?: 未收下)?\] [^\n]*`;new RegExp(String.raw`(?:^|\n\n)${zH}(?:\n${zH})*$`,`u`);function BH(e){return[...e.matchAll(/^\[图片 \d+\] (.+)$/gmu)].map(e=>e[1])}var VH=new Map(Object.entries(RH).map(([e,t])=>[t,e]));function HH(e){return/^(?:\/|[A-Za-z]:\/)/u.test(e.replace(/\\/gu,`/`))}function UH(e){return HH(e)&&e.replace(/\\/gu,`/`).includes(`/bot-chats/secretary-images/`)}function WH(e,t=0){let n=[];for(let[r,i]of e.split(`
|
|
202
|
-
`).entries()){let e=/^\[图片 (\d+)( 未收下)?\] (.+)$/u.exec(i);if(!e||Number(e[1])!==r+1)return null;let a=e[3];if(e[2]){let e=VH.get(a);if(!e)return null;n.push({index:r+1,rejected:e})}else{if(!(r<t?HH(a):UH(a)))return null;n.push({index:r+1,path:a})}}return n}var GH=new RegExp(String.raw`(?:^|\n\n)(${zH}(?:\n${zH})*)`+String.raw`((?:\n\n\[Image[^\n]*\](?:\n\[Image[^\n]*\])*)?)$`,`u`);function KH(e,t=0){let n=GH.exec(e);if(!n)return null;let r=WH(n[1],t);if(!r)return null;let i=e.slice(0,n.index),a=n[2]??``;return{text:i?`${i}${a}`:a.replace(/^\n\n/u,``),entries:r}}new TextEncoder;function qH(e){if(e)try{return decodeURIComponent(e)}catch{return e}}var JH=`([A-Za-z0-9._@:+/=%-]+)`,YH=RegExp(String.raw`^\[(?:来自|From) ([^\]\n@·「」]{1,40}?)`+String.raw`(?: (私聊|private|群|group)(?:「([^」\]\n]{1,64})」)?)?`+`(?: chatId=${JH})?(?: topicId=${JH})?(?: senderId=${JH}| (发送者未知|sender unknown))?`+String.raw`(?: @([^\]\n@·]{1,32}?))?(?: · (\d{2}):(\d{2}))?\]\n`+String.raw`<untrusted-content source="([a-z0-9._:-]+?)(?::@[^"\n]{1,32})?(?: [^"\n]*)?">`+String.raw`([\s\S]*)<\/untrusted-content>((?:\n${zH})*)$`,`u`);function XH(e){let t=YH.exec(e);if(!t)return null;let[,n=``,r,i,a,o,s,c,l,u,d,f=``,p=``,m=``]=t,h=r===`私聊`||r===`private`?`private`:r?`group`:void 0,g={chat:qH(a),topic:qH(o),sender:qH(s)},_=BH(m),v=m?WH(m.slice(1)):null;return{channel:f,title:n,...g.chat?{chatId:g.chat}:{},...h?{chatType:h}:{},...h===`group`&&i?{chatTitle:i}:{},...g.topic?{topicId:g.topic}:{},...g.sender?{senderId:g.sender}:{},...c?{senderUnknown:!0}:{},...l?{username:l}:{},...u&&d?{time:`${u}:${d}`}:{},body:p.split(`<\\/untrusted-content`).join(`</untrusted-content`),..._.length?{images:_}:{},...v?.length?{imageLines:v}:{}}}var ZH=RegExp(`<(agent-notification|goal-continuation|coworker-hired|coworker-dismissed|background-task-update|session-updates|secretary-schedule|secretary-message)>\\n?([\\s\\S]*?)\\n?</\\1>`,`g`),QH=/\n(?=Work toward this goal autonomously\.|Continue working toward it\.)/;function $H(e){let t=(e.split(`
|
|
203
|
-
`).map(e=>e.trim()).find(Boolean)??``).split(/(?<=[。!?.!?])\s*/)[0]?.trim()??``;return t.length<=72?t:`${t.slice(0,72)}…`}function eU(e){let t=e.trim(),n=/^(?:Session goal(?: resumed)?:[ \t]*)([\s\S]*)$/.exec(t),r=(n?n[1]:t).trim(),i=r.search(QH);return i<0?{goal:r,instructions:``}:{goal:r.slice(0,i).trim(),instructions:r.slice(i).trim()}}function tU(e){let t=[],n=new RegExp(ZH.source,`g`),r=0,i=!1;for(let a of e.matchAll(n)){i=!0;let n=a.index??0;n>r&&t.push({kind:`text`,text:e.slice(r,n)});let o=a[1]??``,s=a[2]??``;o===`goal-continuation`?t.push({kind:`goal`,...eU(s)}):o===`secretary-schedule`?t.push({kind:`schedule`,raw:a[0]}):o===`session-updates`?t.push({kind:`updates`,raw:a[0]}):t.push({kind:`notice`,tag:o,body:s}),r=n+a[0].length}return i?(r<e.length&&t.push({kind:`text`,text:e.slice(r)}),t):null}var nU=/^<\/?(?:agent-notification|goal-continuation|coworker-hired|coworker-dismissed|background-task-update|session-updates|secretary-schedule|secretary-message)>$/;function rU(e){return e.split(`
|
|
204
|
-
`).filter(e=>!nU.test(e.trim())).join(`
|
|
205
|
-
`).trim()}function iU(e){return e.length<=72?e:`${e.slice(0,72)}…`}function aU(e){let t=e.trim(),n=t.indexOf(`
|
|
206
|
-
`),r=(n<0?t:t.slice(0,n)).trim(),i=r.indexOf(`:`);if(i>0&&i<=8){let e=r.slice(i+1).trim();if(e){let r=n<0?``:t.slice(n+1);return{summary:iU(e),body:r?`${e}\n${r.trim()}`:e}}}return{summary:iU(r),body:t}}function oU(e){let t=rU(e);return t?t.split(/\n(?=- \[schedule\])/).map(e=>aU(e.replace(/^- \[schedule\][ \t]?/,``))).filter(e=>e.body.length>0):[]}function sU(e){let t=rU(e).replace(/^- \[[a-z-]+(?: session:[^\]]+)?\][ \t]?/gm,``).trim();return{summary:iU(t.split(`
|
|
207
|
-
`).map(e=>e.trim()).find(Boolean)??``),body:t}}var cU=`#7c5cff`,lU=/^#[0-9a-f]{6}$/iu,uU=/^[0-9a-f]{8}$/u,dU=/^([01]\d|2[0-3]):[0-5]\d$/u,fU=[`ui`,`zh`,`en`],pU=[`concise`,`detailed`],mU=[`needs-user`,`with-done`,`off`],hU=[`goal-complete`,`goal-blocked`,`turn-ended`,`needs-user`,`failed`,`stalled`,`interrupted`];function gU(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _U(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function vU(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function yU(e){let t=vU(e);return t===void 0?void 0:Math.floor(t)}function bU(e,t,n){if(!(typeof e!=`number`||!Number.isFinite(e)))return Math.min(n,Math.max(t,Math.round(e)))}function xU(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=_U(n);e&&!t.includes(e)&&t.push(e)}return t}function SU(e,t,n){return t.includes(e)?e:n}function CU(e,t){return typeof e==`boolean`?e:t}var wU={mode:`projects`,projectIds:[]};function TU(e){return gU(e)?e.mode===`all`?{mode:`all`}:e.mode===`explicit`?{mode:`explicit`}:e.mode===`projects`?{mode:`projects`,projectIds:xU(e.projectIds)}:wU:wU}function EU(e){if(!gU(e))return null;let t=gU(e.avatar)?e.avatar:{},n=yU(t.imageVersion),r=typeof t.imageHash==`string`&&uU.test(t.imageHash)?t.imageHash:void 0,i={version:1,name:_U(e.name)??`秘书`,avatar:{color:typeof t.color==`string`&&lU.test(t.color)?t.color:cU,...n&&n>0?{imageVersion:n,...r?{imageHash:r}:{}}:{}},takeoverScope:TU(e.takeoverScope),pluginIds:xU(e.pluginIds),skillIds:xU(e.skillIds),visibleProjectIds:Array.isArray(e.visibleProjectIds)?xU(e.visibleProjectIds):`all`,maxRunningDispatches:bU(e.maxRunningDispatches,1,10)??3,patrolEnabled:CU(e.patrolEnabled,!0),...e.cleanupSkipConfirm===!0?{cleanupSkipConfirm:!0}:{},replyLanguage:SU(e.replyLanguage,fU,`ui`),style:SU(e.style,pU,`concise`),notify:SU(e.notify,mU,`needs-user`),updatedAt:vU(e.updatedAt)??0},a=bU(e.updateWindowMs,1e3,6e4);a!==void 0&&(i.updateWindowMs=a);let o=xU(e.disabledSkillNames);o.length>0&&(i.disabledSkillNames=o);let s=_U(e.addressAs);return s&&(i.addressAs=s),typeof e.dailyBriefAt==`string`&&dU.test(e.dailyBriefAt)&&(i.dailyBriefAt=e.dailyBriefAt),i}var DU=/^<(session-updates|secretary-schedule)>\n([\s\S]*?)\n<\/\1>(?:\n|$)/,OU=/^- \[([a-z-]+)(?: (?:session|pending):([^\]\s]+))?\] ([^\n]*)(?:\n|$)/,kU=/^<untrusted-content source="[^"]*">/,AU=`</untrusted-content>`;function jU(e){return hU.includes(e)}function MU(e,t,n,r){return e===`secretary-schedule`?t===`schedule`&&!n?{kind:t,text:r}:null:t===`proposal`?n?null:{kind:t,text:r}:t===`pending`?{kind:t,text:r}:t===`ask-relay`||t===`leftover`?n?{kind:t,text:r,conversationId:n}:null:jU(t)?n?{kind:t,text:r,conversationId:n}:{kind:t,text:r}:null}function NU(e,t){let n=[],r=t;for(;r;){let t=OU.exec(r),i=t&&MU(e,t[1],t[2],t[3]);if(!t||!i)return null;r=r.slice(t[0].length);let a=kU.exec(r);if(a){let e=r.indexOf(AU);if(e<0)return null;if(i.detail=r.slice(a[0].length,e).split(`<\\/untrusted-content`).join(`</untrusted-content`),r=r.slice(e+20),r.startsWith(`
|
|
208
|
-
`))r=r.slice(1);else if(r)return null}n.push(i)}return n.length>0?n:null}function PU(e){let t=[],n=e.trim();for(;n;){let e=DU.exec(n),r=e&&NU(e[1],e[2]);if(!e||!r)return null;t.push(...r),n=n.slice(e[0].length)}return t.length>0?t:null}var FU=new Set([`Shell read-only shortcut: prefer read (offset/limit) for files, grep for content, find for paths — the dedicated tools handle line ranges and stream far less output.`,"Sleep-waiting in a foreground command costs a model round per check. Put the whole wait in one command that exits when the condition holds (e.g. `until <check>; do sleep 10; done; <report>`) and run it with background: true — you are notified when it finishes, then end your turn.",`timeout only kills the process; it does not keep this call in the foreground. If the command may outlast the yield, set background: true and end your turn — completion wakes you. Do not poll with sleep, ps, pgrep, or task_output loops.`]);function IU(e){let t=e.split(`
|
|
209
|
-
`),n=0;for(;n<t.length&&FU.has(t[n].replace(/\r$/,``));)n++;if(n===0)return e;for(;n<t.length&&!t[n].trim();)n++;return t.slice(n).join(`
|
|
210
|
-
`)||e}var LU=/^Command exited with code \d+$/,RU=/^Command (?:aborted|timed out after \d+ seconds|terminated without an exit code)/,zU=/^\[[^\]]+\]/,BU=/^at\s/,VU=/\b(?:error|fatal|panic|exception|failed|failure|cannot|not found|no such file|denied|refused)\b(?!\.\w|\()/i;function HU(e){let t=IU(e).split(/\r?\n/).map(e=>e.trim()),n=t.findLastIndex(e=>LU.test(e)||RU.test(e));if(n<0)return t.find(Boolean)??``;if(RU.test(t[n]))return t[n];for(let e=n-1;e>=0;e--){let n=t[e];if(n&&!zU.test(n)&&!BU.test(n)&&VU.test(n))return n}return t[n]}function UU({message:e}){let{t}=K(),n={queued:t(`Queued`),running:t(`In progress`),completed:t(`Completed`),failed:t(`Failed`),canceled:t(`Canceled`)},r=e.kind===`routine`?kt:e.kind===`group`?un:e.kind===`delegation-task`?Ot:e.kind===`delegation-retry`||e.kind===`delegation-check-failed`?kn:Nt,i=e.kind===`routine`?`${e.dryRun?t(`Routine dry run`):t(`Routine task`)} · ${e.title}`:e.kind===`group`?t(`Group messages`):e.kind===`delegation-task`?t(`Task from {{name}}`,{name:e.from}):e.kind===`delegation-results`?t(`Delegation results`):e.kind===`delegation-retry`?t(`Continue delegated task`):e.kind===`delegation-check-failed`?t(`Acceptance check not passed`):t(`Result from {{name}}`,{name:e.from});return(0,G.jsxs)(`div`,{"data-bot-injection":e.kind,className:`w-full rounded-lg border border-border/60 bg-muted/20 px-3 py-2 text-sm`,children:[(0,G.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,G.jsx)(r,{className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:i}),e.kind===`delegation-result`&&e.status&&(0,G.jsxs)(`span`,{children:[`· `,n[e.status]??e.status]})]}),(0,G.jsx)(`div`,{className:`whitespace-pre-wrap break-words`,children:e.kind===`routine`?e.prompt:e.kind===`delegation-task`?e.task:e.kind===`delegation-result`||e.kind===`delegation-retry`||e.kind===`delegation-check-failed`?e.text:e.kind===`delegation-results`?e.results.map((e,t)=>(0,G.jsxs)(`p`,{children:[(0,G.jsxs)(`span`,{className:`font-medium`,children:[e.from,e.status&&` · ${n[e.status]??e.status}`,`:`]}),e.text]},`${t}:${e.from}`)):e.messages.map((e,t)=>(0,G.jsxs)(`p`,{children:[(0,G.jsxs)(`span`,{className:`font-medium`,children:[e.from,`:`]}),e.text]},`${t}:${e.from}`))}),e.kind===`delegation-task`&&e.context&&(0,G.jsxs)(`details`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer`,children:t(`Context`)}),(0,G.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:e.context})]}),e.kind===`group`&&e.instruction&&(0,G.jsxs)(`details`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer`,children:t(`Instructions`)}),(0,G.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:e.instruction})]}),e.kind===`group`&&!!e.refs?.length&&(0,G.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1.5`,children:e.refs.map(e=>(0,G.jsxs)(`span`,{title:t(`Referenced chat`),className:`inline-flex h-6 max-w-56 items-center gap-1 rounded-md bg-muted px-1.5 text-xs`,children:[(0,G.jsx)(un,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title})]},e.id))}),e.kind===`group`&&e.note&&(0,G.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:t(`Dispatch hint: {{note}}`,{note:e.note})}),e.kind!==`group`&&!!e.group?.length&&(0,G.jsxs)(`details`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[(0,G.jsxs)(`summary`,{className:`cursor-pointer`,children:[t(`Group messages`),` · `,e.group.length]}),(0,G.jsx)(`div`,{className:`mt-1 whitespace-pre-wrap break-words`,children:e.group.map((e,t)=>(0,G.jsxs)(`p`,{children:[(0,G.jsxs)(`span`,{className:`font-medium`,children:[e.from,`:`]}),e.text]},`${t}:${e.from}`))})]})]})}async function WU(e,t){let n=await NN.getState().restartConversation(e);n&&UD({type:`error`,title:t(`Failed to restart conversation`),description:n})}function GU(e,t){if(!t)return null;for(let[n,r]of Object.entries(e))if(r?.sessionFile===t)return n;return null}function KU(e){return e.split(/[\\/]/).filter(Boolean).pop()??e}function qU(e){return e.alias?.trim()||(e.name===e.path?KU(e.path):e.name)}function JU(e,t){if(!t)return``;let n=e.find(e=>e.id===t.providerId);return n?`${n.name} / ${t.modelId}`:t.modelId}var YU=EU({});if(!YU)throw Error(`secretary default profile`);var XU=YU;function ZU(e,t){let n=e??XU;return{name:e?.name.trim()||t,avatar:{color:n.avatar.color,...n.avatar.imageVersion?{imageVersion:n.avatar.imageVersion}:{}},takeoverScope:n.takeoverScope.mode===`projects`?{mode:`projects`,projectIds:[...n.takeoverScope.projectIds]}:n.takeoverScope,visibleProjectIds:n.visibleProjectIds===`all`?`all`:[...n.visibleProjectIds],maxRunningDispatches:n.maxRunningDispatches,patrolEnabled:n.patrolEnabled,cleanupSkipConfirm:n.cleanupSkipConfirm===!0,replyLanguage:n.replyLanguage,style:n.style,notify:n.notify,addressAs:n.addressAs??null,dailyBriefAt:n.dailyBriefAt??null}}function QU(e){return ZU(null,e)}function $U(e,t){switch(t.type){case`patch`:{let{avatar:n,...r}=t.patch;return{...e,...r,...n?{avatar:{...e.avatar,...n}}:{}}}case`reset`:return t.draft}}var eW=H.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:b,validationMode:x,validation:S}=$M(),{clearErrors:C}=nN(),w=h||s,T=m??a,E={...p,disabled:w},{labelId:D}=iN(),O=cN({id:i});Y(()=>{let e=o!=null;S.inputRef.current?.value||e&&o!==``?b(!0):e&&o===``&&b(!1)},[S.inputRef,b,o]);let k=H.useRef(null);Y(()=>{u&&k.current===Rb(Yy(k.current))&&y(!0)},[u,y]);let[A]=Tj({controlled:o,default:l,name:`FieldControl`,state:`value`}),j=o!==void 0,M=j?A:void 0,N=Uy(()=>S.inputRef.current?.value);return eN(S.inputRef,O,M,N,!w,a),Lr(`input`,e,{ref:[t,k],state:E,props:[{id:O,disabled:w,name:T,ref:S.inputRef,"aria-labelledby":D,autoFocus:u,...j?{value:M}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,pb(eb,e.nativeEvent)),_(t!==(v.initialValue??``)),b(t!==``),e.nativeEvent.defaultPrevented||(C(T),S.change(t))},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),x===`onBlur`&&S.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),S.commit(e.currentTarget.value))}},f,e=>S.getValidationProps(w,e)],stateAttributesMapping:YM})}),tW=H.forwardRef(function(e,t){return(0,G.jsx)(eW,{ref:t,...e})});function nW({className:e,size:t=`default`,unstyled:n=!1,...r}){return(0,G.jsx)(`span`,{className:W(!n&&`relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base shadow-xs ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)]`,e)||void 0,"data-size":t,"data-slot":`input-control`,children:(0,G.jsx)(tW,{className:W(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5`,t===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,t===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,r.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,r.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`),"data-slot":`input`,size:typeof t==`number`?t:void 0,...r})})}var rW=[`#7c5cff`,`#2f9e75`,`#c2553f`,`#2f7fc2`,`#b07a1e`,`#7a4fb5`],iW=/^#[0-9a-f]{6}$/iu;function aW(e){let t=e.trim();return iW.test(t)?t.toLowerCase():null}function oW(e){let t=e?aW(e):null,n=rW.find(e=>e===t)??null;return{preset:n,customSelected:t!==null&&n===null}}function sW({color:e,onChange:t}){let{t:n}=K(),[r,i]=(0,H.useState)(e);(0,H.useEffect)(()=>i(e),[e]);let a=oW(e),o=e=>{let n=aW(e);n&&t(n)};return(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,"data-enso":`secretary-form-avatar`,children:[rW.map(e=>(0,G.jsx)(`button`,{type:`button`,"aria-pressed":a.preset===e,"aria-label":e,onClick:()=>t(e),style:{backgroundColor:e},className:W(`size-6 rounded-full border-2 transition-transform`,a.preset===e?`border-foreground`:`border-transparent hover:scale-105`)},e)),(0,G.jsxs)(`label`,{"data-enso":`secretary-form-avatar-custom`,"data-selected":a.customSelected?`true`:`false`,title:n(`Custom color`),style:a.customSelected?{backgroundColor:e}:void 0,className:W(`relative grid size-6 cursor-pointer place-items-center overflow-hidden rounded-full border-2 text-[10px]`,a.customSelected?`border-foreground text-white`:`border-border text-muted-foreground`),children:[(0,G.jsx)(`span`,{"aria-hidden":!0,className:a.customSelected?`sr-only`:void 0,children:`+`}),(0,G.jsx)(`input`,{type:`color`,"aria-label":n(`Custom color`),value:aW(e)??`#7c5cff`,onChange:e=>o(e.target.value),className:`absolute inset-0 cursor-pointer opacity-0`})]}),(0,G.jsx)(nW,{"data-enso":`secretary-form-avatar-hex`,value:r,spellCheck:!1,"aria-label":n(`Custom color`),onChange:e=>{let t=e.target.value;i(t),o(t)},className:`h-7 w-24 font-mono text-xs`})]})}var cW=[1,2,3,4,5];function lW({value:e,options:t,onChange:n,enso:r}){let{t:i}=K();return(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1`,"data-enso":r,children:t.map(t=>(0,G.jsx)(`button`,{type:`button`,"aria-pressed":t.value===e,onClick:()=>n(t.value),className:W(`rounded-md border px-2.5 py-1 text-xs transition-colors`,t.value===e?`border-primary/60 bg-primary/10 text-foreground`:`border-border text-muted-foreground hover:bg-muted`),children:i(t.label)},t.value))})}function uW({label:e,hint:t,children:n}){let{t:r}=K();return(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`p`,{className:`text-sm`,children:r(e)}),n,t?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(t)}):null]})}function dW({label:e,hint:t,checked:n,onChange:r,enso:i}){let{t:a}=K();return(0,G.jsxs)(`label`,{className:`flex items-start justify-between gap-3`,"data-enso":i,children:[(0,G.jsxs)(`span`,{className:`space-y-1`,children:[(0,G.jsx)(`span`,{className:`block text-sm`,children:a(e)}),(0,G.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:a(t)})]}),(0,G.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":n,onClick:()=>r(!n),className:W(`relative mt-0.5 h-5 w-9 shrink-0 rounded-full border transition-colors`,n?`border-primary bg-primary`:`border-border bg-muted`),children:(0,G.jsx)(`span`,{className:W(`absolute top-0.5 size-3.5 rounded-full bg-background transition-all`,n?`left-[18px]`:`left-0.5`)})})]})}function fW({selected:e,onChange:t,enso:n}){let r=Ce(e=>e.projects).filter(e=>e.kind!==`scratch`&&e.kind!==`secretary`);return r.length===0?null:(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1`,"data-enso":n,children:r.map(n=>{let r=e.includes(n.id);return(0,G.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>t(r?e.filter(e=>e!==n.id):[...e,n.id]),className:W(`rounded-md border px-2.5 py-1 text-xs transition-colors`,r?`border-primary/60 bg-primary/10 text-foreground`:`border-border text-muted-foreground hover:bg-muted`),children:qU(n)},n.id)})})}function pW({initialDraft:e,submitLabel:t,onSubmit:n,busy:r=!1,error:i=null,allowDefaults:a=!1,onCancel:o,hideMaxRunning:s=!1}){let{t:c}=K(),[l,u]=H.useReducer($U,e),d=e=>u({type:`patch`,patch:e});return(0,G.jsxs)(`div`,{className:`space-y-4`,"data-enso":`secretary-profile-form`,children:[(0,G.jsx)(uW,{label:`Name`,children:(0,G.jsx)(nW,{"data-enso":`secretary-form-name`,value:l.name??``,onChange:e=>d({name:e.target.value}),className:`max-w-xs`})}),(0,G.jsx)(uW,{label:`Avatar color`,children:(0,G.jsx)(sW,{color:l.avatar?.color??`#7c5cff`,onChange:e=>d({avatar:{color:e}})})}),(0,G.jsxs)(uW,{label:`Visible projects`,children:[(0,G.jsx)(lW,{enso:`secretary-form-visible-mode`,value:l.visibleProjectIds===`all`?`all`:`selected`,options:[{value:`all`,label:`All projects`},{value:`selected`,label:`Selected projects`}],onChange:e=>d({visibleProjectIds:e===`all`?`all`:l.visibleProjectIds===`all`?[]:l.visibleProjectIds})}),l.visibleProjectIds===`all`?null:(0,G.jsx)(fW,{enso:`secretary-form-visible-projects`,selected:l.visibleProjectIds??[],onChange:e=>d({visibleProjectIds:e})})]}),!s&&(0,G.jsx)(uW,{label:`Running dispatches at most`,children:(0,G.jsx)(lW,{enso:`secretary-form-max-running`,value:String(l.maxRunningDispatches??3),options:cW.map(e=>({value:String(e),label:String(e)})),onChange:e=>d({maxRunningDispatches:Number(e)})})}),(0,G.jsx)(dW,{enso:`secretary-form-patrol`,label:`Watch running sessions automatically`,hint:`While anything is running the secretary checks it and only reports an anomaly: a goal session idle for 3 minutes with an unfinished goal and no live background task, idle for 20 minutes with a background task that never woke it, or running for 30 minutes without any event. Every hour it also reports background tasks left running in finished sessions; nothing is killed. Nothing is sent when all is well.`,checked:l.patrolEnabled??!0,onChange:e=>d({patrolEnabled:e})}),(0,G.jsx)(dW,{enso:`secretary-form-cleanup-skip-confirm`,label:`Clean up without asking`,hint:`Off by default. When on, this secretary's cleanup deletes immediately, with no confirmation card: merged local branches and their worktrees. Sessions are only archived, never deleted. Unmerged branches, branches in use, feat/secretary-agent, main, the current branch and worktrees with uncommitted changes are still refused or skipped.`,checked:l.cleanupSkipConfirm??!1,onChange:e=>d({cleanupSkipConfirm:e})}),i?(0,G.jsx)(`p`,{className:`text-xs text-destructive`,children:i}):null,(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(wa,{size:`sm`,disabled:r,"data-enso":`secretary-form-submit`,onClick:()=>n(l),children:t}),o&&(0,G.jsx)(wa,{variant:`ghost`,size:`sm`,disabled:r,onClick:o,children:c(`Cancel`)}),a&&(0,G.jsx)(`button`,{type:`button`,"data-enso":`secretary-form-defaults`,disabled:r,onClick:()=>n(QU(c(`Secretary`))),className:`text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,children:c(`Use all defaults and start`)})]})]})}var mW=new Set([`session_create`,`todo_item_dispatch`,`secretary_profile_propose`,`skill_propose`,`tool_propose`,`session_takeover_propose`,`cleanup_apply`]);function hW(e){if(!mW.has(e.name)||e.state===`running`||e.state===`error`||!e.output)return null;let t;try{t=JSON.parse(e.output)}catch{return null}if(!t||typeof t!=`object`)return null;let n=t;return n.status===`awaiting_confirmation`&&typeof n.proposalId==`string`?n.proposalId:null}var gW={pending:`Waiting for your confirmation`,executing:`Creating the session…`,succeeded:`Session created`,failed:`Failed`,rejected:`Rejected`,expired:`Expired`},_W={...gW,executing:`Saving the profile…`,succeeded:`Profile saved`};function vW(e){return W(`mb-1 w-full rounded-lg border px-2.5 py-2`,e?`border-warning/40 bg-warning/5`:`border-border/60 bg-muted/20`)}function yW(e){return e.draft.title?.trim()||e.draft.prompt.split(`
|
|
211
|
-
`)[0]?.trim()||``}function bW({proposalId:e,prominent:t}){let{t:n}=K(),r=yR(t=>t.secretary.proposals[e]),i=yR(t=>t.resolving[e]===!0),a=yR(e=>e.resolveProposal),o=Ce(e=>e.projects),s=Ce(e=>e.providers)??[];if(!r)return(0,G.jsx)(`div`,{"data-enso":`secretary-proposal`,className:W(vW(t),`text-[11px] text-muted-foreground`),children:n(`Waiting for your confirmation`)});if(r.kind===`profile`)return(0,G.jsx)(xW,{proposal:r,prominent:t});if(r.kind===`skill`)return(0,G.jsx)(DW,{proposal:r,prominent:t});if(r.kind===`tool`)return(0,G.jsx)(EW,{proposal:r,prominent:t});if(r.kind===`takeover`)return(0,G.jsx)(TW,{proposal:r,prominent:t});if(r.kind===`cleanup`)return(0,G.jsx)(NW,{proposal:r,prominent:t});let c=o.find(e=>e.id===r.draft.projectId),l=r.status===`failed`,u=JU(s,r.draft.model);return(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal`,className:vW(t),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:n(`Dispatch`)}),c&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:qU(c)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:yW(r)}),(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:r.draft.worktree?n(`Isolated worktree`):n(`Project checkout`)})]}),(r.draft.branch||r.draft.baseRef||u||(r.draft.after?.length??0)>0)&&(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal-base`,className:`mt-1 flex flex-wrap items-center gap-1 text-[11px] text-muted-foreground`,children:[r.draft.branch&&(0,G.jsx)(`span`,{children:r.draft.branch}),r.draft.baseRef&&(0,G.jsx)(`span`,{children:n(`from {{ref}}`,{ref:r.draft.baseRef})}),u&&(0,G.jsx)(`span`,{"data-enso":`secretary-proposal-model`,children:n(`Model: {{model}}`,{model:u})}),r.draft.after&&r.draft.after.length>0&&(0,G.jsx)(`span`,{children:n(`After {{ids}}`,{ids:r.draft.after.join(`, `)})})]}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:W(`text-[11px]`,l?`text-destructive`:`text-muted-foreground`),children:[n(gW[r.status]),l&&r.error?` · ${r.error}`:``]}),r.status===`pending`&&(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>void a(r.id,`confirm`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:n(`Confirm dispatch`)}),(0,G.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>void a(r.id,`reject`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Reject`)})]})]})]})}function xW({proposal:e,prominent:t}){let{t:n}=K(),r=yR(t=>t.resolving[e.id]===!0),i=yR(e=>e.resolveProposal),[a,o]=H.useState(!1),s=e.draft,c=e.status===`failed`,l=H.useMemo(()=>({...ZU(null,n(`Secretary`)),...s}),[s,n]);return(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal`,"data-kind":`profile`,className:vW(t),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:n(`Profile`)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:s.name??n(`Secretary`)})]}),(0,G.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:n(`Up to {{n}} at a time`,{n:s.maxRunningDispatches??3})}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,G.jsx)(`span`,{children:n(s.patrolEnabled===!1?`Patrol off`:`Patrol on`)}),(0,G.jsx)(`span`,{children:n(s.cleanupSkipConfirm?`Cleanup without confirmation`:`Cleanup asks first`)})]}),a?(0,G.jsx)(`div`,{className:`mt-2 border-t border-border/60 pt-2`,children:(0,G.jsx)(pW,{initialDraft:l,submitLabel:n(`Confirm`),busy:r,onSubmit:t=>{o(!1),i(e.id,`confirm`,void 0,t)},onCancel:()=>o(!1)})}):(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:W(`text-[11px]`,c?`text-destructive`:`text-muted-foreground`),children:[n(_W[e.status]),c&&e.error?` · ${e.error}`:``]}),e.status===`pending`&&(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`confirm`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:n(`Confirm`)}),(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`reject`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Reject`)}),(0,G.jsx)(`button`,{type:`button`,"data-enso":`secretary-proposal-edit`,disabled:r,onClick:()=>o(!0),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Edit here`)})]})]})]})}var SW={...gW,executing:`Saving the skill…`,succeeded:`Skill saved`},CW={...gW,executing:`Saving the tool…`,succeeded:`Tool saved`},wW={...gW,executing:`Handing it over…`,succeeded:`Handed over to the secretary`};function TW({proposal:e,prominent:t}){let{t:n}=K(),r=yR(t=>t.resolving[e.id]===!0),i=yR(e=>e.resolveProposal),a=Ce(e=>e.projects).find(t=>t.id===e.draft.projectId),o=e.status===`failed`;return(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal`,"data-kind":`takeover`,className:vW(t),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:n(`Take over`)}),a&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:qU(a)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.draft.title??n(`Unnamed`)})]}),(0,G.jsxs)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:[n(`The secretary asks to manage this session: it may message and stop it like its own.`),e.draft.reason?` ${e.draft.reason}`:``]}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:W(`text-[11px]`,o?`text-destructive`:`text-muted-foreground`),children:[n(wW[e.status]),o&&e.error?` · ${e.error}`:``]}),e.status===`pending`&&(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`confirm`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:n(`Allow takeover`)}),(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`reject`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Reject`)})]})]})]})}function EW({proposal:e,prominent:t}){let{t:n}=K(),r=yR(t=>t.resolving[e.id]===!0),i=yR(e=>e.resolveProposal),a=e.draft,o=e.status===`failed`;return(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal`,"data-kind":`tool`,className:vW(t),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:n(`Tool`)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:a.name}),(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:a.runtime===`python`?`Python`:`Node`}),(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:a.readOnly?n(`Read-only`):n(`Asks every call`)}),(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:e.previous?n(`Update`):n(`New`)})]}),(0,G.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:a.description}),(0,G.jsxs)(`details`,{className:`mt-1.5 rounded border border-border/60 bg-background/40 px-2 py-1`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-[11px] text-muted-foreground`,children:n(`Show the arguments`)}),(0,G.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre-wrap text-[11px]`,children:JSON.stringify(a.parameters,null,2)})]}),(0,G.jsxs)(`details`,{className:`mt-1 rounded border border-border/60 bg-background/40 px-2 py-1`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-[11px] text-muted-foreground`,children:n(`Show the code`)}),(0,G.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre font-mono text-[11px]`,children:a.code})]}),e.previous?(0,G.jsxs)(`details`,{className:`mt-1 rounded border border-border/60 bg-background/40 px-2 py-1`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-[11px] text-muted-foreground`,children:n(`Show the current version`)}),(0,G.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre font-mono text-[11px]`,children:e.previous.code})]}):null,(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:W(`text-[11px]`,o?`text-destructive`:`text-muted-foreground`),children:[n(CW[e.status]),o&&e.error?` · ${e.error}`:``]}),e.status===`pending`&&(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`confirm`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:n(`Confirm`)}),(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`reject`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Reject`)})]})]})]})}function DW({proposal:e,prominent:t}){let{t:n}=K(),r=yR(t=>t.resolving[e.id]===!0),i=yR(e=>e.resolveProposal),a=e.draft,o=e.status===`failed`;return(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal`,"data-kind":`skill`,className:vW(t),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:n(`Skill`)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:a.name}),(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:e.previous?n(`Update`):n(`New`)})]}),(0,G.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:a.description}),(0,G.jsxs)(`details`,{className:`mt-1.5 rounded border border-border/60 bg-background/40 px-2 py-1`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-[11px] text-muted-foreground`,children:n(`Show the content`)}),(0,G.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre-wrap text-[11px]`,children:a.body})]}),e.previous?(0,G.jsxs)(`details`,{className:`mt-1 rounded border border-border/60 bg-background/40 px-2 py-1`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-[11px] text-muted-foreground`,children:n(`Show the current version`)}),(0,G.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre-wrap text-[11px]`,children:e.previous.body})]}):null,(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:W(`text-[11px]`,o?`text-destructive`:`text-muted-foreground`),children:[n(SW[e.status]),o&&e.error?` · ${e.error}`:``]}),e.status===`pending`&&(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`confirm`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:n(`Confirm`)}),(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`reject`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Reject`)})]})]})]})}var OW={...gW,executing:`Cleaning up…`,succeeded:`Cleanup done`},kW={branch:`Branch`,worktree:`Worktree`,session:`Session`},AW={"not-merged":`Not merged yet`,"current-branch":`Currently checked out`,"used-by-worktree":`Used by a worktree`,"detached-head":`Detached HEAD`,"uncommitted-changes":`Has uncommitted changes`};function jW(e){return e===void 0?null:e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}var MW=5;function NW({proposal:e,prominent:t}){let{t:n}=K(),r=yR(t=>t.resolving[e.id]===!0),i=yR(e=>e.resolveProposal),a=e.draft.items,o=a.slice(0,MW),s=a.length-o.length,c=e.status===`failed`,l=a.reduce((e,t)=>(e[t.kind]=(e[t.kind]??0)+1,e),{});return(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal`,"data-kind":`cleanup`,className:vW(t),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:n(`Clean up`)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n(`{{count}} items`,{count:a.length})}),[`branch`,`worktree`,`session`].map(e=>l[e]?(0,G.jsxs)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:[l[e],` `,n(kW[e])]},e):null)]}),(0,G.jsxs)(`ul`,{"data-enso":`secretary-cleanup-items`,className:`mt-1.5 space-y-0.5`,children:[o.map(e=>{let t=jW(e.sizeBytes),r=[e.mergedInto?.length?n(`merged into {{refs}}`,{refs:e.mergedInto.join(`, `)}):null,t,e.blocked?n(AW[e.blocked]??e.blocked):null].filter(Boolean);return(0,G.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-1.5 text-[11px]`,children:[(0,G.jsx)(`span`,{"data-enso":`secretary-cleanup-kind`,className:`shrink-0 rounded bg-muted px-1 text-[10px] text-muted-foreground`,children:n(kW[e.kind])}),(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono`,children:e.name}),r.length>0&&(0,G.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:r.join(` · `)})]},e.id)}),s>0&&(0,G.jsx)(`li`,{"data-enso":`secretary-cleanup-rest`,className:`text-[11px] text-muted-foreground`,children:n(`and {{count}} more`,{count:s})})]}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:W(`text-[11px]`,c?`text-destructive`:`text-muted-foreground`),children:[n(OW[e.status]),c&&e.error?` · ${e.error}`:``,e.report?` · ${e.report}`:``]}),e.status===`pending`&&(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`button`,{type:`button`,"data-enso":`secretary-cleanup-confirm`,disabled:r,onClick:()=>void i(e.id,`confirm`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:n(`Confirm cleanup`)}),(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`reject`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Reject`)})]})]})]})}function PW(e){let[t,n]=H.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=H.useRef(null),i=H.useRef(null),a=H.useRef(null),o=H.useRef(null),s=H.useRef(!0),c=H.useRef(null),l=_b(),u=H.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,G.jsx)(Sj.Provider,{value:u,children:(0,G.jsx)(bj.Provider,{value:void 0,children:(0,G.jsx)(sM,{...e})})})}var FW=500,IW=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=Cj(!1),{store:m}=xj(!1),h=m.useState(`open`),g=m.useState(`disabled`),_=H.useRef(null),v=H.useRef(null),y=Cb(),b=Cb(),x=H.useRef(!1),S=H.useRef(null);function C(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),x.current=!1,s.current?.setOpen(!0,pb(tb,n)),b.start(FW,()=>{x.current=!0})}function w(e){if(g)return;d.current=!0,Mb(e),C(e.clientX,e.clientY,e.nativeEvent);let t=Yy(_.current);S.current?.abort();let n=new AbortController;S.current=n,t.addEventListener(`mouseup`,e=>{if(d.current=!1,!x.current)return;b.clear(),x.current=!1;let t=Bb(e);zb(u.current,t)||p&&t&&mM(t)===p||s.current?.setOpen(!1,pb(ub,e))},{once:!0,signal:n.signal})}function T(){y.clear(),v.current=null}function E(e){if(g){T();return}if(d.current=!1,e.touches.length!==1){T();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};v.current=n,y.start(FW,()=>{C(n.x,n.y,e.nativeEvent)})}function D(e){if(e.touches.length!==1){T();return}if(y.isStarted()&&v.current){let t=e.touches[0],n=Math.abs(t.clientX-v.current.x),r=Math.abs(t.clientY-v.current.y);(n>10||r>10)&&T()}}return H.useEffect(()=>()=>{S.current?.abort()},[]),H.useEffect(()=>{function e(e){if(g)return;let t=Bb(e);(zb(_.current,t)||zb(c.current,t)||zb(l.current,t))&&e.preventDefault()}return ex(Yy(_.current),`contextmenu`,e)},[l,g,c]),Lr(`div`,e,{state:{open:h},ref:[_,t],props:[{onContextMenu:w,onTouchStart:E,onTouchMove:D,onTouchEnd:T,onTouchCancel:T,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:dy})}),LW=PW;function RW(e){return(0,G.jsx)(IW,{"data-slot":`context-menu-trigger`,...e})}function zW({children:e,className:t,zIndex:n,...r}){return(0,G.jsxs)(Hj,{children:[(0,G.jsx)(wj,{className:`fixed inset-0 z-40`,"data-enso-float":``,style:n===void 0?void 0:{zIndex:n-1}}),(0,G.jsx)(Qj,{className:`z-50`,"data-slot":`context-menu-positioner`,style:n===void 0?void 0:{zIndex:n},children:(0,G.jsx)(zj,{className:W(LM,t),"data-slot":`context-menu-popup`,...r,children:(0,G.jsx)(`div`,{className:`max-h-(--available-height) w-full overflow-y-auto p-1.5`,children:e})})})]})}function BW({className:e,variant:t=`default`,...n}){return(0,G.jsx)(Ij,{className:W(BM,e),"data-slot":`context-menu-item`,"data-variant":t,...n})}async function VW(e){let t=/^data:([^;,]+);base64,(.*)$/s.exec(e);if(!t)return(await fetch(e)).blob();let n=atob(t[2]),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return new Blob([r],{type:t[1]})}async function HW(e){let t=await VW(e),n=t;if(t.type!==`image/png`){let e=await createImageBitmap(t),r=new OffscreenCanvas(e.width,e.height);r.getContext(`2d`)?.drawImage(e,0,0),e.close(),n=await r.convertToBlob({type:`image/png`})}await navigator.clipboard.write([new ClipboardItem({"image/png":n})])}function UW({src:e,className:t,frameClassName:n,onError:r,alt:i=``,lazy:a=!1,children:o,title:s}){let{t:c}=K(),[l,u]=(0,H.useState)(!1);eD(l),(0,H.useEffect)(()=>{if(!l)return;let e=e=>{e.key===`Escape`&&u(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[l]);let d=()=>{HW(e).then(()=>UD({type:`success`,title:c(`Image copied`)}),e=>UD({type:`error`,title:c(`Could not copy image`),description:e instanceof Error?e.message:String(e)}))};return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(LW,{children:[(0,G.jsx)(RW,{render:(0,G.jsx)(`button`,{type:`button`,onClick:()=>u(!0),title:s,className:W(`cursor-zoom-in`,n),children:o??(0,G.jsx)(`img`,{src:e,alt:i,className:t,onError:r,...a?{loading:`lazy`,decoding:`async`}:{}})}),onContextMenu:e=>e.stopPropagation()}),(0,G.jsx)(zW,{className:`min-w-36`,children:(0,G.jsx)(BW,{closeOnClick:!0,onClick:d,children:c(`Copy image`)})})]}),l&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>u(!1),className:W(`fixed inset-0 flex cursor-zoom-out items-center justify-center bg-black/75`),style:{zIndex:dD.NESTED_MODAL_BACKDROP},"data-enso-float":``,children:(0,G.jsx)(`img`,{src:e,alt:``,className:`max-h-[92vh] max-w-[92vw] rounded-lg object-contain`})})]})}var WW={"too-large":`over 10 MB, not saved`,"not-image":`not a png / jpeg / webp / gif image, not saved`,unavailable:`could not be saved`};function GW(e){return e.split(/[\\/]/u).pop()??e}function KW({entries:e,thumbnails:t=0,align:n=`end`}){let{t:r}=K(),i=e.filter(e=>`path`in e&&e.index>t),a=e.filter(e=>`rejected`in e);return i.length===0&&a.length===0?null:(0,G.jsxs)(`div`,{"data-enso":`inbound-images`,className:W(`flex flex-col gap-1`,n===`end`?`items-end`:`items-start`),children:[i.length>0&&(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.map(e=>(0,G.jsxs)(UW,{src:m(e.path),title:GW(e.path),frameClassName:`inline-flex h-6 items-center gap-1 rounded-md bg-muted px-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,G.jsx)(Qt,{className:`size-3 shrink-0`}),(0,G.jsx)(`span`,{children:r(`Image {{n}}`,{n:e.index})})]},e.index))}),a.map(e=>(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`Image {{n}} not accepted: {{reason}}`,{n:e.index,reason:r(WW[e.rejected])})},e.index))]})}var qW={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,bmp:`image/bmp`,ico:`image/x-icon`,avif:`image/avif`,svg:`image/svg+xml`};function JW(e){let t=e.split(/[?#]/)[0]??``,n=t.lastIndexOf(`.`);return n<0?null:qW[t.slice(n+1).toLowerCase()]??null}var YW=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XW=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZW={};function QW(e,t){return((t||ZW).jsx?XW:YW).test(e)}var $W=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
212
|
-
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),eG=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t($W());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),tG=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),nG=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(eG()),r=tG();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),rG=aG(`end`),iG=aG(`start`);function aG(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function oG(e){let t=iG(e),n=rG(e);if(t&&n)return{start:t,end:n}}function sG(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?lG(e.position):`start`in e||`end`in e?lG(e):`line`in e||`column`in e?cG(e):``}function cG(e){return uG(e&&e.line)+`:`+uG(e&&e.column)}function lG(e){return cG(e&&e.start)+`-`+cG(e&&e.end)}function uG(e){return e&&typeof e==`number`?e:1}var dG=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=sG(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};dG.prototype.file=``,dG.prototype.name=``,dG.prototype.reason=``,dG.prototype.message=``,dG.prototype.stack=``,dG.prototype.column=void 0,dG.prototype.line=void 0,dG.prototype.ancestors=void 0,dG.prototype.cause=void 0,dG.prototype.fatal=void 0,dG.prototype.place=void 0,dG.prototype.ruleId=void 0,dG.prototype.source=void 0;var fG=e(nG(),1),pG={}.hasOwnProperty,mG=new Map,hG=/[A-Z]/g,gG=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),_G=new Set([`td`,`th`]),vG=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function yG(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=AG(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=kG(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Od:Dd,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=bG(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function bG(e,t,n){if(t.type===`element`)return xG(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return SG(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return wG(e,t,n);if(t.type===`mdxjsEsm`)return CG(e,t);if(t.type===`root`)return TG(e,t,n);if(t.type===`text`)return EG(e,t)}function xG(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Od,e.schema=i),e.ancestors.push(t);let a=IG(e,t.tagName,!1),o=jG(e,t),s=NG(e,t);return gG.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!lf(e)})),DG(e,o,a,t),OG(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function SG(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}LG(e,t.position)}function CG(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);LG(e,t.position)}function wG(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Od,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:IG(e,t.name,!0),o=MG(e,t),s=NG(e,t);return DG(e,o,a,t),OG(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function TG(e,t,n){let r={};return OG(r,NG(e,t)),e.create(t,e.Fragment,r,n)}function EG(e,t){return t.value}function DG(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function OG(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function kG(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function AG(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=iG(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function jG(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&pG.call(t.properties,i)){let a=PG(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&_G.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function MG(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else LG(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else LG(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function NG(e,t){let n=[],r=-1,i=e.passKeys?new Map:mG;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=bG(e,a,o);s!==void 0&&n.push(s)}return n}function PG(e,t,n){let r=wd(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?of(n):sf(n)),r.property===`style`){let t=typeof n==`object`?n:FG(e,String(n));return e.stylePropertyNameCase===`css`&&(t=RG(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?bd[r.property]||r.property:r.attribute,n]}}function FG(e,t){try{return(0,fG.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new dG("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=vG+`#cannot-parse-style-attribute`,r}}function IG(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=QW(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=QW(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return pG.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);LG(e)}function LG(e,t){let n=new dG("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=vG+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function RG(e){let t={},n;for(n in e)pG.call(e,n)&&(t[zG(n)]=e[n]);return t}function zG(e){let t=e.replace(hG,BG);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function BG(e){return`-`+e.toLowerCase()}var VG={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},HG={};function UG(e,t){let n=t||HG;return WG(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function WG(e,t,n){if(KG(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return GG(e.children,t,n)}return Array.isArray(e)?GG(e,t,n):``}function GG(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=WG(e[i],t,n);return r.join(``)}function KG(e){return!!(e&&typeof e==`object`)}var qG=document.createElement(`i`);function JG(e){let t=`&`+e+`;`;qG.innerHTML=t;let n=qG.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function YG(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function XG(e,t){return e.length>0?(YG(e,e.length,0,t),e):t}var ZG={}.hasOwnProperty;function QG(e){let t={},n=-1;for(;++n<e.length;)$G(t,e[n]);return t}function $G(e,t){let n;for(n in t){let r=(ZG.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){ZG.call(r,a)||(r[a]=[]);let e=i[a];eK(r[a],Array.isArray(e)?e:e?[e]:[])}}}function eK(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);YG(e,0,0,r)}function tK(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function nK(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var rK=hK(/[A-Za-z]/),iK=hK(/[\dA-Za-z]/),aK=hK(/[#-'*+\--9=?A-Z^-~]/);function oK(e){return e!==null&&(e<32||e===127)}var sK=hK(/\d/),cK=hK(/[\dA-Fa-f]/),lK=hK(/[!-/:-@[-`{-~]/);function uK(e){return e!==null&&e<-2}function dK(e){return e!==null&&(e<0||e===32)}function fK(e){return e===-2||e===-1||e===32}var pK=hK(/\p{P}|\p{S}/u),mK=hK(/\s/);function hK(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function gK(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&iK(e.charCodeAt(n+1))&&iK(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function _K(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return fK(r)?(e.enter(n),s(r)):t(r)}function s(r){return fK(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var vK={tokenize:yK};function yK(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),_K(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return uK(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var bK={tokenize:SK},xK={tokenize:CK};function SK(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return YG(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(xK,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(xK,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return uK(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;YG(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function CK(e,t,n){return _K(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function wK(e){if(e===null||dK(e)||mK(e))return 1;if(pK(e))return 2}function TK(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var EK={name:`attention`,resolveAll:DK,tokenize:OK};function DK(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};kK(d,-c),kK(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=XG(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=XG(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=XG(l,TK(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=XG(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=XG(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,YG(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function OK(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=wK(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=wK(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function kK(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var AK={name:`autolink`,tokenize:jK};function jK(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return rK(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||iK(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||iK(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||oK(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):aK(t)?(e.consume(t),l):n(t)}function u(e){return iK(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||iK(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var MK={partial:!0,tokenize:NK};function NK(e,t,n){return r;function r(t){return fK(t)?_K(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||uK(e)?t(e):n(e)}}var PK={continuation:{tokenize:IK},exit:LK,name:`blockQuote`,tokenize:FK};function FK(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return fK(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function IK(e,t,n){let r=this;return i;function i(t){return fK(t)?_K(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(PK,t,n)(r)}}function LK(e){e.exit(`blockQuote`)}var RK={name:`characterEscape`,tokenize:zK};function zK(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return lK(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var BK={name:`characterReference`,tokenize:VK};function VK(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=iK,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=cK,u):(e.enter(`characterReferenceValue`),a=7,o=sK,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===iK&&!JG(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var HK={partial:!0,tokenize:GK},UK={concrete:!0,name:`codeFenced`,tokenize:WK};function WK(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),fK(t)?_K(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||uK(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(HK,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||uK(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):fK(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),_K(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||uK(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||uK(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&fK(t)?_K(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||uK(t)?e.check(HK,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||uK(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),fK(t)?_K(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),fK(t)?_K(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||uK(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function GK(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var KK={name:`codeIndented`,tokenize:JK},qK={partial:!0,tokenize:YK};function JK(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),_K(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):uK(t)?e.attempt(qK,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||uK(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function YK(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):uK(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):_K(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):uK(e)?i(e):n(e)}}var XK={name:`codeText`,previous:QK,resolve:ZK,tokenize:$K};function ZK(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function QK(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function $K(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):uK(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||uK(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var eq=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&tq(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tq(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tq(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);tq(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tq(this.left,t.reverse())}}}};function tq(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function nq(e){let t={},n=-1,r,i,a,o,s,c,l,u=new eq(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,rq(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return YG(e,0,1/0,u.slice(0)),!l}function rq(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var iq={resolve:oq,tokenize:sq},aq={partial:!0,tokenize:cq};function oq(e){return nq(e),e}function sq(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):uK(t)?e.check(aq,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function cq(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_K(e,a,`linePrefix`)}function a(i){if(i===null||uK(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function lq(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||oK(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||uK(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||dK(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||oK(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function uq(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):uK(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||uK(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!fK(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function dq(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):uK(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_K(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||uK(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function fq(e,t){let n;return r;function r(i){return uK(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):fK(i)?_K(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var pq={name:`definition`,tokenize:hq},mq={partial:!0,tokenize:gq};function hq(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return uq.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=nK(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return dK(t)?fq(e,l)(t):l(t)}function l(t){return lq(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(mq,d,d)(t)}function d(t){return fK(t)?_K(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||uK(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function gq(e,t,n){return r;function r(t){return dK(t)?fq(e,i)(t):n(t)}function i(t){return dq(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return fK(t)?_K(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||uK(e)?t(e):n(e)}}var _q={name:`hardBreakEscape`,tokenize:vq};function vq(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return uK(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var yq={name:`headingAtx`,resolve:bq,tokenize:xq};function bq(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},YG(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function xq(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||dK(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||uK(n)?(e.exit(`atxHeading`),t(n)):fK(n)?_K(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||dK(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Sq=`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.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Cq=[`pre`,`script`,`style`,`textarea`],wq={concrete:!0,name:`htmlFlow`,resolveTo:Dq,tokenize:Oq},Tq={partial:!0,tokenize:Aq},Eq={partial:!0,tokenize:kq};function Dq(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Oq(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):rK(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):rK(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return rK(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||dK(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Cq.includes(l)?(i=1,r.interrupt?t(s):O(s)):Sq.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||iK(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return fK(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||rK(t)?(e.consume(t),b):fK(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||iK(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):fK(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):fK(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||uK(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||dK(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||fK(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||uK(t)?O(t):fK(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),ee):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):uK(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Tq,L,k)(t)):t===null||uK(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Eq,A,L)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||uK(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return Cq.includes(n)?(e.consume(t),ee):O(t)}return rK(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),ee):t===45&&i===2?(e.consume(t),I):O(t)}function ee(t){return t===null||uK(t)?(e.exit(`htmlFlowData`),L(t)):(e.consume(t),ee)}function L(n){return e.exit(`htmlFlow`),t(n)}}function kq(e,t,n){let r=this;return i;function i(t){return uK(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Aq(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(MK,t,n)}}var jq={name:`htmlText`,tokenize:Mq};function Mq(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):rK(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):rK(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):uK(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):uK(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):uK(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):uK(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return rK(t)?(e.consume(t),S):n(t)}function S(t){return t===45||iK(t)?(e.consume(t),S):C(t)}function C(t){return uK(t)?(o=C,N(t)):fK(t)?(e.consume(t),C):M(t)}function w(t){return t===45||iK(t)?(e.consume(t),w):t===47||t===62||dK(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||rK(t)?(e.consume(t),E):uK(t)?(o=T,N(t)):fK(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||iK(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):uK(t)?(o=D,N(t)):fK(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):uK(t)?(o=O,N(t)):fK(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):uK(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||dK(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||dK(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return fK(t)?_K(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var Nq={name:`labelEnd`,resolveAll:Lq,resolveTo:Rq,tokenize:zq},Pq={tokenize:Bq},Fq={tokenize:Vq},Iq={tokenize:Hq};function Lq(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&YG(e,0,e.length,n),e}function Rq(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=XG(s,e.slice(a+1,a+r+3)),s=XG(s,[[`enter`,u,t]]),s=XG(s,TK(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=XG(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=XG(s,e.slice(o+1)),s=XG(s,[[`exit`,c,t]]),YG(e,a,e.length,s),e}function zq(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(nK(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Pq,u,o?u:d)(t):t===91?e.attempt(Fq,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Iq,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Bq(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return dK(t)?fq(e,a)(t):a(t)}function a(t){return t===41?u(t):lq(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return dK(t)?fq(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?dq(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return dK(t)?fq(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Vq(e,t,n){let r=this;return i;function i(t){return uq.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(nK(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Hq(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Uq={name:`labelStartImage`,resolveAll:Nq.resolveAll,tokenize:Wq};function Wq(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Gq={name:`labelStartLink`,resolveAll:Nq.resolveAll,tokenize:Kq};function Kq(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var qq={name:`lineEnding`,tokenize:Jq};function Jq(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),_K(e,t,`linePrefix`)}}var Yq={name:`thematicBreak`,tokenize:Xq};function Xq(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||uK(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),fK(t)?_K(e,s,`whitespace`)(t):s(t))}}var Zq={continuation:{tokenize:tJ},exit:rJ,name:`list`,tokenize:eJ},Qq={partial:!0,tokenize:iJ},$q={partial:!0,tokenize:nJ};function eJ(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:sK(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Yq,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return sK(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(MK,r.interrupt?n:u,e.attempt(Qq,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return fK(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function tJ(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(MK,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,_K(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!fK(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($q,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,_K(e,e.attempt(Zq,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function nJ(e,t,n){let r=this;return _K(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function rJ(e){e.exit(this.containerState.type)}function iJ(e,t,n){let r=this;return _K(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!fK(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var aJ={name:`setextUnderline`,resolveTo:oJ,tokenize:sJ};function oJ(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function sJ(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),fK(t)?_K(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||uK(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var cJ={tokenize:lJ};function lJ(e){let t=this,n=e.attempt(MK,r,e.attempt(this.parser.constructs.flowInitial,i,_K(e,e.attempt(this.parser.constructs.flow,i,e.attempt(iq,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var uJ={resolveAll:mJ()},dJ=pJ(`string`),fJ=pJ(`text`);function pJ(e){return{resolveAll:mJ(e===`text`?hJ:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function mJ(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function hJ(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var gJ=t({attentionMarkers:()=>wJ,contentInitial:()=>vJ,disable:()=>TJ,document:()=>_J,flow:()=>bJ,flowInitial:()=>yJ,insideSpan:()=>CJ,string:()=>xJ,text:()=>SJ}),_J={42:Zq,43:Zq,45:Zq,48:Zq,49:Zq,50:Zq,51:Zq,52:Zq,53:Zq,54:Zq,55:Zq,56:Zq,57:Zq,62:PK},vJ={91:pq},yJ={[-2]:KK,[-1]:KK,32:KK},bJ={35:yq,42:Yq,45:[aJ,Yq],60:wq,61:aJ,95:Yq,96:UK,126:UK},xJ={38:BK,92:RK},SJ={[-5]:qq,[-4]:qq,[-3]:qq,33:Uq,38:BK,42:EK,60:[AK,jq],91:Gq,92:[_q,RK],93:Nq,95:EK,96:XK},CJ={null:[EK,uJ]},wJ={null:[42,95]},TJ={null:[]};function EJ(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=XG(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=TK(a,l.events,l),l.events):[]}function f(e,t){return OJ(p(e),t)}function p(e){return DJ(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){uK(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&YG(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function DJ(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function OJ(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
213
|
-
`;break;case-3:o=`\r
|
|
214
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function kJ(e){let t={constructs:QG([gJ,...(e||{}).extensions||[]]),content:n(vK),defined:[],document:n(bK),flow:n(cJ),lazy:{},string:n(dJ),text:n(fJ)};return t;function n(e){return n;function n(n){return EJ(t,e,n)}}}function AJ(e){for(;!nq(e););return e}var jJ=/[\0\t\n\r]/g;function MJ(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(jJ.lastIndex=u,c=jJ.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var NJ=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function PJ(e){return e.replace(NJ,FJ)}function FJ(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return tK(n.slice(t?2:1),t?16:10)}return JG(n)||e}var IJ={}.hasOwnProperty;function LJ(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),RJ(n)(AJ(kJ(n).document().write(MJ()(e,t,!0))))}function RJ(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(pe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(le),blockQuote:a(ae),characterEscape:T,characterReference:T,codeFenced:a(oe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(oe,o),codeText:a(V,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(se),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ce),hardBreakEscape:a(ue),hardBreakTrailing:a(ue),htmlFlow:a(de,o),htmlFlowData:T,htmlText:a(de,o),htmlTextData:T,image:a(fe),label:o,link:a(pe),listItem:a(he),listItemValue:f,listOrdered:a(me,d),listUnordered:a(me),paragraph:a(ge),reference:te,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(le),strong:a(_e),thematicBreak:a(ye)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ie,autolinkProtocol:B,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:ne,characterReference:re,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:R,resourceDestinationString:I,resourceTitleString:ee,resource:L,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};BJ(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];IJ.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||HJ).call(a,void 0,e[0])}for(r.position={start:zJ(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:zJ(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:zJ(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||HJ).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+sG({start:e.start,end:e.end})+`): it’s not open`);n.position.end=zJ(e.end)}function u(){return UG(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=nK(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ve(),n.position={start:zJ(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=zJ(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=zJ(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=PJ(t),n.identifier=nK(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function L(){this.data.inReference=void 0}function te(){this.data.referenceType=`collapsed`}function R(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=nK(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function z(e){this.data.characterReferenceType=e.type}function ne(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=tK(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=JG(t);let i=this.stack[this.stack.length-1];i.value+=r}function re(e){let t=this.stack.pop();t.position.end=zJ(e.end)}function B(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ie(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[]}}function oe(){return{type:`code`,lang:null,meta:null,value:``}}function V(){return{type:`inlineCode`,value:``}}function se(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ce(){return{type:`emphasis`,children:[]}}function le(){return{type:`heading`,depth:0,children:[]}}function ue(){return{type:`break`}}function de(){return{type:`html`,value:``}}function fe(){return{type:`image`,title:null,url:``,alt:null}}function pe(){return{type:`link`,title:null,url:``,children:[]}}function me(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function he(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ge(){return{type:`paragraph`,children:[]}}function _e(){return{type:`strong`,children:[]}}function ve(){return{type:`text`,value:``}}function ye(){return{type:`thematicBreak`}}}function zJ(e){return{line:e.line,column:e.column,offset:e.offset}}function BJ(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?BJ(e,r):VJ(e,r)}}function VJ(e,t){let n;for(n in t)if(IJ.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function HJ(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+sG({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sG({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+sG({start:t.start,end:t.end})+`) is still open`)}function UJ(e){let t=this;t.parser=n;function n(n){return LJ(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function WJ(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function GJ(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
215
|
-
`}]}function KJ(e,t){let n=t.value?t.value+`
|
|
216
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function qJ(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JJ(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YJ(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=gK(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function XJ(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZJ(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function QJ(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function $J(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return QJ(e,t);let i={src:gK(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function eY(e,t){let n={src:gK(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function tY(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function nY(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return QJ(e,t);let i={href:gK(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function rY(e,t){let n={href:gK(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function iY(e,t,n){let r=e.all(t),i=n?aY(n):oY(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
217
|
-
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
218
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function aY(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=oY(n[r])}return t}function oY(e){return e.spread??e.children.length>1}function sY(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function cY(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lY(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function uY(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dY(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=iG(t.children[1]),o=rG(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function fY(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function pY(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var mY=9,hY=32;function gY(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(_Y(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(_Y(t.slice(i),i>0,!1)),a.join(``)}function _Y(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===mY||t===hY;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===mY||t===hY;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function vY(e,t){let n={type:`text`,value:gY(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function yY(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var bY={blockquote:WJ,break:GJ,code:KJ,delete:qJ,emphasis:JJ,footnoteReference:YJ,heading:XJ,html:ZJ,imageReference:$J,image:eY,inlineCode:tY,linkReference:nY,link:rY,listItem:iY,list:sY,paragraph:cY,root:lY,strong:uY,table:dY,tableCell:pY,tableRow:fY,text:vY,thematicBreak:yY,toml:xY,yaml:xY,definition:xY,footnoteDefinition:xY};function xY(){}var SY=typeof self==`object`?self:globalThis,CY=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new SY[e](t)},wY=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof SY[e]==`function`?CY(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(CY(a,o),i)};return r},TY=e=>wY(new Map,e)(0),EY=``,{toString:DY}={},{keys:OY}=Object,kY=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=DY.call(e).slice(8,-1);switch(n){case`Array`:return[1,EY];case`Object`:return[2,EY];case`Date`:return[3,EY];case`RegExp`:return[4,EY];case`Map`:return[5,EY];case`Set`:return[6,EY];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},AY=([e,t])=>e===0&&(t===`function`||t===`symbol`),jY=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=kY(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of OY(r))(e||!AY(kY(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?EY:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(AY(kY(n))||AY(kY(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!AY(kY(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},MY=(e,{json:t,lossy:n}={})=>{let r=[];return jY(!(t||n),!!t,new Map,r)(e),r},NY=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?TY(MY(e,t)):structuredClone(e):(e,t)=>TY(MY(e,t));function PY(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function FY(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function IY(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||PY,r=e.options.footnoteBackLabel||FY,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=gK(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...NY(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
219
|
-
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
220
|
-
`}]}}var LY=(function(e){if(e==null)return HY;if(typeof e==`function`)return VY(e);if(typeof e==`object`)return Array.isArray(e)?RY(e):zY(e);if(typeof e==`string`)return BY(e);throw Error(`Expected function, string, or object as test`)});function RY(e){let t=[],n=-1;for(;++n<e.length;)t[n]=LY(e[n]);return VY(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function zY(e){let t=e;return VY(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function BY(e){return VY(t);function t(t){return t&&t.type===e}}function VY(e){return t;function t(t,n,r){return!!(UY(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function HY(){return!0}function UY(e){return typeof e==`object`&&!!e&&`type`in e}function WY(e){return e}var GY=[];function KY(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=LY(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+WY(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=GY,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=qY(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function qY(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?GY:[e]}function JY(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),KY(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var YY={}.hasOwnProperty,XY={};function ZY(e,t){let n=t||XY,r=new Map,i=new Map,a={all:s,applyData:$Y,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...bY,...n.handlers},one:o,options:n,patch:QY,wrap:tX};return JY(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(YY.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=NY(n);return r.children=a.all(e),r}return NY(e)}return(a.options.unknownHandler||eX)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=nX(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=nX(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function QY(e,t){e.position&&(t.position=oG(e))}function $Y(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,NY(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function eX(e,t){let n=t.data||{},r=`value`in t&&!(YY.call(n,`hProperties`)||YY.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function tX(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
221
|
-
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
222
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
223
|
-
`}),n}function nX(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function rX(e,t){let n=ZY(e,t),r=n.one(e,void 0),i=IY(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
224
|
-
`},i)),a}function iX(e,t){return e&&`run`in e?async function(n,r){let i=rX(n,{file:r,...t});await e.run(i,r)}:function(n,r){return rX(n,{file:r,...e||t})}}function aX(e){if(e)throw e}var oX=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function sX(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function cX(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?lX(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function lX(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var uX={basename:dX,dirname:fX,extname:pX,join:mX,sep:`/`};function dX(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);_X(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function fX(e){if(_X(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function pX(e){_X(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function mX(...e){let t=-1,n;for(;++t<e.length;)_X(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:hX(n)}function hX(e){_X(e);let t=e.codePointAt(0)===47,n=gX(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function gX(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function _X(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var vX={cwd:yX};function yX(){return`/`}function bX(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function xX(e){if(typeof e==`string`)e=new URL(e);else if(!bX(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return SX(e)}function SX(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var CX=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],wX=class{constructor(e){let t;t=e?bX(e)?{path:e}:typeof e==`string`||OX(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:vX.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<CX.length;){let e=CX[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)CX.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?uX.basename(this.path):void 0}set basename(e){EX(e,`basename`),TX(e,`basename`),this.path=uX.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?uX.dirname(this.path):void 0}set dirname(e){DX(this.basename,`dirname`),this.path=uX.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?uX.extname(this.path):void 0}set extname(e){if(TX(e,`extname`),DX(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=uX.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){bX(e)&&(e=xX(e)),EX(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?uX.basename(this.path,this.extname):void 0}set stem(e){EX(e,`stem`),TX(e,`stem`),this.path=uX.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new dG(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function TX(e,t){if(e&&e.includes(uX.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+uX.sep+"`")}function EX(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function DX(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function OX(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var kX=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),AX=e(oX(),1),jX={}.hasOwnProperty,MX=new class e extends kX{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=cX()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,AX.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(FX(`data`,this.frozen),this.namespace[e]=t,this):jX.call(this.namespace,e)&&this.namespace[e]||void 0:e?(FX(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=RX(e),n=this.parser||this.Parser;return NX(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),NX(`process`,this.parser||this.Parser),PX(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=RX(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);BX(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),NX(`processSync`,this.parser||this.Parser),PX(`processSync`,this.compiler||this.Compiler),this.process(e,r),LX(`processSync`,`process`,t),n;function r(e,r){t=!0,aX(e),n=r}}run(e,t,n){IX(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=RX(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),LX(`runSync`,`run`,n),r;function i(e,t){aX(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=RX(t),r=this.compiler||this.Compiler;return PX(`stringify`,r),IX(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(FX(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,AX.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];sX(o)&&sX(r)&&(r=(0,AX.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function NX(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function PX(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function FX(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function IX(e){if(!sX(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function LX(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function RX(e){return zX(e)?e:new wX(e)}function zX(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function BX(e){return typeof e==`string`||VX(e)}function VX(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var HX=[],UX={allowDangerousHtml:!0},WX=/^(https?|ircs?|mailto|xmpp)$/i,GX=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function KX(e){let t=qX(e),n=JX(e);return YX(t.runSync(t.parse(n),n),e)}function qX(e){let t=e.rehypePlugins||HX,n=e.remarkPlugins||HX,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...UX}:UX;return MX().use(UJ).use(n).use(iX,r).use(t)}function JX(e){let t=e.children||``,n=new wX;return typeof t==`string`?n.value=t:``+t,n}function YX(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||XX;for(let e of GX)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return JY(e,l),yG(e,{Fragment:G.Fragment,components:i,ignoreInvalidStyle:!0,jsx:G.jsx,jsxs:G.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in VG)if(Object.hasOwn(VG,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=VG[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function XX(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||WX.test(e.slice(0,t))?e:``}function ZX(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function QX(e,t,n){let r=LY((n||{}).ignore||[]),i=$X(t),a=-1;for(;++a<i.length;)KY(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function $X(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([eZ(e[0]),tZ(e[1])])}return t}function eZ(e){return typeof e==`string`?new RegExp(ZX(e),`g`):e}function tZ(e){return typeof e==`function`?e:function(){return e}}var nZ=`phrasing`,rZ=[`autolink`,`link`,`image`,`label`];function iZ(){return{transforms:[fZ],enter:{literalAutolink:oZ,literalAutolinkEmail:sZ,literalAutolinkHttp:sZ,literalAutolinkWww:sZ},exit:{literalAutolink:dZ,literalAutolinkEmail:uZ,literalAutolinkHttp:cZ,literalAutolinkWww:lZ}}}function aZ(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:nZ,notInConstruct:rZ},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:nZ,notInConstruct:rZ},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:nZ,notInConstruct:rZ}]}}function oZ(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function sZ(e){this.config.enter.autolinkProtocol.call(this,e)}function cZ(e){this.config.exit.autolinkProtocol.call(this,e)}function lZ(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function uZ(e){this.config.exit.autolinkEmail.call(this,e)}function dZ(e){this.exit(e)}function fZ(e){QX(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,pZ],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,mZ]],{ignore:[`link`,`linkReference`]})}function pZ(e,t,n,r,i){let a=``;if(!_Z(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!hZ(n)))return!1;let o=gZ(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function mZ(e,t,n,r){return!_Z(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function hZ(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function gZ(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=af(e,`(`),a=af(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function _Z(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||mK(n)||pK(n))&&(!t||n!==47)}DZ.peek=EZ;function vZ(){this.buffer()}function yZ(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function bZ(){this.buffer()}function xZ(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function SZ(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=nK(this.sliceSerialize(e)).toLowerCase(),n.label=t}function CZ(e){this.exit(e)}function wZ(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=nK(this.sliceSerialize(e)).toLowerCase(),n.label=t}function TZ(e){this.exit(e)}function EZ(){return`[`}function DZ(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function OZ(){return{enter:{gfmFootnoteCallString:vZ,gfmFootnoteCall:yZ,gfmFootnoteDefinitionLabelString:bZ,gfmFootnoteDefinition:xZ},exit:{gfmFootnoteCallString:SZ,gfmFootnoteCall:CZ,gfmFootnoteDefinitionLabelString:wZ,gfmFootnoteDefinition:TZ}}}function kZ(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:DZ},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
225
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?jZ:AZ))),s(),o}}function AZ(e,t,n){return t===0?e:jZ(e,t,n)}function jZ(e,t,n){return(n?``:` `)+e}var MZ=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];LZ.peek=RZ;function NZ(){return{canContainEols:[`delete`],enter:{strikethrough:FZ},exit:{strikethrough:IZ}}}function PZ(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:MZ}],handlers:{delete:LZ}}}function FZ(e){this.enter({type:`delete`,children:[]},e)}function IZ(e){this.exit(e)}function LZ(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function RZ(){return`~`}function zZ(e){return e.length}function BZ(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||zZ,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=VZ(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=HZ(r[d]);else{let e=HZ(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
226
|
-
`)}function VZ(e){return e==null?``:String(e)}function HZ(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function UZ(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),WZ);return i(),o}function WZ(e,t,n){return`>`+(n?``:` `)+e}function GZ(e,t){return KZ(e,t.inConstruct,!0)&&!KZ(e,t.notInConstruct,!1)}function KZ(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function qZ(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
227
|
-
`&&GZ(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
228
|
-
`}function JZ(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function YZ(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function XZ(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function ZZ(e,t,n,r){let i=XZ(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(YZ(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,QZ);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(JZ(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
229
|
-
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
230
|
-
`),a&&(u+=s.move(a+`
|
|
231
|
-
`)),u+=s.move(c),l(),u}function QZ(e,t,n){return(n?``:` `)+e}function $Z(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function eQ(e,t,n,r){let i=$Z(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
232
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function tQ(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function nQ(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function rQ(e,t,n){let r=wK(e),i=wK(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}iQ.peek=aQ;function iQ(e,t,n,r){let i=tQ(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=rQ(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=nQ(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=rQ(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+nQ(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function aQ(e,t,n){return n.options.emphasis||`*`}function oQ(e,t){let n=!1;return JY(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&UG(e)&&(t.options.setext||n))}function sQ(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(oQ(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
233
|
-
`,after:`
|
|
234
|
-
`});return r(),t(),o+`
|
|
235
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
236
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
237
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=nQ(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}cQ.peek=lQ;function cQ(e){return e.value||``}function lQ(){return`<`}uQ.peek=dQ;function uQ(e,t,n,r){let i=$Z(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function dQ(){return`!`}fQ.peek=pQ;function fQ(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function pQ(){return`!`}mQ.peek=hQ;function mQ(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function hQ(){return"`"}function gQ(e,t){let n=UG(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}_Q.peek=vQ;function _Q(e,t,n,r){let i=$Z(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(gQ(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function vQ(e,t,n){return gQ(e,n)?`<`:`[`}yQ.peek=bQ;function yQ(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function bQ(){return`[`}function xQ(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function SQ(e){let t=xQ(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function CQ(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function wQ(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function TQ(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?CQ(n):xQ(n),s=e.ordered?o===`.`?`)`:`.`:SQ(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),wQ(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function EQ(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function DQ(e,t,n,r){let i=EQ(n),a=n.bulletCurrent||xQ(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function OQ(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var kQ=LY([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function AQ(e,t,n,r){return(e.children.some(function(e){return kQ(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function jQ(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}MQ.peek=NQ;function MQ(e,t,n,r){let i=jQ(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=rQ(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=nQ(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=rQ(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+nQ(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function NQ(e,t,n){return n.options.strong||`*`}function PQ(e,t,n,r){return n.safe(e.value,r)}function FQ(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function IQ(e,t,n){let r=(wQ(n)+(n.options.ruleSpaces?` `:``)).repeat(FQ(n));return n.options.ruleSpaces?r.slice(0,-1):r}var LQ={blockquote:UZ,break:qZ,code:ZZ,definition:eQ,emphasis:iQ,hardBreak:qZ,heading:sQ,html:cQ,image:uQ,imageReference:fQ,inlineCode:mQ,link:_Q,linkReference:yQ,list:TQ,listItem:DQ,paragraph:OQ,root:AQ,strong:MQ,text:PQ,thematicBreak:IQ};function RQ(){return{enter:{table:zQ,tableData:UQ,tableHeader:UQ,tableRow:VQ},exit:{codeText:WQ,table:BQ,tableData:HQ,tableHeader:HQ,tableRow:HQ}}}function zQ(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function BQ(e){this.exit(e),this.data.inTable=void 0}function VQ(e){this.enter({type:`tableRow`,children:[]},e)}function HQ(e){this.exit(e)}function UQ(e){this.enter({type:`tableCell`,children:[]},e)}function WQ(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,GQ));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function GQ(e,t){return t===`|`?t:e}function KQ(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
238
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
239
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return BZ(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=LQ.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function qQ(){return{exit:{taskListCheckValueChecked:YQ,taskListCheckValueUnchecked:YQ,paragraph:XQ}}}function JQ(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:ZQ}}}function YQ(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function XQ(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function ZQ(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=LQ.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function QQ(){return[iZ(),OZ(),NZ(),RQ(),qQ()]}function $Q(e){return{extensions:[aZ(),kZ(e),PZ(),KQ(e),JQ()]}}var e$={tokenize:m$,partial:!0},t$={tokenize:h$,partial:!0},n$={tokenize:g$,partial:!0},r$={tokenize:_$,partial:!0},i$={tokenize:v$,partial:!0},a$={name:`wwwAutolink`,tokenize:f$,previous:y$},o$={name:`protocolAutolink`,tokenize:p$,previous:b$},s$={name:`emailAutolink`,tokenize:d$,previous:x$},c$={};function l$(){return{text:c$}}for(var u$=48;u$<123;)c$[u$]=s$,u$++,u$===58?u$=65:u$===91&&(u$=97);c$[43]=s$,c$[45]=s$,c$[46]=s$,c$[95]=s$,c$[72]=[s$,o$],c$[104]=[s$,o$],c$[87]=[s$,a$],c$[119]=[s$,a$];function d$(e,t,n){let r=this,i,a;return o;function o(t){return!S$(t)||!x$.call(r,r.previous)||C$(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return S$(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(i$,u,l)(t):t===45||t===95||iK(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&rK(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function f$(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!y$.call(r,r.previous)||C$(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(e$,e.attempt(t$,e.attempt(n$,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function p$(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&b$.call(r,r.previous)&&!C$(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(rK(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||oK(t)||dK(t)||mK(t)||pK(t)?n(t):e.attempt(t$,e.attempt(n$,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function m$(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function h$(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(r$,c,s)(t):t===null||dK(t)||mK(t)||t!==45&&pK(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function g$(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(r$,t,a)(o):o===null||dK(o)||mK(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function _$(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||dK(o)||mK(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||dK(e)||mK(e)?t(e):r(e)}function a(e){return rK(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):rK(t)?(e.consume(t),o):n(t)}}function v$(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return iK(e)?n(e):t(e)}}function y$(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||dK(e)}function b$(e){return!rK(e)}function x$(e){return!(e===47||S$(e))}function S$(e){return e===43||e===45||e===46||e===95||iK(e)}function C$(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var w$={tokenize:M$,partial:!0};function T$(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:k$,continuation:{tokenize:A$},exit:j$}},text:{91:{name:`gfmFootnoteCall`,tokenize:O$},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:E$,resolveTo:D$}}}}function E$(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=nK(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function D$(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function O$(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||dK(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(nK(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return dK(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function k$(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||dK(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=nK(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return dK(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),_K(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function A$(e,t,n){return e.check(MK,t,e.attempt(w$,t,n))}function j$(e){e.exit(`gfmFootnoteDefinition`)}function M$(e,t,n){let r=this;return _K(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function N$(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&YG(o,o.length,0,TK(s,e.slice(r+1,n),t)),YG(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),YG(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=wK(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=wK(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var P$=class{constructor(){this.map=[]}add(e,t,n){F$(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function F$(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function I$(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function L$(){return{flow:{null:{name:`table`,tokenize:R$,resolveAll:z$}}}}function R$(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):uK(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):fK(t)?_K(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||dK(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,fK(t)?_K(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return fK(t)?_K(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||uK(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return fK(t)?_K(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||uK(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||uK(n)?(e.exit(`tableRow`),t(n)):fK(n)?_K(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||dK(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function z$(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new P$;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(V$(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=B$(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=B$(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=B$(f,t,o,i,n,d)):(o[0]=o[1],d=B$(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&V$(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=I$(t.events,n))}return e}function B$(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},H$(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=H$(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=H$(t.events,n[2]),a=H$(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},H$(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function V$(e,t,n,r,i){let a=[],o=H$(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function H$(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var U$={name:`tasklistCheck`,tokenize:G$};function W$(){return{text:{91:U$}}}function G$(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return dK(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return uK(r)?t(r):fK(r)?e.check({tokenize:K$},t,n)(r):n(r)}}function K$(e,t,n){return _K(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function q$(e){return QG([l$(),T$(),N$(e),L$(),W$()])}var J$={};function Y$(e){let t=this,n=e||J$,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(q$(n)),a.push(QQ()),o.push($Q(n))}function X$(){let e=navigator.userAgent;return e.includes(`Mac`)?`Reveal in Finder`:e.includes(`Linux`)?`Open Containing Folder`:`Reveal in File Explorer`}function Z$({image:e,onClose:t}){let{t:n}=K();return(0,G.jsx)(pD,{open:e!==null,onOpenChange:e=>{e||t()},children:(0,G.jsxs)(vD,{className:`max-w-4xl`,children:[(0,G.jsxs)(yD,{children:[(0,G.jsx)(xD,{children:n(`Image preview`)}),(0,G.jsx)(SD,{className:`break-all`,children:e?.rel})]}),(0,G.jsx)(wD,{className:`max-h-[70vh]`,children:e&&(0,G.jsx)(`img`,{src:e.dataUrl,alt:e.rel,className:`mx-auto max-h-[65vh] max-w-full object-contain`})}),(0,G.jsx)(bD,{children:(0,G.jsx)(wa,{variant:`outline`,onClick:t,children:n(`Close`)})})]})})}function Q$(e){try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length);let n=document.execCommand(`copy`);return t.remove(),n}catch{return!1}}function $$(e){let t=typeof navigator>`u`?void 0:navigator.clipboard;if(!t?.writeText||window.isSecureContext===!1)return Promise.resolve(Q$(e));try{return Promise.resolve(t.writeText(e)).then(()=>!0,()=>Q$(e))}catch{return Promise.resolve(Q$(e))}}function e1(){return!!window.electronAPI?.remote}function t1(e){return new TextDecoder().decode(Uint8Array.from(atob(e),e=>e.charCodeAt(0)))}function n1(e,t){return e[t]?.btwParentId||t}var r1=new Map,i1=new Map,a1=new Map,o1=new Set,s1=[];function c1(){let e=NN.getState(),t=e.activeId;if(!t)return null;let n=e.conversations[t],r=r1.get(t);return!n||!r?null:{api:r,conversationId:t,projectId:n.projectId}}function l1(e){let t=c1();if(!t||d1(t.projectId))return;pR.getState().ensureOpen();let n=t.api.getPanel(`changes`);if(n){n.focus();return}t.api.addPanel({id:`changes`,component:`changes`,title:e?.title??`Changes`,params:{conversationId:t.conversationId,projectId:t.projectId}})}function u1(e,t){return t?e.some(e=>e.id===t&&e.kind===`secretary`):!1}function d1(e){return u1(Ce.getState().projects,e)}function f1(e,t,n,r){let i=e.getPanel(`files`);if(i){i.focus();return}e.addPanel({id:`files`,component:`files`,title:r??`Files`,params:{conversationId:t,projectId:n}})}function p1(e,t,n,r){let i=NN.getState(),a=n1(i.conversations,e),o=i.conversations[a]?.projectId;if(!o||d1(o))return;pR.getState().ensureOpen(a);let s=r?[t,n,r]:n?[t,n]:[t],c=i1.get(a);c?c(...s):a1.set(a,s);let l=r1.get(a);l?f1(l,a,o):o1.add(a)}function m1(e){let t=NN.getState(),n=e?.conversationId??t.activeId;if(!n)return;let r=t.conversations[n];if(!r)return;let i=n1(t.conversations,n),a=r1.get(i);pR.getState().ensureOpen(i);let o=e?.tabId??`browser:${crypto.randomUUID()}`;if(!a){s1.push({conversationId:i,tabId:o,ownerId:n});return}let s=a.getPanel(o);if(s){s.focus();return}a.addPanel({id:o,component:`browser`,title:e?.title??`Browser`,params:{conversationId:n,projectId:r.projectId}})}function h1(e,t){if(!NN.getState().conversations[e])return null;let n=`browser:${crypto.randomUUID()}`;return m1({conversationId:e,tabId:n,title:new URL(t).host}),window.electronAPI.browser.navigate(n,e,t)}var g1=`my-2 overflow-x-auto rounded-lg border bg-[var(--sunken,var(--muted))] text-(length:--chat-code-block-size) [font-weight:var(--chat-code-block-weight)] leading-relaxed`;function _1(e){let t=e.trimStart();return/^<[a-zA-Z!/]/.test(t)?`html`:/^[{[]/.test(t)?`json`:/^[$#] /.test(t)?`shellscript`:`text`}function v1({code:e,language:t,streaming:n=!1}){let[r,i]=(0,H.useState)(null);(0,H.useEffect)(()=>{if(n){i(null);return}let r=!0;return f_(e,t??_1(e),!0).then(e=>{r&&i(e)}),()=>{r=!1}},[e,t,n]);let a=!n&&(0,G.jsx)(js,{text:e,className:`absolute top-1.5 right-1.5 rounded-md border bg-background/80 p-1.5 text-muted-foreground opacity-0 backdrop-blur transition-opacity group-hover/code:opacity-100`});return r==null?(0,G.jsxs)(`div`,{"data-enso":`code-block`,className:`group/code relative`,children:[(0,G.jsx)(`pre`,{className:`${g1} p-3 font-mono`,children:(0,G.jsx)(`code`,{children:e})}),a]}):(0,G.jsxs)(`div`,{"data-enso":`code-block`,className:`group/code relative`,children:[(0,G.jsx)(`div`,{className:`${g1} [&_pre]:m-0 [&_pre]:overflow-x-auto [&_pre]:bg-transparent! [&_pre]:p-3 [&_pre]:font-mono [&_pre]:[--shiki-dark-bg:transparent]!`,dangerouslySetInnerHTML:{__html:r}}),a]})}var y1=50,b1=3e4,x1={status:`missing`},S1=new Map,C1=new Map,w1=new Set,T1=new Map,E1=null,D1=0,O1={batches:0,paths:0,ms:0},k1=e=>e.cwd??`conversation:${e.conversationId}`,A1=(e,t)=>`${k1(e)}\0${t}`;function j1(e){return e?e.state.status===`ok`?e.epoch===D1:Date.now()-e.at<b1:!1}function M1(e,t){let n=S1.get(e)?.state,r=n?.status===t.status&&(t.status===`missing`||n.status===`ok`&&n.rel===t.rel&&n.kind===t.kind);if(S1.set(e,{state:r&&n?n:t,epoch:D1,at:Date.now()}),!r)for(let t of C1.get(e)??[])t()}function N1(e){return e?{status:`ok`,rel:e.rel,kind:e.kind}:x1}async function P1(e,t){let n=performance.now();try{let n=await window.electronAPI.workspaceFiles.resolveLinks({conversationId:e.conversationId,projectId:e.projectId,rels:t});return t.map((e,t)=>N1(n.ok?n.items[t]:null))}catch{return t.map(()=>x1)}finally{O1.batches+=1,O1.paths+=t.length,O1.ms+=performance.now()-n}}function F1(){E1=null;let e=[...T1.values()];T1.clear();for(let{scope:t,rels:n}of e){let e=[...n];for(let n=0;n<e.length;n+=200){let r=e.slice(n,n+200);P1(t,r).then(e=>{r.forEach((n,r)=>{let i=A1(t,n);w1.delete(i),M1(i,e[r])})})}}}function I1(e,t){let n=A1(e,t);if(w1.has(n)||j1(S1.get(n)))return;w1.add(n);let r=`${e.conversationId}\0${e.projectId}`,i=T1.get(r)??{scope:e,rels:new Set};i.rels.add(t),T1.set(r,i),E1??=setTimeout(F1,y1)}async function L1(e,t){let[n]=await P1(e,[t]);return M1(A1(e,t),n),n}function R1(e,t,n){let r=e&&t?A1(e,t):null,i=(0,H.useCallback)(e=>{if(!r)return()=>{};let t=C1.get(r)??new Set;return C1.set(r,t),t.add(e),()=>{t.delete(e),t.size===0&&C1.delete(r)}},[r]),a=(0,H.useSyncExternalStore)(i,()=>r?S1.get(r)?.state:void 0);return(0,H.useEffect)(()=>{n&&e&&t&&I1(e,t)},[n,r]),a}var z1=2;function B1({value:e}){return typeof e==`string`?(0,G.jsx)(`span`,{className:`text-emerald-700 dark:text-emerald-400`,children:JSON.stringify(e)}):typeof e==`number`?(0,G.jsx)(`span`,{className:`text-sky-700 dark:text-sky-400`,children:String(e)}):(0,G.jsx)(`span`,{className:`text-violet-700 dark:text-violet-400`,children:String(e)})}function V1({name:e,value:t,depth:n}){let[r,i]=(0,H.useState)(n<z1),a=e!==void 0&&(0,G.jsxs)(`span`,{className:`text-foreground/80`,children:[e,(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:`: `})]});if(typeof t!=`object`||!t)return(0,G.jsxs)(`div`,{className:`pl-4`,children:[a,(0,G.jsx)(B1,{value:t})]});let o=Array.isArray(t),s=o?t.map((e,t)=>[String(t),e]):Object.entries(t),[c,l]=o?[`[`,`]`]:[`{`,`}`];return(0,G.jsxs)(`div`,{className:n>0?`pl-4`:void 0,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>i(!r),className:`-ml-4 inline-flex items-center text-left hover:text-foreground`,children:[(0,G.jsx)(gt,{className:W(`h-3 w-3 shrink-0 transition-transform`,r&&`rotate-90`)}),(0,G.jsxs)(`span`,{className:`ml-1`,children:[a,(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[c,!r&&` ${s.length} ${l}`]})]})]}),r&&(0,G.jsxs)(G.Fragment,{children:[s.map(([e,t])=>(0,G.jsx)(V1,{name:o?void 0:e,value:t,depth:n+1},e)),(0,G.jsx)(`div`,{className:`text-muted-foreground`,children:l})]})]})}function H1({source:e,value:t}){let{t:n}=K(),[r,i]=(0,H.useState)(!1),a=e=>W(`rounded px-1.5 py-0.5`,e?`bg-muted text-foreground`:`hover:text-foreground`);return(0,G.jsxs)(`div`,{"data-enso":`json-tree`,className:`group/code relative my-2 rounded-lg border`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1 border-b px-2 py-1 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`mr-auto font-mono`,children:`JSON`}),(0,G.jsx)(`button`,{type:`button`,className:a(!r),onClick:()=>i(!1),children:n(`Tree view`)}),(0,G.jsx)(`button`,{type:`button`,className:a(r),onClick:()=>i(!0),children:n(`Raw text`)}),(0,G.jsx)(js,{text:e,className:`rounded p-1`})]}),r?(0,G.jsx)(`div`,{className:`px-2`,children:(0,G.jsx)(v1,{code:e,language:`json`})}):(0,G.jsx)(`div`,{className:`max-h-[480px] overflow-auto py-2 pr-3 pl-6 font-mono text-(length:--chat-code-block-size) leading-relaxed`,children:(0,G.jsx)(V1,{value:t,depth:0})})]})}function U1(e,{prefersDark:t,terminalIsDark:n}){switch(e){case`light`:return`light`;case`dark`:return`dark`;case`system`:return t?`dark`:`light`;case`sync-terminal`:return n?`dark`:`light`}}function W1(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches}function G1(){let e=Ce(e=>e.theme),t=Ce(e=>e.terminalTheme),[n,r]=(0,H.useState)(W1);return(0,H.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>r(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),U1(e,{prefersDark:n,terminalIsDark:xe(t)})}function K1(e){let t=G1();return(0,H.useMemo)(()=>({...e,themeType:t}),[e,t])}var q1=`http://www.w3.org/2000/svg`,J1=`http://www.w3.org/1999/xlink`,Y1=/<svg\b(?:[^>"']|"[^"]*"|'[^']*')*>/i,X1=16384,Z1=X1*X1,Q1=2;function $1(e){return RegExp(`\\s${e}\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s"'>]+)`,`i`)}function e0(e,t){let n=e.match($1(t));return n?n[0].replace(/^[^=]*=\s*/,``).replace(/^["']|["']$/g,``):null}function t0(e,t,n){let r=` ${t}="${n}"`,i=$1(t);return i.test(e)?e.replace(i,r):e.replace(/\s*\/?>$/,e=>`${r}${e}`)}function n0(e){let t=e.match(Y1)?.[0],n=t?e0(t,`viewBox`):null;if(!n)return null;let r=n.trim().split(/[\s,]+/).map(Number);if(r.length!==4)return null;let[,,i,a]=r;return Number.isFinite(i)&&Number.isFinite(a)&&i>0&&a>0?{width:i,height:a}:null}function r0(e){let t=e.match(Y1);if(!t)return e;let n=t[0];e0(n,`xmlns`)||(n=t0(n,`xmlns`,q1)),e.includes(`xlink:`)&&!e0(n,`xmlns:xlink`)&&(n=t0(n,`xmlns:xlink`,J1));let r=n0(e);if(r){n=t0(n,`width`,String(r.width)),n=t0(n,`height`,String(r.height));let e=e0(n,`style`);if(e!==null){let t=e.split(`;`).filter(e=>e.trim()&&!/^\s*max-width\s*:/i.test(e)).join(`;`).trim();n=t?t0(n,`style`,t):n.replace($1(`style`),``)}}return e.replace(t[0],()=>n)}function i0(e,t=new Date){let n=e=>String(e).padStart(2,`0`);return`mermaid-${`${t.getFullYear()}${n(t.getMonth()+1)}${n(t.getDate())}`}-${`${n(t.getHours())}${n(t.getMinutes())}${n(t.getSeconds())}`}.${e}`}function a0(e,t){let n=Math.min(Q1,X1/e,X1/t,Math.sqrt(Z1/(e*t)));return n>=1?n:null}function o0(e){return new Blob([r0(e)],{type:`image/svg+xml`})}function s0(e){return r0(new XMLSerializer().serializeToString(e))}function c0(e){let t=new DOMParser().parseFromString(e,`text/html`).querySelector(`svg`);if(!t)throw Error(`No svg in markup`);return s0(t)}function l0(e,t){let n=typeof e==`string`?e:URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),typeof e!=`string`&&setTimeout(()=>URL.revokeObjectURL(n),0)}async function u0(e,t,n,r,i){let a=new Image;a.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,await a.decode();let o=document.createElement(`canvas`);o.width=Math.floor(t*r),o.height=Math.floor(n*r);let s=o.getContext(`2d`);if(!s)throw Error(`Canvas unavailable`);s.fillStyle=i,s.fillRect(0,0,o.width,o.height),s.drawImage(a,0,0,o.width,o.height);let c=o.toDataURL(`image/png`);if(!c.startsWith(`data:image/png`))throw Error(`Canvas export failed`);return c}async function d0(e){let t=t=>{try{let n=e.currentSvg();return n?(e.download(o0(n),i0(`svg`)),{kind:`svg`,reason:t}):{kind:`failed`}}catch{return{kind:`failed`}}},n;try{n=r0(await e.rerender())}catch{return t(`rerender-failed`)}if(/<foreignObject\b/i.test(n))return t(`rerender-failed`);let r=n0(n);if(!r)return t(`draw-failed`);let i=a0(r.width,r.height);if(i===null)return t(`too-large`);try{let t=await e.rasterize(n,r.width,r.height,i);return e.download(t,i0(`png`)),{kind:`png`}}catch{return t(`draw-failed`)}}var f0=`position:fixed;left:0;top:0;width:800px;height:600px;overflow:hidden;opacity:0;pointer-events:none;visibility:hidden;contain:strict;`;function p0(e){return!e.includes(`<svg`)||/\bfocusable=/.test(e)?e:e.replace(`<svg`,`<svg focusable="false" tabindex="-1"`)}function m0(e){return{startOnLoad:!1,theme:e,securityLevel:`strict`,fontFamily:`inherit`,suppressErrorRendering:!0,flowchart:{htmlLabels:!1,useMaxWidth:!0}}}var h0=/<(?:a|area)\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,g0=/\s(?:xlink:)?(?:href|target)\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]+)/gi;function _0(e){return e.replace(h0,e=>e.replace(g0,``))}var v0=null,y0=null,b0=Promise.resolve(),x0=0;async function S0(){return y0||(v0||=q(()=>import(`./mermaid.core-D9LtIKua.js`).then(e=>(y0=e.default,y0)),__vite__mapDeps([126,127,128,1,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143])).catch(e=>{throw v0=null,e}),v0)}function C0(e){let t=b0.then(e,e);return b0=t.then(()=>void 0,()=>void 0),t}async function w0(e,t,n={}){return C0(async()=>{let r=await S0();r.initialize({...m0(t),...n});let i=`ensoMermaid${++x0}`,a=document.createElement(`div`);a.setAttribute(`aria-hidden`,`true`),a.style.cssText=f0,document.body.appendChild(a);try{let{svg:t}=await r.render(i,e,a);return p0(_0(t))}finally{a.remove(),document.getElementById(i)?.remove(),document.getElementById(`d${i}`)?.remove()}})}var T0=.1,E0={dark:`#1f2020`,default:`#ffffff`},D0=.1;function O0({code:e,streaming:t=!1,className:n}){let{t:r}=K(),i=(0,H.useRef)(null),[a,o]=(0,H.useState)(null),[s,c]=(0,H.useState)(null),[l,u]=(0,H.useState)(1),[d,f]=(0,H.useState)({x:0,y:0}),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(!1);eD(h);let _=(0,H.useRef)({x:0,y:0}),v=(0,H.useRef)({x:0,y:0}),y=(0,H.useRef)(null),b=(0,H.useRef)(!1),x=G1()===`dark`?`dark`:`default`;(0,H.useEffect)(()=>{if(t){o(null),c(null);return}let n=!1;return(async()=>{if(!e.trim()){o(null),c(null);return}try{let t=await w0(e,x);n||(o(t),c(null),u(1),f({x:0,y:0}))}catch(e){n||(c(e instanceof Error?e.message:`Mermaid render failed`),o(null))}})(),()=>{n=!0}},[e,x,t]);let S=(0,H.useCallback)(()=>u(e=>e+T0),[]),C=(0,H.useCallback)(()=>u(e=>Math.max(e-T0,D0)),[]),w=(0,H.useCallback)(()=>{u(1),f({x:0,y:0})},[]),T=(0,H.useCallback)(()=>{g(!1),u(1),f({x:0,y:0})},[]),E=(0,H.useCallback)(()=>{g(!0),requestAnimationFrame(()=>{let e=y.current,t=e?.firstElementChild;if(!e||!t?.offsetWidth||!t.offsetHeight)return;let n=Math.min((e.clientWidth-48)/t.offsetWidth,(e.clientHeight-48)/t.offsetHeight);u(Math.round(n*100)/100),f({x:0,y:0})})},[]),D=(0,H.useCallback)(e=>{if(!h)return;e.preventDefault();let t=e.deltaY>0?-.1:T0;u(e=>Math.round(Math.max(e+t,D0)*100)/100)},[h]),O=(0,H.useCallback)(e=>{!h||e.button!==0||(m(!0),b.current=!1,_.current={x:e.clientX,y:e.clientY},v.current={...d})},[h,d]),k=(0,H.useCallback)(e=>{if(!p)return;let t=e.clientX-_.current.x,n=e.clientY-_.current.y;(Math.abs(t)>2||Math.abs(n)>2)&&(b.current=!0),f({x:v.current.x+t,y:v.current.y+n})},[p]),A=(0,H.useCallback)(()=>m(!1),[]),j=(0,H.useCallback)(e=>{e.stopPropagation()},[]),M=(0,H.useCallback)(()=>{b.current||T()},[T]),N=(0,H.useCallback)(()=>{try{let e=i.current?.querySelector(`svg`);if(!e)throw Error(`No svg`);l0(o0(s0(e)),i0(`svg`))}catch{UD({type:`error`,title:r(`Export failed`)})}},[r]),P=(0,H.useCallback)(async()=>{let t=await d0({currentSvg:()=>{let e=i.current?.querySelector(`svg`);return e?s0(e):null},rerender:async()=>c0(await w0(e,x,{htmlLabels:!1})),rasterize:(e,t,n,r)=>u0(e,t,n,r,E0[x]),download:l0});t.kind===`failed`?UD({type:`error`,title:r(`Export failed`)}):t.kind===`svg`&&UD({type:`warning`,title:t.reason===`too-large`?r(`Diagram is too large for PNG, exported SVG instead`):r(`PNG export failed, exported SVG instead`)})},[e,x,r]),F=e=>{let t=e===`sm`?`h-6 w-6`:`h-7 w-7`,n=e===`sm`?`h-3.5 w-3.5`:`h-4 w-4`,i=e===`sm`?`h-6 min-w-[2.5rem]`:`h-7 min-w-[3rem]`;return(0,G.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border bg-background/95 p-1 shadow-sm`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:S,className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t),title:r(`Zoom in`),children:(0,G.jsx)(Tn,{className:n})}),(0,G.jsxs)(`button`,{type:`button`,onClick:w,className:W(`flex items-center justify-center rounded text-xs transition-colors hover:bg-accent hover:text-accent-foreground`,i),title:r(`Reset zoom`),children:[Math.round(l*100),`%`]}),(0,G.jsx)(`button`,{type:`button`,onClick:C,disabled:l<=D0,className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t,l<=D0&&`cursor-not-allowed opacity-50`),title:r(`Zoom out`),children:(0,G.jsx)(fn,{className:n})}),l!==1&&(0,G.jsx)(`button`,{type:`button`,onClick:w,className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t),title:r(`Fit to original size`),children:(0,G.jsx)(kn,{className:n})}),(0,G.jsx)(`div`,{className:`mx-0.5 h-4 w-px bg-border`}),(0,G.jsx)(`button`,{type:`button`,onClick:N,className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t),title:r(`Export SVG`),children:(0,G.jsx)(It,{className:n})}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>void P(),className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t),title:r(`Export PNG`),children:(0,G.jsx)(Yt,{className:n})}),h?(0,G.jsx)(`button`,{type:`button`,onClick:T,className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t),title:r(`Exit fullscreen`),children:(0,G.jsx)(dn,{className:n})}):(0,G.jsx)(`button`,{type:`button`,onClick:E,className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t),title:r(`View fullscreen`),children:(0,G.jsx)(on,{className:n})})]})};return s?(0,G.jsxs)(`div`,{className:W(`overflow-x-auto rounded-lg border border-destructive/50`,n),children:[(0,G.jsx)(`div`,{className:`flex items-center gap-2 border-b border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:(0,G.jsx)(`span`,{children:r(`Mermaid render error`)})}),(0,G.jsx)(`pre`,{className:`p-4 text-sm`,children:(0,G.jsx)(`code`,{className:`block font-mono leading-relaxed text-muted-foreground`,children:e})}),(0,G.jsx)(`div`,{className:`border-t border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground`,children:s})]}):a?(0,G.jsxs)(`div`,{className:W(`relative rounded-lg border border-border bg-muted/30`,n),style:{userSelect:`none`,WebkitUserSelect:`none`},children:[(0,G.jsx)(`div`,{ref:i,className:W(`max-h-[min(50vh,20rem)] overflow-hidden [overflow-anchor:none]`,h&&(p?`cursor-grabbing`:`cursor-grab`)),onWheel:D,onMouseDown:O,onMouseMove:k,onMouseUp:A,onMouseLeave:A,onDoubleClick:h?void 0:E,children:(0,G.jsx)(`div`,{className:`origin-center transition-transform duration-100 ease-out`,style:{transform:`translate(${d.x}px, ${d.y}px) scale(${l})`},children:(0,G.jsx)(`div`,{className:`p-4`,dangerouslySetInnerHTML:{__html:a}})})}),(0,G.jsx)(`div`,{className:`absolute right-2 bottom-2`,children:F(`sm`)}),h&&(0,G.jsxs)(`div`,{className:`fixed inset-0 flex select-none flex-col bg-background`,style:{zIndex:dD.TOAST},"data-enso-float":``,onClick:M,onKeyDown:e=>{e.key===`Escape`&&T()},children:[(0,G.jsxs)(`div`,{className:`relative z-10 flex shrink-0 items-center justify-between border-b border-border bg-muted/30 px-4 py-2`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,G.jsx)(`span`,{className:`text-sm font-medium text-muted-foreground`,children:r(`Mermaid preview`)}),(0,G.jsx)(`button`,{type:`button`,onClick:T,className:`flex h-7 w-7 items-center justify-center rounded-md border border-border bg-background/95 text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,title:r(`Exit fullscreen`),children:(0,G.jsx)(er,{className:`h-4 w-4`})})]}),(0,G.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,G.jsx)(`div`,{ref:y,className:W(`flex min-h-0 flex-1 select-none overflow-hidden`,p?`cursor-grabbing`:`cursor-grab`),onWheel:D,onMouseDown:O,onMouseMove:k,onMouseUp:A,onMouseLeave:A,onClick:j,onKeyDown:j,children:(0,G.jsx)(`div`,{className:`m-auto origin-center transition-transform duration-100 ease-out`,style:{transform:`translate(${d.x}px, ${d.y}px) scale(${l})`},children:(0,G.jsx)(`div`,{className:`p-4`,dangerouslySetInnerHTML:{__html:a}})})}),(0,G.jsx)(`div`,{className:`absolute right-4 bottom-4`,children:F(`md`)})]})]})]}):(0,G.jsx)(`div`,{className:W(`flex items-center justify-center rounded-lg border border-border bg-muted/30 p-8`,n),children:(0,G.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:r(`Loading Mermaid diagram...`)})})}var k0=/^[a-z][a-z\d+.-]*:/i,A0=/^(?:https?|ircs?|mailto|xmpp):/i,j0=/^(?:[a-z]:[\\/]|\\\\)/i;function M0(e){let t=e?.trim();if(!t||!/^https?:\/\//i.test(t))return null;try{return new URL(t)}catch{return null}}function N0(e){let t=/^(.*?):(\d+)(?:-\d+)?$/.exec(e);if(!t)return{path:e};let n=Number(t[2]);return n>0?{path:t[1],line:n}:{path:t[1]}}function P0(e){try{return decodeURIComponent(e)}catch{return null}}function F0(e){let t=e.search(/[?#]/);return t<0?e:e.slice(0,t)}function I0(e){try{let t=new URL(e);if(t.protocol!==`file:`)return null;let n=decodeURIComponent(t.pathname);return n?(t.hostname&&t.hostname.toLowerCase()!==`localhost`?n=`//${t.hostname}${n}`:/^\/[a-z]:[\\/]/i.test(n)&&(n=n.slice(1)),n):null}catch{return null}}function L0(e){let t=e.trim();if(!t||t.startsWith(`#`)||t.startsWith(`?`))return{kind:`external`};if(/^file:/i.test(t)){let e=I0(t);return e?{kind:`local`,path:e}:{kind:`blocked`}}if(A0.test(t)||t.startsWith(`//`))return{kind:`external`};let n=P0(F0(t));return n==null||n.includes(`\0`)||k0.test(n)&&!j0.test(n)?{kind:`blocked`}:{kind:`local`,path:n}}function R0(e){let t=e.replace(/\\/g,`/`),n=/^[a-z]:\//i.test(t)||t.startsWith(`//`);if(!n&&!t.startsWith(`/`))return null;let r=/^[a-z]:\//i.test(t)?t.slice(0,2).toLowerCase():null,i=(r||n?t.slice(2):t.slice(1)).split(`/`),a=[];for(let e of i)if(!(!e||e===`.`)){if(e===`..`){if(a.length===0)return null;a.pop()}else a.push(e)}return r?{value:`${r}/${a.join(`/`)}`.replace(/\/$/,``),windows:!0}:n?{value:`//${a.join(`/`)}`,windows:!0}:{value:`/${a.join(`/`)}`.replace(/\/$/,``)||`/`,windows:!1}}function z0(e){let t=e.replace(/\\/g,`/`),n=[];for(let e of t.split(`/`))if(!(!e||e===`.`)){if(e===`..`){if(n.length===0)return null;n.pop()}else{if(e.includes(`\0`))return null;n.push(e)}}return n.join(`/`)}function B0(e){return R0(e)!==null}function V0(e,t){if(!t)return R0(e)?null:z0(e);let n=R0(t);if(!n)return null;let r=n.windows&&/^\/[a-z]:[\\/]/i.test(e)?e.slice(1):e,i=R0(r);if(!i)return r===e?z0(e):null;if(i.windows!==n.windows)return null;let a=n.value.toLowerCase(),o=i.value.toLowerCase();if(o===a)return``;let s=n.value.endsWith(`/`)?n.value:`${n.value}/`;return o.startsWith(s.toLowerCase())?z0(i.value.slice(s.length)):null}function H0(e,t){let n=t?R0(t):null;if(!n||V0(e,t)!==null)return null;let r=n.windows&&/^\/[a-z]:[\\/]/i.test(e)?e.slice(1):e;return R0(r)?r:null}var U0=/^(?:%|ms|s|sec|min|h|ms\/op|ns|µs|us|b|kb|mb|gb|tb|kib|mib|gib|x|×|k|m|bn)$/i;function W0(e){let t=e.trim().replace(/^[$€£¥₹]\s*/,``),n=!1;/^\(.*\)$/.test(t)&&(n=!0,t=t.slice(1,-1));let r=/^([+-]?(?:\d{1,3}(?:,\d{3})+|\d+)(?:\.\d+)?)\s*(\S*)$/.exec(t);if(!r||r[2]&&!U0.test(r[2]))return null;let i=Number(r[1].replace(/,/g,``));return n?-i:i}function G0(e){let t=Math.max(0,...e.map(e=>e.length));return Array.from({length:t},(t,n)=>{let r=e.map(e=>e[n]?.trim()??``).filter(Boolean);return r.length>0&&r.every(e=>W0(e)!==null)})}function K0(e,t,n){return n?(W0(e)??0)-(W0(t)??0):e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function q0(e,t,n){let r=e.map((e,t)=>t);if(!t)return r;let i=t.dir===`asc`?1:-1,a=n=>e[n][t.column]?.trim()??``;return r.sort((e,r)=>{let o=a(e),s=a(r);return!o||!s?o?-1:+!!s:i*K0(o,s,n[t.column]??!1)||e-r})}function J0(e,t){return e?.column===t?e.dir===`asc`?{column:t,dir:`desc`}:null:{column:t,dir:`asc`}}var Y0=new Set([`json`,`jsonc`,`json5`]),X0=new Set([`console`,`shell-session`,`terminal`,`output`,`ansi`]),Z0=new Set([`sh`,`bash`,`shell`,`zsh`,`shellscript`]),Q0=`$ `;function $0(e,t){let n=e?.toLowerCase();if(n&&Y0.has(n))return e2(t)?`json`:null;if(!n&&/^\s*[{[]/.test(t)&&e2(t))return`json`;if(n&&X0.has(n)||t.includes(`\x1B[`))return`terminal`;if(!n||Z0.has(n)){let e=t.split(`
|
|
240
|
-
`).filter(e=>e.trim());if(e[0]?.startsWith(Q0)&&e.some(e=>!e.startsWith(Q0)))return`terminal`}return null}function e2(e){let t=t2(e);return t.ok&&typeof t.value==`object`&&t.value!==null}function t2(e){let t=``,n=0;for(;n<e.length;){let r=e[n];if(r===`"`){let r=n+1;for(;r<e.length&&e[r]!==`"`;)r+=e[r]===`\\`?2:1;t+=e.slice(n,r+1),n=r+1}else if(r===`/`&&e[n+1]===`/`)for(;n<e.length&&e[n]!==`
|
|
241
|
-
`;)n++;else if(r===`/`&&e[n+1]===`*`){let t=e.indexOf(`*/`,n+2);n=t<0?e.length:t+2}else r===`,`&&/^\s*[}\]]/.test(e.slice(n+1))||(t+=r),n++}try{return{ok:!0,value:JSON.parse(t)}}catch{return{ok:!1}}}var n2=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`],r2=[0,95,135,175,215,255],i2=`\x1B`,a2=`\x07`,o2=RegExp(`${i2}\\[([0-9;?]*)([A-Za-z])|${i2}\\][^${a2}${i2}]*(?:${a2}|${i2}\\\\)?|${i2}[@-Z\\\\-_]`,`g`);function s2(...e){return`#${e.map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function c2(e){if(e<0||e>255)return;if(e<8)return n2[e];if(e<16)return`bright-${n2[e-8]}`;if(e<232){let t=e-16;return s2(r2[Math.floor(t/36)],r2[Math.floor(t/6)%6],r2[t%6])}let t=8+(e-232)*10;return s2(t,t,t)}function l2(e,t){if(e[t+1]===5)return[c2(e[t+2]??-1),3];if(e[t+1]===2){let[n,r,i]=e.slice(t+2,t+5);return[n===void 0||r===void 0||i===void 0?void 0:`rgb(${n},${r},${i})`,5]}return[void 0,1]}function u2(e,t){let n=t?t.split(`;`).map(e=>Number(e||0)):[0],r={...e};for(let e=0;e<n.length;e++){let t=n[e];if(t===0)r={};else if(t===1)r.bold=!0;else if(t===2)r.dim=!0;else if(t===3)r.italic=!0;else if(t===4)r.underline=!0;else if(t===22)delete r.bold,delete r.dim;else if(t===23)delete r.italic;else if(t===24)delete r.underline;else if(t>=30&&t<=37)r.fg=n2[t-30];else if(t>=90&&t<=97)r.fg=`bright-${n2[t-90]}`;else if(t>=40&&t<=47)r.bg=n2[t-40];else if(t>=100&&t<=107)r.bg=`bright-${n2[t-100]}`;else if(t===39)delete r.fg;else if(t===49)delete r.bg;else if(t===38||t===48){let[i,a]=l2(n,e);i&&(r[t===38?`fg`:`bg`]=i),e+=a-1}}return r}var d2=(e,t)=>e.fg===t.fg&&e.bg===t.bg&&e.bold===t.bold&&e.dim===t.dim&&e.italic===t.italic&&e.underline===t.underline;function f2(e){let t=[],n={},r=e=>{if(!e)return;let r=t.at(-1);r&&d2(r,n)?r.text+=e:t.push({text:e,...n})},i=0;for(let t of e.matchAll(o2))r(e.slice(i,t.index)),i=t.index+t[0].length,t[2]===`m`&&!t[1]?.includes(`?`)&&(n=u2(n,t[1]??``));return r(e.slice(i)),t}function p2(e){return e.replace(o2,``)}function m2(e){let t=[];for(let n of e.split(`
|
|
242
|
-
`)){if(n.startsWith(Q0)){t.push({kind:`command`,text:n.slice(2)});continue}let e=t.at(-1);e?.kind===`output`?e.text+=`\n${n}`:t.push({kind:`output`,text:n})}return t}var h2=40,g2={black:`#6e7781`,red:`#d1242f`,green:`#1a7f37`,yellow:`#9a6700`,blue:`#0969da`,magenta:`#8250df`,cyan:`#1b7c83`,white:`#8c959f`,"bright-black":`#8c959f`,"bright-red":`#e5534b`,"bright-green":`#3fb950`,"bright-yellow":`#d4a72c`,"bright-blue":`#539bf5`,"bright-magenta":`#b083f0`,"bright-cyan":`#39c5cf`,"bright-white":`#adbac7`};function _2({segment:e}){let{text:t,fg:n,bg:r,bold:i,dim:a,italic:o,underline:s}=e;return!n&&!r&&!i&&!a&&!o&&!s?t:(0,G.jsx)(`span`,{style:{color:n?g2[n]??n:void 0,backgroundColor:r?g2[r]??r:void 0},className:W(i&&`font-semibold`,a&&`opacity-60`,o&&`italic`,s&&`underline`),children:t})}function v2({source:e}){let{t}=K(),[n,r]=(0,H.useState)(!1),i=e.split(`
|
|
243
|
-
`),a=!n&&i.length>h2,o=a?i.slice(-20).join(`
|
|
244
|
-
`):e,s=(0,H.useMemo)(()=>m2(o),[o]);return(0,G.jsxs)(`div`,{"data-enso":`terminal-block`,className:`group/code relative my-2`,children:[(0,G.jsxs)(`div`,{className:`overflow-x-auto rounded-lg border bg-[var(--sunken,var(--muted))] p-3 font-mono text-(length:--chat-code-block-size) leading-relaxed`,children:[a&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`mb-1 text-[11px] text-muted-foreground hover:text-foreground`,children:t(`Show all {{count}} lines`,{count:i.length})}),s.map((e,t)=>e.kind===`command`?(0,G.jsxs)(`div`,{className:`whitespace-pre font-semibold`,children:[(0,G.jsx)(`span`,{className:`select-none text-muted-foreground`,children:`$ `}),p2(e.text)]},t):(0,G.jsx)(`div`,{className:`whitespace-pre`,children:f2(e.text).map((e,t)=>(0,G.jsx)(_2,{segment:e},t))},t))]}),(0,G.jsx)(js,{text:()=>p2(e),className:`absolute top-1.5 right-1.5 rounded-md border bg-background/80 p-1.5 text-muted-foreground opacity-0 backdrop-blur transition-opacity group-hover/code:opacity-100`})]})}function y2(e){if(!e)return;let t=e.split(`:`).at(-1)??e;return/\.(\w+)$/.exec(t)?.[1]||(/^[\w-]+$/.test(e)?e:void 0)}var b2={note:{label:`Note`,border:`border-blue-500`,text:`text-blue-600 dark:text-blue-400`},tip:{label:`Tip`,border:`border-green-500`,text:`text-green-600 dark:text-green-400`},important:{label:`Important`,border:`border-purple-500`,text:`text-purple-600 dark:text-purple-400`},warning:{label:`Warning`,border:`border-amber-500`,text:`text-amber-600 dark:text-amber-400`},caution:{label:`Caution`,border:`border-red-500`,text:`text-red-600 dark:text-red-400`}};function x2(){return e=>{JY(e,`blockquote`,e=>{let t=e.children[0];if(t?.type!==`paragraph`)return;let n=t.children[0];if(n?.type!==`text`)return;let r=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*/i.exec(n.value);if(!r)return;n.value=n.value.slice(r[0].length),n.value||t.children.shift();let i=r[1].toLowerCase();e.data={...e.data,hProperties:{...e.data?.hProperties,"data-alert":i,dataAlert:i}}})}}var S2=/^(?:[\w.@-]+\/)+[\w.@-]+\.\w{1,8}(?::\d+(?:-\d+)?)?$|^[\w.-]+\.\w{1,8}:\d+(?:-\d+)?$/,C2=/^(?!(?:\.+\/)+$)(?:[\w.@-]+\/)+$/,w2=`rounded-[5px] border border-border/70 bg-muted/70 px-1 py-px font-mono text-(length:--chat-inline-code-size) [font-weight:var(--chat-inline-code-weight)]`,T2=[Y$,x2],E2=(0,H.createContext)({text:``,streaming:!1,searchQuery:``,activeNth:-1}),D2=(0,H.createContext)(null),O2=(0,H.createContext)(!0);function k2({text:e}){let{t}=K(),[n,r]=(0,H.useState)(!1),i=()=>{let n=window.getSelection?.();n&&!n.isCollapsed&&n.toString()||$$(e).then(e=>{e&&(r(!0),setTimeout(()=>r(!1),1200),UD({type:`success`,title:t(`Copied`)}))})};return(0,G.jsxs)(`span`,{role:`button`,tabIndex:0,title:t(`Copy`),"data-copy-code":``,className:`group/copy relative cursor-pointer`,onClick:i,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i())},children:[(0,G.jsx)(`code`,{className:w2,children:e}),(0,G.jsx)(`span`,{"aria-hidden":!0,className:W(`pointer-events-none absolute -top-2.5 -right-2 inline-flex rounded-[4px] border border-border bg-background p-0.5 text-muted-foreground shadow-sm transition-opacity`,n?`opacity-100`:`opacity-0 group-hover/copy:opacity-100`),children:n?(0,G.jsx)(mt,{className:`h-3 w-3`}):(0,G.jsx)(Mt,{className:`h-3 w-3`})})]})}function A2(e){for(let t=e.parentElement;t;t=t.parentElement){let{overflowY:e}=getComputedStyle(t);if(e===`auto`||e===`scroll`)return t}return null}function j2(e){let[t,n]=(0,H.useState)(null),[r,i]=(0,H.useState)(()=>typeof IntersectionObserver!=`function`);return(0,H.useEffect)(()=>{if(!e||!t||r)return;let n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&i(!0)},{root:A2(t),rootMargin:`100% 0px`});return n.observe(t),()=>n.disconnect()},[e,t,r]),[n,r]}function M2(e,t){let[n,r]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!t)return;let n=setTimeout(()=>r(e),300);return()=>clearTimeout(n)},[e,t]),!t||n===e}function N2(e,t){switch(e){case`invalid-path`:return t(`The link is outside the current workspace.`);case`unsupported`:return t(`This link is not available on the local computer.`);case`unavailable`:return t(`The linked file or folder is unavailable.`);case`unsupported-viewer`:return t(`This file format cannot be previewed inside EnsoCode.`);case`too-large`:return t(`The image is too large to preview.`);case`invalid-application`:return t(`The selected application path is invalid.`);case`application-unavailable`:return t(`VS Code is unavailable. Install it or select another application.`);default:return e}}async function P2(e,t,n,r){try{let r=V0(t,e.cwd);if(r===null)throw Error(`invalid-path`);let i=await window.electronAPI.workspaceFiles.openContext({conversationId:e.conversationId,projectId:e.projectId,rel:r,itemId:n});if(!i.ok)throw Error(i.error)}catch(e){UD({type:`error`,title:r(`Could not open local file link`),description:N2(e instanceof Error?e.message:String(e),r)})}}function F2({context:e,file:t,extra:n,children:r}){let{t:i}=K(),a=Ce(e=>e.contextMenuOpen),o=e?a.filter(e=>e.enabled):[];return o.length===0&&!n?r:(0,G.jsxs)(LW,{children:[(0,G.jsx)(RW,{render:r,onContextMenu:e=>e.stopPropagation()}),(0,G.jsxs)(zW,{className:`min-w-48`,children:[n,o.map(n=>{let r=n.target===`application`?(n.applicationPath.split(/[/\\]/).at(-1)??n.applicationPath).replace(/\.(?:exe|app)$/i,``):`VS Code`;return(0,G.jsx)(BW,{closeOnClick:!0,onClick:()=>e&&void P2(e,t,n.id,i),children:n.target===`reveal`?i(X$()):i(`Open in {{app}}`,{app:r})},n.id)})]})]})}function I2(e){let t=L0(e);if(t.kind===`external`)return{classification:t,line:void 0};let n=N0(t.kind===`local`?t.path:e);return n.line&&/\.[\w]+$/.test(n.path)?{classification:L0(n.path),line:n.line}:{classification:t,line:void 0}}function L2(e){let t=e?.children;if(t?.length!==1)return null;let n=t[0],r=n.tagName===`code`&&n.children?.length===1?n.children[0]:null;return r?.type===`text`&&typeof r.value==`string`?r.value:null}function R2(e,t){let{t:n}=K(),r=(0,H.useContext)(D2),[i,a]=(0,H.useState)(null),o=e=>{UD({type:`error`,title:n(`Could not open local file link`),description:N2(e,n)})},s=r&&e!==null?H0(e,r.cwd):null,c=async e=>{if(r)try{let t=await window.electronAPI.workspaceFiles.revealExternal({conversationId:r.conversationId,projectId:r.projectId,path:e});!t.ok&&t.error!==`cancelled`&&o(t.error)}catch(e){o(e instanceof Error?e.message:String(e))}};return{linkContext:r,external:s,openLocal:async n=>{if(!r||e===null)return;let i=V0(e,r.cwd);if(i==null){s?await c(s):o(`invalid-path`);return}if(!n&&t){p1(r.conversationId,i,t);return}let l={conversationId:r.conversationId,projectId:r.projectId,rel:i};try{if(n){let e=await window.electronAPI.workspaceFiles.reveal(l);e.ok||o(e.error);return}let e=await window.electronAPI.workspaceFiles.open(l);if(!e.ok){o(e.error);return}if(e.target===`handled`)return;if(e.viewer===`image`){let t=JW(e.rel);if(!t){o(`unsupported-viewer`);return}let n=await window.electronAPI.workspaceFiles.readImage({...l,rel:e.rel});if(!n.ok){o(n.error);return}let r=`data:${t};base64,`;if(!n.dataUrl.startsWith(r)||!/^[A-Za-z0-9+/=]+$/.test(n.dataUrl.slice(r.length))){o(`unsupported-viewer`);return}a({rel:e.rel,dataUrl:n.dataUrl})}else e.viewer===`markdown`?p1(r.conversationId,e.rel,void 0,`markdown`):p1(r.conversationId,e.rel)}catch(e){o(e instanceof Error?e.message:String(e))}},preview:(0,G.jsx)(Z$,{image:i,onClose:()=>a(null)})}}function z2({path:e,children:t}){let{t:n}=K(),r=Ce(e=>e.contextMenuOpen.some(e=>e.enabled&&e.target===`reveal`)),{classification:i}=I2(e),a=i.kind===`local`?i.path:null,{linkContext:o,external:s,openLocal:c,preview:l}=R2(a),u=Ce(e=>e.projects.some(e=>e.id===o?.projectId&&e.kind===`ssh`)),d=o!==null&&a!==null&&V0(a,o.cwd)!==null,f=(0,G.jsxs)(G.Fragment,{children:[(d&&!r||!d&&s)&&!u&&(0,G.jsx)(BW,{closeOnClick:!0,onClick:()=>void c(!0),children:n(X$())}),(0,G.jsx)(BW,{closeOnClick:!0,onClick:()=>{navigator.clipboard.writeText(a??e).then(()=>UD({type:`success`,title:n(`Copied`)}),e=>UD({type:`error`,title:n(`Copy failed`),description:e instanceof Error?e.message:String(e)}))},children:n(`Copy Path`)})]});return d?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(F2,{context:o,file:a??e,extra:f,children:(0,G.jsx)(`span`,{role:`link`,tabIndex:0,className:`cursor-pointer`,onClick:()=>void c(!1),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c(!1))},children:t})}),l]}):(0,G.jsx)(F2,{context:null,file:a??e,extra:f,children:(0,G.jsx)(`span`,{children:t})})}function B2({children:e,href:t,node:n}){let{t:r}=K(),{classification:i,line:a}=I2(t??``),{linkContext:o,external:s,openLocal:c,preview:l}=R2(i.kind===`local`?i.path:null,a),u=i.kind===`local`&&o!==null,d=u?L2(n):null,f=(0,H.useContext)(O2),p=u&&!s&&i.kind===`local`&&V0(i.path,o?.cwd)||null,m=R1(p?o:null,p,f),h=Ce(e=>e.openLinksInBuiltinBrowser&&N(e.disabledBuiltinTools,e.projects,o?.projectId,`browser`))&&o&&i.kind===`external`?M0(t):null,g=e=>{if(i.kind===`external`){if(!h||!o||(iO?e.metaKey:e.ctrlKey))return;let t=h1(o.conversationId,h.href);if(!t)return;e.preventDefault(),t.then(e=>{e.ok||UD({type:`error`,title:r(`Navigation failed`),description:e.error})});return}e.preventDefault(),u&&_()},_=async()=>{if(p&&o&&(await L1(o,p)).status!==`ok`){UD({type:`error`,title:r(`Could not open local file link`),description:N2(`unavailable`,r)});return}await c(!1)},v=(0,G.jsx)(`a`,{href:i.kind===`external`&&t||void 0,className:W(`text-brand underline decoration-brand/40 underline-offset-2 transition-colors hover:decoration-brand`,u&&`cursor-pointer break-all`),role:u?`link`:void 0,tabIndex:u?0:void 0,title:h?r(`{{key}}+Click to open in external browser`,{key:iO?`Cmd`:`Ctrl`}):void 0,...i.kind===`external`?{target:`_blank`,rel:`noreferrer`}:{},onClick:g,onKeyDown:e=>{u&&e.key===`Enter`&&(e.preventDefault(),_())},children:d??e});if(!u||i.kind!==`local`||!o)return v;if(!s&&m?.status!==`ok`)return d===null?(0,G.jsx)(`span`,{children:e}):p&&!m?(0,G.jsx)(`code`,{className:w2,children:d}):(0,G.jsx)(k2,{text:d});let y=s?(0,G.jsx)(F2,{context:null,file:i.path,extra:(0,G.jsx)(BW,{closeOnClick:!0,onClick:()=>void c(!0),children:r(X$())}),children:v}):(0,G.jsx)(F2,{context:o,file:i.path,children:v});return d===null?(0,G.jsxs)(`span`,{className:`inline`,children:[y,(0,G.jsx)(`button`,{type:`button`,className:`ml-1 inline-flex rounded p-0.5 align-middle text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":r(X$()),title:r(X$()),onClick:()=>void c(!0),children:(0,G.jsx)(Ut,{className:`h-3.5 w-3.5`})}),l]}):(0,G.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-0.5 rounded-[5px] border border-border/70 bg-muted/70 py-px pr-0.5 pl-1 align-baseline font-mono text-(length:--chat-inline-code-size) [font-weight:var(--chat-inline-code-weight)]`,children:[y,(0,G.jsx)(`button`,{type:`button`,className:`inline-flex shrink-0 rounded-[3px] p-0.5 text-muted-foreground hover:bg-background hover:text-foreground`,"aria-label":r(X$()),title:r(X$()),onClick:()=>void c(!0),children:(0,G.jsx)(Ut,{className:`h-3 w-3`})}),l]})}function V2(e,t,n=!0){let r=XX(e);return r||t!==`href`?r:n&&I2(e).classification.kind===`local`?e:``}var H2=`my-2 leading-[1.625] first:mt-0 last:mb-0`;function U2({children:e}){let{t}=K(),n=(0,H.useContext)(D2),r=(0,H.useContext)(O2),i=typeof e==`string`?e:``,a=C2.test(i)||S2.test(i),{path:o,line:s}=N0(i),c=a&&n&&!(C2.test(i)&&e1())&&V0(o,n.cwd)||null,l=R1(c?n:null,c,r);if(!a)return(0,G.jsx)(`code`,{className:w2,children:e});if(!c||!n||l?.status===`missing`)return(0,G.jsx)(k2,{text:i});if(!l)return(0,G.jsx)(`code`,{className:w2,children:e});if(l.kind===`dir`&&e1())return(0,G.jsx)(k2,{text:i});let u=e=>UD({type:`error`,title:t(`Could not open local file link`),description:N2(e,t)}),d=async()=>{let e=await L1(n,c);if(e.status!==`ok`){u(`unavailable`);return}if(e.kind===`file`){p1(n.conversationId,e.rel,s);return}try{let t=await window.electronAPI.workspaceFiles.reveal({conversationId:n.conversationId,projectId:n.projectId,rel:e.rel});t.ok||u(t.error)}catch(e){u(e instanceof Error?e.message:String(e))}};return(0,G.jsx)(F2,{context:n,file:l.rel,children:(0,G.jsx)(`button`,{type:`button`,onClick:()=>void d(),title:i,className:`inline-flex max-w-full items-center rounded-[5px] border border-border/70 bg-muted/70 px-1 py-px align-baseline font-mono text-(length:--chat-inline-code-size) [font-weight:var(--chat-inline-code-weight)] text-brand transition-colors hover:bg-muted`,children:(0,G.jsx)(`span`,{className:`truncate`,children:i})})})}var W2=`mt-4 mb-2 text-(length:--chat-h1-size) leading-tight [font-weight:var(--chat-h1-weight)]`,G2=`mt-4 mb-2 text-(length:--chat-h2-size) leading-tight [font-weight:var(--chat-h2-weight)]`,K2=`mt-3 mb-1.5 text-(length:--chat-h3-size) leading-tight [font-weight:var(--chat-h3-weight)]`,q2=`mt-3 mb-1 text-(length:--chat-h4-size) [font-weight:var(--chat-h4-weight)]`,J2=`whitespace-nowrap border-b border-border px-2 py-1 text-left font-medium`,Y2=`whitespace-nowrap border-b border-border/50 px-2 py-1`;function X2({source:e,language:t,streaming:n}){let r=(0,H.useMemo)(()=>{let r=$0(t,e);if(r===`json`){let t=t2(e);return!n&&t.ok?{kind:r,value:t.value}:null}return r?{kind:r}:null},[t,e,n]);return r?.kind===`json`?(0,G.jsx)(H1,{source:e,value:r.value}):r?.kind===`terminal`?(0,G.jsx)(v2,{source:e}):(0,G.jsx)(v1,{code:e,language:t,streaming:n})}var Z2=6;function Q2(e){return e.type===`text`?e.value:`children`in e?e.children.map(Q2).join(``):``}var $2=(e,t)=>(e?.children??[]).filter(e=>e.type===`element`&&e.tagName===t),e4=(e,t)=>H.Children.toArray(e).filter(e=>(0,H.isValidElement)(e)&&(t===void 0||e.type===t));function t4({children:e,sort:t,onSort:n}){return n?(0,G.jsx)(`th`,{className:J2,"aria-sort":t===`asc`?`ascending`:t===`desc`?`descending`:void 0,children:(0,G.jsxs)(`button`,{type:`button`,onClick:n,className:`group/sort inline-flex items-center gap-1 hover:text-foreground`,children:[e,(0,G.jsx)(t===`desc`?it:ot,{className:W(`h-3 w-3 shrink-0`,t===`none`?`opacity-0 group-hover/sort:opacity-40`:`opacity-70`)})]})}):(0,G.jsx)(`th`,{className:J2,children:e})}function n4({children:e,node:t}){let{t:n}=K(),{text:r,streaming:i}=(0,H.useContext)(E2),[a,o]=(0,H.useState)(null),[s,c]=(0,H.useState)(null),l=t?.position?.start?.offset,u=t?.position?.end?.offset,d=l!==void 0&&u!==void 0?r.slice(l,u):null,f=e4(e),p=f.find(e=>e.type===`thead`),m=e4(f.find(e=>e.type===`tbody`)?.props.children,`tr`),h=(0,H.useMemo)(()=>$2(t,`tbody`).flatMap(e=>$2(e,`tr`)).map(e=>e.children.filter(e=>e.type===`element`).map(Q2)),[t]),g=(0,H.useMemo)(()=>G0(h),[h]),_=!i&&p!==void 0&&h.length>=2&&m.length===h.length,v=e;if(_){let e=s?.trim().toLowerCase(),t=q0(h,a,g).filter(t=>!e||h[t].join(` `).toLowerCase().includes(e)),n=e4(p.props.children,`tr`);v=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`thead`,{children:n.map((e,t)=>(0,H.cloneElement)(e,{key:e.key??t},e4(e.props.children).map((e,t)=>(0,H.cloneElement)(e,{key:e.key??t,sort:a?.column===t?a.dir:`none`,onSort:()=>o(e=>J0(e,t))}))))}),(0,G.jsx)(`tbody`,{children:t.map(e=>m[e])})]})}let y=`rounded-md border bg-background/80 p-1.5 text-muted-foreground opacity-0 backdrop-blur transition-opacity group-hover/table:opacity-100`;return(0,G.jsxs)(`div`,{className:`group/table relative my-2 min-w-0 max-w-full`,children:[_&&s!==null&&(0,G.jsx)(`input`,{autoFocus:!0,type:`text`,onInput:e=>c(e.currentTarget.value),onKeyDown:e=>{e.key===`Escape`&&c(null)},placeholder:n(`Search table`),className:`mb-1 h-7 w-56 rounded-md border bg-background px-2 text-xs outline-none focus:border-ring`}),(0,G.jsx)(`div`,{className:`overflow-x-auto overscroll-x-contain [-webkit-overflow-scrolling:touch]`,children:(0,G.jsx)(`table`,{className:`w-max min-w-full border-collapse text-(length:--chat-table-size) [font-weight:var(--chat-table-weight)] leading-[1.5] [overflow-wrap:normal]`,children:v})}),d&&!i&&(0,G.jsxs)(`div`,{className:`absolute top-0.5 right-0.5 flex gap-1`,children:[_&&h.length>=Z2&&(0,G.jsx)(`button`,{type:`button`,title:n(`Search table`),onClick:()=>c(e=>e===null?``:null),className:W(y,`hover:text-foreground`),children:(0,G.jsx)(jn,{className:`h-3 w-3`})}),(0,G.jsx)(js,{text:d,className:y})]})]})}var r4={p:({children:e})=>(0,G.jsx)(p4,{className:H2,children:e}),a:B2,ul:({children:e})=>(0,G.jsx)(`ul`,{className:`my-2 list-disc space-y-1 pl-5 leading-[1.625] marker:text-muted-foreground [&_p]:leading-[1.625]`,children:e}),ol:({children:e})=>(0,G.jsx)(`ol`,{className:`my-2 list-decimal space-y-1 pl-5 leading-[1.625] marker:text-muted-foreground [&_p]:leading-[1.625]`,children:e}),h1:({children:e})=>(0,G.jsx)(`h1`,{className:W2,children:e}),h2:({children:e})=>(0,G.jsx)(`h2`,{className:G2,children:e}),h3:({children:e})=>(0,G.jsx)(`h3`,{className:K2,children:e}),h4:({children:e})=>(0,G.jsx)(`h4`,{className:q2,children:e}),h5:({children:e})=>(0,G.jsx)(`h5`,{className:q2,children:e}),h6:({children:e})=>(0,G.jsx)(`h6`,{className:q2,children:e}),blockquote:({children:e,node:t})=>{let{t:n}=K(),r=t?.properties,i=b2[String(r?.dataAlert??r?.[`data-alert`]??``)];return i?(0,G.jsxs)(`blockquote`,{className:W(`my-1.5 border-l-2 pl-3`,i.border),children:[(0,G.jsx)(`p`,{className:W(`mt-1.5 mb-0.5 text-xs font-semibold`,i.text),children:n(i.label)}),e]}):(0,G.jsx)(`blockquote`,{className:`my-2 border-l-2 border-brand/30 pl-3 text-muted-foreground`,children:e})},code:U2,pre:({node:e})=>{let{streaming:t}=(0,H.useContext)(E2),n=e?.children?.[0],r=n&&`properties`in n?n.properties:void 0,i=/language-(\S+)/.exec(r?.className?.join(` `)??``)?.[1],a=n&&`children`in n?n.children?.[0]:void 0,o=(a&&`value`in a?String(a.value):``).replace(/\n$/,``),s=y2(i),c=PO(s);return c?(0,G.jsx)(WO,{pluginId:c.pluginId,lang:c.lang,source:o}):s?.toLowerCase()===`mermaid`?(0,G.jsx)(O0,{code:o,streaming:t}):(0,G.jsx)(X2,{source:o,language:s,streaming:t})},table:n4,th:t4,td:({children:e})=>(0,G.jsx)(`td`,{className:Y2,children:e}),hr:()=>(0,G.jsx)(`hr`,{className:`my-3 border-border`})},i4=new Set([`blockquote`,`div`,`dl`,`figure`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`hr`,`li`,`ol`,`p`,`pre`,`table`,`ul`]),a4=`mt-2 mb-0 leading-[1.625] first:mt-0`,o4=`empty:hidden whitespace-normal`;function s4(e){return e.type===`element`&&i4.has(e.tagName)}function c4(e,t,n){let r,i;for(let t of e?.children??[]){if(s4(t))break;let e=t.position?.start?.offset,n=t.position?.end?.offset;e!=null&&n!=null&&(r??=e,i=n)}if(r==null||i==null)return null;let a=t.slice(r,i);if(!a.trim())return null;let o=e?.position?.end?.offset??i;return{source:a,final:!n||o<t.trimEnd().length}}function l4(e,t){let n=0;for(let r of e)if(!(t&&r.type===`text`&&!r.value.trim())){if(s4(r))return n;n+=1}return null}function u4(e){let{text:t,streaming:n,leafSlot:r}=(0,H.useContext)(E2);if(!r)return null;let i=c4(e,t,n);return i?{...i,messageIndex:r.messageIndex,sessionId:r.sessionId,entry:r.entry}:null}function d4({text:e}){return(0,G.jsx)(w4,{text:e})}function f4({leaf:e}){return(0,G.jsx)(`div`,{className:o4,children:(0,G.jsx)(UO,{entry:e.entry,source:e.source,final:e.final,messageIndex:e.messageIndex,sessionId:e.sessionId,Markdown:d4})})}function p4({children:e,className:t}){let{searchQuery:n,activeNth:r}=(0,H.useContext)(E2);return(0,G.jsx)(`p`,{className:t,children:n.trim()?gH(e,n,r,{n:0}):e})}function m4({children:e,node:t}){let n=u4(t);return n?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(p4,{className:a4,children:e}),(0,G.jsx)(f4,{leaf:n})]}):(0,G.jsx)(p4,{className:H2,children:e})}function h4(e,t){return function({children:n,node:r}){let i=u4(r),a=(0,G.jsx)(e,{className:t,children:n});return i?(0,G.jsxs)(G.Fragment,{children:[a,(0,G.jsx)(f4,{leaf:i})]}):a}}function g4({tag:e,className:t,children:n,node:r}){let i=u4(r),a=e;if(!i)return(0,G.jsx)(a,{className:t,children:n});let o=l4(r?.children??[],e!==`li`),s=H.Children.toArray(n);return(0,G.jsxs)(a,{className:t,children:[o==null?s:s.slice(0,o),(0,G.jsx)(f4,{leaf:i}),o==null?null:s.slice(o)]})}var _4=h4(`h1`,W2),v4=h4(`h2`,G2),y4=h4(`h3`,K2),b4=h4(`h4`,q2),x4=h4(`h5`,q2),S4=h4(`h6`,q2),C4={...r4,p:m4,h1:_4,h2:v4,h3:y4,h4:b4,h5:x4,h6:S4,li:({children:e,node:t,className:n})=>(0,G.jsx)(g4,{tag:`li`,className:n,node:t,children:e}),th:({children:e,node:t})=>(0,G.jsx)(g4,{tag:`th`,className:J2,node:t,children:e}),td:({children:e,node:t})=>(0,G.jsx)(g4,{tag:`td`,className:Y2,node:t,children:e})};function w4({text:e,streaming:t=!1,searchQuery:n=``,activeNth:r=-1,leafSlot:i=null}){let a=(0,H.useContext)(D2)!==null,[o,s]=j2(a),c=M2(e,t),l=s&&c,u=(0,H.useMemo)(()=>({text:e,streaming:t,searchQuery:n,activeNth:r,...i?{leafSlot:i}:{}}),[e,t,n,r,i]),d=(0,H.useMemo)(()=>(e,t)=>V2(e,t,a),[a]);return(0,G.jsx)(E2.Provider,{value:u,children:(0,G.jsx)(O2.Provider,{value:l,children:(0,G.jsx)(`div`,{ref:o,className:W(`[font-weight:var(--chat-body-weight)]`,t&&`t-stream-live`),children:(0,G.jsx)(KX,{remarkPlugins:T2,components:i?C4:r4,urlTransform:d,children:e})})})})}function T4({leaf:e,...t}){IO();let n=jO(),r=(0,H.useMemo)(()=>n?{messageIndex:e.messageIndex,sessionId:e.sessionId,entry:n}:null,[n,e.messageIndex,e.sessionId]);return(0,G.jsx)(w4,{...t,leafSlot:r})}function E4({text:e,streaming:t=!1,searchQuery:n=``,activeNth:r=-1,leaf:i}){return i?(0,G.jsx)(T4,{text:e,streaming:t,searchQuery:n,activeNth:r,leaf:i}):(0,G.jsx)(w4,{text:e,streaming:t,searchQuery:n,activeNth:r})}function D4(e){let t=(e.split(`
|
|
245
|
-
`).map(e=>e.replace(/^[#>\-*\s]+/u,``).trim()).find(Boolean)??``).replace(/\s+/gu,` `);return t.length>60?`${t.slice(0,60)}…`:t}function O4({message:e}){let{t}=K(),n=e.username?`@${e.username}`:``;return(0,G.jsxs)(`div`,{"data-telegram-inbound":e.channel,className:`w-full rounded-lg border border-border/60 bg-muted/20 px-3 py-2 text-sm`,children:[(0,G.jsxs)(`details`,{className:`group`,children:[(0,G.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,G.jsx)(Mn,{className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`shrink-0`,children:e.channel===`telegram`?t(`From Telegram`):t(`From {{name}}`,{name:e.title})}),n&&(0,G.jsx)(`span`,{className:`shrink-0 text-foreground`,children:n}),e.time&&(0,G.jsxs)(`span`,{className:`shrink-0`,children:[`· `,e.time]}),(0,G.jsx)(`span`,{className:`min-w-0 truncate font-normal group-open:hidden`,children:D4(e.body)})]}),(0,G.jsx)(`div`,{className:`mt-1.5 break-words`,children:(0,G.jsx)(E4,{text:e.body})})]}),e.imageLines&&(0,G.jsx)(`div`,{className:`mt-1.5`,children:(0,G.jsx)(KW,{entries:e.imageLines,align:`start`})})]})}var k4=H.createContext(void 0);function A4(e){let t=H.useContext(k4);if(t===void 0&&!e)throw Error(yr(47));return t}var j4={...xT,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},M4=class extends Kw{constructor(e,t,n){let r=new fT;super(N4(e,r,t,n),P4(r),j4)}setOpen=(e,t)=>{let n=t.reason===nb,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=aT(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n={open:e,openChangeReason:t.reason};iT(n,e,t.trigger,a()),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Lo.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function N4(e,t,n,r=!1){let i={...mT(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i.floatingRootContext=hT(t,n,r),i}function P4(e){return{popupRef:H.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:H.createRef(),beforeContentFocusGuardRef:H.createRef(),stickIfOpenTimeout:new Sb,triggerElements:e}}function F4({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=L4(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),dT(u,d),cT(u);let{forceUnmount:m}=lT(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),H.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),H.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,pb(fb))}),[m,u]);let h=d||f;return(0,G.jsxs)(k4.Provider,{value:u,children:[s&&(0,G.jsx)(nT,{handle:s,store:u}),h&&(0,G.jsx)(R4,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})}function I4(e){return A4(!0)?(0,G.jsx)(F4,{props:e}):(0,G.jsx)(QS,{children:(0,G.jsx)(F4,{props:e})})}function L4(e,t){let n=tT((e,n)=>new M4(t,e,n));return H.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function R4({store:e,modal:t}){let n=fC(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return uT(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var z4=H.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=A4(!0),h=ST(s)??m;if(!h)throw Error(yr(74));let g=vb(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=H.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=sT(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`openChangeReason`),T=h.useState(`stickIfOpen`),E=h.useState(`openMethod`),D=h.useState(`focusManagerModal`),O=MT(v,{enabled:!a&&l&&(E!==`touch`||w!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:WT(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),k=lC(v,{stickIfOpen:T}),A=uE(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),j=h.useState(`triggerProps`,C),{getButtonProps:M,buttonRef:N}=Zy({disabled:a,native:o}),P={open(e){return e&&w===`trigger-press`?dy.open(e):uy.open(e)}},{preFocusGuardRef:F,handlePreFocusGuardFocus:I,handleFocusTargetFocus:ee}=hM(h,x),L=Lr(`button`,e,{state:{disabled:a,open:y},ref:[N,t,S,x],props:[k.reference,O,j,A,{[FS]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,M],stateAttributesMapping:P}),te=(0,G.jsx)(H.Fragment,{children:L},g);return C&&!D?(0,G.jsxs)(H.Fragment,{children:[(0,G.jsx)(dx,{ref:F,onFocus:I}),te,(0,G.jsx)(dx,{ref:h.context.triggerFocusTargetRef,onFocus:ee})]}):te}),B4=H.createContext(void 0);function V4(){let e=H.useContext(B4);if(e===void 0)throw Error(yr(45));return e}var H4=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return A4().useState(`mounted`)||n?(0,G.jsx)(B4.Provider,{value:n,children:(0,G.jsx)(US,{ref:t,...r})}):null}),U4=H.createContext(void 0);function W4(){let e=H.useContext(U4);if(!e)throw Error(yr(46));return e}var G4=H.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=LS,..._}=e,v=A4(),y=V4(),b=XS(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=v.useState(`adaptiveOrigin`),M=H.useRef(null),N=Zw(O),P=ID({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:j}),F=x.useState(`domReferenceElement`);Y(()=>{let e=F,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return N(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[F,N,v]);let I=E===!0&&w!==`trigger-hover`;Zj(C&&I,D===`touch`,O,T);let ee=v.useStateSetter(`positionerElement`),L=BD(e,{open:C,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:k},{styles:P.positionerStyles,transitionStatus:A,props:_,refs:[t,ee],hidden:!S,inert:!C});return(0,G.jsxs)(U4.Provider,{value:P,children:[S&&I&&(0,G.jsx)(ZT,{inert:XT(!C),cutout:T}),(0,G.jsx)(ZS,{id:b,children:L})]})}),K4=H.createContext(void 0);function q4(){let[e,t]=H.useState(0),n=Uy(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:H.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var J4=H.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=A4(),l=W4(),u=Rj(!0)!=null,{context:d,hasClosePart:f}=q4(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);Qw({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),jT(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?eT(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=Lr(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...$w,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&qT.has(e.key)&&e.stopPropagation()}},zD(g),s],stateAttributesMapping:py});return(0,G.jsx)(cC,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:xy(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,G.jsx)(K4.Provider,{value:d,children:M})})}),Y4=H.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=A4(),{side:c}=W4(),l=s.useState(`instantType`),{children:u,state:d}=kM({store:s,side:c,children:a});return Lr(`div`,e,{state:{activationDirection:d.activationDirection,transitioning:d.transitioning,instant:l},ref:t,props:[o,{children:u}],stateAttributesMapping:OM})}),X4=I4;function Z4(e){return(0,G.jsx)(z4,{"data-slot":`popover-trigger`,...e})}function Q4({children:e,className:t,positionerClassName:n,side:r=`bottom`,align:i=`center`,sideOffset:a=4,alignOffset:o=0,tooltipStyle:s=!1,...c}){return(0,G.jsx)(H4,{children:(0,G.jsx)(G4,{align:i,alignOffset:o,className:W(`z-50 h-(--positioner-height) max-h-(--available-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none`,n),"data-slot":`popover-positioner`,side:r,sideOffset:a,children:(0,G.jsx)(J4,{className:W(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) rounded-lg border bg-popover bg-clip-padding text-popover-foreground shadow-lg transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-starting-style:scale-98 data-starting-style:opacity-0 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]`,s&&`w-fit text-balance rounded-md text-xs shadow-black/5 shadow-md before:rounded-[calc(var(--radius-md)-1px)]`,t),"data-slot":`popover-popup`,...c,children:(0,G.jsx)(Y4,{className:W(`relative size-full max-h-(--available-height) overflow-clip px-(--viewport-inline-padding) py-4 outline-none [--viewport-inline-padding:--spacing(4)] data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,s?`py-1 [--viewport-inline-padding:--spacing(2)]`:`not-data-transitioning:overflow-y-auto`),"data-slot":`popover-viewport`,children:e})})})})}var $4=new Map,e3;function t3(e){if(e3?.revision===e)return e3.request;let t=window.electronAPI.providers.listOauth().then(t=>{let n=new Map;for(let e of t)for(let t of e.accounts){if(typeof t.email!=`string`)continue;let e=``;for(let n of t.email){let t=n.codePointAt(0)??0;t>=32&&t!==127&&(e+=n)}e=e.trim(),e&&n.set(t.key,e)}return{revision:e,emails:n}}).catch(t=>(console.error(`Failed to load OAuth account metadata`,t),{revision:e,emails:$4})),n={revision:e,request:t,data:void 0};return e3=n,t.then(e=>{e3===n&&(n.data=e)}),t}function n3(){let e=LL(e=>e.snapshot.revision),[t,n]=(0,H.useState)(()=>e3?.revision===e?e3.data:void 0);return(0,H.useEffect)(()=>{let t=!1;return t3(e).then(e=>{t||n(e)}),()=>{t=!0}},[e]),t?.revision===e?t.emails:$4}function r3(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677)}return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36)}function i3(e,t,n){return`${e}:${r3(t)}:${r3(n,1)}`}var a3=/(?:\x1b\]|\x9d)[^\x07\x1b\x9c]*(?:\x07|\x1b\\|\x9c|$)/g,o3=/(?:\x1b\[|\x9b)[0-?]*[ -/]*(?:[@-~]|$)/g;function s3(e){return e.replace(a3,``).replace(o3,``)}var c3=_N()(e=>({conversationId:null,result:null,tab:`session`,from:null,open:(t,n,r)=>e({conversationId:t,result:n??null,tab:n?`result`:`session`,from:r??null}),setTab:t=>e({tab:t}),close:()=>e({conversationId:null,result:null,tab:`session`,from:null})})),l3=_N()(()=>({back:null}));function u3(e){return NN.getState().conversations[e]?.parentId??e}function d3(e){let t=NN.getState().conversations[e]?.projectId;return Ce.getState().projects.some(e=>e.id===t&&e.kind===`secretary`)}var f3=!1;function p3(){f3||(f3=!0,NN.subscribe((e,t)=>{if(e.activeId===t.activeId)return;let{back:n}=l3.getState();n&&(!e.activeId||u3(e.activeId)!==n.to)&&l3.setState({back:null})}))}function m3(e,t){let n=NN.getState();if(!n.conversations[e])return;let r=t??n.activeId,i=r?u3(r):null,a=u3(e);p3(),c3.getState().close(),n.selectConversation(e),l3.setState({back:i&&i!==a&&d3(i)&&!d3(a)?{from:i,to:a}:null})}function h3(e,t){let n=new Set([t]),r=e[t]?.forkedFromConversationId;for(;r&&!n.has(r);)n.add(r),r=e[r]?.forkedFromConversationId;return n.size}function g3(e){return!e.started&&!e.spawning&&!e.parentId&&!!e.sessionFile&&!e.historyOnly&&!e.worktreeMissing&&!e.workspaceMigrating&&e.status!==`running`}function _3(e,t){return t&&!t.canRewind||!e||e.historyOnly||e.worktreeMissing||e.workspaceMigrating||e.spawning||e.status===`running`||e.rewinding||e.restoringFiles?!1:e.started?!0:g3(e)}function v3(e,t,n=1){return t&&(!t.canRewind||t.canFork===!1)||n>=3||!e||e.parentId||e.historyOnly||e.status!==`idle`?!1:e.started?!e.spawning:g3(e)}function y3(e,t){let n=typeof t==`string`?e.messages.findIndex(e=>e.entryId===t):C3(e.messages,t);if(n===null||n<0)return null;let r=e.messages[n];return r?.role!==`user`||r.optimistic||!r.entryId?.trim()?null:{entryId:r.entryId,userIndexFromEnd:e.messages.slice(n+1).filter(e=>e.role===`user`).length}}function b3(e,t,n,r,i){if(!n||t!==e)return null;let a=i??x3(n,r);if(a===null)return null;let o=y3(n,a);return o?{conversationId:e,...o}:null}function x3(e,t){if(!Number.isInteger(t)||t<0)return null;let n=t-(e.historyBaseIndex??0);return n<0||e.messages[n]?.role!==`user`?null:e.messages.slice(n+1).filter(e=>e.role===`user`).length}function S3(e,t){if(!Number.isInteger(t))return null;let n=e.historyBaseIndex??0;for(let r=t;r>=n;r--)if(e.messages[r-n]?.role===`user`)return x3(e,r);return null}function C3(e,t){if(!Number.isInteger(t)||t<0)return null;let n=[];for(let t=0;t<e.length;t++)e[t]?.role===`user`&&n.push(t);let r=n[n.length-1-t];return r===void 0?null:r}var w3=`
|
|
246
|
-
…`;function T3(e){return e.length>=32768&&e.endsWith(w3)?e.slice(0,-2):null}function E3(e){return!!(e?.role===`user`&&e.optimistic&&e.deliveryRejected&&e.deliveryId&&!e.entryId)}function D3(e){return!!(e?.role===`user`&&e.optimistic&&!e.deliveryRejected&&!e.withdrawRequested&&e.deliveryId&&!e.entryId)}var O3=_N(e=>({byConversation:{},replace:(t,n)=>e(e=>{let r={...e.byConversation};if(n.length>0)r[t]=n;else if(r[t])delete r[t];else return e;return{byConversation:r}})}));function k3(e){let t=e.toLowerCase();return t.startsWith(`image/`)?`image`:t.startsWith(`text/`)||t===`application/json`||t===`application/javascript`||t===`application/xml`||t.endsWith(`+json`)||t.endsWith(`+xml`)?`text`:`file`}function A3(e){return!Number.isFinite(e)||e<1024?`${Math.max(0,Math.round(e))} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}async function j3(e){if(!window.electronAPI.remote){let t=await window.electronAPI.extensionPlugins.artifactSave(e.id);return t.ok?null:t.error}let t=await window.electronAPI.extensionPlugins.artifactRead(e.id);if(!t.ok)return t.error;let n=Uint8Array.from(atob(t.base64),e=>e.charCodeAt(0)),r=URL.createObjectURL(new Blob([n],{type:e.mime||`application/octet-stream`})),i=document.createElement(`a`);return i.href=r,i.download=e.name,i.click(),URL.revokeObjectURL(r),null}function M3({artifact:e,onDelete:t}){let[n,r]=(0,H.useState)(null),[i,a]=(0,H.useState)(null),[o,s]=(0,H.useState)(!1),c=k3(e.mime),l=async()=>{s(!0),a(null);let t=await window.electronAPI.extensionPlugins.artifactRead(e.id);if(s(!1),!t.ok){a(t.error),r(null);return}if(c===`image`){r({kind:`image`,body:`data:${t.info.mime};base64,${t.base64}`});return}if(c===`text`){r({kind:`text`,body:t1(t.base64)});return}r(null),a(`这个文件不能在这里预览`)};return(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.name,children:[e.name,(0,G.jsxs)(`span`,{className:`ml-2 text-muted-foreground`,children:[e.mime,` · `,A3(e.size)]})]}),c!==`file`&&(0,G.jsx)(wa,{size:`sm`,variant:`ghost`,disabled:o,onClick:()=>void l(),children:`预览`}),(0,G.jsx)(wa,{size:`sm`,variant:`ghost`,disabled:o,onClick:()=>{s(!0),j3(e).then(e=>{s(!1),a(e)})},children:window.electronAPI.remote?`下载`:`另存`}),t&&(0,G.jsx)(wa,{size:`sm`,variant:`ghost`,onClick:()=>t(e.id),children:`删除`})]}),i&&(0,G.jsx)(`p`,{className:`text-destructive text-xs`,children:i}),n?.kind===`text`&&(0,G.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-all font-mono text-muted-foreground text-xs`,children:n.body}),n?.kind===`image`&&(0,G.jsx)(`img`,{src:n.body,alt:e.name,className:`max-h-48 max-w-full rounded border object-contain`})]})}function N3({artifacts:e,onDelete:t}){return e.length===0?(0,G.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`还没有产出文件`}):(0,G.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,G.jsx)(M3,{artifact:e,onDelete:t},e.id))})}function P3({artifacts:e,align:t=`tool-row`}){return(0,G.jsxs)(`div`,{className:W(`mt-1 mb-1.5 rounded-lg border border-border/70 bg-card px-3 py-2`,t===`card`?`w-full`:`ml-[30px]`),children:[(0,G.jsx)(`p`,{className:`mb-1 text-[11px] text-muted-foreground`,children:`产出文件`}),(0,G.jsx)(N3,{artifacts:e})]})}var F3={},I3=new Set,L3=new Map;function R3(e){return I3.add(e),()=>I3.delete(e)}function z3(e,t){let n=`${e}\0${t}`,r=L3.get(n);return r||(r=window.electronAPI.extensionPlugins.asset(e,t).then(e=>e.ok?`data:${e.mime};base64,${e.base64}`:null).catch(()=>null),r.then(e=>e===null&&L3.delete(n)),L3.set(n,r)),r}function B3({pluginId:e,icon:t,className:n}){let r=(0,H.useSyncExternalStore)(R3,()=>F3[e]),i=t??r,[a,o]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(o(null),!i)return;let t=!0;return z3(e,i).then(e=>t&&o(e)),()=>{t=!1}},[e,i]),a?(0,G.jsx)(`img`,{src:a,alt:``,className:W(`object-contain`,n)}):(0,G.jsx)(En,{className:n})}var V3={read_only:`Read-only`,regenerable:`Regenerable output`,reversible_workspace_change:`Reversible workspace change`,data_loss:`Possible data loss`,system_state:`Changes system state`,exfiltration:`Sends data externally`,unclear_target:`Unclear target or intent`};function H3({value:e}){let t=Pe(e),{t:n}=K();if(!t)return null;let r=`allow ${t.allow.toFixed(2)} · ask ${t.ask.toFixed(2)} · block ${t.block.toFixed(2)}`;return(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 border-border/60 border-t px-3 py-1 text-[10px] text-muted-foreground`,"data-approval-review":t.verdict,children:[(0,G.jsx)(`span`,{className:`font-semibold tracking-wide text-foreground/75`,children:t.verdict===`allow`?n(`Auto-managed · allowed`):n(`Auto-managed · denied`)}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{className:`font-mono`,children:t.model}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{className:`font-mono`,children:r}),t.reason&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsxs)(`span`,{children:[n(`Reason`),`: `,n(V3[t.reason])]})]})]})}function U3({ask:e,waiting:t}){let{t:n}=K(),r=e.answer!==null&&!e.options.includes(e.answer)?e.answer:null;return(0,G.jsxs)(`div`,{className:`space-y-1.5 px-3 py-2 text-xs`,children:[(0,G.jsx)(`p`,{className:`whitespace-pre-wrap break-words leading-relaxed text-foreground`,children:e.question}),(e.options.length>0||r!==null)&&(0,G.jsxs)(`ul`,{className:`space-y-0.5`,children:[e.options.map(t=>(0,G.jsx)(W3,{selected:t===e.answer,text:t},t)),r!==null&&(0,G.jsx)(W3,{selected:!0,text:r,label:e.options.length>0&&!e.autoSelected?n(`Custom answer`):void 0})]}),e.autoSelected&&(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:n(`No answer in time; the default was selected`)}),t&&e.answer===null&&(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:n(`Waiting for your answer`)})]})}function W3({selected:e,text:t,label:n}){let{t:r}=K(),i=e?xt:Et;return(0,G.jsxs)(`li`,{"data-selected":e||void 0,className:W(`flex items-start gap-1.5 rounded-md px-2 py-1 leading-relaxed`,e?`bg-primary/10 text-foreground`:`text-muted-foreground`),children:[(0,G.jsx)(i,{className:W(`mt-0.5 h-3.5 w-3.5 shrink-0`,e?`text-primary`:`opacity-40`)}),(0,G.jsxs)(`span`,{className:`min-w-0 whitespace-pre-wrap break-words`,children:[n&&(0,G.jsx)(`span`,{className:`mr-1.5 text-muted-foreground`,children:n}),t]}),e&&(0,G.jsx)(`span`,{className:`sr-only`,children:r(`Selected`)})]})}var G3=/^Subagent ".*" \(agentId [^,\s]+, runId [^)\s]+\) \S+ after .+\.$/gm,K3=/^The following is the subagent's report: .*$\n?/m,q3=/<usage>([\s\S]*?)<\/usage>/,J3=/^Background tasks this subagent started\b.*\n((?:- .*(?:\n|$))+)/m,Y3=(e,t)=>{let n=RegExp(`^${t}: (\\d+)$`,`m`).exec(e);return n?Number(n[1]):null};function X3(e){let t=e.indexOf(`
|
|
247
|
-
`),n=t<0?e:e.slice(0,t),r=t<0?``:e.slice(t+1),i=null,a=[],o=q3.exec(r);if(o){let e=J3.exec(r.slice(o.index+o[0].length));e&&(a=e[1].split(`
|
|
248
|
-
`).filter(e=>e.startsWith(`- `)).map(e=>e.slice(2))),r=r.slice(0,o.index);let t=Y3(o[1],`subagent_tokens`),n=Y3(o[1],`tool_uses`),s=Y3(o[1],`duration_ms`);t!==null&&n!==null&&s!==null&&(i={tokens:t,toolUses:n,durationMs:s})}return{header:n,report:r.replace(K3,``).trim(),usage:i,...a.length>0?{tasks:a}:{}}}function Z3(e){let t=e.trim(),n=[...t.matchAll(G3)].map(e=>e.index);return n[0]===0?n.map((e,r)=>X3(t.slice(e,n[r+1]).replace(/\n+---\s*$/,``).trim())):null}function Q3(e){return aE(`alert-dialog`,e)}function $3(e){return uD(e.open??!1),(0,G.jsx)(Q3,{...e})}var e6=QT;function t6({className:e,style:t,...n}){return(0,G.jsx)(my,{className:W(`fixed inset-0 bg-black/32 backdrop-blur-sm transition-all duration-200 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0`,e),style:t,"data-slot":`alert-dialog-backdrop`,...n})}function n6({className:e,style:t,...n}){return(0,G.jsx)(sE,{className:W(`fixed inset-0 grid grid-rows-[1fr_auto] justify-items-center pt-6 sm:grid-rows-[1fr_auto_3fr] sm:p-4`,e),style:t,"data-slot":`alert-dialog-viewport`,...n})}function r6({className:e,showBackdrop:t=!0,zIndexLevel:n=`base`,...r}){let i=n===`nested`?dD.NESTED_MODAL_BACKDROP:dD.MODAL_BACKDROP,a=n===`nested`?dD.NESTED_MODAL_CONTENT:dD.MODAL_CONTENT,o=n===`nested`?dD.DROPDOWN_IN_NESTED_MODAL:dD.DROPDOWN_IN_MODAL;return(0,G.jsxs)(e6,{children:[(0,G.jsx)(tD,{}),t&&(0,G.jsx)(t6,{style:{zIndex:i}}),(0,G.jsx)(n6,{style:{zIndex:a},children:(0,G.jsx)(fD.Provider,{value:o,children:(0,G.jsx)(YT,{className:W(`sm:-translate-y-[calc(1.25rem*var(--nested-dialogs))] relative row-start-2 grid max-h-full w-full min-w-0 border-t bg-popover bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-nested-dialog-open:origin-top data-ending-style:opacity-0 data-starting-style:opacity-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:translate-y-4 max-sm:before:hidden sm:max-w-lg sm:data-nested:data-ending-style:translate-y-8 sm:data-nested:data-starting-style:translate-y-8 sm:scale-[calc(1-0.1*var(--nested-dialogs))] sm:rounded-2xl sm:border sm:data-ending-style:scale-98 sm:data-starting-style:scale-98 sm:before:rounded-[calc(var(--radius-2xl)-1px)] dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]`,e),"data-slot":`alert-dialog-popup`,...r})})})]})}function i6({className:e,...t}){return(0,G.jsx)(`div`,{className:W(`flex flex-col gap-2 p-6 not-has-[+[data-slot=alert-dialog-footer]]:pb-4 text-center max-sm:pb-4 sm:text-left`,e),"data-slot":`alert-dialog-header`,...t})}function a6({className:e,variant:t=`default`,...n}){return(0,G.jsx)(`div`,{className:W(`flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]`,t==="default"&&`border-t bg-muted/50 py-4`,t===`bare`&&`pt-4 pb-6`,e),"data-slot":`alert-dialog-footer`,...n})}function o6({className:e,...t}){return(0,G.jsx)(cE,{className:W(`font-heading text-xl leading-none`,e),"data-slot":`alert-dialog-title`,...t})}function s6({className:e,...t}){return(0,G.jsx)(yb,{className:W(`text-muted-foreground text-sm`,e),"data-slot":`alert-dialog-description`,...t})}function c6(e){return(0,G.jsx)(mb,{"data-slot":`alert-dialog-close`,...e})}function l6({open:e,onOpenChange:t,title:n,description:r,confirmLabel:i,cancelLabel:a,onConfirm:o,zIndexLevel:s}){let{t:c}=K();return(0,G.jsx)($3,{open:e,onOpenChange:t,children:(0,G.jsxs)(r6,{className:`sm:max-w-sm`,zIndexLevel:s,children:[(0,G.jsxs)(i6,{children:[(0,G.jsx)(o6,{className:`text-base`,children:n}),r&&(0,G.jsx)(s6,{children:r})]}),(0,G.jsxs)(a6,{variant:`bare`,children:[(0,G.jsx)(c6,{render:(0,G.jsx)(wa,{variant:`outline`,size:`sm`}),children:a??c(`Cancel`)}),(0,G.jsx)(wa,{variant:`destructive`,size:`sm`,onClick:()=>{o(),t(!1)},children:i})]})]})})}function u6(e,t){return!e||e<=0||t===void 0||t>=e?null:Math.round((1-t/e)*100)}function d6({hits:e,defaultOpen:t=!1}){let{t:n}=K();return e.length===0?(0,G.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:n(`No results`)}):(0,G.jsx)(`ul`,{className:`divide-y divide-border/60`,children:e.map(e=>(0,G.jsx)(p6,{hit:e,defaultOpen:t},e.id))})}function f6({view:e}){let{t}=K(),n=e.written?e.deduplicated&&t(`Identical memory already exists, nothing new was written`):t(`Similar memories already exist, nothing was written`);return(0,G.jsxs)(G.Fragment,{children:[n&&(0,G.jsx)(`p`,{className:`px-3 pt-2 text-xs text-muted-foreground`,children:n}),e.written?(0,G.jsx)(d6,{hits:[e.memory],defaultOpen:!0}):(0,G.jsx)(d6,{hits:e.candidates})]})}function p6({hit:e,defaultOpen:t}){let{t:n}=K(),[r,i]=(0,H.useState)(t);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:e=>{let t=window.getSelection();t?.toString()&&e.currentTarget.contains(t.anchorNode)||i(e=>!e)},className:`block w-full cursor-pointer px-3 py-2 text-left transition-colors hover:bg-muted/40`,children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:W(`min-w-0 flex-1 font-medium text-foreground text-xs`,r?`break-words`:`truncate`),children:e.title}),e.unitType&&(0,G.jsx)(tj,{variant:`secondary`,size:`sm`,children:e.unitType}),e.space&&(0,G.jsx)(tj,{variant:`outline`,size:`sm`,children:n(e.space===`global`?`Global`:`Project`)}),e.relevance!==null&&(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums`,title:n(`Semantic similarity`),children:e.relevance.toFixed(2)})]}),(0,G.jsx)(`span`,{className:W(`mt-0.5 whitespace-pre-wrap break-words text-muted-foreground text-xs leading-relaxed`,r?`block`:`line-clamp-2`),children:e.content})]})})}var m6=H.createContext(void 0);function h6(e){let t=H.useContext(m6);if(t===void 0&&!e)throw Error(yr(50));return t}var g6={...xT,instantType:e=>e.instantType,adaptiveOrigin:e=>e.adaptiveOrigin,closeDelay:e=>e.closeDelay},_6=class extends Kw{constructor(e,t,n){let r=new fT;super(v6(e,r,t,n),y6(r),g6)}setOpen=(e,t)=>{let{inlineRectCoordsRef:n}=this.context;oT(this,e,t,{onBeforeDispatch(){let r=t.event;e&&t.reason===`trigger-hover`&&t.trigger&&`clientX`in r&&`clientY`in r&&n.current?.element!==t.trigger&&Tw(n,t.trigger,r.clientX,r.clientY)}})}};function v6(e,t,n,r=!1){let i={...mT(),instantType:void 0,adaptiveOrigin:void 0,closeDelay:300,...e};return i.floatingRootContext=hT(t,n,r),i}function y6(e){return{popupRef:H.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e,inlineRectCoordsRef:{current:void 0}}}function b6(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,onOpenChangeComplete:i,actionsRef:a,handle:o,triggerId:s,defaultTriggerId:c=null,children:l}=e,u=tT((e,r)=>new _6({open:n,openProp:t,activeTriggerId:c,triggerIdProp:s},e,r));u.useControlledProp(`openProp`,t),u.useControlledProp(`triggerIdProp`,s),u.useContextCallback(`onOpenChange`,r),u.useContextCallback(`onOpenChangeComplete`,i);let d=u.useState(`open`),f=u.useState(`activeTriggerId`),p=u.useState(`mounted`),m=u.useState(`payload`);cT(u,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:h}=lT(d,u,()=>{u.context.inlineRectCoordsRef.current=void 0});Y(()=>{d&&(f??u.set(`payload`,void 0))},[u,f,d]),H.useImperativeHandle(a,()=>({unmount:h,close:()=>u.setOpen(!1,pb(fb))}),[h,u]);let g=d||p;return(0,G.jsxs)(m6.Provider,{value:u,children:[o&&(0,G.jsx)(nT,{handle:o,store:u}),g&&(0,G.jsx)(x6,{store:u}),typeof l==`function`?l({payload:m}):l]})}function x6({store:e}){let t=fC(e.useState(`floatingRootContext`));return uT(e,{activeTriggerProps:t.reference,inactiveTriggerProps:t.trigger,popupProps:t.floating}),null}var S6=Fw(function(e){return h6(!0)?(0,G.jsx)(b6,{...e}):(0,G.jsx)(QS,{children:(0,G.jsx)(b6,{...e})})}),C6=H.createContext(void 0);function w6(){let e=H.useContext(C6);if(e===void 0)throw Error(yr(48));return e}var T6=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return h6().useState(`mounted`)||n?(0,G.jsx)(C6.Provider,{value:n,children:(0,G.jsx)(DD,{ref:t,...r})}):null}),E6=Iw(function(e,t){let{render:n,className:r,delay:i,closeDelay:a,id:o,payload:s,handle:c,style:l,...u}=e,d=h6(!0),f=ST(c)??d;if(!f)throw Error(yr(89));let p=vb(o),m=f.useState(`isTriggerActive`,p),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`floatingRootContext`),_=f.context.inlineRectCoordsRef,v=H.useRef(null),y=i??600,b=a??300,{registerTrigger:x,isMountedByThisTrigger:S}=sT(p,v,f,{payload:s,closeDelay:b}),C=MT(g,{mouseOnly:!0,move:!1,handleClose:WT(),delay:()=>({open:y,close:b}),triggerElementRef:v,isActiveTrigger:m,isClosing:()=>f.select(`transitionStatus`)===`ending`}),w=ET(g,{delay:y}),T={open:h},E=f.useState(`triggerProps`,S),D=ww(_,h);return Lr(`a`,e,{state:T,ref:[t,x,v],props:[C,w.reference,E,D,{id:p},u],stateAttributesMapping:uy})}),D6=H.createContext(void 0);function O6(){let e=H.useContext(D6);if(e===void 0)throw Error(yr(49));return e}var k6=H.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=LS,style:g,..._}=e,v=h6(),y=w6(),b=XS(),x=v.useState(`open`),S=v.useState(`mounted`),C=v.useState(`floatingRootContext`),w=v.useState(`instantType`),T=v.useState(`transitionStatus`),E=v.useState(`adaptiveOrigin`),D=v.context.inlineRectCoordsRef,O=ID({anchor:i,floatingRootContext:C,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:y,nodeId:b,collisionAvoidance:h,adaptiveOrigin:E,inline:Ew(D)}),k=O.update;Y(()=>{x&&S&&k()},[x,S,k]);let A=BD(e,{open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:w},{styles:O.positionerStyles,transitionStatus:T,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!S,inert:!x});return(0,G.jsx)(D6.Provider,{value:O,children:(0,G.jsx)(ZS,{id:b,children:A})})}),A6=H.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=h6(),{side:s,align:c}=O6(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`closeDelay`);return Qw({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),jT(p,{closeDelay:m}),Lr(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,o.useStateSetter(`popupElement`)],props:[$w,f,zD(d),a],stateAttributesMapping:py})}),j6=S6;function M6({...e}){return(0,G.jsx)(E6,{"data-slot":`preview-card-trigger`,...e})}function N6({className:e,children:t,align:n=`center`,sideOffset:r=4,...i}){return(0,G.jsx)(T6,{children:(0,G.jsx)(k6,{align:n,className:`z-50`,"data-slot":`preview-card-positioner`,sideOffset:r,children:(0,G.jsx)(A6,{className:W(`relative flex w-64 origin-(--transform-origin) text-balance rounded-lg border bg-popover bg-clip-padding p-4 text-popover-foreground text-sm shadow-lg transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]`,e),"data-slot":`preview-card-content`,...i,children:t})})})}var P6={mask:`text-sky-600 dark:text-sky-400`,warn:`text-amber-600 dark:text-amber-400`,block:`text-red-600 dark:text-red-400`},F6={mask:Fn,warn:Nn,block:Pn},I6={mask:`Mask`,warn:`Warn only`,block:`Block`},L6={system:`System prompt`,user:`Your message`,tool_result:`Tool output`,tool_args:`Tool arguments`,assistant:`Earlier replies`,tools:`Tool descriptions`};function R6({report:e}){let{t}=K(),n=f(e);if(!n)return null;let r=F6[n],i=new Set(e.hits.map(e=>e.token)).size;return(0,G.jsxs)(j6,{children:[(0,G.jsxs)(M6,{render:(0,G.jsx)(`span`,{className:W(`inline-flex shrink-0 items-center gap-0.5 text-[11px]`,P6[n]),"data-privacy-mask":n}),children:[(0,G.jsx)(r,{className:`size-3.5`}),(0,G.jsx)(`span`,{className:`tabular-nums`,children:i})]}),(0,G.jsxs)(N6,{className:`max-h-(--available-height) w-72 flex-col overflow-y-auto overscroll-contain text-xs`,children:[(0,G.jsx)(`p`,{className:`mb-1.5 font-medium`,children:t(`Privacy masking`)}),(0,G.jsx)(`ul`,{className:`space-y-1`,children:Ae(e.hits).map(e=>(0,G.jsxs)(`li`,{className:`flex flex-wrap gap-x-2`,children:[(0,G.jsx)(`span`,{className:P6[e.action],children:t(I6[e.action])}),(0,G.jsx)(`span`,{children:e.kind}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:t(L6[e.where]??e.where)}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e.values>1?t(`{{count}} values`,{count:e.values}):e.preview}),e.count>1&&(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[`×`,e.count]})]},`${e.action}-${e.kind}-${e.where}`))}),e.restored>0&&(0,G.jsx)(`p`,{className:`mt-1.5 text-muted-foreground`,children:t(`Restored {{count}} in the reply`,{count:e.restored})})]})]})}function z6(e){let{inputTokens:t,outputTokens:n}=e;if(typeof t!=`number`||!Number.isFinite(t)||t<0||typeof n!=`number`||!Number.isFinite(n)||n<0)return null;let r=Math.max(0,t-n);return{tokens:r,percent:t>0?Math.round(r/t*100):null}}var B6={compressed:`Compressed`,unchanged:`Unchanged`,pending:`Background task started`,bypassed:`Bypassed`,unavailable:`Unavailable`};function V6({value:e}){let t=c(e),{t:n}=K();if(!t)return null;let r=z6(t);return(0,G.jsxs)(`div`,{className:`border-border/60 border-t text-[10px] text-muted-foreground`,"data-rtk-status":t.status,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 px-3 py-1`,children:[(0,G.jsx)(`span`,{className:`font-semibold tracking-wide text-foreground/75`,children:`RTK`}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{children:n(B6[t.status])}),r&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{children:n(`~{{count}} tokens saved`,{count:vN(r.tokens)})}),r.percent!==null&&(0,G.jsxs)(`span`,{children:[`(`,r.percent,`%)`]})]})]}),(0,G.jsxs)(`div`,{className:`space-y-2 px-3 pb-2`,children:[t.status===`pending`&&(0,G.jsx)(`p`,{className:`rounded bg-muted/40 px-2 py-1 text-foreground/80`,children:n(`This is the startup receipt; see the task_output result for final statistics.`)}),(t.inputTokens!==void 0||t.reason)&&(0,G.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1`,children:[t.inputTokens!==void 0&&t.outputTokens!==void 0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{children:n(`Input estimate`)}),(0,G.jsx)(`dd`,{className:`font-mono text-foreground/80`,children:n(`{{count}} tokens`,{count:vN(t.inputTokens)})}),(0,G.jsx)(`dt`,{children:n(`Output estimate`)}),(0,G.jsx)(`dd`,{className:`font-mono text-foreground/80`,children:n(`{{count}} tokens`,{count:vN(t.outputTokens)})})]}),t.reason&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{children:n(`Reason`)}),(0,G.jsx)(`dd`,{className:`min-w-0 whitespace-pre-wrap text-foreground/80`,children:t.reason})]})]})]})]})}function H6(e,t,n){if(e==null||t===void 0||t<=e)return null;let r=Math.max(0,t-n);return{remainingMs:r,fraction:Math.min(1,r/(t-e))}}function U6(e,t,n=z){let r=t-e;return r>=n?r:null}var W6={exit_nonzero:`Exit {{code}}`,deadline:`Killed at timeout`,stopped_by_user:`Stopped by you`,tty_required:`Needs terminal`,auth_required:`Needs login`,not_found:`Command not found`,not_executable:`Not executable`,binary_output:`Binary output`,output_truncated:`Log truncated`},G6={deadline:`Killed when its timeout was reached. Raise the timeout or run it in the background.`,tty_required:`Needs an interactive terminal. Use a non-interactive flag (such as --yes) or run it in your own terminal.`,auth_required:`Needs credentials. Sign in from your own terminal, then retry.`,not_found:`The program is not installed or not on PATH.`};function K6(e){return e?.kind===`deadline`?[`background`,`timeout`]:[]}function q6(e,t,n){let r=`\`\`\`\n${t}\n\`\`\``;return e===`background`?n(`Rerun this command with background: true:
|
|
249
|
-
|
|
250
|
-
{{command}}`,{command:r}):n(`Rerun this command with timeout: {{seconds}}:
|
|
251
|
-
|
|
252
|
-
{{command}}`,{seconds:600,command:r})}function J6(e,t,n){return t(e)?(n(),!0):!1}function Y6(){let[e,t]=(0,H.useState)(()=>Date.now());return(0,H.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),1e3);return()=>clearInterval(e)},[]),e}var X6=5,Z6=2*Math.PI*X6;function Q6({startedAt:e,deadlineAt:t,output:n}){let{t:r}=K(),i=Y6(),a=(0,H.useRef)({output:n,at:e??Date.now()});a.current.output!==n&&(a.current={output:n,at:Date.now()});let o=H6(e,t,i),s=U6(a.current.at,i);return!o&&s===null?null:(0,G.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-[10px] text-muted-foreground/70 tabular-nums`,children:[s!==null&&(0,G.jsx)(`span`,{"data-shell-quiet":!0,className:`rounded bg-muted px-1`,children:r(`No output for {{seconds}}s`,{seconds:Math.floor(s/1e3)})}),o&&o.remainingMs>0&&(0,G.jsxs)(`span`,{className:`flex items-center gap-0.5`,title:r(`Moves to background in {{seconds}}s`,{seconds:Math.ceil(o.remainingMs/1e3)}),children:[(0,G.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,"aria-hidden":`true`,children:[(0,G.jsx)(`circle`,{cx:`6`,cy:`6`,r:X6,fill:`none`,stroke:`currentColor`,opacity:`0.25`}),(0,G.jsx)(`circle`,{cx:`6`,cy:`6`,r:X6,fill:`none`,stroke:`currentColor`,strokeDasharray:Z6,strokeDashoffset:Z6*(1-o.fraction),transform:`rotate(-90 6 6)`})]}),Math.ceil(o.remainingMs/1e3),`s`]})]})}function $6(e,t){return e.kind===`exit_nonzero`&&e.exitCode===void 0?t(`Failed`):t(W6[e.kind],{code:e.exitCode??``})}function e8({failure:e}){let{t}=K();return(0,G.jsx)(`span`,{"data-shell-failure":e.kind,className:W(`shrink-0 rounded px-1 text-[10px]`,e.retryable?`bg-muted text-muted-foreground`:`bg-destructive/10 text-destructive`),children:$6(e,t)})}function t8({failure:e,command:t}){let{t:n}=K(),[r,i]=(0,H.useState)(!1);if(!e)return null;let a=G6[e.kind],o=K6(e);return(0,G.jsxs)(`div`,{"data-shell-status":e.kind,className:`mt-2 flex items-center gap-2 border-t border-current/10 pt-1.5 text-[11px] opacity-80`,children:[(0,G.jsx)(`span`,{className:`shrink-0 font-medium`,children:$6(e,n)}),a&&(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:n(a)}),o.map(e=>(0,G.jsx)(`button`,{type:`button`,"data-shell-rerun":e,onClick:()=>{J6(q6(e,t,n),Ek,wk)},className:`flex shrink-0 items-center gap-1 underline-offset-2 hover:underline hover:opacity-100`,children:e===`background`?n(`Rerun in background`):n(`Rerun with {{seconds}}s timeout`,{seconds:600})},e)),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),1e3)})},className:`ml-auto flex shrink-0 items-center gap-1 hover:opacity-100`,title:n(`Copy command`),children:[r?(0,G.jsx)(mt,{className:`h-3 w-3`}):(0,G.jsx)(Mt,{className:`h-3 w-3`}),n(`Copy command`)]})]})}function n8({icon:e,state:t}){let n=t===`running`||t===`reviewing`;return(0,G.jsxs)(`span`,{className:W(`relative flex size-[22px] shrink-0 items-center justify-center rounded-full border text-muted-foreground`,n&&`border-transparent text-brand`,t===`error`&&`border-destructive/40 text-destructive`),children:[(0,G.jsx)(e,{className:`size-3`}),n&&(0,G.jsx)(`span`,{className:`absolute -inset-px animate-spin rounded-full border-[1.5px] border-brand/20 border-t-brand`})]})}function r8({state:e}){return(0,G.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:e===`running`||e===`reviewing`?(0,G.jsx)(`span`,{className:`size-2.5 animate-spin rounded-full border-[1.5px] border-border border-t-brand`}):e===`error`?(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-destructive`}):(0,G.jsx)(`span`,{className:`size-1 rounded-full bg-current opacity-60`})})}var i8={queued:[`Queued`,`bg-muted-foreground`],running:[`running`,`bg-amber-500`],awaiting_input:[`awaiting input`,`bg-amber-500`],validating:[`validating`,`bg-amber-500`],succeeded:[`succeeded`,`bg-emerald-500`],failed:[`failed`,`bg-destructive`],cancelled:[`cancelled`,`bg-muted-foreground`],interrupted:[`interrupted`,`bg-muted-foreground`],creating:[`creating`,`bg-amber-500`],ready:[`idle`,`bg-muted-foreground`],active:[`running`,`bg-amber-500`],parked:[`parked`,`bg-muted-foreground`],closed:[`closed`,`bg-muted-foreground`]};function a8({view:e,titles:t}){let{t:n}=K();return(0,G.jsxs)(`div`,{className:`space-y-2 px-3 py-2 text-sm`,children:[e.kind===`report`&&e.text&&(0,G.jsx)(E4,{text:e.text}),e.kind===`report`&&e.value&&(0,G.jsx)(E4,{text:`\`\`\`json\n${e.value}\n\`\`\``}),e.kind===`report`&&e.error&&(0,G.jsx)(`p`,{className:`whitespace-pre-wrap text-destructive`,children:e.error}),e.runs.length>0&&(0,G.jsx)(`ul`,{className:`space-y-0.5 text-xs text-muted-foreground`,children:e.runs.map(e=>(0,G.jsx)(o8,{run:e,title:t?.[e.agentId]},e.runId||e.agentId))}),e.kind===`list`&&e.runs.length===0&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`No agents`)}),e.kind===`wait`&&e.timedOut&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Timed out; unfinished agents keep running`)}),e.kind===`wait`&&e.interrupted&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Wait was interrupted`)}),(0,G.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer hover:text-foreground`,children:n(`Run info`)}),(0,G.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap font-mono`,children:e.info})]}),e.head&&(0,G.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs text-muted-foreground`,children:e.head})]})}function o8({run:e,title:t}){let{t:n}=K(),[r,i]=i8[e.status]??[null,`bg-muted-foreground`],a=e.durationMs===null?``:n(`took {{duration}}`,{duration:yN(e.durationMs)});return(0,G.jsxs)(`li`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 shrink-0 rounded-full`,i)}),t&&(0,G.jsx)(`span`,{className:`truncate text-foreground`,children:t}),(0,G.jsx)(`span`,{className:`shrink-0`,children:[r?n(r):e.status,a].filter(Boolean).join(` · `)})]})}var s8=e=>!!e&&typeof e==`object`&&!Array.isArray(e),c8=e=>typeof e==`string`&&e.trim()?e:null;function l8(e){if(!s8(e))return null;let{agentId:t,runId:n,status:r,createdAt:i,startedAt:a,finishedAt:o}=e;if(typeof t!=`string`||typeof n!=`string`||typeof r!=`string`)return null;let s=typeof a==`number`?a:i;return{agentId:t,runId:n,status:r,durationMs:typeof o==`number`&&typeof s==`number`?Math.max(0,o-s):null}}var u8=new Set([`closed`,`parked`,`creating`]);function d8(e){if(!s8(e))return null;let{agentId:t,status:n,latestRun:r}=e;return typeof t!=`string`||typeof n!=`string`?null:(u8.has(n)?null:l8(r))??{agentId:t,runId:``,status:n,durationMs:null}}function f8(e,t){let n=BB(t);if(!n)return null;let{head:r,value:i}=n;if(e===`report`){let e=l8(i.run);if(!e)return null;let{text:t,value:n,error:a,...o}=i;return{kind:`report`,head:r,runs:[e],text:c8(t),value:n==null?null:JSON.stringify(n,null,2),error:c8(a),info:JSON.stringify(o,null,2)}}if(e===`list`){if(!Array.isArray(i.agents))return null;let e=i.agents.flatMap(e=>d8(e)??[]);return e.length===i.agents.length?{kind:`list`,head:r,runs:e,info:JSON.stringify(i,null,2)}:null}let a=e===`wait`?i:e===void 0?i.report:null;if(!s8(a)||!Array.isArray(a.runs))return(e===void 0||e===`resume`)&&i.report===void 0&&typeof i.agentId==`string`&&typeof i.runId==`string`?{kind:`receipt`,head:r,runs:[],info:JSON.stringify(i,null,2)}:null;let o=a.runs.flatMap(e=>l8(e)??[]);return o.length===a.runs.length?{kind:`wait`,head:r,runs:o,timedOut:a.timedOut===!0,interrupted:a.interrupted===!0,info:JSON.stringify(i,null,2)}:null}var p8={"restart-lost":`This subagent was started before EnsoCode restarted, and its record was lost in the restart`,"other-owner":`This subagent belongs to another conversation and cannot be controlled here`,"not-found":`This conversation has no subagent with this id (mistyped, or agentId and runId mixed up)`};function m8(e){let t=/^([a-z][a-z-]*):\s/u.exec(e?.trim()??``)?.[1];return t&&p8[t]||null}function h8({items:e,live:t=[],onOpen:n}){let{t:r}=K(),[i,a]=(0,H.useState)(!1);return(0,G.jsxs)(`div`,{"data-enso":`task-wrap-up`,"data-open":i?`true`:`false`,className:LN,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`flex w-full items-start gap-2 text-left hover:text-foreground`,children:[(0,G.jsx)(Jt,{className:RN}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:r(`{{count}} background tasks to wrap up: stop them or say why they keep running`,{count:e.length})})]}),i&&(0,G.jsx)(`ul`,{className:`mt-1.5 space-y-1.5 border-t border-border/60 pt-1.5`,children:e.map(e=>{let r=t.find(t=>t.taskId===e.taskId);return(0,G.jsx)(g8,{item:e,command:r?.command??e.command,onOpen:r?.status===`running`?n:void 0},e.taskId)})})]})}function g8({item:e,command:t,onOpen:n}){let{t:r}=K(),[i,a]=(0,H.useState)(!1);return(0,G.jsxs)(`li`,{"data-enso":`task-wrap-up-item`,"data-task-id":e.taskId,className:`flex min-w-0 gap-2`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`min-w-0 flex-1 text-left hover:text-foreground`,children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-foreground`,children:e.taskId}),e.ran&&(0,G.jsx)(`span`,{className:`shrink-0`,children:r(`Running for {{duration}}`,{duration:e.ran})})]}),(0,G.jsx)(`span`,{"data-enso":`task-wrap-up-command`,title:t,className:W(`block font-mono text-[11px]`,i?`whitespace-pre-wrap break-all`:`truncate`),children:t})]}),n&&(0,G.jsx)(`button`,{type:`button`,"data-enso":`task-wrap-up-open`,title:r(`Show in task bar`),"aria-label":r(`Show in task bar`),onClick:()=>n(e.taskId),className:`flex size-5 shrink-0 items-center justify-center rounded-[5px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(at,{className:`h-3.5 w-3.5`})})]})}function _8({command:e,output:t,failure:n}){let r=Ce(e=>e.terminalTheme),i=Ce(e=>e.terminalFontFamily),a=re(r)??ue;return(0,G.jsxs)(`div`,{"data-slot":`terminal-output`,className:`px-3 py-2 text-xs leading-relaxed`,style:{backgroundColor:a.background,"--terminal-bg":a.background,color:a.foreground,fontFamily:i},children:[(0,G.jsxs)(`div`,{className:`whitespace-pre-wrap [overflow-wrap:anywhere]`,children:[(0,G.jsx)(`span`,{style:{color:a.green},children:`$ `}),e]}),t&&(0,G.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap [overflow-wrap:anywhere]`,style:{fontFamily:`inherit`},children:s3(t)}),(0,G.jsx)(t8,{failure:n,command:e})]})}function v8(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(!(n.role!==`toolResult`||n.toolName!==`todo`||!n.todos))return n.todos.some(e=>e.status!==`completed`)?{id:n.toolCallId??String(t),todos:n.todos}:null}return null}function y8({todos:e}){return(0,G.jsx)(`ul`,{className:`space-y-0.5 text-xs`,children:e.map(e=>(0,G.jsxs)(`li`,{className:`flex items-start gap-1.5`,children:[e.status===`completed`?(0,G.jsx)(mt,{className:`mt-0.5 h-3 w-3 shrink-0 text-brand`}):e.status===`in_progress`?(0,G.jsx)(St,{className:`mt-0.5 h-3 w-3 shrink-0 text-brand`}):(0,G.jsx)(Et,{className:`mt-0.5 h-3 w-3 shrink-0 text-muted-foreground/50`}),(0,G.jsx)(`span`,{className:W(e.status===`completed`?`text-muted-foreground line-through`:e.status===`in_progress`?`font-medium`:`text-muted-foreground`),children:e.content})]},e.content))})}function b8({done:e,total:t,className:n}){return(0,G.jsx)(`div`,{className:W(`h-0.5 overflow-hidden rounded-full bg-border`,n),children:(0,G.jsx)(`div`,{className:`h-full rounded-full bg-brand transition-[width]`,style:{width:`${t?e/t*100:0}%`}})})}var x8=new Set;function S8({conversationId:e}){let{t}=K(),n=Ce(e=>e.pinUnfinishedTodos),r=NN(t=>t.conversations[e]?.messages),i=(0,H.useMemo)(()=>n&&r?v8(r):null,[n,r]),[a,o]=(0,H.useState)(!1),[,s]=(0,H.useState)(0);if(!i||x8.has(i.id))return null;let c=i.todos.filter(e=>e.status===`completed`).length,l=i.todos.find(e=>e.status===`in_progress`)??i.todos.find(e=>e.status===`pending`);return(0,G.jsxs)(`div`,{"data-enso":`todo`,className:`mb-1.5 rounded-xl border bg-card px-3 py-1.5 text-xs shadow-xs`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,G.jsx)(nn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`shrink-0 font-medium`,children:t(`Todos`)}),(0,G.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground tabular-nums`,children:[c,`/`,i.todos.length]}),!a&&l&&(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,title:l.content,children:l.content}),a?(0,G.jsx)(ht,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,G.jsx)(gt,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-muted-foreground`})]}),(0,G.jsx)(`button`,{type:`button`,title:t(`Hide until the todo list updates`),onClick:()=>{x8.add(i.id),s(e=>e+1)},className:`shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground`,children:(0,G.jsx)(er,{className:`h-3.5 w-3.5`})})]}),a&&(0,G.jsxs)(`div`,{className:`mt-1.5 max-h-48 overflow-y-auto pb-0.5`,children:[(0,G.jsx)(b8,{done:c,total:i.todos.length,className:`mb-2`}),(0,G.jsx)(y8,{todos:i.todos})]})]})}function C8({image:e,path:t,alt:n}){let{t:r}=K(),i=(0,H.useMemo)(()=>fz(e,t,!0),[e,t]),[a,o]=(0,H.useState)(!1);return!i||a?(0,G.jsx)(`p`,{"data-slot":`tool-image-missing`,className:`text-xs text-muted-foreground`,children:r(`Image unavailable`)}):(0,G.jsx)(UW,{src:i,alt:n,lazy:!0,onError:()=>o(!0),frameClassName:`block max-w-full`,className:`block max-h-64 max-w-full rounded-md border border-border/60 bg-muted/40 object-contain`})}function w8({image:e,output:t}){let{t:n}=K(),r=(0,H.useMemo)(()=>uz(t),[t]),i=[];return r?.path&&i.push([n(`Path`),r.path]),r?.width&&r.height&&i.push([n(`Dimensions`),`${r.width} × ${r.height}`]),r?.size!==null&&r?.size!==void 0&&i.push([n(`File size`),Zz(r.size)]),(0,G.jsxs)(`div`,{"data-slot":`image-view`,className:`space-y-2 px-3 py-2`,children:[(0,G.jsx)(C8,{image:e,path:r?.path,alt:r?.path??``}),i.length>0?(0,G.jsx)(`dl`,{className:`space-y-0.5 text-xs`,children:i.map(([e,t])=>(0,G.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[(0,G.jsx)(`dt`,{className:`shrink-0 text-muted-foreground`,children:e}),(0,G.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,children:t})]},e))}):null]})}function T8(){let e=NN(e=>e.conversations),t=Ce(e=>e.projects),n=yR(e=>e.secretary.board.todos),r=yR(e=>e.secretary.proposals);return{sessionTitle(t){return e[t]?.title?.trim()||void 0},projectName(e){let n=t.find(t=>t.id===e);return n?.alias?.trim()||n?.name?.trim()||void 0},todoText(e){return n.find(t=>t.id===e)?.text},proposal(e){let t=r[e];return t?{status:t.status,kind:t.kind}:void 0}}}function E8(e){let t=e.cardPeers??[];return[{name:e.name,args:e.args??null,output:e.output,state:e.state,...e.image?{image:e.image}:{}},...t.map(t=>({name:e.name,args:t.args??null,output:t.output,state:t.state,...t.image?{image:t.image}:{}}))]}function D8({item:e,framed:t=!1}){let{t:n,locale:r}=K(),i=T8(),a=NN(e=>e.conversations),o=yz(E8(e),{t:n,locale:r===`zh`?`zh`:`en`,lookup:i}),s=iB(o.cards.map(e=>e.state)),[c,l]=(0,H.useState)(!1),u=o.grouped?null:o.cards[0]??null;return(0,G.jsxs)(`div`,{"data-enso":`tool-card`,"data-tool":e.name,"data-open":c?`true`:`false`,"data-grouped":o.grouped?`true`:`false`,"data-count":o.cards.length,className:`my-0.5 w-full min-w-0 text-[13px]`,children:[(0,G.jsxs)(`button`,{type:`button`,"data-enso":`tool-card-expand`,"aria-expanded":c,onClick:()=>l(e=>!e),className:`group/step flex min-h-6 w-full min-w-0 items-center gap-2 text-left text-[13px] text-muted-foreground`,children:[(0,G.jsx)(r8,{state:s}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:o.grouped?o.title:u?.title}),u?.status?(0,G.jsx)(O8,{status:u.status}):null,(0,G.jsx)(gt,{className:W(`h-3 w-3 shrink-0 opacity-0 transition-[opacity,transform] group-hover/step:opacity-100`,c&&`rotate-90 opacity-100`)})]}),c&&o.grouped?o.cards.map((e,n)=>(0,G.jsx)(k8,{card:e,known:a,onOpen:m3,framed:t},`${e.title}-${n}`)):null,c&&u?(0,G.jsx)(A8,{card:u,known:a,onOpen:m3,framed:t}):null]})}function O8({status:e}){return(0,G.jsx)(`span`,{"data-enso":`tool-card-status`,"data-tone":e.tone,className:W(`shrink-0 rounded px-1 py-px text-[10px]`,e.tone===`error`&&`bg-destructive/15 text-destructive`,e.tone===`ok`&&`bg-success/15 text-success`,(e.tone===`queued`||e.tone===`pending`)&&`bg-warning/15 text-warning`,e.tone===`neutral`&&`bg-muted text-muted-foreground`),children:e.label})}function k8({card:e,known:t,onOpen:n,framed:r}){let[i,a]=(0,H.useState)(!1);return(0,G.jsxs)(`div`,{className:`pl-5`,children:[(0,G.jsxs)(`button`,{type:`button`,"data-enso":`tool-card-expand`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`group/step flex min-h-6 w-full min-w-0 items-center gap-2 text-left text-[13px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),e.status?(0,G.jsx)(O8,{status:e.status}):null,(0,G.jsx)(gt,{className:W(`h-3 w-3 shrink-0 opacity-0 transition-[opacity,transform] group-hover/step:opacity-100`,i&&`rotate-90 opacity-100`)})]}),i?(0,G.jsx)(A8,{card:e,known:t,onOpen:n,framed:r,nested:!0}):null]})}function A8({card:e,known:t,onOpen:n,framed:r,nested:i=!1}){let{t:a}=K(),[o,s]=(0,H.useState)(!1),c=(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-raw`,"aria-expanded":o,onClick:()=>s(e=>!e),className:`text-[11px] text-muted-foreground hover:text-foreground`,children:a(`View raw data`)}),l=o?(0,G.jsxs)(`div`,{className:W(`mt-1 space-y-1`,r&&`max-h-60 overflow-auto`),children:[e.rawArgs&&(0,G.jsx)(`pre`,{className:`overflow-auto font-mono text-[10px] leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:e.rawArgs}),e.rawOutput&&(0,G.jsx)(`pre`,{className:`overflow-auto font-mono text-[10px] leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:e.rawOutput})]}):null,u=(e,r)=>(0,G.jsx)(I8,{block:e,known:t,onOpen:n},`${e.kind}-${r}`);if(r){let t=[];e.blocks.forEach((e,n)=>{let r=e.kind===`prompt`,i=t.at(-1);!r&&i&&!i.prompt?i.blocks.push([e,n]):t.push({prompt:r,blocks:[[e,n]]})});let n=t.at(-1),r=!n||n.prompt,a=(0,G.jsxs)(`div`,{children:[c,l]});return(0,G.jsxs)(`div`,{"data-enso":`tool-card-body`,"data-framed":`true`,className:W(`mt-1 mb-1.5 min-w-0 overflow-hidden rounded-lg border border-border/70 bg-card text-[12px]`,!i&&`ml-5`),children:[t.map((e,t)=>(0,G.jsxs)(`div`,{className:W(`min-w-0`,t>0&&`border-t border-border/60`,!e.prompt&&`space-y-1.5 px-3 py-2`),children:[e.blocks.map(([e,t])=>e.kind===`prompt`?(0,G.jsx)(P8,{label:e.label,text:e.text},t):u(e,t)),!r&&e===n?a:null]},t)),r?(0,G.jsx)(`div`,{className:W(`px-3 py-2`,n&&`border-t border-border/60`),children:a}):null]})}return(0,G.jsxs)(`div`,{"data-enso":`tool-card-body`,className:`space-y-1 py-0.5 pl-5 text-[12px]`,children:[(0,G.jsx)(`div`,{className:`space-y-1`,children:e.blocks.map(u)}),(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-raw`,"aria-expanded":o,onClick:()=>s(e=>!e),className:`mt-1 text-[11px] text-muted-foreground hover:text-foreground`,children:a(`View raw data`)}),l]})}var j8={"--chat-h1-size":`1em`,"--chat-h2-size":`1em`,"--chat-h3-size":`1em`,"--chat-h4-size":`1em`,"--chat-code-block-size":`11px`},M8=4;function N8(e){let t=e.split(`
|
|
253
|
-
`).filter(e=>e.trim()&&!/^\s*(```|~~~)/.test(e)).map(e=>e.replace(/^\s*#{1,6}\s+/,``).trimEnd());return{preview:t.slice(0,M8).join(`
|
|
254
|
-
`),folded:t.length>M8||e.length>320}}function P8({label:e,text:t}){let{t:n}=K(),{preview:r,folded:i}=N8(t),[a,o]=(0,H.useState)(!1),s=a||!i;return(0,G.jsxs)(`section`,{"data-enso":`tool-card-prompt`,"data-open":s?`true`:`false`,className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 px-3 pt-1.5 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2.5`,children:[i&&(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-prompt-toggle`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`hover:text-foreground`,children:n(a?`Show less`:`Show full text`)}),(0,G.jsx)(js,{text:t,label:n(`Copy`)})]})]}),s?(0,G.jsx)(`div`,{"data-enso":`tool-card-prompt-body`,style:j8,className:`max-h-80 min-w-0 overflow-y-auto overscroll-contain px-3 pt-1 pb-2 text-xs leading-relaxed [&_:is(h1,h2,h3,h4)]:mt-2.5 [&_:is(h1,h2,h3,h4)]:mb-1 [&_[data-enso=code-block]>:first-child]:border-0`,children:(0,G.jsx)(E4,{text:t})}):(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-prompt-preview`,onClick:()=>o(!0),className:`line-clamp-4 block w-full min-w-0 px-3 pt-1 pb-2 text-left text-xs leading-relaxed text-muted-foreground break-words whitespace-pre-wrap`,children:r})]})}function F8({row:e}){let{t}=K(),[n,r]=(0,H.useState)(!1),i=e.display===`long`&&(e.value.length>120||e.value.includes(`
|
|
255
|
-
`));return(0,G.jsxs)(`div`,{className:`contents`,children:[(0,G.jsx)(`dt`,{className:`whitespace-nowrap text-muted-foreground`,children:e.label}),(0,G.jsxs)(`dd`,{"data-enso":`tool-card-kv-value`,"data-display":e.display,title:e.display===`path`?e.value:void 0,className:W(`min-w-0`,e.display===`path`?`truncate`:`whitespace-pre-wrap break-words`),children:[i&&!n?(0,G.jsx)(`span`,{className:`line-clamp-2`,children:e.value}):e.value,i&&(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-kv-toggle`,"aria-expanded":n,onClick:()=>r(e=>!e),className:`block text-[11px] text-muted-foreground hover:text-foreground`,children:t(n?`Show less`:`Show more`)})]})]})}function I8({block:e,known:t,onOpen:n}){let{t:r}=K(),[i,a]=(0,H.useState)(!1);if(e.kind===`error`)return(0,G.jsx)(`p`,{className:`rounded-md bg-destructive/10 px-2 py-1 text-destructive text-xs whitespace-pre-wrap`,children:e.text});if(e.kind===`note`)return(0,G.jsx)(`p`,{className:`whitespace-pre-wrap text-xs`,children:e.text});if(e.kind===`prompt`)return(0,G.jsx)(P8,{label:e.label,text:e.text});if(e.kind===`markdown`){let t=e.collapsed&&!i;return(0,G.jsxs)(`div`,{className:`text-sm`,children:[t?(0,G.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.text.split(`
|
|
256
|
-
`).find(e=>e.trim())}):(0,G.jsx)(E4,{text:e.text}),e.collapsed&&(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-fold`,onClick:()=>a(e=>!e),className:`text-[11px] text-muted-foreground hover:text-foreground`,children:r(i?`Show less`:`Show more`)})]})}return e.kind===`image`?(0,G.jsx)(`div`,{"data-enso":`tool-card-image`,children:(0,G.jsx)(C8,{image:e.image,path:e.path,alt:e.alt})}):e.kind===`session`?t[e.id]?(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-session`,"data-conversation-id":e.id,onClick:()=>n(e.id),className:`truncate text-left text-xs text-foreground underline-offset-2 hover:underline`,children:e.label}):(0,G.jsx)(`p`,{className:`text-xs`,children:e.label}):e.kind===`kv`?(0,G.jsx)(`dl`,{className:`grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-0.5 text-xs`,children:e.rows.map(e=>(0,G.jsx)(F8,{row:e},e.label))}):e.kind===`diff`?(0,G.jsx)(`div`,{className:`space-y-0.5 text-xs`,children:e.rows.map(e=>(0,G.jsxs)(`p`,{className:`min-w-0 break-words`,children:[(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.label,` `]}),(0,G.jsx)(`span`,{className:`text-muted-foreground line-through`,children:e.before}),(0,G.jsxs)(`span`,{children:[` → `,e.after]})]},e.label))}):e.kind===`list`?(0,G.jsx)(`ul`,{className:`space-y-0.5`,children:e.items.map((e,r)=>(0,G.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-1.5 text-xs`,children:[e.sessionId&&t[e.sessionId]?(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-session`,"data-conversation-id":e.sessionId,onClick:()=>n(e.sessionId),className:`min-w-0 truncate text-left hover:underline`,children:e.title}):(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title}),e.badge&&(0,G.jsx)(`span`,{"data-enso":`tool-card-badge`,"data-tone":e.badgeTone,className:W(`shrink-0 rounded px-1 py-px text-[10px]`,e.badgeTone===`error`&&`bg-destructive/15 text-destructive`,e.badgeTone===`ok`&&`bg-success/15 text-success`,e.badgeTone===`pending`&&`bg-warning/15 text-warning`,(!e.badgeTone||e.badgeTone===`neutral`||e.badgeTone===`queued`)&&`bg-muted text-muted-foreground`),children:e.badge}),e.detail&&(0,G.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:e.detail})]},`${e.title}-${r}`))}):null}var L8=(0,H.createContext)({report:()=>{},scroller:{current:null}}),R8=L8.Provider;function z8(){return(0,H.useContext)(L8)}var B8=(0,H.lazy)(()=>q(()=>import(`./EditDiff-B3HxLrbF.js`).then(e=>({default:e.EditDiff})),__vite__mapDeps([144,1,145,146]))),V8=(0,H.lazy)(()=>q(()=>import(`./ReadFileView-BFpGH-kK.js`).then(e=>({default:e.ReadFileView})),__vite__mapDeps([147,1,145,146]))),H8=(e,t)=>e===t||!!e&&!!t&&e.runMs===t.runMs&&e.turnMs===t.turnMs&&e.ttftMs===t.ttftMs&&e.tps===t.tps;function U8(e,t){let n=e??[],r=t??[];return n.length===r.length&&n.every((e,t)=>{let n=r[t];return n!==void 0&&e.key===n.key&&e.state===n.state&&e.output===n.output&&e.image?.data===n.image?.data&&JSON.stringify(e.args??null)===JSON.stringify(n.args??null)})}function W8(e,t){if(e.secretarySession!==t.secretarySession)return!1;let n=e.item,r=t.item;if(n===r)return!0;if(n.kind!==r.kind||n.key!==r.key)return!1;switch(n.kind){case`user`:return r.kind!==`user`||n.text!==r.text||n.images.length!==r.images.length||n.timestamp!==r.timestamp||n.deliveryState!==r.deliveryState||n.turnDurationMs!==r.turnDurationMs||n.collapsed!==r.collapsed||n.canCollapse!==r.canCollapse||n.hostTaskWrapUp!==r.hostTaskWrapUp?!1:n.images.every((e,t)=>e===r.images[t]);case`text`:case`thinking`:return r.kind===n.kind&&n.text===r.text&&n.streaming===r.streaming&&(n.kind!==`text`||r.kind===`text`&&H8(n.perf,r.perf)&&n.timestamp===r.timestamp&&n.turnDurationMs===r.turnDurationMs)&&(n.kind!==`thinking`||r.kind===`thinking`&&n.durationMs===r.durationMs);case`tool`:return r.kind===`tool`&&n.state===r.state&&n.name===r.name&&n.summary===r.summary&&n.output===r.output&&n.edits===r.edits&&n.writeContent===r.writeContent&&n.fileChanges===r.fileChanges&&n.imagePath===r.imagePath&&n.image?.data===r.image?.data&&n.image?.mimeType===r.image?.mimeType&&n.generatedImages===r.generatedImages&&n.todos===r.todos&&n.durationMs===r.durationMs&&n.startedAt===r.startedAt&&n.agentMeta===r.agentMeta&&n.source===r.source&&n.nestedPending===r.nestedPending&&JSON.stringify(n.sandbox)===JSON.stringify(r.sandbox)&&n.rtk===r.rtk&&n.approvalReview===r.approvalReview&&n.plan?.title===r.plan?.title&&n.plan?.text===r.plan?.text&&n.sentMessage===r.sentMessage&&n.memoryContent===r.memoryContent&&n.ask?.question===r.ask?.question&&n.ask?.options.join(`
|
|
257
|
-
`)===r.ask?.options.join(`
|
|
258
|
-
`)&&n.ask?.answer===r.ask?.answer&&n.ask?.autoSelected===r.ask?.autoSelected&&n.subagentOp===r.subagentOp&&JSON.stringify(n.subagentTitles)===JSON.stringify(r.subagentTitles)&&n.waiting===r.waiting&&n.pluginArtifacts===r.pluginArtifacts&&n.shellFailure===r.shellFailure&&JSON.stringify(n.args??null)===JSON.stringify(r.args??null)&&U8(n.cardPeers,r.cardPeers);case`tool-group`:return r.kind===`tool-group`&&n.expanded===r.expanded&&n.count===r.count&&n.stats.commands===r.stats.commands&&n.stats.reads===r.stats.reads&&n.stats.searches===r.stats.searches&&n.stats.others===r.stats.others&&n.exploring===r.exploring&&n.live===r.live&&n.activity?.thinking===r.activity?.thinking&&n.activity?.workedMs===r.activity?.workedMs&&n.explore?.goal===r.explore?.goal&&n.explore?.report===r.explore?.report&&n.explore?.steps===r.explore?.steps&&n.notice===r.notice;case`error`:return r.kind===`error`&&n.text===r.text;case`interrupted`:return r.kind===`interrupted`&&n.at===r.at&&n.exitKind===r.exitKind&&n.unfinishedTools.length===r.unfinishedTools.length;case`task-note`:return r.kind===`task-note`&&n.detail===r.detail;case`compaction`:case`compaction-notice`:return(r.kind===`compaction`||r.kind===`compaction-notice`)&&n.kind===r.kind&&n.summary===r.summary&&n.tokensBefore===r.tokensBefore&&n.tokensAfter===r.tokensAfter&&n.verified===r.verified;case`compaction-progress`:return r.kind===`compaction-progress`&&n.state===r.state;case`session-custom`:return r.kind===`session-custom`&&n.entry===r.entry;case`divider`:return r.kind===`divider`&&n.text===r.text;case`plugin-message`:return r.kind===`plugin-message`&&n.text===r.text&&n.pluginId===r.pluginId;case`resumed-reply`:return r.kind===`resumed-reply`&&n.expanded===r.expanded&&n.text===r.text&&n.thinking===r.thinking&&n.tools.length===r.tools.length;case`discarded-turn`:return r.kind===`discarded-turn`&&n.expanded===r.expanded&&n.reason===r.reason&&n.messages.length===r.messages.length&&n.messages.every((e,t)=>e===r.messages[t])&&n.tools.length===r.tools.length}}var G8=/^<role>\n?([\s\S]*?)\n?<\/role>\s*/,K8=/^<workspace-migrated>\n?([\s\S]*?)\n?<\/workspace-migrated>\s*/,q8=/^<workspace-branch-changed>\n?([\s\S]*?)\n?<\/workspace-branch-changed>\s*/;function J8({note:e}){let{t}=K(),n=/on Git branch ("(?:[^"\\]|\\.)*")/.exec(e)?.[1],r=``;try{r=n?String(JSON.parse(n)):``}catch{}return(0,G.jsxs)(`aside`,{title:e,className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(Kt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 break-all`,children:r?t(`Workspace switched to branch {{branch}}`,{branch:r}):t(`Workspace switched branch`)})]})}function Y8({items:e}){let t=ON(),n=NN(e=>t?void 0:M5(e)?.id),r=NN(e=>t?void 0:M5(e)?.backgroundTasks);return(0,G.jsx)(h8,{items:e,live:r,onOpen:n?e=>NN.setState({pendingAgentOpen:{sessionId:n,agentId:e}}):void 0})}function X8({note:e}){let{t}=K(),n=/(?:moved to|main working tree): (.+)$/m.exec(e)?.[1]?.trim(),r=e.includes(`main working tree`);return(0,G.jsxs)(`aside`,{title:e,className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(Kt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsxs)(`span`,{className:`min-w-0`,children:[t(r?`Workspace fell back to the main working tree`:`Workspace moved to an isolated worktree`),n&&(0,G.jsx)(`span`,{className:`ml-1.5 break-all font-mono text-[11px] opacity-80`,children:n})]})]})}function Z8({note:e}){let{t}=K();return(0,G.jsxs)(`aside`,{className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(Ot,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0`,children:t(e===`on`?`Plan mode on: read-only research, then a plan for your approval`:e===`off`?`Plan mode off`:`Context compacted: the approved plan was attached again`)})]})}function Q8({note:e}){let{t}=K(),n=e===`on`;return(0,G.jsxs)(`aside`,{className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[n?(0,G.jsx)(Lt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}):(0,G.jsx)(Xn,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0`,children:t(n?`Unattended mode on: no one is watching, so it decides and keeps going`:`Unattended mode off: a person is available again`)})]})}function $8({tag:e,body:t}){let n=e===`agent-notification`?Z3(t):null;return n?(0,G.jsx)(r5,{notices:n}):(0,G.jsx)(i5,{tag:e,body:t})}function e5({goal:e,instructions:t}){let{t:n}=K(),[r,i]=(0,H.useState)(!1),a=$H(e);return(0,G.jsxs)(`div`,{"data-enso":`goal-continuation`,"data-open":r?`true`:`false`,className:W(`my-1 w-full min-w-0`,PN),children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>i(e=>!e),className:`flex w-full min-w-0 items-center gap-2 text-left text-muted-foreground hover:text-foreground`,children:[(0,G.jsx)(FN,{}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n(`Continue goal: {{summary}}`,{summary:a||e})})]}),r&&(0,G.jsxs)(`div`,{className:`mt-1.5 space-y-1.5 border-t border-border/60 pt-1.5`,children:[(0,G.jsx)(`p`,{className:`whitespace-pre-wrap text-foreground`,children:e}),t&&(0,G.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-[11px] leading-relaxed text-muted-foreground`,children:t})]})]})}function t5({enso:e,icon:t,title:n,body:r}){let[i,a]=(0,H.useState)(!1);return(0,G.jsxs)(`div`,{"data-enso":e,"data-open":i?`true`:`false`,className:LN,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`flex w-full items-start gap-2 text-left enabled:hover:text-foreground`,children:[(0,G.jsx)(t,{className:RN}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n})]}),i&&r&&(0,G.jsx)(`p`,{className:`mt-1.5 whitespace-pre-wrap text-foreground`,children:r})]})}function n5({segments:e,searchQuery:t,activeNth:n}){let{t:r}=K();return(0,G.jsx)(G.Fragment,{children:e.map((e,i)=>{let a=`${e.kind}-${i}`;if(e.kind===`text`){let r=e.text.trim();return r?(0,G.jsx)(b5,{text:r,searchQuery:t,activeNth:n},a):null}if(e.kind===`goal`)return(0,G.jsx)(e5,{goal:e.goal,instructions:e.instructions},a);if(e.kind===`schedule`){let t=oU(e.raw),n=t.length>0?t:[{summary:``,body:``}];return(0,G.jsx)(H.Fragment,{children:n.map((e,t)=>(0,G.jsx)(t5,{enso:`secretary-schedule-card`,icon:tt,title:e.summary?r(`Scheduled: {{summary}}`,{summary:e.summary}):r(`Scheduled`),body:e.body},t))},a)}if(e.kind===`updates`){let t=PU(e.raw);if(t)return(0,G.jsx)(o5,{lines:t},a);let n=sU(e.raw);return(0,G.jsx)(t5,{enso:`session-updates-card`,icon:un,title:n.summary?r(`Session updates: {{summary}}`,{summary:n.summary}):r(`Session updates`),body:n.body},a)}return(0,G.jsx)($8,{tag:e.tag,body:e.body},a)})})}function r5({notices:e}){let{t}=K(),[n,r]=(0,H.useState)(!1);return(0,G.jsxs)(`div`,{className:IN,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full items-start gap-2 px-3 py-2 text-left hover:text-foreground`,children:[(0,G.jsx)(ut,{className:RN}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.map(e=>e.header).join(` · `)})]}),n&&e.map((n,r)=>(0,G.jsxs)(`div`,{className:`border-border/60 border-t`,children:[e.length>1&&(0,G.jsx)(`p`,{className:`truncate px-3 pt-2`,children:n.header}),n.report&&(0,G.jsx)(`div`,{className:`max-h-80 overflow-auto px-3 py-2 text-sm text-foreground`,children:(0,G.jsx)(E4,{text:n.report})}),n.usage&&(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 border-border/60 border-t px-3 py-1 text-[10px]`,children:[(0,G.jsx)(`span`,{className:`font-semibold tracking-wide text-foreground/75`,children:`Subagent`}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{children:t(`{{count}} tokens`,{count:vN(n.usage.tokens)})}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{children:t(`{{count}} tool calls`,{count:n.usage.toolUses})}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{children:yN(n.usage.durationMs)})]}),n.tasks&&(0,G.jsxs)(`div`,{className:`border-border/60 border-t px-3 py-1 text-[11px]`,children:[(0,G.jsx)(`p`,{className:`text-foreground/75`,children:t(`Background tasks started by this subagent`)}),n.tasks.map(e=>(0,G.jsx)(`p`,{className:`truncate font-mono text-muted-foreground`,children:e},e))]})]},r))]})}function i5({tag:e,body:t}){let[n,r]=(0,H.useState)(!1),i=rU(t);if(!i)return null;let a=i.indexOf(`
|
|
259
|
-
`),o=a>0,s=e.startsWith(`coworker-`)||e===`agent-notification`?ut:Un;return(0,G.jsxs)(`div`,{className:LN,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:!o,onClick:()=>r(e=>!e),className:`flex w-full items-start gap-2 text-left enabled:hover:text-foreground`,children:[(0,G.jsx)(s,{className:RN}),(0,G.jsx)(`span`,{className:W(`min-w-0 flex-1`,o?`truncate`:`whitespace-pre-wrap`),children:o?i.slice(0,a):i})]}),o&&n&&(0,G.jsx)(`pre`,{className:`mt-1.5 max-h-80 overflow-auto font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words`,children:i.slice(a+1)})]})}var a5={"goal-complete":mt,"goal-blocked":bt,"needs-user":Xn,"turn-ended":un,failed:Tt,stalled:Jt,interrupted:On,proposal:Dt,schedule:tt,pending:Jt,"ask-relay":sn,leftover:Jt};function o5({lines:e}){return(0,G.jsx)(`div`,{"data-enso":`secretary-updates`,className:W(IN,`divide-y divide-border/60`),children:e.map((e,t)=>(0,G.jsx)(s5,{line:e,onOpen:m3},t))})}function s5({line:e,onOpen:t}){let{t:n}=K(),[r,i]=(0,H.useState)(!1),a=a5[e.kind],o=`conversationId`in e?e.conversationId:void 0,s=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(a,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:e.text})]});return(0,G.jsxs)(`div`,{"data-enso":`secretary-update`,"data-open":r?`true`:`false`,className:`px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[e.detail?(0,G.jsx)(`button`,{type:`button`,"data-enso":`secretary-update-expand`,"aria-expanded":r,onClick:()=>i(e=>!e),className:`flex min-w-0 flex-1 items-start gap-2 text-left hover:text-foreground`,children:s}):(0,G.jsx)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,children:s}),o&&t?(0,G.jsx)(`button`,{type:`button`,"data-enso":`secretary-update-open`,title:n(`Open session`),"aria-label":n(`Open session`),onClick:e=>{e.stopPropagation(),t(o)},className:`-mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-[5px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(at,{className:`h-3.5 w-3.5`})}):null]}),e.detail&&r&&(0,G.jsx)(`pre`,{className:`mt-1.5 ml-5.5 max-h-60 overflow-auto font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words`,children:e.detail})]})}var c5=/^<message-from-main-agent>\n?([\s\S]*?)\n?<\/message-from-main-agent>\s*$/;function l5(e){let t=G8.exec(e);return c5.test(t?e.slice(t[0].length):e)}function u5({name:e,content:t}){let{t:n}=K();return(0,G.jsxs)(pD,{children:[(0,G.jsxs)(hD,{className:Qk(`skill`,!0),children:[(0,G.jsx)(zn,{className:`h-3 w-3`}),e]}),(0,G.jsxs)(vD,{className:`max-w-lg`,children:[(0,G.jsx)(yD,{children:(0,G.jsxs)(xD,{className:`text-base`,children:[n(`Skill`),` · `,e]})}),(0,G.jsx)(wD,{className:`max-h-[50vh] text-sm`,children:(0,G.jsx)(E4,{text:t})})]})]})}function d5({chip:e,extra:t}){return(0,G.jsxs)(`div`,{className:`max-w-[80%] rounded-2xl rounded-br-md bg-muted px-4 py-2.5 text-sm`,children:[(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,children:e}),t?(0,G.jsx)(`div`,{className:`mt-1.5 whitespace-pre-wrap break-words leading-relaxed`,children:t}):null]})}function f5({blocks:e,hostTaskWrapUp:t}){let n=Bk(e.rest),r=t?Vk(e.rest):void 0,i=(0,G.jsx)(d5,{chip:(0,G.jsx)(`span`,{className:`inline-flex flex-wrap gap-1 align-middle`,children:e.skills.map(e=>(0,G.jsx)(u5,{name:e.name,content:e.body},e.location))}),extra:n.rest.trim()});return!n.plan&&!n.unattended&&!r?i:(0,G.jsxs)(G.Fragment,{children:[n.plan&&(0,G.jsx)(Z8,{note:n.plan}),n.unattended&&(0,G.jsx)(Q8,{note:n.unattended}),r&&(0,G.jsx)(Y8,{items:r.items}),i]})}function p5({text:e}){let t=Gk(e);if(t.names.length>1)return(0,G.jsx)(d5,{chip:(0,G.jsx)(`span`,{className:`inline-flex flex-wrap gap-1 align-middle`,children:t.names.map(e=>(0,G.jsx)($k,{name:`/skill:${e}`},e))}),extra:t.rest});let n=Yk(e);return n.slash?(0,G.jsx)(d5,{chip:(0,G.jsx)($k,{name:n.slash}),extra:n.rest.trim()}):null}function m5({preset:e}){let{t}=K();return(0,G.jsxs)(`div`,{className:`min-w-64 max-w-[80%] overflow-hidden rounded-2xl rounded-br-md bg-muted text-sm`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3.5 py-2.5`,children:[(0,G.jsx)(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-info/15 text-info`,children:(0,G.jsx)(Qn,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:t(`Workflow preset`)}),(0,G.jsx)(`p`,{className:`truncate font-medium`,title:e.id,children:e.name||e.id})]})]}),e.args.length>0&&(0,G.jsx)(`dl`,{className:`space-y-1 border-t border-border/60 px-3.5 py-2 text-xs`,children:e.args.map(([e,t])=>(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(`dt`,{className:`shrink-0 font-mono text-muted-foreground`,children:e}),(0,G.jsx)(`dd`,{className:`min-w-0 whitespace-pre-wrap break-words`,children:t})]},e))})]})}function h5({kind:e,label:t,title:n}){let r=e===`file`?Bt:e===`chat`?On:Bn;return(0,G.jsxs)(`span`,{className:W(aA(e),`mx-0.5 max-w-52 rounded-md px-1.5 align-middle leading-4`),title:n,children:[(0,G.jsx)(r,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate`,children:t})]})}function g5({label:e,sessionFile:t}){let n=GU(NN(e=>e.conversations),t);return n?(0,G.jsxs)(`button`,{type:`button`,"data-enso":`chat-ref`,onClick:()=>m3(n),title:t,className:W(aA(`chat`),`mx-0.5 inline-flex max-w-52 items-center gap-1 rounded-md px-1.5 align-middle leading-4 hover:bg-muted`),children:[(0,G.jsx)(On,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate`,children:e})]}):(0,G.jsx)(h5,{kind:`chat`,label:e,title:t})}function _5({text:e,searchQuery:t=``,activeNth:n=-1}){let r=DA(pA(e)),i={n:0};return(0,G.jsx)(`span`,{className:`whitespace-pre-wrap`,children:r.map((e,r)=>e.type===`file`?(0,G.jsx)(z2,{path:e.path,children:(0,G.jsx)(h5,{kind:`file`,label:MA(e.path),title:e.path})},r):e.type===`chat`?(0,G.jsx)(g5,{label:e.label,sessionFile:e.sessionFile},r):e.type===`ui-element`?(0,G.jsx)(h5,{kind:`ui-element`,label:e.label,title:`${e.path}${e.text?` · ${e.text}`:``}`},r):(0,G.jsx)(`span`,{children:t.trim()?hH(e.text,t,n,i):e.text},r))})}function v5({files:e,chats:t}){return(0,G.jsxs)(`span`,{className:`mt-1.5 flex flex-wrap gap-1.5`,children:[e.map(e=>(0,G.jsx)(z2,{path:e,children:(0,G.jsx)(h5,{kind:`file`,label:MA(e),title:e})},`f:${e}`)),t.map(e=>(0,G.jsx)(h5,{kind:`chat`,label:e.label,title:e.sessionFile},`c:${e.sessionFile}`))]})}var y5=`max-w-[82%] rounded-[10px] bg-muted px-3.5 py-[9px] text-(length:--chat-body-size) leading-[1.6]`;function b5({text:e,searchQuery:t=``,activeNth:n=-1,thumbnails:r=0,align:i=`end`,hostTaskWrapUp:a=!1}){let{t:o}=K(),s=ON(),c=!!(s?.speaker||s?.botSession),l=KH(e,r);if(l)return(0,G.jsxs)(G.Fragment,{children:[l.text&&(0,G.jsx)(b5,{text:l.text,searchQuery:t,activeNth:n,hostTaskWrapUp:a}),(0,G.jsx)(KW,{entries:l.entries,thumbnails:r,align:i})]});let d=XH(e);if(d)return(0,G.jsx)(O4,{message:d});let f=c?AH(e):null;if(f)return(0,G.jsx)(UU,{message:f});let p=c?EH(e):e;if(p!==e)return(0,G.jsx)(b5,{text:p,searchQuery:t,activeNth:n,hostTaskWrapUp:a});let m=c?SH(e):null;if(m?.refs.length)return(0,G.jsxs)(`div`,{className:`flex w-full flex-col items-end gap-1.5`,children:[m.body&&(0,G.jsx)(b5,{text:m.body,searchQuery:t,activeNth:n}),(0,G.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:m.refs.map(e=>(0,G.jsxs)(`span`,{title:o(`Referenced chat`),className:`inline-flex h-6 max-w-56 items-center gap-1 rounded-md bg-muted px-1.5 text-xs`,children:[(0,G.jsx)(un,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title})]},e.id))})]});let h=D(e);if(h.note){let e=h.rest.trim();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Z8,{note:h.note}),e&&(0,G.jsx)(b5,{text:e,searchQuery:t,activeNth:n,hostTaskWrapUp:a})]})}let g=Nk(e);if(g.note){let e=g.rest.trim();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Q8,{note:g.note}),e&&(0,G.jsx)(b5,{text:e,searchQuery:t,activeNth:n,hostTaskWrapUp:a})]})}let _=a?Rk(e):null;if(_){let e=_.rest.trim();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Y8,{items:_.items}),e&&(0,G.jsx)(b5,{text:e,searchQuery:t,activeNth:n})]})}let v=q8.exec(e);if(v){let r=e.slice(v[0].length).trim();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(J8,{note:v[1]??``}),r&&(0,G.jsx)(b5,{text:r,searchQuery:t,activeNth:n})]})}let y=u(e);if(y?.kind===`approved`)return(0,G.jsxs)(`div`,{className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(Dt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsxs)(`span`,{className:`min-w-0`,children:[o(`Plan approved, executing`),(0,G.jsx)(`span`,{className:`ml-1.5 text-foreground`,children:y.title})]})]});if(y?.kind===`feedback`)return(0,G.jsxs)(`div`,{className:W(y5,`whitespace-pre-wrap`),children:[(0,G.jsxs)(`p`,{className:`mb-1 flex items-center gap-1 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:[(0,G.jsx)(Ot,{className:`h-3 w-3`}),o(`Plan feedback`)]}),(0,G.jsx)(_5,{text:y.feedback,searchQuery:t,activeNth:n})]});let b=gA(e);if(b)return(0,G.jsx)(m5,{preset:b});let x=FA(e);if(x.files.length>0||x.chats.length>0){let e=Yk(x.body);return(0,G.jsxs)(`div`,{className:y5,children:[e.slash?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)($k,{name:e.slash}),e.rest.trim()?(0,G.jsx)(`span`,{className:`ml-1.5 align-middle`,children:(0,G.jsx)(_5,{text:e.rest.trim(),searchQuery:t,activeNth:n})}):null]}):(0,G.jsx)(_5,{text:x.body,searchQuery:t,activeNth:n}),(0,G.jsx)(v5,{files:x.files,chats:x.chats})]})}let S=Kk(e);if(S)return(0,G.jsx)(f5,{blocks:S,hostTaskWrapUp:a});if(Yk(e).slash)return(0,G.jsx)(p5,{text:e});let C=K8.exec(e);if(C){let r=e.slice(C[0].length).trim();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(X8,{note:C[1]}),r&&(0,G.jsx)(b5,{text:r,searchQuery:t,activeNth:n})]})}let w=tU(e);if(w)return(0,G.jsx)(n5,{segments:w,searchQuery:t,activeNth:n});let T=PU(e);if(T)return(0,G.jsx)(o5,{lines:T});let E=G8.exec(e),O=E?e.slice(E[0].length):e,k=c5.exec(O),A=k?k[1]:O;return(0,G.jsxs)(`div`,{className:W(k?`max-w-[80%] rounded-2xl rounded-bl-md border border-blue-500/20 bg-blue-500/8 px-4 py-2.5 text-sm`:W(y5,`whitespace-pre-wrap`)),children:[k&&(0,G.jsxs)(`p`,{className:`mb-1 flex items-center gap-1 text-[10px] font-medium tracking-wide text-blue-600 uppercase dark:text-blue-400`,children:[(0,G.jsx)(ut,{className:`h-3 w-3`}),o(`From main agent`)]}),E?.[1]&&!NH(E[1])&&(0,G.jsxs)(`div`,{className:`mb-2 rounded-md bg-background/60 px-2.5 py-1.5 text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`font-semibold`,children:o(`Role`)}),` · `,E[1]]}),k?(0,G.jsx)(E4,{text:A,searchQuery:t,activeNth:n}):(0,G.jsx)(_5,{text:A,searchQuery:t,activeNth:n})]})}function x5(e){return e.kind===`tool-group`||e.kind===`thinking`||e.kind===`tool`&&PV(e)}var S5=`text-[color:var(--subtle-foreground,var(--muted-foreground))]`,C5=`animate-pulse motion-reduce:animate-none`;function w5({model:e,at:t,privacyMask:n,secretarySession:r=!1,face:i}){let a=ON(),o=xR(),s=r?i??o:null,c=a?.speaker??(a?null:s),l=!a&&s?!0:void 0,u=[e,typeof t==`number`?X5(t):null].filter(Boolean).join(` · `);return!c&&!u&&!n?null:(0,G.jsxs)(`div`,{className:`mb-2 flex h-6 min-w-0 items-center gap-2 text-xs select-none`,children:[c&&(c.image?(0,G.jsx)(`img`,{"data-enso":l?`secretary-chat-avatar`:void 0,"data-image":l?`true`:void 0,src:c.image,alt:``,draggable:!1,className:`size-[22px] shrink-0 rounded-full object-cover`,style:{backgroundColor:c.color}}):l?(0,G.jsx)(OL,{name:c.name,color:c.color,enso:`secretary-chat-avatar`,className:`size-[22px] rounded-full`}):(0,G.jsx)(`span`,{className:`flex size-[22px] shrink-0 items-center justify-center rounded-full font-semibold text-[11px] text-white`,style:{backgroundColor:c.color},children:[...c.name.trim()][0]?.toUpperCase()??`?`})),c&&(0,G.jsx)(`span`,{className:`shrink-0 truncate text-[13px] font-semibold text-foreground`,children:c.name}),u&&(0,G.jsx)(`span`,{className:W(`min-w-0 truncate text-[11.5px]`,S5),children:u}),n&&(0,G.jsx)(R6,{report:n})]})}var T5=(0,H.memo)(function({item:e,secretarySession:t=!1,onToggleGroup:n,onToggleTurn:r}){let i=dH(),a=i.query,o=i.activeKey===e.key?i.activeNth:-1,s=t;switch(e.kind){case`user`:{let t=e.text?l5(e.text):!1,n=e.collapsed===!0,i=e.hostTaskWrapUp?Hk(e.text):e.text;return(0,G.jsxs)(`div`,{"data-enso":`message-user`,className:W(`group/user flex flex-col gap-1.5`,t?`items-start`:`items-end`),children:[e.images.map((e,t)=>(0,G.jsx)(UW,{src:`data:${e.mimeType};base64,${e.data}`,className:`max-h-48 max-w-full rounded-lg border object-contain`},t)),e.text&&(0,G.jsx)(b5,{text:e.text,searchQuery:a,activeNth:o,thumbnails:e.images.length,align:t?`start`:`end`,hostTaskWrapUp:e.hostTaskWrapUp===!0}),n?(0,G.jsx)(W5,{turnKey:e.key,text:i,timestamp:e.timestamp,turnDurationMs:e.turnDurationMs,onToggle:r}):(0,G.jsx)(K5,{turnKey:e.key,messageIndex:Number(e.key),text:i,timestamp:e.timestamp,deliveryState:e.deliveryState,canCollapse:e.canCollapse,onToggleTurn:r})]})}case`text`:return(0,G.jsx)(q5,{item:e,searchQuery:a,activeNth:o});case`thinking`:return(0,G.jsx)($5,{itemKey:e.key,text:e.text,streaming:e.streaming,durationMs:e.durationMs,startedAt:e.startedAt});case`tool`:{let t=hW(e),n=mz(e.name,s),r=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(BO,{name:e.name,output:e.output,state:e.state}),n?(0,G.jsx)(D8,{item:e,framed:s}):(0,G.jsx)(ane,{item:e}),t?(0,G.jsx)(bW,{proposalId:t}):null,e.pluginArtifacts?(0,G.jsx)(P3,{artifacts:e.pluginArtifacts,align:n?`card`:`tool-row`}):null]});return n?(0,G.jsx)(`div`,{"data-enso":`tool-card-pair`,className:`w-full min-w-0`,children:r}):r}case`tool-group`:return(0,G.jsx)(r7,{item:e,onToggle:n});case`error`:return(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-sm text-destructive`,children:[(0,G.jsx)(bt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap`,children:e.text}),(0,G.jsx)(I5,{})]});case`interrupted`:return(0,G.jsx)(P5,{item:e});case`task-note`:return(0,G.jsx)(e7,{item:e});case`compaction`:case`compaction-notice`:return(0,G.jsx)(n7,{item:e});case`compaction-progress`:return(0,G.jsx)(t7,{state:e.state});case`session-custom`:return(0,G.jsx)(j5,{entry:e.entry});case`plugin-message`:return(0,G.jsx)(O5,{item:e});case`discarded-turn`:return(0,G.jsx)(k5,{item:e,onToggle:n});case`resumed-reply`:return(0,G.jsx)(A5,{item:e,onToggle:n});case`divider`:return(0,G.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`h-px flex-1 bg-border`}),e.text,(0,G.jsx)(`span`,{className:`h-px flex-1 bg-border`})]})}},W8),E5=e=>{if(typeof e==`string`)return e;if(e===void 0)return`—`;try{return JSON.stringify(e)}catch{return String(e)}};function D5({entry:e}){let{t}=K(),n=n3(),r=n.get(e.accountKey),i=e.previousAccountKey?n.get(e.previousAccountKey):void 0,a=e.previousAccountKey?i&&r?t(`ChatGPT account switched: {{previous}} → {{current}}`,{previous:i,current:r}):t(`ChatGPT account switched`):r?t(`ChatGPT account selected: {{account}}`,{account:r}):t(`ChatGPT account selected`);return(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-border/60 bg-muted/20 px-2.5 py-2 text-xs`,children:[(0,G.jsx)(Dn,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-primary`}),(0,G.jsx)(`p`,{className:`min-w-0 break-words text-muted-foreground`,children:a})]})}function O5({item:e}){let{t}=K();return(0,G.jsxs)(`div`,{"data-plugin-message":e.pluginId,className:`rounded-md border border-dashed border-border bg-muted/20 px-3 py-2 text-xs`,children:[(0,G.jsxs)(`p`,{className:`mb-1 flex items-center gap-1.5 text-muted-foreground`,children:[(0,G.jsx)(B3,{pluginId:e.pluginId,className:`h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:t(`From plugin {{name}}`,{name:e.pluginName})}),(0,G.jsx)(`span`,{className:`font-mono opacity-70`,children:e.pluginId})]}),(0,G.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-foreground`,children:e.text})]})}function k5({item:e,onToggle:t}){let{t:n}=K();return(0,G.jsxs)(`div`,{"data-discarded-turn":e.pluginId,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t?.(e.key),"data-enso":`tool-row`,className:W(`group/step flex min-h-6 w-full items-center gap-2 text-left text-[13px] transition-colors hover:text-foreground`,S5),children:[(0,G.jsx)(In,{className:`h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground group-hover/step:text-foreground`,children:ks(`turn_discard`,n)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.pluginName,e.reason].filter(Boolean).join(` · `)}),(0,G.jsx)(gt,{className:W(`h-3 w-3 shrink-0 transition-transform`,e.expanded&&`rotate-90`)})]}),e.expanded&&(0,G.jsxs)(`div`,{className:`t-acc-reveal mt-1 mb-1.5 ml-5 space-y-2 rounded-md border border-dashed border-border bg-muted/20 px-3 py-2 text-xs`,children:[(0,G.jsxs)(`p`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,G.jsx)(B3,{pluginId:e.pluginId,className:`h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:n(`From plugin {{name}}`,{name:e.pluginName})})]}),e.messages.map((e,t)=>(0,G.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-foreground`,children:e},t)),e.tools.map((e,t)=>(0,G.jsxs)(`p`,{className:W(`truncate`,S5),children:[ks(e.name,n),` `,e.summary]},t))]})]})}function A5({item:e,onToggle:t}){let{t:n}=K();return(0,G.jsxs)(`div`,{"data-resumed-reply":``,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t?.(e.key),"aria-expanded":e.expanded,"data-enso":`tool-row`,className:W(`group/step flex min-h-6 w-full items-center gap-2 text-left text-[13px] transition-colors hover:text-foreground`,S5),children:[(0,G.jsx)(bn,{className:`h-3.5 w-3.5 shrink-0`}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[n(`Interrupted by a restart, continued below`),(0,G.jsx)(`span`,{className:`ml-1.5 opacity-70`,children:e.expanded?n(`Hide the interrupted part`):n(`Show the interrupted part`)})]}),(0,G.jsx)(gt,{className:W(`h-3 w-3 shrink-0 transition-transform`,e.expanded&&`rotate-90`)})]}),e.expanded&&(0,G.jsxs)(`div`,{className:`t-acc-reveal mt-1 mb-1.5 ml-5 space-y-2 rounded-md border border-dashed border-border bg-muted/20 px-3 py-2 text-xs`,children:[e.thinking&&(0,G.jsx)(`p`,{className:W(`whitespace-pre-wrap break-words`,S5),children:e.thinking}),e.text&&(0,G.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-foreground`,children:e.text}),e.tools.map((e,t)=>(0,G.jsxs)(`p`,{className:W(`truncate`,S5),children:[ks(e.name,n),` `,e.summary]},t))]})]})}function j5({entry:e}){let{t}=K();if(e.kind===`oauth-account-selected`)return(0,G.jsx)(D5,{entry:e});if(e.kind===`agent-dispatch`)return(0,G.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border/60 bg-muted/20 px-2.5 py-2 text-xs`,children:[(0,G.jsx)(ut,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:t(`Dispatched to`)}),(0,G.jsx)(`span`,{className:`font-medium`,children:e.child.instanceName})]});if(e.kind===`agent-completed`)return(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-emerald-500/20 bg-emerald-500/5 px-2.5 py-2 text-xs`,children:[(0,G.jsx)(mt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-500`}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`p`,{className:`font-medium`,children:[e.child.instanceName,` · `,t(`Completed`)]}),e.receiptSummary&&(0,G.jsx)(`p`,{className:`mt-0.5 whitespace-pre-wrap text-muted-foreground`,children:e.receiptSummary})]})]});if(e.kind===`agent-failed`)return(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-destructive/20 bg-destructive/5 px-2.5 py-2 text-xs`,children:[(0,G.jsx)(bt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-destructive`}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`p`,{className:`font-medium`,children:[e.child.instanceName,` · `,t(`Failed`)]}),(0,G.jsx)(`p`,{className:`mt-0.5 whitespace-pre-wrap text-muted-foreground`,children:e.message})]})]});if(e.kind===`tool-batch-label`)return null;if(e.kind===`task-wrap-up-nudge`)return(0,G.jsxs)(`div`,{"data-enso":`task-wrap-up-nudge`,className:`my-1 flex items-center gap-1.5 text-[12px] text-subtle-foreground`,children:[(0,G.jsx)(en,{className:`size-3.5 shrink-0`}),t(`{{count}} background tasks are still undeclared; the next message asks the agent to stop each one or state why it keeps running`,{count:e.count})]});let n=e.receipt,r=n.outcome===`succeeded`;return(0,G.jsx)(`div`,{className:W(`rounded-md border px-2.5 py-2 text-xs`,r?`border-emerald-500/20 bg-emerald-500/5`:n.outcome===`failed`?`border-destructive/20 bg-destructive/5`:`border-amber-500/20 bg-amber-500/5`),children:(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[r?(0,G.jsx)(mt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-500`}):(0,G.jsx)(bt,{className:W(`mt-0.5 h-3.5 w-3.5 shrink-0`,n.outcome===`failed`?`text-destructive`:`text-amber-500`)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`p`,{className:`font-medium`,children:[n.subject.label,` · `,t(n.outcome)]}),(0,G.jsx)(`p`,{className:`mt-0.5 whitespace-pre-wrap text-muted-foreground`,children:n.summary}),n.changes&&n.changes.length>0&&(0,G.jsx)(`dl`,{className:`mt-2 space-y-1 border-t border-border/50 pt-2`,children:n.changes.map(e=>(0,G.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-2`,children:[(0,G.jsx)(`dt`,{className:`truncate text-muted-foreground`,children:e.field}),(0,G.jsxs)(`dd`,{className:`text-right font-mono`,children:[E5(e.previous),` → `,E5(e.value)]})]},e.field))})]})]})})}function M5(e){let t=e.activeId?e.conversations[e.activeId]:null;return t?t.activeTabId?e.conversations[t.activeTabId]??t:t:null}var N5=()=>()=>{};function P5({item:e}){let{locale:t}=K(),n=LH({at:e.at,kind:e.exitKind,unfinishedTools:e.unfinishedTools,lang:t});return(0,G.jsxs)(`div`,{"data-enso":`timeline-interrupted`,className:`flex items-start gap-2 text-sm text-warning`,children:[(0,G.jsx)(bt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap`,children:n}),(0,G.jsx)(F5,{})]})}function F5(){let{t:e}=K();return NN(e=>{let t=M5(e);return!!(t&&!t.spawning&&t.status!==`running`)})?(0,G.jsxs)(`button`,{type:`button`,"data-enso":`timeline-interrupted-retry`,title:e(`Retry`),onClick:()=>{let e=M5(NN.getState());e&&NN.getState().retryInterrupted(e.id)},className:`mt-0.5 inline-flex shrink-0 items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground`,children:[(0,G.jsx)(Dn,{className:`h-3 w-3`}),e(`Retry`)]}):null}function I5(){let{t:e}=K(),t=ON(),n=t?.botControls,r=NN(e=>{if(t&&(!t.canRetry||t.botControls))return!1;let n=M5(e);return!!(n?.started&&!n.spawning&&n.status!==`running`)}),i=()=>{if(!n||!t?.canRetry)return!1;let e=n.projection();return!!(e&&e.status!==`running`)},a=(0,H.useSyncExternalStore)(n?.subscribe??N5,i,i);return(n?a:r)?(0,G.jsxs)(`button`,{type:`button`,title:e(`Retry`),onClick:()=>{if(n)return n.retry();let e=M5(NN.getState());e&&NN.getState().retry(e.id)},className:`mt-0.5 inline-flex shrink-0 items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground`,children:[(0,G.jsx)(Dn,{className:`h-3 w-3`}),e(`Retry`)]}):null}function L5(e,t){return _3(M5(e),t)}var R5=`flex items-center gap-1 text-[11px] text-muted-foreground transition-opacity hover:text-foreground`;function z5({messageIndex:e}){let{t}=K(),n=ON();return NN(e=>{let t=M5(e);return v3(t,n,t?h3(e.conversations,t.id):1)})?(0,G.jsxs)(`button`,{type:`button`,className:R5,title:t(`Keep this session and start a parallel one from here`),onClick:()=>{let t=NN.getState(),n=M5(t);if(!n)return;let r=S3(n,e);r!==null&&t.forkFromMessage(n.id,r)},children:[(0,G.jsx)(Kt,{className:`h-3 w-3`}),t(`Conversation branch`)]}):null}function B5({messageIndex:e}){let{t}=K(),n=ON(),r=NN(e=>M5(e)?.id),i=NN(t=>{let i=r?t.conversations[r]:void 0;if(n||!i||i.historyOnly||i.rewinding||i.restoringFiles||i.workspaceMigrating)return;let a=i.messages[e-(i.historyBaseIndex??0)];return E3(a)||i.status===`running`&&D3(a)?a?.deliveryId:void 0});return!r||!i?null:(0,G.jsxs)(`button`,{type:`button`,title:t(`Withdraw message`),onClick:()=>NN.getState().withdrawMessage(r,{kind:`delivery`,id:i}),className:`inline-flex items-center gap-1 hover:text-foreground`,children:[(0,G.jsx)(Jn,{className:`h-3 w-3`}),t(`Withdraw message`)]})}function V5(){let{t:e}=K(),t=NN(e=>M5(e)?.id);return t?(0,G.jsxs)(`button`,{type:`button`,onClick:()=>void WU(t,e),className:`inline-flex items-center gap-1 hover:text-foreground`,children:[(0,G.jsx)(kn,{className:`h-3 w-3`}),e(`Restart conversation`)]}):null}function H5({messageIndex:e}){let{t}=K(),n=ON(),r=NN(e=>M5(e)?.id),i=NN(t=>{let i=r?t.conversations[r]:void 0;if(n||!i||i.historyOnly)return;let a=i.messages[e-(i.historyBaseIndex??0)];return E3(a)?a?.deliveryId:void 0});return!r||!i?null:(0,G.jsxs)(`button`,{type:`button`,title:t(`Resend`),onClick:()=>NN.getState().resendMessage(r,i),className:`inline-flex items-center gap-1 hover:text-foreground`,children:[(0,G.jsx)(Dn,{className:`h-3 w-3`}),t(`Resend`)]})}function U5({messageIndex:e}){let{t}=K(),[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(null),o=ON(),s=o?.botControls,c=NN(t=>{if(o?.botControls)return!1;let n=M5(t);return L5(t,o)&&!!(n&&b3(n.id,n.id,n,e))}),l=()=>{if(!s||!o?.canRewind||!o.sessionId)return null;let t=s.projection();return!t||t.status===`running`?null:b3(o.sessionId,o.sessionId,t,e)?.entryId??null},u=(0,H.useSyncExternalStore)(s?.subscribe??N5,l,l);if(!(s?u!==null:c))return null;let d=t=>{if(s&&o?.sessionId&&u){a({restoreFiles:t,conversationId:o.sessionId,entryId:u});return}let n=M5(NN.getState());if(!n)return;let r=b3(n.id,n.id,n,e);r&&a({restoreFiles:t,conversationId:n.id,entryId:r.entryId})},f=(t,n,r)=>{if(s)return s.rewind(r,t);let i=NN.getState(),a=b3(n,M5(i)?.id,i.conversations[n],e,r);a&&i.rewind(a.conversationId,a.entryId,t)},p=[{icon:Jn,label:t(`Conversation only`),desc:t(`Rewind to this message`),restoreFiles:!1,action:()=>d(!1)},{icon:On,label:t(`Conversation + files`),desc:t(`Rewind and restore files to before this turn`),restoreFiles:!0,action:()=>d(!0)}];return(0,G.jsxs)(X4,{open:n,onOpenChange:r,children:[(0,G.jsxs)(Z4,{className:R5,title:t(`Rewind to this message`),children:[(0,G.jsx)(Jn,{className:`h-3 w-3`}),t(`Rewind`)]}),(0,G.jsx)(Q4,{side:`bottom`,align:`end`,className:`w-72 [&_[data-slot=popover-viewport]]:p-1`,children:p.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{r(!1),e.action()},className:`flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors hover:bg-muted/60`,children:[(0,G.jsx)(e.icon,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`block`,children:e.label}),(0,G.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.desc})]})]},e.label))}),(0,G.jsx)(l6,{open:i!==null,onOpenChange:e=>{e||a(null)},title:t(`Rewind to this message?`),description:i?.restoreFiles?t(`Later messages leave the current branch and working-tree files are restored to before this turn.`):t(`Later messages leave the current branch; the text returns to the input box.`),confirmLabel:t(`Rewind`),onConfirm:()=>{i&&f(i.restoreFiles,i.conversationId,i.entryId)}})]})}function W5({turnKey:e,text:t,timestamp:n,turnDurationMs:r,onToggle:i}){let{t:a}=K();return(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground/80 select-none`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>i?.(e,!1),className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-muted/70 hover:text-foreground cursor-pointer border border-border/40`,title:a(`Expand`),children:[(0,G.jsx)(gt,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{children:a(`Expand`)})]}),(0,G.jsx)(G5,{text:t}),typeof n==`number`&&(0,G.jsx)(`span`,{children:X5(n)}),r!==void 0&&(0,G.jsxs)(`span`,{children:[`· `,a(`took {{duration}}`,{duration:yN(r)})]})]})}function G5({text:e}){return e.trim()?(0,G.jsx)(`span`,{"data-enso":`copy-user-prompt`,className:`inline-flex`,children:(0,G.jsx)(J5,{text:e,className:`opacity-0 transition-opacity group-hover/user:opacity-100 focus-visible:opacity-100`})}):null}function K5({turnKey:e,messageIndex:t,text:n,timestamp:r,canCollapse:i,deliveryState:a,onToggleTurn:o}){let{t:s}=K(),c=Ce(e=>e.autoCollapseTurns);return(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-muted-foreground/75 select-none`,children:[(0,G.jsx)(U5,{messageIndex:t}),(0,G.jsx)(H5,{messageIndex:t}),(0,G.jsx)(B5,{messageIndex:t}),(0,G.jsx)(G5,{text:n}),a&&(0,G.jsx)(`span`,{children:s(a===`stuck`?`Not sent: the previous turn is stuck and could not be interrupted. Restart the conversation, then resend.`:a===`rejected`?`Not sent`:`Delivery unconfirmed`)}),a===`stuck`&&(0,G.jsx)(V5,{}),c&&i&&o&&(0,G.jsxs)(`button`,{type:`button`,onClick:()=>o(e,!0),className:W(R5,`cursor-pointer opacity-0 group-hover/user:opacity-100`),title:s(`Collapse`),children:[(0,G.jsx)(ht,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{children:s(`Collapse`)})]}),typeof r==`number`&&(0,G.jsx)(`span`,{children:X5(r)})]})}function q5({item:e,searchQuery:t=``,activeNth:n=-1}){let{t:r}=K(),i=ON(),a=e.perf?Q5(e.perf,r,e.turnDurationMs!==void 0):``,o=NN(e=>M5(e)?.id??null),s=Number(e.key.split(`-`)[0]),c={text:e.text,messageIndex:s,sessionId:i?i.sessionId:o};return(0,G.jsxs)(`div`,{"data-enso":`message-assistant`,className:`group text-(length:--chat-body-size)`,children:[(0,G.jsx)(E4,{text:e.text,streaming:e.streaming,searchQuery:t,activeNth:n,leaf:{messageIndex:c.messageIndex,sessionId:c.sessionId}}),e.turnEnd&&!e.streaming&&i?.turnFooter?.(Number(e.key.split(`-`)[0])),!e.streaming&&(0,G.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[11px] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100`,children:[(0,G.jsx)(zO,{position:`left`,...c}),(0,G.jsx)(J5,{text:e.text}),(0,G.jsx)(zO,{position:`right`,...c}),e.turnEnd&&(0,G.jsx)(z5,{messageIndex:Number(e.key.split(`-`)[0])}),e.timestamp&&!e.turnEnd&&(0,G.jsx)(`span`,{children:X5(e.timestamp)}),e.turnDurationMs!==void 0&&(0,G.jsxs)(`span`,{children:[e.timestamp&&!e.turnEnd&&`· `,r(`took {{duration}}`,{duration:yN(e.turnDurationMs)})]}),a&&(0,G.jsxs)(`span`,{children:[`· `,a]})]})]})}function J5({text:e,className:t}){let{t:n}=K(),[r,i]=(0,H.useState)(!1);return(0,G.jsx)(`button`,{type:`button`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>{i(!0),setTimeout(()=>i(!1),1e3)})},className:W(`flex items-center gap-1 transition-colors hover:text-foreground`,t),title:n(`Copy`),children:r?(0,G.jsx)(mt,{className:`h-3 w-3`}):(0,G.jsx)(Mt,{className:`h-3 w-3`})})}var Y5=e=>String(e).padStart(2,`0`),X5=e=>{let t=new Date(e);return`${Y5(t.getHours())}:${Y5(t.getMinutes())}`},Z5=e=>{let t=e/1e3;return String(t<10?Math.round(t*10)/10:Math.round(t))};function Q5(e,t,n=!1){let r=[];return(!n||e.turnMs!==void 0)&&r.push(`${Z5(e.runMs)}s`),e.ttftMs!==void 0&&r.push(`TTFT ${Z5(e.ttftMs)}s`),e.tps!==void 0&&r.push(`${Math.round(e.tps)} tok/s`),!n&&e.turnMs!==void 0&&r.push(t(`total {{duration}}`,{duration:yN(e.turnMs)})),r.join(` · `)}function $5({itemKey:e,text:t,streaming:n,durationMs:r,startedAt:i}){let{t:a}=K(),o=Ce(e=>e.expandLiveReasoning),[s,c]=(0,H.useState)(null),l=sB(s,n,o);return(0,G.jsxs)(`div`,{"data-enso":`thinking`,"data-live":n||void 0,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>c(!l),className:W(`flex min-h-6 items-center gap-2 text-[13px] transition-colors hover:text-foreground`,S5),children:[(0,G.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:(0,G.jsx)(dt,{className:W(`size-3`,n&&`animate-pulse text-brand`)})}),n?(0,G.jsx)(`span`,{className:W(`text-foreground`,C5),children:a(`Thinking…`)}):r===null?(0,G.jsx)(`span`,{children:a(`Thought process`)}):(0,G.jsx)(`span`,{children:a(`Thought for {{duration}}`,{duration:yN(r)})}),n&&(0,G.jsx)(s7,{itemKey:e,since:i}),(0,G.jsx)(gt,{className:W(`h-3 w-3 transition-transform`,l&&`rotate-90`)})]}),l&&(0,G.jsx)(HO,{text:t,streaming:n,itemKey:e})]})}function e7({item:e}){let{t}=K(),[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(void 0),o=/^Background task (\S+) finished \((.+?), ran (.+?)\)/.exec(e.summary),s=o?`${o[1]} · ${o[2]} · ${o[3]}`:e.summary,c=/(?:read ((?:\/|[A-Za-z]:[\\/]).+?\.log) for the complete log|Full log: ((?:\/|[A-Za-z]:[\\/])\S+?\.log))/.exec(e.detail)?.slice(1).find(Boolean)??null;return(0,H.useEffect)(()=>{!n||!c||i!==void 0||window.electronAPI.files.read(c).then(e=>{a(typeof e==`string`?e:null)}).catch(()=>a(null))},[n,c,i]),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full items-center gap-3`,title:e.detail,children:[(0,G.jsx)(`span`,{className:`h-px flex-1 bg-border`}),(0,G.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground`,children:[(0,G.jsx)(mt,{className:`h-3 w-3 text-green-600 dark:text-green-500`}),s,(0,G.jsx)(gt,{className:W(`h-3 w-3 transition-transform`,n&&`rotate-90`)})]}),(0,G.jsx)(`span`,{className:`h-px flex-1 bg-border`})]}),n&&(0,G.jsxs)(`div`,{className:`mt-1.5 rounded-lg border border-border/60 bg-muted/20`,children:[(0,G.jsx)(`pre`,{className:`border-b border-border/60 px-3 py-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-muted-foreground`,children:e.detail}),(0,G.jsx)(`pre`,{className:`max-h-64 overflow-auto px-3 py-2 font-mono text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground`,children:c?i===void 0?t(`Loading…`):s3(i??t(`(log unavailable)`)):t(`(no log available)`)})]})]})}function t7({state:e}){let{t}=K();return(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(an,{className:`h-3 w-3 animate-spin`}),(0,G.jsx)(`span`,{children:t(e===`queued`?`Compacts after this turn`:`Compacting…`)})]})}function n7({item:e}){let{t}=K(),[n,r]=(0,H.useState)(!1),i=e.kind===`compaction`,a=e.tokensBefore===null?null:vN(e.tokensBefore),o=u6(e.tokensBefore,e.tokensAfter),s=o!==null&&e.tokensBefore!==null&&e.tokensAfter!==void 0?t(`{{kind}} · {{before}} → {{after}} · freed {{percent}}%`,{kind:t(e.memory?`Memory context compacted`:e.verified?`Verified context compacted`:`Context compacted`),before:vN(e.tokensBefore),after:vN(e.tokensAfter),percent:o}):e.memory?a===null?t(`Memory context compacted`):t(`Memory context compacted ({{tokens}} tokens before)`,{tokens:a}):e.verified?a===null?t(`Verified context compacted`):t(`Verified context compacted ({{tokens}} tokens before)`,{tokens:a}):a===null?t(`Context compacted`):t(`Context compacted ({{tokens}} tokens before)`,{tokens:a});return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:W(`flex items-center gap-3`,i&&`w-full`),title:e.memory?t(`Summary rendered from continuous memory. Messages above are no longer in the model context; use recall for sources.`):e.verified?t(`Verified summary from smart compaction. Messages above are no longer in the model context.`):t(i?`Messages above are no longer in the model context; only this summary is.`:`Latest compaction summary — expand to read what the model kept.`),children:[i&&(0,G.jsx)(`span`,{className:`h-px flex-1 bg-border`}),(0,G.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground`,children:[(0,G.jsx)(hn,{className:`h-3 w-3`}),s,(0,G.jsx)(gt,{className:W(`h-3 w-3 transition-transform`,n&&`rotate-90`)})]}),i&&(0,G.jsx)(`span`,{className:`h-px flex-1 bg-border`})]}),n&&(0,G.jsx)(`pre`,{className:`mt-1.5 max-h-80 overflow-auto rounded-lg border border-border/60 bg-muted/20 px-3 py-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-muted-foreground`,children:e.summary||t(`(summary unavailable)`)})]})}function r7({item:e,onToggle:t}){let{t:n}=K(),r=Ce(e=>e.compactReadOnlyTools),i=[];e.stats.commands>0&&i.push(n(`ran {{count}} commands`,{count:e.stats.commands})),e.stats.reads>0&&i.push(n(`read {{count}} files`,{count:e.stats.reads})),e.stats.searches>0&&i.push(n(`searched {{count}} times`,{count:e.stats.searches})),e.stats.others>0&&i.push(n(`{{count}} other calls`,{count:e.stats.others}));let a=[];r&&(e.stats.reads>0&&a.push(n(`{{count}} files`,{count:e.stats.reads})),e.stats.searches>0&&a.push(n(`{{count}} searches`,{count:e.stats.searches})));let o=e.activity,s=[];o&&(o.thinking>0&&s.push(n(`{{count}} thinking steps`,{count:o.thinking})),e.count>0&&s.push(n(`{{count}} tool calls`,{count:e.count})));let c=e.explore,l=e.exploring||!!(o&&e.live),u=e.notice===`patrol`?n(`Patrol clear`):e.notice===`seen`?n(`Update seen`):null,d=c?ks(`explore_fold`,n):u||(o?n(`Worked for {{duration}}`,{duration:yN(o.workedMs)}):r?e.exploring?n(`Exploring`):n(`Explored`):n(`{{count}} tool calls`,{count:e.count})),f=c?[c.goal,n(`{{count}} tool calls`,{count:e.count})].filter(Boolean):u?s:e.summary&&!e.exploring?[e.summary]:o?s:r?a:i,p=(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{c?.steps&&t?.(RV(e.key)),t?.(e.key)},title:c?.goal,"data-explore-head":c?``:void 0,"data-enso":`tool-row`,"data-notice":e.notice,className:W(`group/step flex min-h-6 w-full items-center gap-2 text-left text-[13px] transition-colors hover:text-foreground`,S5),children:[(0,G.jsx)(r8,{state:e.exploring?`running`:`ok`}),(0,G.jsx)(`span`,{className:W(`shrink-0 text-muted-foreground group-hover/step:text-foreground`,l&&W(C5,`text-foreground`),e.exploring&&`font-medium`),children:d}),(0,G.jsx)(`span`,{className:W(`min-w-0 flex-1 truncate`,l&&C5),children:f.join(` · `)}),(0,G.jsx)(gt,{className:W(`h-3 w-3 shrink-0 transition-transform`,e.expanded&&`rotate-90`)})]});return!c||!e.expanded?p:(0,G.jsxs)(G.Fragment,{children:[p,(0,G.jsxs)(`div`,{"data-slot":`tool-details`,className:`t-acc-reveal mt-1 mb-1.5 ml-5 overflow-hidden rounded-lg border border-border/70 bg-card text-sm shadow-xs`,children:[c.goal&&(0,G.jsxs)(`div`,{className:`border-b border-border/60 px-3 py-2`,children:[(0,G.jsx)(`div`,{className:`mb-0.5 text-[11px] text-muted-foreground`,children:n(`Goal`)}),(0,G.jsx)(`p`,{className:`whitespace-pre-wrap`,children:c.goal})]}),c.report&&(0,G.jsxs)(`div`,{className:`border-b border-border/60 px-3 py-2`,children:[(0,G.jsx)(`div`,{className:`mb-0.5 text-[11px] text-muted-foreground`,children:n(`Result`)}),(0,G.jsx)(E4,{text:c.report})]}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t?.(RV(e.key)),className:`flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground`,children:[(0,G.jsx)(gt,{className:W(`h-3 w-3 shrink-0 transition-transform`,c.steps&&`rotate-90`)}),(0,G.jsx)(`span`,{children:c.steps?n(`Hide process`):n(`Show process`)}),(0,G.jsxs)(`span`,{children:[`· `,n(`{{count}} tool calls`,{count:e.count})]})]})]})]})}function i7({children:e,className:t,follow:n}){let r=(0,H.useRef)(null),i=(0,H.useRef)(null),a=(0,H.useRef)(n),o=(0,H.useRef)(n),s=(0,H.useRef)(null),c=(0,H.useRef)(null),l=(0,H.useRef)(0);o.current=n;let u=(0,H.useCallback)(()=>{a.current=!1,s.current=null,cancelAnimationFrame(l.current)},[]),d=(0,H.useCallback)(()=>{!o.current||!a.current||(cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{let e=r.current;if(!e||!o.current||!a.current)return;let t=Math.max(0,e.scrollHeight-e.clientHeight);s.current=t,e.scrollTop=t}))},[]);return(0,H.useEffect)(()=>{n?(a.current=!0,d()):(s.current=null,cancelAnimationFrame(l.current))},[n,d]),(0,H.useEffect)(d),(0,H.useEffect)(()=>{let e=i.current;if(!e)return;let t=new ResizeObserver(d);return t.observe(e),()=>t.disconnect()},[d]),(0,H.useEffect)(()=>()=>cancelAnimationFrame(l.current),[]),(0,G.jsx)(`div`,{ref:r,onWheel:e=>{e.deltaY<0&&u()},onPointerDown:e=>{e.target===e.currentTarget&&u()},onTouchStart:e=>{c.current=e.touches[0]?.clientY??null},onTouchMove:e=>{let t=e.touches[0]?.clientY;t!==void 0&&c.current!==null&&t>c.current&&u(),c.current=t??null},onTouchEnd:()=>{c.current=null},onScroll:e=>{if(!o.current)return;let t=e.currentTarget;if(t.scrollHeight-t.scrollTop-t.clientHeight<=2){a.current=!0,s.current=null;return}let n=s.current;if(n!==null&&t.scrollTop>=n-2){s.current=null,d();return}u()},className:W(`max-h-96 overflow-auto [overflow-anchor:none]`,t),children:(0,G.jsx)(`div`,{ref:i,children:e})})}function rne(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}function ine({source:e,output:t,view:n}){let r=n?.status===`completed`?rne(n.value):n?.error??t;return(0,G.jsxs)(`div`,{className:`space-y-1 px-3 py-1`,children:[e?(0,G.jsx)(v1,{code:e,language:`javascript`}):null,n&&n.calls.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[...new Map(n.calls.map(e=>[e.name,e])).keys()].map(e=>{let t=n.calls.filter(t=>t.name===e),r=t.find(e=>!e.ok),i=`${e} ×${t.length}`;return(0,G.jsx)(`span`,{className:W(`rounded-md border px-1.5 py-0.5 font-mono text-[10px]`,r?`border-destructive/40 text-destructive`:`text-muted-foreground`),title:t.map(e=>e.summary).filter(Boolean).join(`
|
|
260
|
-
`),children:r?`${i} · ${r.error??`error`}`:i},e)})}):null,r?n?.status===`completed`&&typeof n.value!=`string`?(0,G.jsx)(v1,{code:r,language:`json`}):(0,G.jsx)(`pre`,{className:`font-mono text-xs leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:s3(r)}):null,n?.console?(0,G.jsx)(`pre`,{className:`border-l-2 pl-2 font-mono text-xs leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:s3(n.console)}):null]})}function a7({path:e,fallback:t}){let[n,r]=(0,H.useState)(!1);return n?t:(0,G.jsx)(`div`,{"data-slot":`read-image`,className:`w-full min-w-0 px-3 py-3`,children:(0,G.jsx)(UW,{src:m(e),onError:()=>r(!0),frameClassName:`block w-full`,className:`mx-auto block max-h-80 max-w-full rounded-md bg-muted/40 object-contain`})})}function ane({item:e}){let{t}=K(),n=ON(),r=Ce(e=>e.compactReadOnlyTools),i=Ce(e=>e.expandLiveEdits),a=r&&e.name!==`bash`&&PV(e),o=!!(e.edits&&e.edits.length>0),s=!!e.writeContent,c=!!(e.fileChanges&&e.fileChanges.length>0),l=e.sandbox??null,u=e.state===`error`?null:e.sentMessage,d=!!e.imagePath&&e.state!==`error`,f=Os[e.name],p=BR(e.name),m=e.state!==`error`&&e.todos?.length===0,h=m?t(`Todo list cleared`):e.subagentOp?[t(As[e.subagentOp]),e.summary].filter(Boolean).join(` · `):e.summary,g=e.nestedPending&&e.state===`running`?`${h} · ${e.nestedPending} pending`:l?.calls.length&&e.state!==`error`?TB(l.calls):h,_=!m&&!!(e.output||e.source||u||e.ask),v=e.state===`running`&&e.waiting===`subagent`&&!n,y=o||s||c||_||v||d,b=i&&(o||s||d)&&e.state===`running`,[x,S]=(0,H.useState)(b),[C,w]=(0,H.useState)(!1),T=(0,H.useRef)(null),E=z8();(0,H.useEffect)(()=>{if(!C)return;let t=T.current;if(!t)return;let n=e.key,r=E.report,i=new IntersectionObserver(([e])=>r(n,e?.isIntersecting===!0),{root:E.scroller.current});return i.observe(t),()=>{i.disconnect(),r(n,!1)}},[C,e.key,E]);let D=x&&e.name===`memory_search`?az(e.output):null,O=x&&e.name===`memory_capture`?oz(e.output,e.memoryContent):null,k=x&&e.name===`subagent`&&e.state!==`error`?f8(e.subagentOp,e.output):null,A=e.name===`subagent`&&e.state===`error`?m8(e.output):null,j=(0,H.useRef)(c);return(0,H.useEffect)(()=>{let t=oB(e,j.current);j.current=c,(b||i&&t)&&S(!0)},[b,i,c,e]),e.todos&&e.todos.length>0?(0,G.jsx)(cne,{todos:e.todos}):e.name.startsWith(`goal_`)?(0,G.jsx)(one,{item:e}):e.plan&&e.state!==`error`?(0,G.jsx)(sne,{plan:e.plan}):(0,G.jsxs)(`div`,{ref:T,"data-enso":`tool-row`,"data-tool-style":a?`compact`:`full`,"data-user-open":C?`true`:void 0,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:!y,onClick:()=>{let t=!x;S(t),w(t),E.report(e.key,t)},className:W(`group/step flex min-h-6 min-w-0 flex-1 items-center gap-2 text-left text-[13px]`,S5,y&&`cursor-pointer`),children:[(0,G.jsx)(r8,{state:e.state}),(0,G.jsx)(`span`,{className:W(`shrink-0 text-muted-foreground transition-colors group-hover/step:text-foreground`,e.state===`running`&&W(C5,`text-foreground`)),children:f?t(f):p?.tool??e.name}),(0,G.jsx)(`span`,{className:W(`min-w-0 flex-1 truncate font-mono text-[12px]`,e.state===`error`?`text-destructive`:`text-muted-foreground`,e.state===`running`&&C5),children:e.state===`error`&&e.output?h&&e.name===`apply_patch`&&c?`${g} · ${hne(e.output)}`:A?t(A):HU(s3(e.output)):h?g:null}),e.backgroundTaskId&&(0,G.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,title:e.backgroundTaskId,children:t(`Moved to background`)}),e.shellFailure&&e.state!==`running`&&(0,G.jsx)(e8,{failure:e.shellFailure}),e.state===`reviewing`?(0,G.jsx)(`span`,{className:W(`shrink-0 text-[11px] text-foreground`,C5),children:t(`Assistant reviewing…`)}):e.state===`running`&&e.startedAt!==null?(0,G.jsxs)(G.Fragment,{children:[e.callId&&(e.name===`bash`||e.name===`powershell`)&&(0,G.jsx)(mne,{callId:e.callId,startedAt:e.startedAt,output:e.output??``}),(0,G.jsx)(s7,{itemKey:e.key,since:e.startedAt??void 0})]}):(e.agentMeta||e.durationMs!==null)&&(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums`,children:[e.agentMeta?.modelId,e.agentMeta?.outputTokens?`${e.agentMeta.outputTokens} tok`:null,e.durationMs===null?null:yN(e.durationMs)].filter(Boolean).join(` · `)}),y&&(0,G.jsx)(gt,{className:W(`h-3 w-3 shrink-0 text-muted-foreground opacity-0 transition-[opacity,transform] group-hover/step:opacity-100`,x&&`rotate-90 opacity-100`)})]}),e.state===`running`&&e.callId&&!n&&(0,G.jsx)(lne,{callId:e.callId,waiting:!!e.waiting}),(o||s||c)&&(e.state===`ok`||c)&&(0,G.jsx)(`button`,{type:`button`,title:t(`Open in side panel`),className:`flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,onClick:()=>l1(),children:(0,G.jsx)(qt,{className:`h-3 w-3`})})]}),e.generatedImages?.length?(0,G.jsx)(`div`,{"data-slot":`generated-images`,className:`mt-2 mb-3 ml-5 grid gap-3`,children:e.generatedImages.map(e=>(0,G.jsx)(a7,{path:e,fallback:(0,G.jsx)(`p`,{className:`break-all px-3 py-2 text-xs text-muted-foreground`,children:e})},e))}):null,x&&y&&(0,G.jsxs)(`div`,{"data-slot":`tool-details`,className:`t-acc-reveal mt-1 mb-1.5 ml-5 overflow-hidden rounded-lg border border-border/70 bg-card shadow-xs`,children:[p&&(0,G.jsxs)(`div`,{className:`truncate border-b border-border/60 px-3 py-1 font-mono text-[10px] text-muted-foreground`,children:[p.server,`.`,p.tool]}),v&&(0,G.jsx)(pne,{agentIds:e.subagentTitles?Object.keys(e.subagentTitles):void 0}),o&&e.edits&&(0,G.jsx)(i7,{follow:e.state===`running`,children:(0,G.jsx)(H.Suspense,{fallback:null,children:(0,G.jsx)(B8,{path:e.summary,blocks:e.edits})})}),c&&e.fileChanges&&(0,G.jsx)(i7,{follow:e.state===`running`,children:e.fileChanges.map((e,n)=>(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:W(`flex items-center gap-2 border-border/60 px-3 py-1 font-mono text-[10px] text-muted-foreground`,(n>0||o)&&`border-t`),children:[(0,G.jsx)(`span`,{className:`uppercase`,children:e.type}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.path,children:e.path}),e.truncated&&(0,G.jsx)(`span`,{children:t(`Truncated preview`)})]}),(0,G.jsx)(H.Suspense,{fallback:null,children:(0,G.jsx)(B8,{path:e.path,blocks:[e],snapshot:e})})]},`${e.type}:${i3(e.path,e.oldText,e.newText)}`))}),cB(e)&&(0,G.jsx)(i7,{follow:!1,className:`border-t border-border/60`,children:(0,G.jsx)(`pre`,{className:`px-3 py-2 font-mono text-xs leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:s3(e.output??``)})}),s&&e.writeContent&&(0,G.jsx)(i7,{follow:e.state===`running`,className:W((o||c)&&`border-t border-border/60`),children:(0,G.jsx)(H.Suspense,{fallback:null,children:(0,G.jsx)(V8,{path:e.summary,contents:e.writeContent})})}),!o&&!s&&!c&&(_||d)&&(0,G.jsxs)(i7,{follow:e.state===`running`,children:[EB(e.name)?(0,G.jsx)(ine,{source:e.source,output:e.output,view:l}):e.name===`bash`||e.name===`powershell`?(0,G.jsx)(_8,{command:e.summary,output:e.output??``,failure:e.shellFailure}):e.name===`read`&&d&&e.imagePath?(0,G.jsx)(a7,{path:e.imagePath,fallback:(0,G.jsx)(H.Suspense,{fallback:null,children:(0,G.jsx)(V8,{path:e.summary,contents:e.output??``})})},e.imagePath):e.name===`image_view`&&e.state===`ok`?(0,G.jsx)(w8,{image:e.image,output:e.output}):e.name===`read`?(0,G.jsx)(H.Suspense,{fallback:null,children:(0,G.jsx)(V8,{path:e.summary,contents:e.output??``})}):e.name===`subagent`&&e.state!==`error`&&!u&&!k?(0,G.jsx)(`div`,{className:`px-3 py-2 text-sm`,children:(0,G.jsx)(E4,{text:e.output??``})}):D?(0,G.jsx)(d6,{hits:D}):O?(0,G.jsx)(f6,{view:O}):(0,G.jsxs)(G.Fragment,{children:[e.ask&&(0,G.jsx)(U3,{ask:e.ask,waiting:e.state===`running`}),u&&(0,G.jsx)(`div`,{className:`px-3 py-2 text-sm`,children:(0,G.jsx)(E4,{text:u})}),k?(0,G.jsx)(a8,{view:k,titles:e.subagentTitles}):e.output&&(0,G.jsx)(`pre`,{className:`px-3 py-2 font-mono text-xs leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:s3(e.output)})]}),(0,G.jsx)(V6,{value:e.rtk}),(0,G.jsx)(H3,{value:e.approvalReview})]})]})]})}function one({item:e}){let{t}=K(),n=e.name.replace(`goal_`,``),r=t(n===`complete`?`Goal completed`:n===`blocked`?`Goal blocked`:`Goal waiting`);return(0,G.jsxs)(`div`,{className:W(`flex items-start gap-2 rounded-lg border px-3 py-2 text-sm`,n===`complete`&&`border-green-500/50 bg-green-500/5`,n===`blocked`&&`border-destructive/50 bg-destructive/5`,n===`wait`&&`border-amber-500/50 bg-amber-500/5`),children:[(0,G.jsx)(Kn,{className:W(`mt-0.5 h-4 w-4 shrink-0`,n===`complete`&&`text-green-600 dark:text-green-500`,n===`blocked`&&`text-destructive`,n===`wait`&&`text-amber-500`)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`p`,{className:`font-medium`,children:r}),e.summary&&(0,G.jsx)(`p`,{className:`mt-0.5 whitespace-pre-wrap text-muted-foreground text-xs`,children:e.summary})]})]})}function sne({plan:e}){let{t}=K(),[n,r]=(0,H.useState)(!1);return(0,G.jsxs)(`div`,{className:`rounded-lg border border-border/60 bg-muted/30 px-3 py-2`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full min-w-0 items-center gap-2 text-left text-xs`,children:[(0,G.jsx)(Ot,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`shrink-0 font-medium text-muted-foreground`,children:t(`Plan`)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,G.jsx)(gt,{className:W(`h-3 w-3 shrink-0 text-muted-foreground transition-transform`,n&&`rotate-90`)})]}),n&&(0,G.jsx)(`div`,{className:`mt-2 border-border/60 border-t pt-2 text-sm`,children:(0,G.jsx)(E4,{text:e.text})})]})}function cne({todos:e}){let{t}=K(),n=e.filter(e=>e.status===`completed`).length;return(0,G.jsxs)(`div`,{"data-enso":`todo`,className:`rounded-lg border bg-card px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(nn,{className:`h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:t(`Todos`)}),(0,G.jsxs)(`span`,{className:`ml-auto tabular-nums`,children:[n,`/`,e.length]})]}),(0,G.jsx)(b8,{done:n,total:e.length,className:`mt-1.5 mb-2`}),(0,G.jsx)(y8,{todos:e})]})}var o7=new Map;function lne({callId:e,waiting:t}){let{t:n}=K(),r=NN(e=>M5(e)?.id??``),[i,a]=(0,H.useState)(!1);if((0,H.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>a(!1),5e3);return()=>clearTimeout(e)},[i]),!r)return null;let o=n(t?i?`Stopping wait…`:`Stop waiting`:i?`Moving to background…`:`Move to background`);return(0,G.jsxs)(`button`,{type:`button`,disabled:i,title:o,className:`flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-60`,onClick:()=>{a(!0),window.electronAPI.agent.backgroundTool(r,e).then(e=>{e.ok||a(!1)},()=>a(!1))},children:[(0,G.jsx)(t?In:rt,{className:`h-3 w-3`}),o]})}var une=5e3,dne=[];function fne(e,t){if(e.status===`queued`)return t(`Queued`);let n=e.activity;return n?.phase===`tool`?[n.tool,n.detail].filter(Boolean).join(` `):n?.phase===`writing`?t(`Writing reply…`):t(`Thinking…`)}function pne({agentIds:e}){let{t}=K(),n=NN(e=>M5(e)?.id??``),r=O3(e=>e.byConversation[n]??dne),[i,a]=(0,H.useState)(!1);if((0,H.useEffect)(()=>{if(!n)return;let e=!0,t=t=>{e&&(O3.getState().replace(n,t),a(!0))},r=()=>window.electronAPI.agent.subagentProgress(n).then(t,()=>{}),i=window.electronAPI.agent.onSubagentProgress(e=>{e.sessionId===n&&t(e.runs)});r();let o=setInterval(r,une);return()=>{e=!1,clearInterval(o),i()}},[n]),!i)return null;let o=e?.length?r.filter(t=>e.includes(t.agentId)):r;return(0,G.jsxs)(`div`,{className:`border-b border-border/60 px-3 py-2 text-xs`,children:[o.length===0?(0,G.jsx)(`div`,{className:`text-muted-foreground`,children:t(`No running subagents`)}):o.map(e=>(0,G.jsxs)(`div`,{className:`py-0.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`max-w-[40%] shrink-0 truncate font-medium`,children:e.title??e.agentId.slice(0,8)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-muted-foreground`,children:fne(e,t)}),(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums`,children:yN(e.elapsedMs)})]}),e.text&&(0,G.jsx)(`div`,{className:`line-clamp-2 break-words pl-2 text-[11px] text-muted-foreground/80`,children:e.text.replace(/\s+/g,` `)})]},e.runId)),(0,G.jsx)(`div`,{className:`mt-1 text-[11px] text-muted-foreground/80`,children:t(`Stopping the wait does not stop subagents; the assistant is notified when they finish.`)})]})}function s7({itemKey:e,since:t}){let n=ON(),r=NN(e=>M5(e)?.id??``),i=n?n.sessionId??``:r,a=(0,H.useRef)(null);if(a.current===null){let n=`${i}:${e}`;a.current=t??o7.get(n)??Date.now(),t===void 0&&o7.set(n,a.current)}let o=t??a.current,[,s]=(0,H.useState)(0);return(0,H.useEffect)(()=>{let e=setInterval(()=>s(e=>e+1),1e3);return()=>clearInterval(e)},[]),(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums`,children:yN(Date.now()-o)})}function mne({callId:e,startedAt:t,output:n}){let r=ON(),i=NN(t=>r?void 0:M5(t)?.toolDeadlineAt?.[e]);return(0,G.jsx)(Q6,{startedAt:t,deadlineAt:i,output:n})}function c7(e){return e.kind===`tool-group`||e.kind===`tool`&&!e.todos?.length&&!e.name.startsWith(`goal_`)}var hne=e=>s3(e.split(`
|
|
261
|
-
`,1)[0]??``);function gne(e,t,n,r,i=100){if(r||!n)return{hiddenSince:t,delayMs:null};let a=t??e;return{hiddenSince:a,delayMs:Math.max(0,i-(e-a))}}var _ne=1e6;function vne(e,t,n=_ne){if(t.length===0)return{anchor:null,firstItemIndex:n,remount:!1};if(!e)return{anchor:{keys:t,index:n},firstItemIndex:n,remount:!1};let r=new Map(t.map((e,t)=>[e,t]));for(let n=0;n<e.keys.length;n++){let i=r.get(e.keys[n]);if(i===void 0)continue;let a=e.index+n-i;return{anchor:{keys:t,index:a},firstItemIndex:a,remount:!1}}return{anchor:{keys:t,index:n},firstItemIndex:n,remount:!0}}function yne(e,t){return t}var bne=new Set([`text`,`thinking`,`tool`,`tool-group`]);function xne(e,t,n,r){let i=(0,H.useRef)(WV),[a,o]=(0,H.useState)(()=>Date.now()),s=r.compact,c=r.autoCollapseCompletedTurns,l=r.collapseCompletedActivity===!0,u=r.collapseLiveActivity===!0,d={compact:s,autoCollapseCompletedTurns:c,turnOverrides:r.turnOverrides},f=u?YV(e,t,r,i.current,a):null;i.current=f?.witness??WV;let p=f?.wakeAt??null,m=oH(e,t,n,{...d,collapseCompletedActivity:l,collapseLiveActivity:u,releasedLiveActivity:f?.released,heldOpenTools:r.heldOpenTools,foldToolOnlyTurns:r.foldToolOnlyTurns===!0,readableToolCards:r.readableToolCards===!0});return(0,H.useEffect)(()=>{if(p===null||p<=a)return;let e=window.setTimeout(()=>o(p),p-a);return()=>window.clearTimeout(e)},[p,a]),m}var Sne=[{icon:jt,title:`Map the project`,hint:`Entry points, modules and key dependencies`,prompt:`Walk me through this project's structure: entry points, module layout and key dependencies.`},{icon:ft,title:`Find potential issues`,hint:`Suspicious logic and unhandled edge cases`,prompt:`Review this project for potential bugs, suspicious logic and unhandled edge cases, and list them by severity.`},{icon:Vt,title:`Add unit tests`,hint:`Cover the core modules with tests`,prompt:`Find the core modules that lack tests and add unit tests for them.`},{icon:On,title:`Summarize recent changes`,hint:`A digest based on git log`,prompt:`Summarize the recent changes in this repository based on git log.`}];function Cne({onPick:e}){let{t}=K();return(0,G.jsx)(`div`,{className:`mx-auto grid w-full max-w-[560px] grid-cols-1 gap-2.5 text-left @min-[36rem]:grid-cols-2`,children:Sne.map(({icon:n,title:r,hint:i,prompt:a})=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>e(t(a)),"data-slot":`welcome-suggestion`,className:`group flex items-start gap-3 rounded-xl border bg-card px-3.5 py-3 text-left shadow-xs transition-[border-color,box-shadow,transform] duration-200 hover:-translate-y-px hover:border-brand/25 hover:shadow-float`,children:[(0,G.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-lg bg-brand/8 text-brand dark:bg-brand/14`,children:(0,G.jsx)(n,{className:`size-3.5`})}),(0,G.jsxs)(`span`,{className:`min-w-0`,children:[(0,G.jsx)(`span`,{className:`block text-[13px] font-medium`,children:t(r)}),(0,G.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:t(i)})]})]},r))})}var l7=`enso-chat-col mx-auto w-full max-w-2xl px-4 @min-[56rem]:max-w-3xl @min-[72rem]:max-w-4xl @min-[84rem]:max-w-5xl @min-[96rem]:max-w-6xl @min-[112rem]:max-w-7xl`,u7=1e3;function d7({className:e,children:t}){let[n,r]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{let e=requestAnimationFrame(()=>r(!0));return()=>cancelAnimationFrame(e)},[]),(0,G.jsx)(`div`,{className:W(`t-stagger`,n&&`is-shown`,e),children:t})}var f7=40,wne={index:`LAST`,align:`end`},Tne={top:600,bottom:600},Ene=e=>e?`auto`:!1;function Dne({style:e,...t}){let n=e?.visibility===`hidden`,[r,i]=(0,H.useState)(!1),a=(0,H.useRef)(null);return(0,H.useEffect)(()=>{let e=gne(Date.now(),a.current,n,r);if(a.current=e.hiddenSince,e.delayMs===null)return;let t=window.setTimeout(()=>i(!0),e.delayMs);return()=>window.clearTimeout(t)},[n,r]),(0,G.jsx)(`div`,{...t,style:n&&r?{...e,visibility:`visible`}:e})}function One({ref:e,items:t,busy:n,loading:r=!1,running:i,runStartedAt:a,lastOutputAt:o,error:s,emptyTitle:c,emptyDescription:l,onSuggestion:u,onRetryResume:d,onRetrySync:f,virtualize:p=!0,onStartReached:m,historyLoading:h=!1,hasOlder:g,olderCursor:_,searchQuery:v=``,activeHit:y=null,secretarySession:b=!1,secretaryFace:x}){let{t:S}=K(),C=ON(),w=xR(),T=b?x??w:null,E=!C&&T?T:null,D=b,O=(0,H.useRef)(null),[k,A]=(0,H.useState)(!0),[j,M]=(0,H.useState)(!1),N=(0,H.useRef)(!0),P=(0,H.useRef)(null),F=(0,H.useRef)(0),I=(0,H.useRef)(0),ee=(0,H.useRef)(null),L=(0,H.useRef)(!1),te=(0,H.useRef)(!1),R=(0,H.useRef)(0),[z,ne]=(0,H.useState)(null),re=(0,H.useRef)(0),B=(0,H.useCallback)(e=>{cancelAnimationFrame(re.current),re.current=requestAnimationFrame(()=>ne(e()))},[]);(0,H.useEffect)(()=>()=>cancelAnimationFrame(re.current),[]);let[ie,ae]=(0,H.useState)(new Set),oe=(0,H.useRef)(new Set),[V,se]=(0,H.useState)(()=>new Set),ce=(0,H.useCallback)((e,t)=>{let n=oe.current;t!==n.has(e)&&(t?n.add(e):n.delete(e),se(new Set(n)))},[]),le=(0,H.useRef)({report:ce,scroller:P});le.current.report=ce;let ue=(0,H.useCallback)(e=>{ae(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[de,fe]=(0,H.useState)(new Map),pe=Ce(e=>e.autoCollapseTurns),me=Ce(e=>e.collapseCompletedActivity),he=Ce(e=>e.collapseLiveActivity),ge=Ce(e=>e.liveActivityFoldDelaySec),_e=Ce(e=>e.compactReadOnlyTools),ve=xne(t,i,ie,{compact:_e,autoCollapseCompletedTurns:pe,collapseCompletedActivity:me,collapseLiveActivity:he,liveActivityFoldDelaySec:ge,heldOpenTools:V,turnOverrides:de,foldToolOnlyTurns:!C&&D,readableToolCards:D}),ye=(0,H.useRef)({state:sH,collapse:new Map,reveal:new Map}),be=(0,H.useMemo)(()=>{let e=ye.current,t=e=>P.current?.querySelector(`[data-nav-key="${CSS.escape(e)}"]`),n=cH(e.state,ve,(e,n)=>{let r=t(e)?.getBoundingClientRect().top,i=t(n)?.getBoundingClientRect().bottom;return r===void 0||i===void 0?0:i-r}),r=Date.now();e.state=n.next;for(let{key:t,...i}of n.collapses)e.collapse.set(t,{at:r,...i});for(let t of n.expands)e.reveal.set(t,r);return n.children},[ve]),xe=(0,H.useRef)(null),Se=(0,H.useRef)(0),we=(0,H.useRef)(null),Te=vne(xe.current,ve.map(e=>e.key));xe.current=Te.anchor,Te.remount&&(Se.current+=1,we.current=null);let Ee=Te.firstItemIndex,De=(0,H.useCallback)((e,t)=>{fe(n=>n.get(e)===t?n:new Map(n).set(e,t))},[]),Oe=(0,H.useMemo)(()=>{let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(r.kind!==`user`)continue;let i=``;for(let e=n+1;e<t.length;e++){let n=t[e];if(n.kind===`user`)break;if(n.kind===`text`){i=n.text;break}}e.push({key:r.key,question:r.text||`[image]`,answer:i})}return e},[t]),ke=(0,H.useCallback)(()=>{let e=P.current;e&&e.scrollHeight-e.scrollTop-e.clientHeight>2&&(L.current=!0,e.scrollTop=e.scrollHeight)},[]),Ae=(0,H.useCallback)(()=>{cancelAnimationFrame(F.current);let e=Date.now()+1200,t=null,n=()=>{cancelAnimationFrame(F.current),L.current=!1,t?.removeEventListener(`touchstart`,n),t?.removeEventListener(`wheel`,n)},r=()=>{if(te.current){n();return}!t&&P.current&&(t=P.current,t.addEventListener(`touchstart`,n,{passive:!0,once:!0}),t.addEventListener(`wheel`,n,{passive:!0,once:!0})),ke(),N.current=!0,A(!0),Date.now()<e?F.current=requestAnimationFrame(r):n()};r(),A(!0),N.current=!0},[ke]);(0,H.useEffect)(()=>()=>{cancelAnimationFrame(F.current),cancelAnimationFrame(I.current),window.clearTimeout(R.current)},[]);let je=()=>{te.current=!0,window.clearTimeout(R.current)},Me=()=>{window.clearTimeout(R.current),R.current=window.setTimeout(()=>{te.current=!1},400)},Ne=()=>{je(),Me()},Pe=()=>{cancelAnimationFrame(F.current),cancelAnimationFrame(I.current),L.current=!1,N.current=!1,A(!1)},Fe=(0,H.useCallback)(e=>{if(ee.current?.disconnect(),ee.current=null,!e)return;let t=new ResizeObserver(()=>{if(!N.current&&!L.current)return;cancelAnimationFrame(I.current);let e=8,t=()=>{ke();let n=P.current;(n?n.scrollHeight-n.scrollTop-n.clientHeight:0)<=2||(--e>0?I.current=requestAnimationFrame(t):Ae())};t()});t.observe(e),ee.current=t,Ae()},[ke,Ae]);(0,H.useEffect)(()=>()=>ee.current?.disconnect(),[]);let Ie=e=>ve.findIndex(t=>t.key===e||t.kind===`tool-group`&&p7(t,e)),Le=e=>{if(!p){P.current?.querySelector(`[data-nav-key="${CSS.escape(e)}"]`)?.scrollIntoView({block:`center`});return}let t=Ie(e);t>=0&&O.current?.scrollToIndex({index:yne(Ee,t),align:`center`})},Re=(0,H.useRef)(null),ze=e=>{if(Pe(),Ie(e)>=0){Re.current=null,Le(e);return}let n=null,r=!1;for(let i of t)if(i.kind===`user`&&(n=i.key),i.key===e){r=!0;break}!r||!n||(Re.current=e,De(n,!1))};(0,H.useLayoutEffect)(()=>{let e=Re.current;!e||Ie(e)<0||(Re.current=null,Le(e))},[ve]),(0,H.useImperativeHandle)(e,()=>({scrollToBottom:Ae,pinToBottom:ke,isAtBottom:()=>N.current,getScroller:()=>p?null:P.current,scrollToKey:ze}));let Be=(0,H.useRef)(!1),Ve=`${_}:${Ee}`,He=(0,H.useRef)(Ve);He.current!==Ve&&(He.current=Ve,Be.current=!1);let Ue=()=>{!m||Be.current||(Be.current=!0,m())};(0,H.useEffect)(()=>{p&&!h&&we.current===Ee&&Ue()},[_,h]);let We=(0,H.useMemo)(()=>({query:v,activeKey:y?.key??``,activeNth:y?.nth??-1}),[v,y?.key,y?.nth]),Ge=(e,t)=>{let n=ve[t+1];if(n!==void 0&&c7(e)&&c7(n))return`pb-0`;if(!_e)return`pb-4`;let r=n!==void 0&&x5(n);return x5(e)?r?`pb-1`:`pb-2`:e.kind===`text`&&r?`pb-1`:`pb-4`},Ke=(e,t)=>{let n=ve[t-1],r=n?.kind===`user`&&!n.collapsed&&bne.has(e.kind)?n:void 0,i=Date.now(),a=ye.current.collapse.get(e.key),o=a&&i-a.at<u7?a:void 0,s=be.get(e.key),c=s&&ye.current.reveal.get(s.group),l=s&&c!==void 0&&i-c<u7;return(0,G.jsxs)(`div`,{"data-nav-key":e.key,"data-fold-collapse":o?o.pair?`pair`:`toggle`:void 0,style:o?{"--fold-from":`${o.height}px`}:l?{"--fold-i":s.index}:void 0,className:W(l7,Ge(e,t),l&&`t-fold-reveal`,`[overflow-wrap:anywhere]`),children:[r&&(0,G.jsx)(w5,{model:r.replyModel,at:r.replyAt,privacyMask:r.replyPrivacyMask,secretarySession:D,face:T}),(0,G.jsx)(Pne,{itemKey:e.key,children:(0,G.jsx)(T5,{item:e,secretarySession:D,onToggleGroup:ue,onToggleTurn:De})})]},e.key)},qe=(0,H.useRef)(!1);g===!0&&(qe.current=!0);let Je=xB(t.length>0,h,g,qe.current,!p&&j);(0,H.useLayoutEffect)(()=>{if(p){M(!1);return}let e=P.current;M(!!e&&SB(g===!0,h,e.scrollHeight,e.clientHeight))},[p,g,h,Ee,ve.length,t.length]);let Ye={pageChrome:Je,onLoadMore:Je===`more`?Ue:void 0,busy:n,loading:!!r,since:lH({loading:!!r,runStartedAt:a,lastOutputAt:o}),error:s,onRetryResume:d};return(0,G.jsx)(uH.Provider,{value:We,children:(0,G.jsx)(R8,{value:le.current,children:(0,G.jsxs)(`div`,{"data-enso":`timeline`,className:`@container relative min-h-0 flex-1`,onWheel:Ne,onKeyDown:Ne,onTouchStart:e=>{P.current?.contains(e.target)&&je()},onTouchEnd:Me,onPointerDown:e=>{e.target===P.current&&(je(),window.addEventListener(`pointerup`,Me,{once:!0}))},children:[(0,G.jsx)(bH,{items:Oe,activeKey:z,onJump:ze}),t.length===0&&!n?(0,G.jsxs)(d7,{className:`flex h-full flex-col items-center justify-center gap-2 overflow-y-auto px-4 text-center`,children:[(0,G.jsx)(`span`,{className:`t-stagger-line t-stagger-line--1 mb-3`,children:E?(0,G.jsx)(AL,{name:E.name,color:E.color,image:E.image,needsYou:0,running:0,size:`lg`,enso:`secretary-chat-avatar`}):(0,G.jsx)(`span`,{className:`flex size-11 items-center justify-center rounded-[13px] border border-brand/20 bg-brand/8 text-brand dark:bg-brand/14`,children:(0,G.jsx)(kN,{className:`size-6`})})}),(0,G.jsx)(`p`,{className:`t-stagger-line t-stagger-line--1 text-[22px] font-semibold tracking-tight`,children:c}),s?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`t-stagger-line t-stagger-line--2 max-w-md text-sm text-destructive whitespace-pre-wrap`,children:S(s)}),d&&(0,G.jsx)(wa,{size:`sm`,variant:`outline`,onClick:d,children:S(`Retry resume`)})]}):(0,G.jsxs)(G.Fragment,{children:[f?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`t-stagger-line t-stagger-line--2 max-w-md text-sm text-muted-foreground`,children:S(`Session is not ready yet — no history to show.`)}),(0,G.jsx)(wa,{size:`sm`,variant:`outline`,onClick:f,children:S(`Retry sync`)})]}):l===``?null:(0,G.jsx)(`p`,{className:`t-stagger-line t-stagger-line--2 text-sm text-muted-foreground`,children:l??S(`Ask the agent…`)}),u&&(0,G.jsx)(`div`,{className:`t-stagger-line t-stagger-line--3 mt-5 w-full`,children:(0,G.jsx)(Cne,{onPick:u})})]})]}):t.length===0&&s?(0,G.jsxs)(d7,{className:`flex h-full flex-col items-center justify-center gap-2 text-center`,children:[(0,G.jsx)(`p`,{className:`t-stagger-line t-stagger-line--1 max-w-md text-sm text-destructive whitespace-pre-wrap`,children:S(s)}),d&&(0,G.jsx)(wa,{size:`sm`,variant:`outline`,onClick:d,children:S(`Retry resume`)})]}):t.length===0?(0,G.jsxs)(`div`,{"data-timeline-loading":``,className:`flex h-full flex-col items-center justify-center gap-2.5 text-center`,children:[(0,G.jsx)(an,{className:`h-5 w-5 animate-spin text-muted-foreground`}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:S(`Preparing session…`)})]}):p?(0,G.jsx)(MI,{ref:O,data:ve,defaultItemHeight:80,computeItemKey:(e,t)=>t.key,firstItemIndex:Ee,startReached:Ue,followOutput:Ene,atBottomThreshold:f7,atBottomStateChange:e=>{if(!e&&N.current&&!te.current){Ae();return}A(e),N.current=e},increaseViewportBy:Tne,initialTopMostItemIndex:wne,rangeChanged:({startIndex:e})=>{we.current=e,e>Ee+4&&(Be.current=!1),B(()=>{let t=Math.max(0,e-Ee),n=null;for(let e=0;e<=Math.min(t+1,ve.length-1);e++)ve[e]?.kind===`user`&&(n=ve[e].key);return n})},scrollerRef:e=>{P.current=e instanceof HTMLElement?e:null},className:`h-full select-text`,context:Ye,components:Ane,itemContent:(e,t)=>Ke(t,e-Ee)},Se.current):(0,G.jsx)(`div`,{ref:e=>{P.current=e},onScroll:e=>{let t=e.currentTarget;if(L.current){L.current=!1,N.current=!0,A(!0);return}if(!te.current){N.current&&ke();return}let n=t.scrollHeight-t.scrollTop-t.clientHeight<=f7;n!==N.current&&(N.current=n,A(n)),m&&(t.scrollTop<80&&!Be.current?(Be.current=!0,m()):t.scrollTop>240&&(Be.current=!1))},className:`h-full select-text overflow-y-auto [overflow-anchor:none]`,children:(0,G.jsxs)(`div`,{ref:Fe,children:[(0,G.jsx)(m7,{context:Ye}),ve.map((e,t)=>Ke(e,t)),(0,G.jsx)(h7,{context:Ye})]})}),!k&&t.length>0&&(0,G.jsxs)(`button`,{type:`button`,onClick:Ae,className:`absolute bottom-4 left-1/2 z-10 inline-flex h-7 -translate-x-1/2 items-center gap-1.5 rounded-full border bg-card px-3 text-xs text-muted-foreground shadow-float transition-colors hover:text-foreground`,children:[(0,G.jsx)(it,{className:`h-3 w-3`}),S(`Scroll to bottom`)]})]})})})}function p7(e,t){return e.children.some(e=>e.key===t||e.kind===`tool-group`&&p7(e,t))}function kne({chrome:e,onLoadMore:t}){let{t:n}=K();return e===`none`?(0,G.jsx)(`div`,{className:`h-6`}):(0,G.jsx)(`div`,{className:W(l7,`flex items-center justify-center gap-2 py-3`),children:e===`loading`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(an,{className:`h-3.5 w-3.5 animate-spin text-muted-foreground`}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Loading earlier messages…`)})]}):e===`more`?(0,G.jsx)(`button`,{type:`button`,className:`text-xs text-muted-foreground underline-offset-2 hover:underline`,onClick:t,children:n(`Load earlier messages`)}):(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Beginning of conversation`)})})}function m7({context:e}){return(0,G.jsx)(kne,{chrome:e.pageChrome,onLoadMore:e.onLoadMore})}function h7({context:e}){let{t}=K(),{busy:n,loading:r,since:i,error:a,onRetryResume:o}=e;return(0,G.jsxs)(`div`,{className:W(l7,`pb-6 [overflow-wrap:anywhere]`),children:[n&&(0,G.jsxs)(`div`,{className:`flex min-h-[26px] items-center gap-2 text-[13px]`,children:[(0,G.jsx)(jne,{}),(0,G.jsx)(`span`,{className:`animate-pulse text-foreground motion-reduce:animate-none`,children:t(r?`Loading…`:`Working…`)}),i!==void 0&&(0,G.jsx)(Nne,{since:i})]}),a&&(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`p`,{className:`min-w-0 flex-1 text-sm text-destructive whitespace-pre-wrap`,children:t(a)}),(0,G.jsx)(I5,{}),o&&(0,G.jsx)(wa,{size:`sm`,variant:`outline`,onClick:o,children:t(`Retry resume`)})]})]})}var Ane={List:Dne,Header:m7,Footer:h7};function jne(){return(0,G.jsxs)(`span`,{className:`relative flex size-[22px] shrink-0 items-center justify-center`,children:[(0,G.jsx)(`span`,{className:`absolute size-2 animate-ping rounded-full bg-brand/50`}),(0,G.jsx)(`span`,{className:`relative size-2 rounded-full bg-brand`})]})}var Mne=e=>{let t=Math.max(0,Math.round(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m${t%60}s`},Nne=(0,H.memo)(function({since:e}){let[,t]=(0,H.useState)(0);return(0,H.useEffect)(()=>{let e=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(e)},[]),(0,G.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground tabular-nums`,children:Mne(Date.now()-e)})}),Pne=class extends H.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidUpdate(e){e.itemKey!==this.props.itemKey&&this.state.failed&&this.setState({failed:!1})}render(){return this.state.failed?(0,G.jsxs)(`p`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-1.5 text-xs text-destructive`,children:[`message render failed · `,this.props.itemKey]}):this.props.children}};function Fne({retry:e,onCancel:t}){let{t:n}=K(),[r,i]=(0,H.useState)(()=>Date.now());(0,H.useEffect)(()=>{let e=setInterval(()=>i(Date.now()),500);return()=>clearInterval(e)},[]);let a=Math.max(0,Math.ceil((e.at+e.delayMs-r)/1e3));return(0,G.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2.5 py-1.5 text-xs`,children:[(0,G.jsx)(Dn,{className:`h-3.5 w-3.5 shrink-0 animate-spin text-amber-500 [animation-duration:2s]`}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.error,children:[e.maxAttempts>0?n(`Auto-retrying ({{attempt}}/{{max}})`,{attempt:e.attempt,max:e.maxAttempts}):n(`Auto-retrying ({{attempt}})`,{attempt:e.attempt}),(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,a>0?n(`retrying in {{seconds}}s`,{seconds:a}):n(`retrying…`),` — `,e.error]})]}),t&&(0,G.jsx)(`button`,{type:`button`,title:n(`Cancel auto-retry`),onClick:t,className:`shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground`,children:(0,G.jsx)(er,{className:`h-3.5 w-3.5`})})]})}function g7(e){return e.status===`running`?e.idle?`idle`:e.keep?`kept`:`running`:e.status}function _7(e,t){let n=Math.max(0,Math.floor(e/6e4));if(n<60)return t(`{{n}} min`,{n});let r=Math.floor(n/60),i=n%60;return i===0?t(`{{n}} h`,{n:r}):t(`{{h}} h {{m}} min`,{h:r,m:i})}function Ine(e){let t=Math.max(0,Math.floor(e/6e4));return t<60?`${t}m`:`${Math.floor(t/60)}h ${String(t%60).padStart(2,`0`)}m`}function v7(e){let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`}function y7(e=3e4){let[t,n]=(0,H.useState)(()=>Date.now());return(0,H.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var Lne={ok:`bg-success/15 text-success`,pending:`bg-warning/15 text-warning`,neutral:`bg-muted text-muted-foreground`};function b7({tone:e,children:t,className:n}){return(0,G.jsx)(`span`,{className:W(`shrink-0 rounded px-1 py-px text-[10px]`,Lne[e],n),children:t})}function x7(e,t,n){return n(`Idle {{duration}}`,{duration:_7(t-(e.idle?.since??t),n)})}function Rne({task:e,now:t}){let{t:n}=K(),r=g7(e);return r===`idle`?(0,G.jsx)(b7,{tone:`pending`,children:x7(e,t,n)}):r===`kept`?(0,G.jsx)(b7,{tone:`neutral`,children:n(`Kept`)}):r===`running`?(0,G.jsx)(b7,{tone:`ok`,children:n(`Running`)}):e.interrupted===`restart`?(0,G.jsx)(b7,{tone:`pending`,children:n(`Interrupted by restart`)}):null}function zne({task:e}){return g7(e)===`idle`?(0,G.jsx)(`span`,{className:`relative flex size-[22px] shrink-0 items-center justify-center rounded-full border border-dashed border-warning/60 text-warning`,children:(0,G.jsx)(mn,{className:`size-3`})}):(0,G.jsx)(n8,{icon:Un,state:e.status===`running`?`running`:e.status===`failed`?`error`:`ok`})}function Bne(e,t){let n=e.keep;if(!n)return;let r=n.reason??v7(n.at);return n.by===`user`?t(`Kept by you · {{detail}}`,{detail:r}):t(`Kept: {{reason}}`,{reason:r})}function Vne({task:e,className:t}){let{t:n}=K(),r=g7(e)===`kept`?Bne(e,n):void 0;return r?(0,G.jsxs)(`div`,{className:W(`flex min-w-0 items-center gap-1 text-[11px] text-muted-foreground/85`,t),children:[(0,G.jsx)(Sn,{className:`size-3 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate`,title:r,children:r})]}):null}function S7(e,t){window.electronAPI.agent.stopTask(e,t)}function C7(e,t,n){window.electronAPI.agent.keepTask(e,t,n)}function Hne({onStop:e,className:t}){let{t:n}=K();return(0,G.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e()},title:n(`Stop task`),className:W(`flex h-6 shrink-0 items-center rounded-md px-1.5 text-xs text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,t),children:n(`Stop`)})}function w7({sessionId:e,taskId:t}){let{t:n}=K();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(wa,{size:`xs`,variant:`ghost`,className:`text-muted-foreground`,onClick:n=>{n.stopPropagation(),C7(e,t,``)},children:n(`Keep`)}),(0,G.jsx)(wa,{size:`xs`,variant:`outline`,className:`hover:text-destructive`,onClick:n=>{n.stopPropagation(),S7(e,t)},children:n(`Stop`)})]})}var Une=[`pattern`,`query`,`path`,`file_path`],Wne=[`path`,`file_path`,`query`,`pattern`],Gne=[`command`,`cmd`,`script`],Kne=[`path`,`file_path`,`pattern`,`query`,`command`,`url`,`description`,`summary`],qne=120;function T7(e){let t=e.replace(/\s+/g,` `).trim();return t.length>qne?`${t.slice(0,119)}…`:t}function Jne(e){let t=e.toLowerCase();return t.includes(`search`)||t.includes(`grep`)||t===`find`?Une:t===`read`||t.endsWith(`_read`)?Wne:t===`bash`||t.includes(`shell`)||t.includes(`terminal`)?Gne:Kne}function Yne(e,t){let n=t.trim();if(!n)return``;let r;try{r=JSON.parse(n)}catch{return T7(n)}if(r===null)return``;if(typeof r!=`object`||Array.isArray(r))return T7(JSON.stringify(r)??String(r));let i=UR(e,r);if(i.summary!==void 0)return T7(i.summary);if(!i.args||typeof i.args!=`object`)return``;let a=i.args;for(let e of Jne(i.name)){let t=a[e];if(typeof t==`string`&&t.trim())return T7(t)}let o=JSON.stringify(a);return o===`{}`?``:T7(o)}function Xne(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=24}var E7=new Map,Zne=e=>{let t=E7.get(e);return t?new Set(t):new Set},D7=(e,t)=>(E7.set(e,t),t),O7=new Map,Qne=(e,t)=>{let n=O7.get(e)??new Set;O7.set(e,n);for(let e of t)n.add(e);return n},k7=`enso:task-bar-expanded`,A7=new Map,j7=()=>{try{let e=JSON.parse(window.sessionStorage.getItem(k7)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}},$ne=e=>A7.get(e)??j7().includes(e),ere=(e,t)=>{A7.set(e,t);try{let n=j7().filter(t=>t!==e);window.sessionStorage.setItem(k7,JSON.stringify(t?[...n,e]:n))}catch{}return t};function tre({sessionId:e,tasks:t,subagents:n,readOnly:r}){let i=Ce(e=>e.virtualModels),{t:a}=K(),[o,s]=(0,H.useState)(()=>Zne(e)),[c,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(()=>$ne(e)),f=NN(e=>e.pendingAgentOpen);(0,H.useEffect)(()=>{!f||f.sessionId!==e||(l(f.agentId),NN.setState({pendingAgentOpen:null}))},[f,e]);let p=Qne(e,[...t.filter(e=>e.status===`running`).map(e=>e.taskId),...n.filter(e=>e.status===`running`).map(e=>e.id)]),m=(e,t)=>!o.has(e)&&(t===`running`||p.has(e)),h=t.filter(e=>m(e.taskId,e.status)),g=n.filter(e=>m(e.id,e.status));if((0,H.useEffect)(()=>{let r=O7.get(e),i=[...t.filter(e=>e.status!==`running`).map(e=>e.taskId),...n.filter(e=>e.status!==`running`).map(e=>e.id)].filter(e=>r?.has(e)&&!o.has(e)&&e!==c);if(i.length===0)return;let a=setTimeout(()=>{s(t=>{let n=new Set(t);for(let e of i)n.add(e);return D7(e,n)})},5e3);return()=>clearTimeout(a)},[e,t,n,o,c]),h.length===0&&g.length===0)return null;let _=t=>{s(n=>D7(e,new Set(n).add(t))),c===t&&l(null)},v=h.find(e=>e.taskId===c)??null,y=g.find(e=>e.id===c)??null,b=h.length>=2;return(0,G.jsxs)(`div`,{className:`relative mb-1.5`,children:[(v||y)&&(0,G.jsxs)(`div`,{className:`absolute bottom-full left-0 right-0 z-30 mb-1.5 rounded-xl border bg-card shadow-float`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-1.5 text-xs`,children:[(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-muted-foreground`,children:[v?v.command:y?.description,y?.modelId?` · ${hj(i,y.modelId)}`:``]}),v&&(0,G.jsx)(are,{sessionId:e,task:v,readOnly:r}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>l(null),className:`rounded p-0.5 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(er,{className:`h-3.5 w-3.5`})})]}),v&&(0,G.jsx)(ore,{sessionId:e,task:v,readOnly:r}),y&&(0,G.jsx)(sre,{agent:y},y.id)]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-xl border bg-card p-1 shadow-xs`,children:[b&&(0,G.jsx)(nre,{sessionId:e,tasks:h,expanded:u,readOnly:r,onToggle:()=>d(ere(e,!u))}),(!b||u)&&h.map(t=>(0,G.jsx)(ire,{sessionId:e,task:t,readOnly:r,open:c===t.taskId,onToggle:()=>l(c===t.taskId?null:t.taskId),onDismiss:()=>_(t.taskId)},t.taskId)),g.map(t=>(0,G.jsxs)(rre,{icon:ut,status:t.status,meta:(0,G.jsx)(fre,{agent:t}),open:c===t.id,onToggle:()=>l(c===t.id?null:t.id),stopTitle:a(`Stop subagent`),onStop:r?void 0:()=>void window.electronAPI.agent.stopSubagent(e,t.id),onDismiss:()=>_(t.id),children:[t.agentType&&(0,G.jsx)(`span`,{className:`shrink-0 font-medium`,children:t.agentType}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,children:[t.description,t.modelId&&(0,G.jsxs)(`span`,{className:`text-muted-foreground/60`,children:[` `,`· `,hj(i,t.modelId)]}),t.status===`running`&&t.currentActivity&&(0,G.jsxs)(`span`,{className:`text-muted-foreground/60`,children:[` · `,t.currentActivity]})]})]},t.id))]})]})}function nre({sessionId:e,tasks:t,expanded:n,readOnly:r,onToggle:i}){let{t:a}=K(),o=y7(1e3),[s,c]=(0,H.useState)(!1),l=t.filter(e=>e.status===`running`),u=t.filter(e=>g7(e)===`idle`).length,d=l.reduce((e,t)=>Math.min(e,t.startedAt),o),f=!r&&l.length>0;return(0,H.useEffect)(()=>{f||c(!1)},[f]),(0,G.jsxs)(`div`,{"data-enso":`background-task-summary`,className:`flex min-h-[30px] min-w-0 items-center gap-2 rounded-lg px-1 text-[13px]`,children:[(0,G.jsx)(n8,{icon:Un,state:l.length>0?`running`:`ok`}),s?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs`,children:a(`Stop {{count}} background tasks?`,{count:l.length})}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>c(!1),className:`flex h-6 shrink-0 items-center rounded-md px-1.5 text-xs whitespace-nowrap text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:a(`Cancel`)}),(0,G.jsx)(`button`,{type:`button`,"data-enso":`background-task-stop-all-confirm`,onClick:()=>{for(let t of l)S7(e,t.taskId);c(!1)},className:`flex h-6 shrink-0 items-center rounded-md bg-destructive/10 px-1.5 text-xs whitespace-nowrap text-destructive transition-colors hover:bg-destructive/15`,children:a(`Stop {{count}}`,{count:l.length})})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,"data-enso":`background-task-summary-toggle`,onClick:i,"aria-expanded":n,className:`flex h-6 min-w-0 flex-1 items-center gap-1.5 rounded-md text-left text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,G.jsxs)(`span`,{className:`min-w-0 truncate`,children:[a(`{{count}} background tasks`,{count:t.length}),l.length>0&&` · ${a(`longest running {{duration}}`,{duration:yN(o-d)})}`]}),u>0&&(0,G.jsx)(b7,{tone:`pending`,className:`whitespace-nowrap`,children:a(`{{count}} suspected idle`,{count:u})}),(0,G.jsx)(ht,{className:W(`h-3 w-3 shrink-0 transition-transform`,n&&`rotate-180`)})]}),f&&(0,G.jsx)(`button`,{type:`button`,"data-enso":`background-task-stop-all`,onClick:()=>c(!0),className:`flex h-6 shrink-0 items-center rounded-md px-1.5 text-xs whitespace-nowrap text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,children:a(`Stop all`)})]})]})}function rre({icon:e,status:t,meta:n,open:r,onToggle:i,stopTitle:a,onStop:o,onDismiss:s,children:c}){let{t:l}=K();return(0,G.jsxs)(`div`,{className:`flex min-h-[30px] min-w-0 items-center gap-2 px-1 text-[13px]`,children:[(0,G.jsx)(n8,{icon:e,state:t===`running`?`running`:t===`failed`?`error`:`ok`}),c,n,(0,G.jsxs)(`button`,{type:`button`,onClick:i,"aria-expanded":r,className:`flex h-6 shrink-0 items-center gap-0.5 rounded-md px-1.5 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[l(`Output`),(0,G.jsx)(ht,{className:W(`h-3 w-3 transition-transform`,r&&`rotate-180`)})]}),t===`running`?o&&(0,G.jsx)(`button`,{type:`button`,onClick:o,title:a,className:`flex h-6 shrink-0 items-center rounded-md px-1.5 text-xs text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,children:l(`Stop`)}):(0,G.jsx)(`button`,{type:`button`,onClick:s,className:`flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(er,{className:`h-3 w-3`})})]})}function ire({sessionId:e,task:t,readOnly:n,open:r,onToggle:i,onDismiss:a}){let{t:o}=K(),s=y7(),c=g7(t);return(0,G.jsxs)(`div`,{"data-enso":`background-task-row`,"data-view":c,className:W(`flex min-h-[30px] min-w-0 items-center gap-2 rounded-lg px-1 text-[13px]`,c===`kept`&&`py-1`,c===`idle`&&`bg-warning/[0.06]`,r&&`bg-muted`),children:[(0,G.jsx)(zne,{task:t}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,title:t.command,children:t.command}),c===`idle`&&(0,G.jsx)(b7,{tone:`pending`,children:x7(t,s,o)})]}),(0,G.jsx)(Vne,{task:t,className:`mt-0.5`})]}),(0,G.jsx)(pre,{task:t}),(0,G.jsxs)(`button`,{type:`button`,onClick:i,"aria-expanded":r,className:W(`flex h-6 shrink-0 items-center gap-0.5 rounded-md px-1.5 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,r&&`bg-foreground/[0.06] text-foreground`),children:[o(`Output`),(0,G.jsx)(ht,{className:W(`h-3 w-3 transition-transform`,r&&`rotate-180`)})]}),t.status===`running`?n?null:c===`idle`?(0,G.jsx)(w7,{sessionId:e,taskId:t.taskId}):(0,G.jsx)(Hne,{onStop:()=>S7(e,t.taskId)}):(0,G.jsx)(`button`,{type:`button`,onClick:a,className:`flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(er,{className:`h-3 w-3`})})]})}function are({sessionId:e,task:t,readOnly:n}){let{t:r}=K(),i=y7(),a=g7(t);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Rne,{task:t,now:i}),!n&&a===`idle`&&(0,G.jsx)(w7,{sessionId:e,taskId:t.taskId}),!n&&a===`kept`&&(0,G.jsx)(wa,{size:`xs`,variant:`ghost`,className:`text-muted-foreground`,onClick:()=>C7(e,t.taskId,null),children:r(`Unkeep`)})]})}function M7({icon:e,label:t,value:n}){return(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-md bg-muted px-2 py-1.5`,children:[(0,G.jsx)(e,{className:`size-3.5 shrink-0 text-warning`}),(0,G.jsx)(`span`,{className:`truncate text-muted-foreground`,children:t}),(0,G.jsx)(`span`,{className:`ml-auto shrink-0 font-medium tabular-nums`,children:n})]})}function N7({children:e}){return(0,G.jsx)(`div`,{className:`text-[11px] text-subtle-foreground tabular-nums`,children:e})}function ore({sessionId:e,task:t,readOnly:n}){let{t:r}=K(),i=y7(),a=g7(t),o=Ine(i-t.startedAt),s=t.idle?.ports??[],c=a===`idle`||a===`kept`;return(0,G.jsxs)(G.Fragment,{children:[a===`idle`&&(0,G.jsxs)(`div`,{className:`space-y-2.5 px-3 py-2.5 text-xs`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-3 gap-1.5`,children:[(0,G.jsx)(M7,{icon:kt,label:r(`No new output`),value:_7(i-(t.idle?.since??i),r)}),(0,G.jsx)(M7,{icon:Yn,label:s.length>0?r(`Port {{ports}}`,{ports:s.join(`, `)}):r(`Ports`),value:s.length>0?r(`No connections`):r(`Not listening`)}),(0,G.jsx)(M7,{icon:Pt,label:`CPU`,value:`0%`})]}),(0,G.jsx)(N7,{children:r(`Running for {{duration}} · Suspected idle tasks are never stopped automatically`,{duration:o})})]}),a===`kept`&&t.keep&&(0,G.jsxs)(`div`,{className:`space-y-2.5 px-3 py-2.5 text-xs`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md bg-muted px-2.5 py-2`,children:[(0,G.jsx)(Sn,{className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[t.keep.by===`user`&&!n?(0,G.jsx)(`input`,{"data-enso":`background-task-keep-reason`,defaultValue:t.keep.reason??``,maxLength:200,placeholder:r(`Add a reason (optional)`),className:`w-full bg-transparent text-[13px] outline-none placeholder:text-subtle-foreground`,onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},onBlur:n=>{let r=n.currentTarget.value.trim();r!==(t.keep?.reason??``)&&C7(e,t.taskId,r)}},t.keep.at):(0,G.jsx)(`div`,{className:`text-[13px]`,children:t.keep.reason??`—`}),(0,G.jsx)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:t.keep.by===`agent`?r(`Kept by the agent at {{time}} when wrapping up`,{time:v7(t.keep.at)}):r(`Kept by you at {{time}}`,{time:v7(t.keep.at)})})]})]}),(0,G.jsx)(N7,{children:r(`Running for {{duration}}`,{duration:o})})]}),c&&(0,G.jsx)(`div`,{className:`flex items-center gap-2 border-t border-border/60 px-3 pt-2 text-[11px] text-subtle-foreground`,children:(0,G.jsx)(`span`,{children:r(`Recent output`)})}),(0,G.jsx)(mre,{tail:t.tail,outputBytes:t.outputBytes,running:t.status===`running`,framed:!c})]})}function sre({agent:e}){let{t}=K(),n=e.activities??[],r=(0,H.useRef)(null),i=(0,H.useRef)(!0);return(0,H.useEffect)(()=>{let e=r.current;e&&i.current&&(e.scrollTop=e.scrollHeight)},[n,e.resultText]),(0,G.jsxs)(`div`,{ref:r,className:`max-h-96 space-y-2 overflow-auto px-3 py-2 text-sm`,onScroll:e=>{i.current=Xne(e.currentTarget)},children:[n.map(e=>(0,G.jsx)(cre,{activity:e},e.id)),n.length===0&&!e.resultText&&(0,G.jsx)(`pre`,{className:`font-mono text-xs whitespace-pre-wrap text-muted-foreground`,children:(e.activityLog??[]).join(`
|
|
262
|
-
`)||t(`(no output yet)`)}),e.detailsPruned&&(0,G.jsx)(`div`,{className:`rounded-md border border-dashed px-2.5 py-2 text-xs text-muted-foreground`,children:t(`Earlier activity details were cleared; the final report is still available.`)}),e.resultText&&e.status!==`running`&&(0,G.jsxs)(`section`,{className:W(`rounded-lg border px-3 py-2`,e.status===`failed`?`border-destructive/30 bg-destructive/5`:`border-blue-500/30 bg-blue-500/5`),children:[(0,G.jsx)(`div`,{className:`mb-1.5 font-medium text-xs text-foreground`,children:t(`Final report`)}),(0,G.jsx)(E4,{text:e.resultText})]})]})}function cre({activity:e}){let{t}=K(),[n,r]=(0,H.useState)(!1);if(e.type===`assistant`)return(0,G.jsxs)(`section`,{className:`rounded-md bg-muted/30 px-2.5 py-2`,children:[(0,G.jsx)(`div`,{className:`mb-1 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:t(`Assistant`)}),(0,G.jsx)(dre,{text:e.text,markdown:!0})]});let i=Yne(e.toolName,e.argumentsText),a=UR(e.toolName,e.argumentsText).name,o=BR(a),s=`subagent-tool-${e.id.replace(/[^A-Za-z0-9_-]/g,`-`)}`;return(0,G.jsxs)(`section`,{className:`border-b border-border/40 last:border-b-0`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-controls":s,"aria-expanded":n,onClick:()=>r(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-md px-1.5 py-1 text-left text-xs transition-colors hover:bg-muted/50`,children:[(0,G.jsx)(lre,{toolName:a}),(0,G.jsx)(`span`,{className:`shrink-0 font-medium text-foreground/80`,children:o?.tool??a}),i&&(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground`,title:i,children:i}),!i&&(0,G.jsx)(`span`,{className:`min-w-0 flex-1`}),(0,G.jsx)(ure,{status:e.status,label:t(e.status)}),(0,G.jsx)(gt,{"aria-hidden":`true`,className:W(`h-3 w-3 shrink-0 text-muted-foreground transition-transform`,n&&`rotate-90`)})]}),n&&(0,G.jsxs)(`div`,{id:s,className:`ml-5 border-border/50 border-l pb-2 pl-2.5`,children:[o&&(0,G.jsxs)(`div`,{className:`mb-1 truncate font-mono text-[10px] text-muted-foreground/70`,children:[o.server,`.`,o.tool]}),(0,G.jsx)(`div`,{className:`text-[10px] text-muted-foreground/70`,children:t(`Arguments`)}),(0,G.jsx)(`pre`,{className:`max-h-28 overflow-auto font-mono text-[10px] leading-relaxed whitespace-pre-wrap text-muted-foreground/80`,children:s3(e.argumentsText)}),e.outputText&&(0,G.jsxs)(`div`,{className:`mt-1.5 border-border/40 border-t pt-1.5`,children:[(0,G.jsx)(`div`,{className:`mb-0.5 text-[10px] text-muted-foreground`,children:t(`Result`)}),(0,G.jsx)(`pre`,{className:`overflow-auto font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-foreground/80`,children:s3(e.outputText)})]})]})]})}function lre({toolName:e}){let t=e.toLowerCase(),n=`h-3.5 w-3.5 shrink-0 text-muted-foreground`;return t.includes(`search`)||t.includes(`grep`)||t===`find`?(0,G.jsx)(jn,{"aria-hidden":`true`,className:n}):t===`read`||t===`write`||t===`edit`||t===`apply_patch`||t.endsWith(`_read`)?(0,G.jsx)(Bt,{"aria-hidden":`true`,className:n}):t===`bash`||t===`exec`||t===`codemode`||t.includes(`shell`)||t.includes(`terminal`)?(0,G.jsx)(qn,{"aria-hidden":`true`,className:n}):(0,G.jsx)($n,{"aria-hidden":`true`,className:n})}function ure({status:e,label:t}){let n=`h-3.5 w-3.5`;return(0,G.jsx)(`span`,{role:`status`,"aria-label":t,title:t,className:W(`shrink-0`,e===`failed`?`text-destructive`:`text-muted-foreground`),children:e===`running`?(0,G.jsx)(an,{"aria-hidden":`true`,className:W(n,`animate-spin`)}):e===`done`?(0,G.jsx)(mt,{"aria-hidden":`true`,className:n}):e===`failed`?(0,G.jsx)(bt,{"aria-hidden":`true`,className:n}):(0,G.jsx)(st,{"aria-hidden":`true`,className:n})})}function dre({text:e,label:t,markdown:n=!1}){let{t:r}=K(),i=e.length>800||e.split(`
|
|
263
|
-
`).length>16,a=n?(0,G.jsx)(E4,{text:e}):(0,G.jsx)(`pre`,{className:`overflow-x-auto font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-muted-foreground`,children:s3(e)});return i?(0,G.jsxs)(`details`,{className:`group/details`,children:[(0,G.jsxs)(`summary`,{className:`cursor-pointer text-[10px] text-muted-foreground hover:text-foreground`,children:[t?`${t} · `:``,r(`{{count}} chars`,{count:e.length})]}),(0,G.jsx)(`div`,{className:`mt-1.5`,children:a})]}):(0,G.jsxs)(`div`,{children:[t&&(0,G.jsx)(`div`,{className:`mb-0.5 text-[10px] text-muted-foreground`,children:t}),a]})}function fre({agent:e}){let[,t]=(0,H.useState)(0);return(0,H.useEffect)(()=>{if(e.status!==`running`)return;let n=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(n)},[e.status]),(0,G.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums`,children:[e.steps>0?`${e.steps} steps · `:``,e.outputTokens?`${e.outputTokens} tok · `:``,e.status===`running`?yN(Date.now()-e.startedAt):e.status]})}function pre({task:e}){let[,t]=(0,H.useState)(0);return(0,H.useEffect)(()=>{if(e.status!==`running`)return;let n=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(n)},[e.status]),(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums`,children:e.status===`running`?yN(Date.now()-e.startedAt):e.exitCode===void 0?e.status:`exit ${e.exitCode}`})}function mre({tail:e,outputBytes:t,running:n,framed:r=!0}){let{t:i}=K(),a=(0,H.useRef)(null);return(0,H.useEffect)(()=>{let e=a.current;e&&(e.scrollTop=e.scrollHeight)},[e]),(0,G.jsx)(`pre`,{ref:a,className:W(`max-h-56 overflow-auto font-mono text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground`,r?`border-t border-border/60 px-2.5 py-2`:`px-3 pt-1 pb-2.5`),children:s3(e)||(t===void 0?i(`Loading…`):t>0?i(`Output written ({{size}}), not loaded yet`,{size:Zz(t)}):n?`${i(`(no output yet)`)}\n${i(`The process has not written anything. Without a terminal, some programs buffer output and only write it in blocks or on exit.`)}`:i(`(no output yet)`))})}function hre(e){return{sessionId:e.sessionId,canRewind:!e.bot&&!e.deviceReadOnly,canRetry:!e.bot&&!e.deviceReadOnly,canFork:!1,...e.bot?{botSession:!0}:{}}}var P7=7e5,gre=1600;async function F7(e,t=P7,n=gre){let r=await createImageBitmap(e),i=Math.min(1,n/Math.max(r.width,r.height)),a=document.createElement(`canvas`);a.width=Math.round(r.width*i),a.height=Math.round(r.height*i);let o=a.getContext(`2d`);if(!o)throw Error(`画布不可用`);o.drawImage(r,0,0,a.width,a.height),r.close();for(let e of[.85,.7,.55,.4]){let n=a.toDataURL(`image/jpeg`,e),r=n.slice(n.indexOf(`,`)+1);if(r.length*.75<=t)return{data:r,mimeType:`image/jpeg`}}throw Error(`图片太大,请换一张更小的图`)}var I7=e=>Math.floor(P7/Math.max(1,e));async function L7(e,t){try{return await F7(e,t)}catch{return F7(e,t,1024)}}async function _re(e){let t=I7(e.length),n=[];for(let r of e)n.push(await L7(r,t));return n}function vre(e,t,n,r){let i=e?.find(e=>e.id===n);if(!i)return null;let a=i.text;return{sessionId:t,messageId:n,text:a,...i.hasImages?{hasImages:!0}:{},priorMatches:r.filter(e=>R7(a,e)).length,priorUserCount:r.length}}function R7(e,t){if(t===e)return!0;let n=T3(t);return n!==null&&e.trimStart().startsWith(n)}function yre(e,t,n){let r=new Set(t.filter(e=>e.sessionId===n).map(e=>e.messageId));return(e??[]).filter(e=>!r.has(e.id))}function bre(e,t,n){let r=t.filter(e=>e.sessionId===n).map(e=>Sre(e));return r.length===0?[...e]:[...e,...r]}function xre(e,t,n,r){return e.filter(e=>e.sessionId===t?r?.turnSettled&&n.length>e.priorUserCount?!1:e.text?n.filter(t=>R7(e.text,t)).length<=e.priorMatches:n.length<=e.priorUserCount:!0)}function z7(e){return e.filter(e=>e.role===`user`).map(Cre)}function Sre(e){let t=e.text||(e.hasImages?`[image]`:``);return{role:`user`,content:t?[{type:`text`,text:t}]:[]}}function Cre(e){return e.content.map(e=>e.type===`text`?e.text:``).join(`
|
|
264
|
-
`).trim()}var wre=e=>e===`outbox-discarding`?`正在移除…`:e===`outbox-discard`?`移除未保存,请勿关闭页面;请再次移除,重启后可能重新入队`:e===`outbox-storage`?`无法保存离线消息,请勿关闭页面;可重试或复制消息`:e===`delivery-unconfirmed`?`未收到回执,发送结果未确认;可重试确认`:e===`read-only`?`此设备为只读`:e===`session-busy`?`请等当前回复结束`:e&&Ss(`zh`,Oa(e)??e),B7=(e=!1)=>e?`此设备为只读,刚才的操作未执行;可在桌面「设置 → 设备」切换为可操作`:`此设备为只读,只能查看;可在桌面「设置 → 设备」切换为可操作`,Tre=70;function Ere({percent:e,critical:t}){return(0,G.jsx)(`span`,{"aria-hidden":!0,className:`h-1 w-7 shrink-0 overflow-hidden rounded-full bg-muted-foreground/20`,children:(0,G.jsx)(`span`,{className:W(`block h-full rounded-full`,t?`bg-destructive`:e>=Tre?`bg-warning`:`bg-muted-foreground/70`),style:{width:`${e}%`}})})}function Dre(e,t){let n={inputTokens:0,outputTokens:0,...e};return t&&(n.contextUsed=t.used,t.window!==void 0&&(n.contextWindow=t.window)),n.inputTokens===0&&n.outputTokens===0&&n.cacheHitPercent===void 0&&n.ttftAvgMs===void 0&&n.tokensPerSecond===void 0&&n.contextUsed===void 0?void 0:n}function Ore(e,t){let n={tokens:void 0,cache:void 0,context:void 0,speed:void 0};if(!t)return n;if(t.contextUsed!==void 0){let e=t.contextUsed,r=t.contextWindow??0;if(r>0){let t=Math.min(100,Math.round(e/r*100));n.context={compact:`${t}%`,full:`${vN(r)} · ${t}%`,percent:t,critical:t>=90}}else n.context={compact:`${vN(e)}·?`,full:`${vN(e)} · ?`}}let r=[],i=[];return t.ttftAvgMs!==void 0&&(r.push(yN(t.ttftAvgMs)),i.push(e(`First token avg {{duration}}`,{duration:yN(t.ttftAvgMs)}))),t.tokensPerSecond!==void 0&&(r.push(`${t.tokensPerSecond} tok/s`),i.push(e(`{{speed}} tok/s`,{speed:t.tokensPerSecond}))),r.length>0&&(n.speed={compact:r.join(` · `),full:i.join(` · `)}),(t.inputTokens>0||t.outputTokens>0)&&(n.tokens={compact:`↑${vN(t.inputTokens)} ↓${vN(t.outputTokens)}`,full:e(`Input {{input}} tok · Output {{output}} tok`,{input:vN(t.inputTokens),output:vN(t.outputTokens)})}),t.cacheHitPercent!==void 0&&(n.cache={compact:`${t.cacheHitPercent}%`,full:e(`Cache hit {{percent}}%`,{percent:t.cacheHitPercent})}),n}var kre=[[`tokens`,At],[`cache`,Ft],[`context`,Gt],[`speed`,tr]];function Are({usageTotals:e,context:t}){let{t:n}=K(),r=Ore(n,Dre(e,t));return(0,G.jsx)(`div`,{"data-slot":`stats-line`,className:`flex min-h-6 flex-wrap items-center justify-center gap-x-3 px-1`,children:kre.map(([e,t])=>{let n=r[e];return n?(0,G.jsxs)(`span`,{className:W(`flex items-center gap-1 text-[11px] tabular-nums`,n.critical?`text-destructive`:`text-muted-foreground/80`),children:[n.percent===void 0?(0,G.jsx)(t,{className:`h-3 w-3 shrink-0 opacity-75`}):(0,G.jsx)(Ere,{percent:n.percent,critical:!!n.critical}),n.compact]},e):null})})}function V7(e){let{view:t,sessionId:n}=e,r=(0,H.useRef)(null),[i,a]=(0,H.useState)(!1),o=(0,H.useRef)(null),s=(0,H.useRef)(null),c=(0,H.useRef)(!1);(0,H.useLayoutEffect)(()=>{let e=o.current,t=s.current,n=e?.querySelector(`[aria-selected="true"]`);!e||!t||!n||(c.current||(t.style.transition=`none`),t.style.transform=`translate(${n.offsetLeft}px, ${n.offsetTop}px)`,t.style.width=`${n.offsetWidth}px`,t.style.height=`${n.offsetHeight}px`,c.current||=(t.offsetWidth,t.style.transition=``,!0))},[n,e.tabGroup]);let l=t?.status===`running`,u=e.bot,d=!!(u?.readOnly||e.deviceReadOnly),f=e.artifacts?.chatId,p=e.artifacts?.conversationId,m=(0,H.useMemo)(()=>({...hre({sessionId:n,bot:u,deviceReadOnly:e.deviceReadOnly}),...f&&p?{turnFooter:e=>(0,G.jsx)(Ka,{target:{chatId:f,conversationId:p,messageIndex:e}})}:{}}),[n,u,e.deviceReadOnly,f,p]),h=(0,H.useMemo)(()=>{if(u)return[];let t=[{name:`/goal`,description:`Set a session goal (/goal <objective> · pause · resume · clear)`},{name:`/compact`,description:`Compact the context now (/compact [summary focus])`}],n=(e.slashCommands??[]).filter(e=>e.name!==`/goal`&&e.name!==`/compact`);return[...t,...n]},[e.slashCommands,u]),g=(0,H.useMemo)(()=>t?[...t.messages.entries()].sort((e,t)=>e[0]-t[0]):[],[t]),_=(0,H.useMemo)(()=>bre(g.map(([,e])=>e),e.echoes??[],n??``),[g,e.echoes,n]),v=_.length>0||t?.status===`running`||t?.status===`failed`;MN(n?{id:n,projectId:``,status:t?.status??`idle`,started:v,spawning:!1,messages:_,queuedMessages:e.queued?.map(e=>({id:e.id,text:e.text}))}:null);let y=(0,H.useMemo)(()=>wV(_,l,[],e.cwd,{pendingApprovals:t?.approvals,compaction:t?.compaction,compactionNoticeAt:L(g.map(([e])=>e),t?.compactionNoticeAt)}),[_,g,l,e.cwd,t?.approvals,t?.compaction,t?.compactionNoticeAt]),b=t?.messages.size?Math.min(...t.messages.keys()):null,x=(0,H.useRef)(null),S=(0,H.useCallback)(()=>{if(!e.hasOlder||!e.onLoadOlder)return;let t=r.current?.getScroller();x.current=t?{height:t.scrollHeight,top:t.scrollTop}:null,e.onLoadOlder()},[e.hasOlder,e.onLoadOlder]);(0,H.useLayoutEffect)(()=>{let e=r.current?.getScroller(),t=x.current;!e||!t||(x.current=null,e.scrollTop=t.top+(e.scrollHeight-t.height))},[b]),(0,H.useEffect)(()=>{r.current?.isAtBottom()&&r.current.pinToBottom()},[y]);let C=async(t,n)=>{a(!0);try{let i=I7(n.length),a=[];for(let e of n)a.push(await jre(e,i));e.onSend(t,a),r.current?.scrollToBottom()}finally{a(!1)}};return(0,G.jsx)(DN.Provider,{value:m,children:(0,G.jsxs)(`div`,{className:`phone-chat-root flex h-full min-h-0 flex-col`,children:[(0,G.jsxs)(`header`,{className:`flex shrink-0 items-center gap-1 border-b bg-background px-2 py-2 pt-safe`,children:[u?.onBack||!e.drawerDocked?(0,G.jsx)(`button`,{type:`button`,onClick:u?.onBack??e.onOpenDrawer,"aria-label":u?.onBack?`返回群聊`:`打开会话列表`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:u?.onBack?(0,G.jsx)(_t,{className:`h-4.5 w-4.5`}):(0,G.jsx)(yn,{className:`h-4.5 w-4.5`})}):(0,G.jsx)(`span`,{className:`h-9 w-9 shrink-0`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 text-center`,children:[(0,G.jsxs)(`p`,{className:`flex min-w-0 items-center justify-center gap-1.5`,children:[e.connState!==`host-offline`&&e.connState!==`unauthorized`&&(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 shrink-0 rounded-full`,e.connState===`online`&&!e.syncing?`bg-emerald-500`:`animate-pulse bg-amber-500`),title:e.connState===`online`&&e.syncing?`同步中…`:e.stateLabel}),(0,G.jsx)(`span`,{className:`truncate font-medium text-sm`,children:e.title})]}),(0,G.jsx)(`p`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.projectName||e.stateLabel})]}),u?.readOnly?(0,G.jsx)(`span`,{className:`h-9 w-9 shrink-0`}):(0,G.jsx)(`button`,{type:`button`,onClick:e.onNewSession,disabled:!e.canCreate||d||!!u&&i||e.connState!==`online`,"aria-label":`新建会话`,title:e.newSessionHint??`新建会话`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-40`,children:(0,G.jsx)(Vn,{className:`h-4.5 w-4.5`})})]}),e.connState===`host-offline`&&(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center justify-center gap-1.5 bg-amber-500/10 py-1 text-amber-700 text-xs dark:text-amber-400`,children:[(0,G.jsx)(an,{className:`h-3 w-3 animate-spin`,"aria-hidden":!0}),(0,G.jsx)(`span`,{children:e.stateLabel})]}),e.tabGroup&&e.tabGroup.children.length>0&&(0,G.jsxs)(`div`,{ref:o,role:`tablist`,className:`t-tabs relative flex shrink-0 items-center justify-start gap-1 overflow-x-auto border-b px-2 py-1`,children:[(0,G.jsx)(`span`,{ref:s,"aria-hidden":`true`,className:`t-tabs-pill pointer-events-none absolute top-0 left-0 z-0 rounded-md bg-muted`}),(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":n===e.tabGroup.parent.id,className:H7(n===e.tabGroup.parent.id),onClick:()=>e.onSelectTab?.(e.tabGroup?.parent.id??``),children:[(0,G.jsx)(cn,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`max-w-40 truncate`,children:e.tabGroup.parent.title||`新对话`})]}),e.tabGroup.children.map(t=>(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":n===t.id,className:H7(n===t.id),onClick:()=>e.onSelectTab?.(t.id),children:[(0,G.jsx)(ut,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`max-w-28 truncate`,children:t.title||`coworker`}),(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 shrink-0 rounded-full`,t.status===`running`?`animate-pulse bg-brand`:t.status===`failed`?`bg-destructive`:`bg-muted-foreground/30`)})]},t.id))]}),n===null?(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,G.jsx)(`span`,{className:`mb-3 flex size-11 items-center justify-center rounded-[13px] border border-brand/20 bg-brand/8 text-brand dark:bg-brand/14`,children:(0,G.jsx)(kN,{className:`size-6`})}),(0,G.jsx)(`p`,{className:`font-semibold text-[22px] tracking-tight`,children:`EnsoCode`}),(0,G.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e.connState===`online`?`从左上角选择会话,或新建一个`:e.stateLabel})]}):(0,G.jsx)(One,{ref:r,items:y,busy:t===null?!!e.syncing:l,loading:t===null,running:l,error:void 0,emptyTitle:e.projectName||`EnsoCode`,virtualize:!1,historyLoading:e.historyLoading,hasOlder:e.hasOlder,firstItemIndex:b??0,onStartReached:e.hasOlder?S:void 0},n),n!==null&&(0,G.jsx)(`div`,{className:`phone-dock @container shrink-0 pt-1 pb-safe`,children:(0,G.jsxs)(`div`,{className:`enso-chat-col mx-auto w-full max-w-2xl px-4 @min-[56rem]:max-w-3xl @min-[72rem]:max-w-4xl @min-[84rem]:max-w-5xl @min-[96rem]:max-w-6xl @min-[112rem]:max-w-7xl`,children:[t?.retry&&(0,G.jsx)(Fne,{retry:t.retry}),!d&&(0,G.jsx)(UN,{conversationId:n,queued:(e.queued??[]).map(e=>({id:e.id,text:e.text}))}),e.goal&&!d&&(0,G.jsx)(BN,{conversationId:n,goal:{...e.goal,noProgressRuns:0}}),(0,G.jsx)(S8,{conversationId:n},n),(0,G.jsx)(tre,{sessionId:n,tasks:t?.tasks??[],subagents:t?.subagents??[],readOnly:e.deviceReadOnly}),u?.outbox,u?.notice&&(0,G.jsx)(`p`,{className:`mb-1 rounded-md bg-destructive/10 px-2 py-1 text-destructive text-xs`,children:u.notice}),e.deviceReadOnly?(0,G.jsx)(`p`,{className:`mb-1 rounded-md bg-muted px-2 py-1 text-center text-muted-foreground text-xs`,children:B7(e.readOnlyRejected)}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(g_,{approvals:t?.approvals??[],onRespond:e.onApproval,clockOffset:e.clockOffset}),(0,G.jsx)(b_,{asks:t?.asks??[],onAnswer:e.onAsk,clockOffset:e.clockOffset,autoFocus:!1})]}),!d&&(0,G.jsx)(EN,{commands:h,running:l,busy:l,locked:e.newSessionBusy||!!u&&i||(t?.approvals??[]).length>0,focusKey:u?.chatId?`bot-chat:${u.chatId}`:n,autoFocus:!1,enterToSend:!1,toolbar:e.modelLabel&&e.onOpenConfig?(0,G.jsxs)(`button`,{type:`button`,onClick:e.onOpenConfig,className:`flex min-w-0 items-center gap-0.5 rounded-md px-1.5 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:[(0,G.jsx)(`span`,{className:`truncate`,children:e.modelLabel}),(0,G.jsx)(ht,{className:`h-3 w-3 shrink-0`})]}):void 0,onSend:e=>{C(e.text,e.images)},onAbort:e.onAbort}),!d&&(0,G.jsx)(Are,{usageTotals:e.usageTotals,context:e.context})]})})]})})}function H7(e){return W(`t-tab flex min-w-0 shrink-0 items-center gap-1.5 rounded-md px-2 py-1 text-xs transition-colors`,e?`font-medium`:`text-muted-foreground`)}async function jre(e,t){if(e.data.length*.75<=t)return e;let n=await(await fetch(`data:${e.mimeType};base64,${e.data}`)).blob();return L7(new File([n],`image`,{type:e.mimeType}),t)}function U7(e){if(e.kind===`ssh`)return e.sshConnectionName?.trim()||e.sshHost}function W7(e){return e.alias?.trim()||e.name}function G7(e){let t=W7(e),n=U7(e);return n?`${t} (${n})`:t}var K7=`enso-phone-drawer-segment`;function Mre(){let e=localStorage.getItem(K7);return e===`bot`||e===`code`?e:null}function Nre(e){localStorage.setItem(K7,e)}function q7(e,t){if(!e)return!1;let n=Mre();return n?n===`bot`:t!==null}function Pre(e,t=0){let n=new Map;for(let r of e)if(!(r.seq<=t)&&((r.kind===`human`||r.newConversation)&&n.clear(),r.kind===`bot`&&r.botId&&n.delete(r.botId),r.failure&&n.set(r.failure.botId,r.id),r.retryOf))for(let[e,t]of n)t===r.retryOf&&n.delete(e);return new Set(n.values())}function Fre(e,t){let n=RegExp(`#${t}(?!\\d)`).exec(e);if(!n)return;let r=n.index+n[0].length;return[e.slice(0,n.index),n[0],e.slice(r)]}function Ire({status:e}){return e===`running`?(0,G.jsx)(an,{className:`h-3 w-3 shrink-0 animate-spin text-brand`}):e===`done`?(0,G.jsx)(mt,{className:`h-3 w-3 shrink-0 text-muted-foreground`}):e===`denied`?(0,G.jsx)(Ln,{className:`h-3 w-3 shrink-0 text-muted-foreground`}):e===`timeout`?(0,G.jsx)(kt,{className:`h-3 w-3 shrink-0 text-warning`}):(0,G.jsx)(er,{className:`h-3 w-3 shrink-0 text-destructive`})}function Lre({item:e,bots:t,clockOffset:n,onOpen:r}){let i=t.get(e.botId),a=e.ownerBotId?t.get(e.ownerBotId):void 0,o=e.state!==`queued`,[s,c]=(0,H.useState)(()=>Date.now());(0,H.useEffect)(()=>{if(!o)return;let e=window.setInterval(()=>c(Date.now()),1e3);return()=>window.clearInterval(e)},[o]);let l=s-n,u=o&&r?()=>r(e.conversationId):void 0;return(0,G.jsxs)(`button`,{type:`button`,disabled:!u,onClick:u,className:`flex w-full gap-2 rounded-lg border bg-muted/30 px-2.5 py-2 text-left disabled:cursor-default`,children:[(0,G.jsx)(Mo,{bot:i,size:`sm`,busy:o}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,G.jsxs)(`span`,{className:`truncate font-medium`,children:[i?.name??`成员`,a?(0,G.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[` 替 `,a.name]}):null]}),(0,G.jsx)(`span`,{className:W(`shrink-0`,o?`text-brand`:`text-muted-foreground`),children:ss(e)}),o&&e.startedAt!==void 0&&(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:us(l-e.startedAt)}),u&&(0,G.jsx)(gt,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-muted-foreground`})]}),e.more>0&&(0,G.jsxs)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:[`+`,e.more,` 个更早的步骤`]}),e.steps.map((e,t)=>(0,G.jsxs)(`span`,{className:`mt-1 flex items-center gap-1.5 text-[11px]`,children:[(0,G.jsx)(Ire,{status:e.status}),(0,G.jsx)(`span`,{className:`shrink-0 font-medium`,children:e.name}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-muted-foreground`,children:e.detail}),e.status===`timeout`&&(0,G.jsx)(`span`,{className:`shrink-0 text-warning`,children:e.name===`ask_user`?`已超时未回答`:`已超时拒绝`}),(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:e.durationMs===void 0?e.startedAt===void 0?``:us(l-e.startedAt):us(e.durationMs)})]},t))]})]})}var J7=e=>[...e].sort((e,t)=>t.activityAt-e.activityAt);function Rre(e,t,n=10){let r=J7(e),i=e=>e.id===t.currentId||e.id===t.rootId?0:e.unread||e.running?1:2,a=new Set([...r].sort((e,t)=>i(e)-i(t)).slice(0,n).map(e=>e.id));return r.filter(e=>a.has(e.id)).sort((e,n)=>Number(n.id===t.rootId)-Number(e.id===t.rootId))}function zre(e,t,n){let r=t.trim().toLowerCase();return J7(e).filter(e=>(n===`all`||(n===`unread`?e.unread:e.running))&&(!r||`${e.title}\n${e.preview??``}`.toLowerCase().includes(r)))}var Y7=oE,Bre=QT;function Vre({className:e,...t}){return(0,G.jsx)(my,{className:W(`fixed inset-0 z-50 bg-black/32 backdrop-blur-sm transition-opacity duration-150 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0`,e),"data-slot":`sheet-backdrop`,...t})}function Hre({className:e,side:t,inset:n=!1,...r}){return(0,G.jsx)(sE,{className:W(`fixed inset-0 z-50 grid`,t===`bottom`&&`grid grid-rows-[1fr_auto] pt-12`,t===`top`&&`grid grid-rows-[auto_1fr] pb-12`,t===`left`&&`flex justify-start`,t===`right`&&`flex justify-end`,n&&`sm:p-4`),"data-slot":`sheet-viewport`,...r})}function X7({className:e,children:t,showCloseButton:n=!0,side:r=`right`,inset:i=!1,...a}){return(0,G.jsxs)(Bre,{children:[(0,G.jsx)(tD,{}),(0,G.jsx)(Vre,{}),(0,G.jsx)(Hre,{inset:i,side:r,children:(0,G.jsxs)(YT,{className:W(`relative flex max-h-full min-h-0 w-full min-w-0 flex-col bg-popover bg-clip-padding text-popover-foreground shadow-lg transition-[opacity,translate] duration-150 [transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] will-change-transform before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:opacity-0 data-starting-style:opacity-0 max-sm:before:hidden dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]`,r===`bottom`&&`row-start-2 border-t data-ending-style:translate-y-8 data-starting-style:translate-y-8`,r===`top`&&`data-ending-style:-translate-y-8 data-starting-style:-translate-y-8 border-b`,r===`left`&&`data-ending-style:-translate-x-8 data-starting-style:-translate-x-8 w-[calc(100%-(--spacing(12)))] max-w-md border-e`,r===`right`&&`col-start-2 w-[calc(100%-(--spacing(12)))] max-w-md border-s data-ending-style:translate-x-8 data-starting-style:translate-x-8`,i&&`before:hidden sm:rounded-2xl sm:border sm:before:rounded-[calc(var(--radius-2xl)-1px)] sm:**:data-[slot=sheet-footer]:rounded-b-[calc(var(--radius-2xl)-1px)]`,e),"data-slot":`sheet-popup`,...a,children:[t,n&&(0,G.jsx)(mb,{"aria-label":`Close`,className:`absolute end-2 top-2`,render:(0,G.jsx)(wa,{size:`icon`,variant:`ghost`}),children:(0,G.jsx)(er,{})})]})})]})}function Z7({className:e,...t}){return(0,G.jsx)(`div`,{className:W(`flex flex-col gap-2 p-6 in-[[data-slot=sheet-popup]:has([data-slot=sheet-panel])]:pb-3 max-sm:pb-4`,e),"data-slot":`sheet-header`,...t})}function Q7({className:e,...t}){return(0,G.jsx)(cE,{className:W(`font-heading text-xl leading-none`,e),"data-slot":`sheet-title`,...t})}function $7(e,t,n=Date.now()){let r=new Intl.RelativeTimeFormat(t,{numeric:`auto`}),i=e-n,a=Math.abs(i);return a<6e4?r.format(0,`second`):a<36e5?r.format(Math.trunc(i/6e4),`minute`):a<864e5?r.format(Math.trunc(i/36e5),`hour`):a<2592e6?r.format(Math.trunc(i/864e5),`day`):a<31536e6?r.format(Math.trunc(i/2592e6),`month`):r.format(Math.trunc(i/31536e6),`year`)}function e9({entry:e}){return(0,G.jsxs)(G.Fragment,{children:[e.running&&(0,G.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full bg-warning`}),(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:$7(e.activityAt,`zh`)})]})}function Ure({threads:e,status:t}){let[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(``),{entries:o,currentId:s,rootId:c,disabledHint:l}=e,u=o.find(e=>e.id===s),d=Rre(o,{currentId:s,rootId:c}),f=o.length-d.length,p=zre(o,i,`all`),m=t=>{!l&&t!==s&&e.onSelect(t)};return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(IM,{children:[(0,G.jsxs)(RM,{"aria-label":`切换话题`,className:`mx-auto flex max-w-full items-center justify-center gap-0.5 text-[11px] text-muted-foreground`,children:[(0,G.jsxs)(`span`,{className:`truncate`,children:[u?.title??`主话题`,t&&` · ${t}`]}),(0,G.jsx)(ht,{className:`h-3 w-3 shrink-0`})]}),(0,G.jsxs)(zM,{className:`w-72 max-w-[calc(100vw-1rem)]`,children:[(0,G.jsxs)(VM,{children:[(0,G.jsx)(UM,{children:`话题`}),d.map(e=>(0,G.jsxs)(HM,{disabled:!!l&&e.id!==s,onClick:()=>m(e.id),children:[(0,G.jsx)(mt,{className:W(e.id!==s&&`invisible`)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,G.jsx)(e9,{entry:e})]},e.id))]}),(0,G.jsx)(WM,{}),f>0&&(0,G.jsxs)(HM,{onClick:()=>{a(``),r(!0)},children:[(0,G.jsx)(rn,{}),`全部话题(`,o.length,`)`]}),(0,G.jsxs)(HM,{disabled:!!l,onClick:e.onCreate,children:[(0,G.jsx)(ln,{}),`新话题`]}),l&&(0,G.jsx)(`p`,{className:`px-2 py-1.5 text-muted-foreground text-xs`,children:l})]})]}),(0,G.jsx)(Y7,{open:n,onOpenChange:r,children:(0,G.jsxs)(X7,{side:`bottom`,className:`max-h-[80vh] pb-safe`,children:[(0,G.jsx)(Z7,{children:(0,G.jsxs)(Q7,{children:[`全部话题(`,o.length,`)`]})}),(0,G.jsx)(`div`,{className:`px-4 pb-2`,children:(0,G.jsx)(nW,{value:i,placeholder:`搜索话题…`,onChange:e=>a(e.target.value)})}),l&&(0,G.jsx)(`p`,{className:`px-4 pb-2 text-muted-foreground text-xs`,children:l}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 pb-3`,children:[p.map(e=>(0,G.jsxs)(`button`,{type:`button`,disabled:!!l&&e.id!==s,onClick:()=>{m(e.id),r(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-left hover:bg-accent disabled:opacity-60`,children:[(0,G.jsx)(mt,{className:W(`h-4 w-4 shrink-0`,e.id!==s&&`invisible`)}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`block truncate text-sm`,children:e.title}),e.preview&&(0,G.jsx)(`span`,{className:`block truncate text-muted-foreground text-xs`,children:e.preview})]}),(0,G.jsx)(e9,{entry:e})]},e.id)),p.length===0&&(0,G.jsx)(`p`,{className:`py-8 text-center text-muted-foreground text-sm`,children:`没有匹配的话题`})]})]})})]})}var Wre={queued:`排队中`,running:`进行中`,completed:`已完成`,failed:`失败`,canceled:`已取消`,blocked:`卡住了`},t9=4,Gre=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),Kre={started:{icon:Ct,className:`border-brand/50 text-brand`},blocked:{icon:bt,className:`border-warning/60 text-warning`},delivered:{icon:xt,className:`border-success/60 text-success`}};function qre({entry:e,bots:t}){let n=!!e.taskId,[r,i]=(0,H.useState)(!n),a=(0,G.jsxs)(G.Fragment,{children:[n&&(0,G.jsx)(gt,{"aria-hidden":!0,className:W(`h-3 w-3 shrink-0 transition-transform`,r&&`rotate-90`)}),(0,G.jsxs)(`span`,{className:`font-medium`,children:[t.get(e.from)?.name??`成员`,` → `,t.get(e.to)?.name??`成员`]}),(0,G.jsx)(`span`,{className:W(`rounded px-1.5 py-0.5`,e.state===`running`||e.state===`queued`?`bg-brand/10 text-brand`:e.state===`failed`?`bg-destructive/10 text-destructive`:`bg-muted text-muted-foreground`),children:Wre[e.state]})]});return(0,G.jsxs)(`div`,{className:`rounded-lg border bg-muted/30 px-3 py-2 text-xs`,children:[n?(0,G.jsx)(`button`,{type:`button`,"aria-expanded":r,"aria-label":r?`收起委派结果`:`展开委派结果`,className:`flex w-full items-center gap-1.5 text-left`,onClick:()=>i(e=>!e),children:a}):(0,G.jsx)(`p`,{className:`flex items-center gap-1.5`,children:a}),r&&e.summary&&(0,G.jsx)(`p`,{className:`mt-1 line-clamp-3 text-muted-foreground`,children:e.summary})]})}function n9(e,t){let n=[...t].sort((e,t)=>t.length-e.length),r=[],i=e,a=0;for(;i;){let e=i.indexOf(`@`),t=e<0?void 0:n.find(t=>i.startsWith(t,e+1));if(e<0||!t){r.push(i);break}e>0&&r.push(i.slice(0,e)),r.push((0,G.jsxs)(`span`,{className:`font-medium text-brand`,children:[`@`,t]},a++)),i=i.slice(e+1+t.length)}return r}function Jre(e){let{chat:t,bots:n,timeline:r,state:i}=e,a=(0,H.useRef)(null),o=(0,H.useRef)(null),s=(0,H.useRef)(null),c=(0,H.useRef)(!0),l=(0,H.useRef)(null),[u,d]=(0,H.useState)(``),[f,p]=(0,H.useState)(0),[m,h]=(0,H.useState)([]),[g,_]=(0,H.useState)(!1),[v,y]=(0,H.useState)(null),b=r?.entries??[],x=t.epochSeq??b.findLast(e=>e.kind===`system`&&e.newConversation)?.seq??0,[S,C]=(0,H.useState)(!1);(0,H.useEffect)(()=>C(!1),[t.id,x]);let w=x>0&&!S,T=Xo(b,x,S),E=Pre(b,x),D=t.members.map(e=>n.get(e)).filter(e=>!!(e&&!e.archived)),O=D.map(e=>e.name),k=!!i?.current||t.status!==`idle`,A=$o(u,f),j=A?ts(A.query,D):[],M=T[0]?.seq,N=T.at(-1)?.seq;(0,H.useLayoutEffect)(()=>{let e=a.current;if(!e)return;let t=s.current;t?(s.current=null,e.scrollTop=t.top+(e.scrollHeight-t.height)):c.current&&(e.scrollTop=e.scrollHeight)},[M,N,i?.current,e.activities.length]);let P=()=>{let t=a.current;!r?.hasOlder||!t||e.historyLoading||e.connState!==`online`||w&&(b[0]?.seq??x)<=x||(s.current={height:t.scrollHeight,top:t.scrollTop},e.onLoadOlder())},F=e=>{if(!A)return;let t=ns(u,A,f,e.name);d(t.text),p(t.caret),requestAnimationFrame(()=>{o.current?.focus(),o.current?.setSelectionRange(t.caret,t.caret)})},I=(0,H.useRef)(m);I.current=m,(0,H.useEffect)(()=>()=>{for(let e of I.current)URL.revokeObjectURL(e.url)},[]);let ee=e=>{let t=[...e??[]].filter(e=>e.type.startsWith(`image/`)).slice(0,t9-m.length).map(e=>({file:e,url:URL.createObjectURL(e)}));h(e=>[...e,...t]),y(null)},L=e=>{URL.revokeObjectURL(e),h(t=>t.filter(t=>t.url!==e))},te=async()=>{if(!u.trim()&&m.length===0||g||e.newSessionBusy)return;let t=[];if(m.length){_(!0);try{t=await _re(m.map(e=>e.file))}catch(e){y(e instanceof Error?e.message:`图片处理失败`);return}finally{_(!1)}}e.onSend(u,t);for(let e of m)URL.revokeObjectURL(e.url);h([]),y(null),d(``),p(0),c.current=!0},R=t=>{switch(t.kind){case`human`:return(0,G.jsxs)(`div`,{className:`flex flex-col items-end`,children:[t.text&&(0,G.jsxs)(`div`,{className:`max-w-[85%] whitespace-pre-wrap break-words rounded-2xl rounded-br-md bg-brand/10 px-3 py-2 text-sm`,children:[n9(t.text,O),t.truncated&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`消息过长,仅显示部分内容`})]}),t.images?.length?(0,G.jsx)(Ka,{target:{chatId:e.chat.id,entryId:t.id}}):null]},t.seq);case`bot`:{let r=n.get(t.botId);return(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(Mo,{bot:r,size:`sm`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`p`,{className:`flex items-baseline gap-1.5 text-xs`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:r?.name??`成员`}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:Gre(t.at)})]}),(0,G.jsxs)(`div`,{className:`mt-0.5 min-w-0 text-sm`,children:[(0,G.jsx)(E4,{text:t.text}),t.truncated&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`消息过长,仅显示部分内容`})]}),(0,G.jsx)(Ka,{target:{chatId:e.chat.id,entryId:t.id}}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>e.onOpenProcess(t.conversationId),className:`mt-0.5 flex items-center gap-0.5 text-muted-foreground text-xs hover:text-foreground`,children:[(0,G.jsx)(gt,{className:`h-3 w-3`}),`查看过程`]})]})]},t.seq)}case`delegation`:return(0,G.jsx)(qre,{entry:t,bots:n},t.seq);case`progress`:{let e=n.get(t.botId),r=Kre[t.phase],i=r.icon,a=Fre(t.text,t.taskSeq);return(0,G.jsxs)(`div`,{"data-phase":t.phase,className:`flex gap-2 text-xs`,children:[(0,G.jsx)(Mo,{bot:e,size:`sm`}),(0,G.jsxs)(`div`,{className:W(`flex min-w-0 items-start gap-1.5 rounded-md border-l-2 bg-muted/50 px-2 py-1`,r.className),children:[(0,G.jsx)(i,{"aria-hidden":!0,className:`mt-px h-3.5 w-3.5 shrink-0`}),(0,G.jsxs)(`p`,{className:`line-clamp-2 min-w-0 break-words text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:e?.name??`成员`}),` `,a?(0,G.jsxs)(G.Fragment,{children:[n9(a[0],O),(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:a[1]}),n9(a[2],O)]}):n9(t.text,O)]})]})]},t.seq)}case`system`:return(0,G.jsxs)(`p`,{className:`text-center text-muted-foreground text-xs`,children:[t.text,E.has(t.id)&&e.onRetry&&!e.deviceReadOnly&&(0,G.jsx)(`button`,{type:`button`,className:`ml-2 underline disabled:opacity-50`,disabled:k||e.connState!==`online`,onClick:()=>e.onRetry?.(t.id),children:`重试`})]},t.seq)}},z=i?.current?n.get(i.current):void 0;return(0,G.jsxs)(`div`,{className:`phone-chat-root flex h-full min-h-0 flex-col`,children:[(0,G.jsxs)(`header`,{className:`flex shrink-0 items-center gap-1 border-b bg-background px-2 py-2 pt-safe`,children:[e.drawerDocked?(0,G.jsx)(`span`,{className:`h-9 w-9 shrink-0`}):(0,G.jsx)(`button`,{type:`button`,onClick:e.onOpenDrawer,"aria-label":`打开会话列表`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:(0,G.jsx)(yn,{className:`h-4.5 w-4.5`})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 text-center`,children:[(0,G.jsx)(`p`,{className:`truncate font-medium text-sm`,children:t.title||`群聊`}),e.threads?(0,G.jsx)(Ure,{threads:e.threads,status:e.connState===`online`?void 0:e.stateLabel}):(0,G.jsx)(`p`,{className:`truncate text-[11px] text-muted-foreground`,children:e.connState===`online`?`${t.members.length} 位成员`:e.stateLabel})]}),e.threads?(0,G.jsx)(`button`,{type:`button`,onClick:e.threads.onCreate,disabled:!!e.threads.disabledHint,"aria-label":`新话题`,title:e.threads.disabledHint??`新话题`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-40`,children:(0,G.jsx)(Vn,{className:`h-4.5 w-4.5`})}):(0,G.jsx)(`button`,{type:`button`,onClick:e.onNewSession,disabled:!e.canCreate||e.deviceReadOnly||g||e.connState!==`online`,"aria-label":`新建会话`,title:e.newSessionHint??`新建会话`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-40`,children:(0,G.jsx)(Vn,{className:`h-4.5 w-4.5`})})]}),(0,G.jsxs)(`div`,{ref:a,onScroll:e=>{let t=e.currentTarget;c.current=t.scrollHeight-t.scrollTop-t.clientHeight<40,t.scrollTop<60&&P()},className:`min-h-0 flex-1 space-y-3 overflow-y-auto px-3 py-3`,children:[r===void 0?(0,G.jsxs)(`p`,{className:`flex items-center justify-center gap-1.5 py-8 text-muted-foreground text-sm`,children:[(0,G.jsx)(an,{className:`h-4 w-4 animate-spin`}),`读取中…`]}):r.hasOlder&&(!w||(b[0]?.seq??x)>x)?(0,G.jsx)(`button`,{type:`button`,onClick:P,disabled:e.historyLoading||e.connState!==`online`,className:`w-full py-1 text-center text-muted-foreground text-xs`,children:e.historyLoading?`加载中…`:`加载更早的消息`}):T.length===0?(0,G.jsx)(`p`,{className:`py-8 text-center text-muted-foreground text-sm`,children:`@ 成员开始对话,未 @ 时由群主回复`}):null,x>0&&(0,G.jsx)(`button`,{type:`button`,className:`w-full py-1 text-center text-muted-foreground text-xs`,onClick:()=>{C(!S),S&&r?.history?e.onJumpLatest?.():!S&&r?.hasOlder&&!b.some(e=>e.seq<x)&&e.onLoadOlder()},children:w?`更早的对话 · ${x-1} 条`:`收起更早的对话`}),r?.history&&(0,G.jsx)(`button`,{type:`button`,className:`w-full py-1 text-center text-brand text-xs`,onClick:()=>{c.current=!0,e.onJumpLatest?.()},children:`回到最新消息`}),T.map(R),e.activities.map(t=>(0,G.jsx)(Lre,{item:t,bots:n,clockOffset:e.clockOffset,onOpen:e.onOpenProcess},t.conversationId)),z&&e.activities.length===0&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(Mo,{bot:z,size:`sm`,busy:!0}),(0,G.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[z.name,` 正在回复…`]})]})]}),(0,G.jsxs)(`div`,{className:`phone-dock shrink-0 space-y-2 px-3 pt-1 pb-safe`,children:[e.outbox,e.notice&&(0,G.jsx)(`p`,{className:`rounded-md bg-destructive/10 px-2 py-1 text-destructive text-xs`,children:e.notice}),e.deviceReadOnly&&(0,G.jsx)(`p`,{className:`rounded-md bg-muted px-2 py-1 text-center text-muted-foreground text-xs`,children:B7(e.readOnlyRejected)}),!e.deviceReadOnly&&e.pending.map(({sessionId:t,botId:r,view:i})=>i.approvals.length>0||i.asks.length>0?(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:n.get(r)?.name??`成员`}),(0,G.jsx)(g_,{approvals:i.approvals,clockOffset:e.clockOffset,onRespond:(n,r)=>e.onApproval(t,n,r)}),(0,G.jsx)(b_,{asks:i.asks,clockOffset:e.clockOffset,onAnswer:(n,r)=>e.onAsk(t,n,r),autoFocus:!1})]},t):null),(0,G.jsxs)(`div`,{className:W(`relative`,e.deviceReadOnly&&`hidden`),children:[j.length>0&&(0,G.jsx)(`div`,{className:`absolute right-0 bottom-full left-0 mb-1 max-h-48 overflow-y-auto rounded-lg border bg-popover p-1 shadow-md`,children:j.map(e=>{let t=n.get(e.id);return(0,G.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>F(e),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent`,children:[t?(0,G.jsx)(Mo,{bot:t,size:`sm`}):(0,G.jsx)(`span`,{className:`flex h-7 w-7 items-center justify-center rounded-full bg-muted text-xs`,children:`@`}),(0,G.jsx)(`span`,{className:`font-medium`,children:e.name}),t?.title&&(0,G.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:t.title})]},e.id)})}),v&&(0,G.jsx)(`p`,{className:`mb-1 text-destructive text-xs`,children:v}),m.length>0&&(0,G.jsx)(`div`,{className:`mb-1.5 flex gap-1.5`,children:m.map(e=>(0,G.jsxs)(`div`,{className:`relative h-14 w-14 overflow-hidden rounded-lg border`,children:[(0,G.jsx)(`img`,{src:e.url,alt:``,className:`h-full w-full object-cover`}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`移除图片`,onClick:()=>L(e.url),className:`absolute top-0.5 right-0.5 flex h-4 w-4 items-center justify-center rounded-full bg-black/60 text-white`,children:(0,G.jsx)(er,{className:`h-3 w-3`})})]},e.url))}),(0,G.jsxs)(`div`,{className:`flex items-end gap-2 rounded-2xl border bg-background px-3 py-2`,children:[(0,G.jsx)(`input`,{ref:l,type:`file`,accept:`image/*`,multiple:!0,hidden:!0,onChange:e=>{ee(e.target.files),e.target.value=``}}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`添加图片`,disabled:m.length>=t9,onClick:()=>l.current?.click(),className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-muted-foreground disabled:opacity-40`,children:(0,G.jsx)(Zt,{className:`h-4.5 w-4.5`})}),(0,G.jsx)(`textarea`,{ref:o,rows:1,value:u,placeholder:`@ 成员,或直接说…`,onChange:e=>{d(e.target.value),p(e.target.selectionStart??e.target.value.length)},onSelect:e=>p(e.currentTarget.selectionStart??0),className:`max-h-32 min-h-6 flex-1 resize-none bg-transparent text-sm outline-none field-sizing-content`}),k&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`停止`,onClick:e.onStop,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-foreground`,children:(0,G.jsx)(Gn,{className:`h-3.5 w-3.5 fill-current`})}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`发送`,disabled:!u.trim()&&m.length===0||g||e.newSessionBusy||!e.outbox&&e.connState!==`online`,onClick:()=>void te(),className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-brand text-brand-foreground disabled:opacity-40`,children:(0,G.jsx)(ot,{className:`h-4 w-4`})})]})]})]})]})}var r9=e=>typeof window.matchMedia==`function`&&window.matchMedia(e).matches;function Yre(e){return(0,H.useSyncExternalStore)(t=>{if(typeof window.matchMedia!=`function`)return()=>{};let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},()=>r9(e),()=>r9(e))}var Xre=`(min-width: 900px)`;function Zre(e){let t=H.useRef(!0);t.current&&(t.current=!1,e())}var i9=H.createContext(null);function a9(){let e=H.useContext(i9);if(e===null)throw Error(yr(60));return e}var Qre=(e,t)=>Object.is(e,t);function o9(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function s9(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e!==void 0&&o9(e,t,n))}function $re(e,t,n){return e.filter(e=>!o9(t,e,n))}function c9(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function l9(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function eie(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(l9(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function u9(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return c9(e)}function d9(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?c9(e.value):c9(e)}function f9(e,t,n){function r(){return u9(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=l9(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function tie(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,G.jsx)(H.Fragment,{children:f9(r,t,n)},i)),e),[])}var p9={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:d9(t,r)!==``},hasNullItemLabel:(e,t)=>t?eie(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>o9(t,e,n)):o9(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function nie(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function rie(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=Qre,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=nN(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=$M(),F=cN({id:t}),I=M||d,ee=j??c,[L,te]=Tj({controlled:n,default:y?r??Mr:r,name:`Select`,state:`value`}),[R,z]=Tj({controlled:a,default:o,name:`Select`,state:`open`}),ne=H.useRef([]),re=H.useRef([]),B=H.useRef(null),ie=H.useRef(null),ae=H.useRef(0),oe=H.useRef(null),V=H.useRef([]),se=H.useRef(!1),ce=H.useRef(null),le=H.useRef(null),ue=H.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),de=H.useRef(!1),{mounted:fe,setMounted:pe,transitionStatus:me}=Xw(R),{openMethod:he,triggerProps:ge}=dE(R),_e=xr(()=>new Kw({id:F,labelId:void 0,modal:m,multiple:y,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:L,open:R,mounted:fe,transitionStatus:me,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ve=Vw(_e,p9.activeIndex),ye=Vw(_e,p9.selectedIndex),be=Vw(_e,p9.triggerElement),xe=Vw(_e,p9.positionerElement),Se=yM(he),Ce=he??Se,we=H.useMemo(()=>y?``:d9(L,x),[y,L,x]),Te=H.useMemo(()=>y&&Array.isArray(L)?L.map(e=>d9(e,x)):d9(L,x),[y,L,x]);eN(nx(be),F,L,Uy(()=>Te),!I,c);let Ee=H.useRef(L),De=y?Array.isArray(L)&&L.length>0:L!=null&&we!==``;Y(()=>{A(De)},[De,A]),Y(function(){let e=L,t=!1;if(y){let n=Array.isArray(L)?L:[];t=n.length===0,e=n[n.length-1]}let n=t?-1:s9(V.current,e,S),r=n===-1?null:n;r===null&&(le.current=null),!R&&_e.set(`selectedIndex`,r)},[y,R,L,S,_e]);function Oe(e){let t=k.initialValue;return Array.isArray(e)&&Array.isArray(t)?!nie(e,t,(e,t)=>o9(e,t,S)):e!==t}lE(L,()=>{T(ee),E(Oe(L)),N.change(L)});let ke=Uy((e,t)=>{s?.(e,t),!t.isCanceled&&(z(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(D(!0),O(!1),P===`onBlur`&&N.commit(L)))}),Ae=Uy(()=>{pe(!1),_e.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});Qw({enabled:!h,open:R,ref:B,onComplete(){R||Ae()}}),H.useImperativeHandle(h,()=>({unmount:Ae}),[Ae]);let je=Uy((e,t)=>{i?.(e,t),!t.isCanceled&&te(e)}),Me=Uy(e=>{let t=ME(e.scrollHeight,e.clientHeight),n=NE(e.scrollTop,t),r=n>0,i=n<t;_e.set(`scrollUpArrowVisible`,r),_e.set(`scrollDownArrowVisible`,i)}),Ne=CT({open:R,onOpenChange:ke,elements:{reference:be,floating:xe}}),Pe=lC(Ne,{enabled:!f&&!I,event:`mousedown`}),Fe=fC(Ne),Ie=LT(Ne,{enabled:!f&&!I,listRef:ne,activeIndex:ve,selectedIndex:ye,disabledIndices:Mr,onNavigate(e){e===null&&!R||_e.set(`activeIndex`,e)},focusItemOnHover:C}),Le=RT(Ne,{enabled:!f&&!I&&(R||!y),listRef:re,activeIndex:ve,selectedIndex:ye,disabledIndices:e=>FM(ne.current[e]),onMatch(e){R?_e.set(`activeIndex`,e):je(V.current[e],pb(eb))},onTyping(e){se.current=e}}),Re=H.useMemo(()=>ir(Le.reference,Ie.reference,Fe.reference,Pe.reference,ge),[Pe.reference,Le.reference,Ie.reference,Fe.reference,ge]),ze=H.useMemo(()=>ir($w,Le.floating,Ie.floating,Fe.floating),[Le.floating,Ie.floating,Fe.floating]),Be=Ie.item??Nr;Zre(()=>{_e.update({popupProps:ze,triggerProps:Re})}),_e.useSyncedValues({id:F,modal:m,multiple:y,value:L,open:R,mounted:fe,transitionStatus:me,popupProps:ze,triggerProps:Re,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:Ce});let Ve=H.useMemo(()=>({store:_e,floatingContext:Ne,required:p,disabled:I,readOnly:f,multiple:y,highlightItemOnHover:C,setValue:je,setOpen:ke,listRef:ne,popupRef:B,scrollHandlerRef:ie,handleScrollArrowVisibility:Me,scrollArrowsMountedCountRef:ae,itemProps:Be,valueRef:oe,valuesRef:V,labelsRef:re,typingRef:se,selectionRef:ue,firstItemTextRef:ce,selectedItemTextRef:le,validation:N,onOpenChangeComplete:_,alignItemWithTriggerActiveRef:de,initialValueRef:Ee}),[_e,Ne,p,I,f,y,C,je,ke,Be,N,_,Me]),He=Sr(g,N.inputRef),Ue=y?void 0:ee,We=H.useMemo(()=>!y||!Array.isArray(L)||!ee?null:L.map(e=>{let t=d9(e,x);return(0,G.jsx)(`input`,{type:`hidden`,form:l,name:ee,value:t,disabled:I},t)}),[y,L,l,ee,x,I]);return(0,G.jsxs)(i9.Provider,{value:Ve,children:[w,(0,G.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){_e.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=pb(eb,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=V.current.findIndex(t=>d9(t,x).toLowerCase()===e||u9(t,b).toLowerCase()===e);r===-1&&(r=V.current.findIndex((t,n)=>{let r=re.current[n];return r!=null&&r.toLowerCase()===e}));let i=V.current[r];i!=null&&je(i,n)}_e.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&Ue==null?`${F}-hidden-input`:void 0,form:l,name:Ue,autoComplete:u,value:we,disabled:I,required:p&&!(y&&De),readOnly:f,ref:He,style:ee?ux:lx,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),We]})}function iie(e,t){return e??t}var aie=400,oie={...dy,...YM,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},sie=H.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,state:f,disabled:p}=$M(),{labelId:m}=iN(),{store:h,setOpen:g,selectionRef:_,validation:v,readOnly:y,required:b,alignItemWithTriggerActiveRef:x,disabled:S}=a9(),C=p||S||a,w=Vw(h,p9.open),T=Vw(h,p9.mounted),E=Vw(h,p9.value),D=Vw(h,p9.triggerProps),O=Vw(h,p9.positionerElement),k=Vw(h,p9.listElement),A=Vw(h,p9.popupSide),j=Vw(h,p9.id),M=Vw(h,p9.labelId),N=Vw(h,p9.hasSelectedValue),P=T&&O?A:null,F=i??j,I=iie(m,M);cN({id:F});let ee=nx(O),L=H.useRef(null),{getButtonProps:te,buttonRef:R}=Zy({disabled:C,native:o}),z=h.useStateSetter(`triggerElement`),ne=Cb(),re=Cb(),B=Cb();H.useEffect(()=>{if(w)return B.start(aie,()=>{_.current.allowUnselectedMouseUp=!0,_.current.allowSelectedMouseUp=!0}),()=>{B.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},re.clear()},[w,_,re,B]);let ie=ir(D,{id:F,role:`combobox`,"aria-expanded":w,"aria-haspopup":`listbox`,"aria-controls":w?k?.id??Jb(O)?.id:void 0,"aria-labelledby":I,"aria-readonly":y||void 0,"aria-required":b||void 0,tabIndex:C?-1:0,onFocus(e){u(!0),w&&x.current&&g(!1,pb(eb,e.nativeEvent)),ne.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){zb(O,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&v.commit(E))},onMouseDown(e){if(w)return;let t=Yy(e.currentTarget);function n(e){if(!L.current)return;let t=e.target;zb(L.current,t)||zb(ee.current,t)||uM(e,L.current)||g(!1,pb(ub,e))}re.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,te),ae=v.getValidationProps(C,ie);ae.role=`combobox`;let oe={...f,open:w,disabled:C,value:E,readOnly:y,popupSide:P,placeholder:!N};return Lr(`button`,e,{ref:[t,L,R,z],state:oe,stateAttributesMapping:oie,props:ae})}),cie={value:()=>null},lie=H.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=a9(),u=Vw(c,p9.value),d=Vw(c,p9.items),f=Vw(c,p9.itemToStringLabel),p=Vw(c,p9.hasSelectedValue),m=!p&&a!=null&&i==null,h=Vw(c,p9.hasNullItemLabel,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(m&&!h?a:Array.isArray(u)?tie(u,d,f):f9(u,d,f)),Lr(`span`,e,{state:g,ref:[t,l],props:[{children:_},s],stateAttributesMapping:cie})}),uie=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=a9();return Lr(`span`,e,{state:{open:Vw(o,p9.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:uy})}),die=H.forwardRef(function(e,t){let{store:n}=a9(),r=Vw(n,p9.mounted),i=Vw(n,p9.forceMount);return r||i?(0,G.jsx)(US,{ref:t,...e}):null}),m9=H.createContext(void 0);function h9(){let e=H.useContext(m9);if(!e)throw Error(yr(59));return e}function g9(e,t){e&&Object.assign(e.style,t)}var _9={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},fie={position:`fixed`},pie=H.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=IS,style:_,...v}=e,{store:y,listRef:b,labelsRef:x,alignItemWithTriggerActiveRef:S,selectedItemTextRef:C,valuesRef:w,initialValueRef:T,popupRef:E,setValue:D,floatingContext:O}=a9(),k=Vw(y,p9.open),A=Vw(y,p9.mounted),j=Vw(y,p9.modal),M=Vw(y,p9.value),N=Vw(y,p9.openMethod),P=Vw(y,p9.positionerElement),F=Vw(y,p9.triggerElement),I=Vw(y,p9.isItemEqualToValue),ee=Vw(y,p9.transitionStatus),L=H.useRef(null),te=H.useRef(null),[R,z]=H.useState(h),ne=A&&R&&N!==`touch`;!A&&R!==h&&z(h),H.useImperativeHandle(S,()=>ne),Zj((ne||j)&&k,N===`touch`,P,F);let re=ID({anchor:n,floatingRootContext:O,positionMethod:a,mounted:A,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??ne,collisionAvoidance:g,keepMounted:!0}),B=ne?`none`:re.side,ie=ne?fie:re.positionerStyles,ae={open:k,side:B,align:re.align,anchorHidden:re.anchorHidden};Y(()=>{y.set(`popupSide`,re.side)},[y,re.side]);let oe=BD(e,ae,{styles:ie,transitionStatus:ee,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!A,inert:!k}),V=H.useRef(0),se=Uy(e=>{if(w.current.length===0)return;let t=V.current;if(V.current=e.size,e.size===t)return;let n=pb(eb);if(t!==0&&!y.state.multiple&&M!==null&&s9(w.current,M,I)===-1){let e=T.current,t=e!=null&&s9(w.current,e,I)!==-1?e:null;D(t,n),t===null&&(y.set(`selectedIndex`,null),C.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(M)){let e=M.filter(e=>s9(w.current,e,I)!==-1);e.length!==M.length&&(D(e,n),e.length===0&&(y.set(`selectedIndex`,null),C.current=null))}if(k&&ne){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};g9(P,e),g9(E.current,e)}}),ce=H.useMemo(()=>({...re,side:B,alignItemWithTriggerActive:ne,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:L,scrollDownArrowRef:te}),[re,B,ne,z]);return(0,G.jsx)(Uj,{elementsRef:b,labelsRef:x,onMapChange:se,children:(0,G.jsxs)(m9.Provider,{value:ce,children:[A&&j&&(0,G.jsx)(ZT,{inert:XT(!k),cutout:F}),oe]})})}),mie={...fy,...iy},hie=H.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s,popupRef:c,onOpenChangeComplete:l,setOpen:u,valueRef:d,firstItemTextRef:f,selectedItemTextRef:p,multiple:m,handleScrollArrowVisibility:h,scrollHandlerRef:g,listRef:_,highlightItemOnHover:v,floatingContext:y}=a9(),{side:b,align:x,alignItemWithTriggerActive:S,isPositioned:C,setControlledAlignItemWithTrigger:w}=h9(),T=Rj(!0)!=null,E=AE(),{nonce:D,disableStyleElements:O}=xE(),k=Vw(s,p9.id),A=Vw(s,p9.open),j=Vw(s,p9.openMethod),M=Vw(s,p9.mounted),N=Vw(s,p9.popupProps),P=Vw(s,p9.transitionStatus),F=Vw(s,p9.triggerElement),I=Vw(s,p9.positionerElement),ee=Vw(s,p9.listElement),L=H.useRef(!1),te=H.useRef(!1),R=H.useRef({}),z=sx(),ne=Uy(e=>{if(!I||!c.current||!te.current)return;let t=I.style.top===`0px`,n=I.style.bottom===`0px`;if(L.current||!S||!t&&!n){h(e);return}let r=b9(I),i=x9(I.getBoundingClientRect().height,`y`,r),a=Yy(I),o=_y(I),s=o.getComputedStyle(I),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=v9(o.getComputedStyle(c.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=y9(e),g=null,_=e=>{I.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=jE(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(L.current=!0),h(e);return}f-y>1?g=t?1/0:0:n&&p<m&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=jE(g,0,y9(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(L.current=!0),h(e)});H.useImperativeHandle(g,()=>ne,[ne]),Qw({open:A,ref:c,onComplete(){A&&l?.(!0)}});let re={open:A,transitionStatus:P,side:b,align:x};Y(()=>{!I||!c.current||Object.keys(R.current).length||(R.current={top:I.style.top||`0`,left:I.style.left||`0`,right:I.style.right,height:I.style.height,bottom:I.style.bottom,minHeight:I.style.minHeight,maxHeight:I.style.maxHeight,marginTop:I.style.marginTop,marginBottom:I.style.marginBottom})},[c,I]),Y(()=>{A||S||(te.current=!1,L.current=!1,g9(I,R.current))},[A,S,I,c]),Y(()=>{let e=c.current;if(!A||!F||!I||!e||S&&!C||s.state.transitionStatus===`ending`)return;if(te.current=!0,e.style.removeProperty(`--transform-origin`),!S){z.request(()=>h(ee||e));return}let t=gie(e);try{let t=p.current;t?.isConnected||(t=!p9.hasSelectedValue(s.state)&&f.current?.isConnected?f.current:null);let n=d.current,r=_y(I),i=r.getComputedStyle(I),a=r.getComputedStyle(e),o=Yy(F),c=b9(F),l=S9(F.getBoundingClientRect(),c),u=S9(I.getBoundingClientRect(),c),m=l.height,g=ee||e,y=g.scrollHeight,b=parseFloat(a.borderBottomWidth),x=parseFloat(i.marginTop)||10,S=parseFloat(i.marginBottom)||10,C=parseFloat(i.minHeight)||100,T=v9(a),D=o.documentElement.clientHeight-x-S,O=o.documentElement.clientWidth,k=D-l.bottom+m,A,j=E===`rtl`?l.right-u.width:l.left,M=0;if(t&&n){let e=S9(n.getBoundingClientRect(),c);A=S9(t.getBoundingClientRect(),c),j=u.left+(E===`rtl`?e.right-A.right:e.left-A.left);let r=e.top-l.top+e.height/2;M=A.top-u.top+A.height/2-r}let N=k+M+S+b,P=Math.min(D,N),te=D-x-S,z=N-P,ne=O-5;I.style.left=`${jE(j,5,ne-u.width)}px`,I.style.height=`${P}px`,I.style.maxHeight=`none`,I.style.marginTop=`${x}px`,I.style.marginBottom=`${S}px`,e.style.height=`100%`;let re=y9(g),B=z>=re-1;B&&(P=Math.min(D,u.height)-(z-re));let ie=l.top<20||l.bottom>D-20||Math.ceil(P)+1<Math.min(y,C),ae=(r.visualViewport?.scale??1)!==1&&Ab;if(ie||ae){g9(I,R.current),w(!1);return}let oe=Math.max(C,P);if(B){let e=Math.max(0,D-N);I.style.top=u.height>=te?`0`:`${e}px`,I.style.height=`${P}px`,g.scrollTop=y9(g)}else I.style.bottom=`0`,g.scrollTop=z;if(A){let t=u.top,n=u.height,r=A.top+A.height/2,i=jE(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(oe===D||P>=T)&&(L.current=!0),h(g),v&&s.state.selectedIndex===null&&s.state.activeIndex===null&&_.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,A,I,F,d,f,p,c,h,S,w,z,ee,_,v,E,C]),H.useEffect(()=>{if(!S||!I||!A)return;let e=_y(I);function t(e){u(!1,pb(Mee,e))}return ex(e,`resize`,t)},[u,S,I,A]);let B={...ee?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":m||void 0,id:`${k}-list`},onKeyDown(e){T&&qT.has(e.key)&&e.stopPropagation()},onScroll(e){ee||ne(e.currentTarget)},...S&&{style:ee?{height:`100%`}:_9},className:!ee&&S?gE.className:void 0},ie=Lr(`div`,e,{ref:[t,c],state:re,stateAttributesMapping:mie,props:[N,B,zD(P),o]});return(0,G.jsxs)(H.Fragment,{children:[!O&&gE.getElement(D),(0,G.jsx)(cC,{context:y,modal:!1,disabled:!M,openInteractionType:j,returnFocus:a,restoreFocus:!0,children:ie})]})});function v9(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function y9(e){return ME(e.scrollHeight,e.clientHeight)}function b9(e){return YC.getScale(e)}function x9(e,t,n){return e/n[t]}function S9(e,t){return Rx({x:x9(e.x,`x`,t),y:x9(e.y,`y`,t),width:x9(e.width,`x`,t),height:x9(e.height,`y`,t)})}var C9=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function gie(e){let{style:t}=e,n={};for(let[e,r]of C9)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of C9){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var _ie=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o,scrollHandlerRef:s,multiple:c}=a9(),{alignItemWithTriggerActive:l}=h9(),u=Vw(o,p9.hasScrollArrows),d=Vw(o,p9.openMethod),f={id:`${Vw(o,p9.id)}-list`,role:`listbox`,"aria-multiselectable":c||void 0,onScroll(e){s.current?.(e.currentTarget)},...l&&{style:_9},className:u&&d!==`touch`?gE.className:void 0};return Lr(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),w9=H.createContext(void 0);function T9(){let e=H.useContext(w9);if(!e)throw Error(yr(57));return e}var vie=H.memo(H.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=H.useRef(null),d=jj({guess:!0,label:o,textRef:u}),{store:f,itemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:_,valuesRef:v,multiple:y,selectedItemTextRef:b,disabled:x,readOnly:S}=a9(),C=x||s,w=Vw(f,p9.isActive,d.index),T=Vw(f,p9.open),E=Vw(f,p9.isSelected,a),D=Vw(f,p9.isSelectedByFocus,d.index),O=Vw(f,p9.isItemEqualToValue),k=d.index,A=H.useRef(null);Y(()=>{let e=v.current;return e[k]=a,()=>{delete e[k]}},[k,a,v]),Y(()=>{let e=f.state.value,t=e;y&&Array.isArray(e)&&(t=e.length>0?e[e.length-1]:void 0),t!==void 0&&o9(a,t,O)&&(f.set(`selectedIndex`,k),u.current&&(b.current=u.current))},[k,y,O,f,a,b]);let j=H.useRef(`mouse`),M=H.useRef(!1),{getButtonProps:N,buttonRef:P}=Zy({disabled:C,focusableWhenDisabled:!0,native:c,composite:!0}),F={disabled:C,selected:E,highlighted:w};function I(e){if(x||S)return;let t=f.state.value;if(y){let n=Array.isArray(t)?t:[],r=E?$re(n,a,O):[...n,a];h(r,pb(ab,e))}else h(a,pb(ab,e)),m(!1,pb(ab,e))}function ee(){g.current.dragY=0}let L={role:`option`,"aria-selected":E,tabIndex:T&&w?0:-1,onKeyDown(e){f.set(`activeIndex`,k),e.key===` `&&_.current&&e.preventDefault()},onClick(e){let t=j.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&Nb(e.nativeEvent)&&(n!==void 0||w),i=t&&!r&&!M.current;M.current=!1,!(C||i)&&I(e.nativeEvent)},onPointerEnter(e){j.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=g.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){j.current=e.pointerType,M.current=!0,ee()},onMouseUp(){if(ee(),C||j.current===`touch`||M.current)return;let e=!g.current.allowSelectedMouseUp&&E,t=!g.current.allowUnselectedMouseUp&&!E;e||t||(M.current=!0,A.current?.click(),M.current=!1)}},te=Lr(`div`,e,{ref:[P,t,d.ref,A],state:F,props:[p,L,l,N]}),R=H.useMemo(()=>({selected:E,index:k,textRef:u,selectedByFocus:D}),[E,k,u,D]);return(0,G.jsx)(w9.Provider,{value:R,children:te})})),yie=H.forwardRef(function(e,t){let{selected:n}=T9();return e.keepMounted||n?(0,G.jsx)(bie,{...e,ref:t}):null}),bie=H.memo(H.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=T9(),c=H.useRef(null),{transitionStatus:l,setMounted:u}=Xw(s),d=Lr(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:iy});return Qw({open:s,ref:c,onComplete(){s||u(!1)}}),d})),xie=H.memo(H.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=T9(),{firstItemTextRef:a,selectedItemTextRef:o}=a9(),{render:s,className:c,style:l,...u}=e;return Lr(`div`,e,{ref:[H.useCallback(e=>{e&&(n===0&&(a.current=e),i&&(o.current=e))},[a,o,n,i]),t,r],props:u})})),E9=H.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,{store:l,popupRef:u,listRef:d,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:p}=a9(),{side:m,scrollDownArrowRef:h,scrollUpArrowRef:g}=h9(),_=Vw(l,c?p9.scrollUpArrowVisible:p9.scrollDownArrowVisible),v=Vw(l,p9.openMethod),y=_&&v!==`touch`,b=Cb(),x=c?g:h,{mounted:S,transitionStatus:C,setMounted:w}=Xw(y);Y(()=>(p.current+=1,l.set(`hasScrollArrows`,!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&l.set(`hasScrollArrows`,!1)}),[l,p]),Qw({open:y,ref:x,onComplete(){y||w(!1)}});let T=Lr(`div`,e,{ref:[t,x],state:{direction:a,visible:y,side:m,transitionStatus:C},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||b.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??u.current;if(!e)return;l.set(`activeIndex`,null),f(e);let n=ME(e.scrollHeight,e.clientHeight),r=NE(e.scrollTop,n),i=r===(c?0:n),a=d.current;if(r!==e.scrollTop&&(e.scrollTop=r),i){b.clear();return}if(a.length>0){let t=x.current?.offsetHeight||0;e.scrollTop=Sie(a,c,r,e.clientHeight,t,n)}b.start(40,t)}b.start(40,t)},onMouseLeave(){b.clear()}},s],stateAttributesMapping:iy});return S||o?T:null});function Sie(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?NE(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?NE(l.offsetTop+l.offsetHeight-r+i,a):a}var Cie=H.forwardRef(function(e,t){return(0,G.jsx)(E9,{...e,ref:t,direction:`down`})}),wie=H.forwardRef(function(e,t){return(0,G.jsx)(E9,{...e,ref:t,direction:`up`})}),D9=rie;function O9({className:e,size:t=`default`,children:n,...r}){return(0,G.jsxs)(sie,{className:W(`relative inline-flex min-h-9 w-full min-w-36 select-none items-center justify-between gap-2 rounded-lg border border-input bg-background bg-clip-padding px-[calc(--spacing(3)-1px)] text-left text-base shadow-xs outline-none ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-data-disabled:not-focus-visible:not-aria-invalid:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 focus-visible:border-ring focus-visible:ring-[3px] aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/16 data-disabled:pointer-events-none data-disabled:opacity-64 sm:min-h-8 sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-focus-visible:not-aria-invalid:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 [[data-disabled],:focus-visible,[aria-invalid],[data-pressed]]:shadow-none`,t===`sm`&&`min-h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:min-h-7`,t===`lg`&&`min-h-10 sm:min-h-9`,e),"data-slot":`select-trigger`,...r,children:[n,(0,G.jsx)(uie,{"data-slot":`select-icon`,children:(0,G.jsx)(yt,{className:`-me-1 size-4.5 opacity-80 sm:size-4`})})]})}function k9({className:e,...t}){return(0,G.jsx)(lie,{className:W(`flex-1 truncate data-placeholder:text-muted-foreground`,e),"data-slot":`select-value`,...t})}function A9({className:e,children:t,sideOffset:n=4,alignItemWithTrigger:r=!0,zIndex:i,...a}){let o=H.useContext(fD);return(0,G.jsx)(die,{children:(0,G.jsx)(pie,{alignItemWithTrigger:r,className:`select-none`,style:{zIndex:i??o},"data-slot":`select-positioner`,sideOffset:n,children:(0,G.jsxs)(hie,{className:`origin-(--transform-origin) transition-[scale,opacity] has-data-[side=none]:scale-100 has-data-starting-style:scale-98 has-data-starting-style:opacity-0 has-data-[side=none]:transition-none`,"data-slot":`select-popup`,...a,children:[(0,G.jsx)(wie,{className:`top-0 z-50 flex h-6 w-full cursor-default items-center justify-center before:pointer-events-none before:absolute before:inset-x-px before:top-px before:h-[200%] before:rounded-t-[calc(var(--radius-lg)-1px)] before:bg-linear-to-b before:from-50% before:from-popover`,"data-slot":`select-scroll-up-arrow`,children:(0,G.jsx)(vt,{className:`relative size-4.5 sm:size-4`})}),(0,G.jsx)(`span`,{className:`relative block h-full rounded-lg border bg-popover bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-lg dark:not-in-data-[slot=group]:bg-clip-border`,children:(0,G.jsx)(_ie,{className:W(`max-h-(--available-height) min-w-(--anchor-width) overflow-y-auto p-1`,e),"data-slot":`select-list`,children:t})}),(0,G.jsx)(Cie,{className:`bottom-0 z-50 flex h-6 w-full cursor-default items-center justify-center before:pointer-events-none before:absolute before:inset-x-px before:bottom-px before:h-[200%] before:rounded-b-[calc(var(--radius-lg)-1px)] before:bg-linear-to-t before:from-50% before:from-popover`,"data-slot":`select-scroll-down-arrow`,children:(0,G.jsx)(ht,{className:`relative size-4.5 sm:size-4`})})]})})})}function j9({className:e,children:t,...n}){return(0,G.jsxs)(vie,{className:W(`grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),"data-slot":`select-item`,...n,children:[(0,G.jsx)(yie,{className:`col-start-1`,children:(0,G.jsx)(`svg`,{"aria-hidden":`true`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/1500/svg`,children:(0,G.jsx)(`path`,{d:`M5.252 12.7 10.2 18.63 18.748 5.37`})})}),(0,G.jsx)(xie,{className:`col-start-2 min-w-0`,children:t})]})}function Tie(e,t,n){return e.find(e=>e.id===t)?.id??e.find(e=>e.id===n)?.id??e[0]?.id??``}var M9={supervised:`受监督(每步确认)`,"auto-edits":`自动接受编辑`,full:`完全放行`,assistant:`助手代审`},N9={minimal:`极低`,low:`低`,medium:`中`,high:`高`,xhigh:`极高`,max:`最高`};function Eie({projects:e,providers:t,open:n,preferredProjectId:r,onClose:i,onCreate:a}){let[o,s]=(0,H.useState)(null),[c,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(null),[f,p]=(0,H.useState)(`full`),[m,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)(`medium`),[v,y]=(0,H.useState)(n);n!==v&&(y(n),n&&s(null));let b=Tie(e,o,r),x=t.find(e=>e.id===c)??t[0]??{id:``,models:[]},S=x.id,C=x.models.find(e=>e.id===u)?.id??x.models[0]?.id??``,w=!!(b&&S&&C);return(0,G.jsx)(Y7,{open:n,onOpenChange:e=>!e&&i(),children:(0,G.jsxs)(X7,{side:`bottom`,className:`pb-safe`,children:[(0,G.jsx)(Z7,{children:(0,G.jsx)(Q7,{children:`新建会话`})}),(0,G.jsxs)(`div`,{className:`space-y-4 p-4 pt-0`,children:[(0,G.jsx)(P9,{label:`项目`,children:(0,G.jsxs)(D9,{items:e.map(e=>({value:e.id,label:G7(e)})),value:b,onValueChange:e=>s(e),children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:dD.DROPDOWN_IN_MODAL,children:e.map(e=>(0,G.jsx)(j9,{value:e.id,children:G7(e)},e.id))})]})}),(0,G.jsx)(P9,{label:`模型服务`,children:(0,G.jsxs)(D9,{items:t.map(e=>({value:e.id,label:e.name})),value:S,onValueChange:e=>{l(e),d(null)},children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:dD.DROPDOWN_IN_MODAL,children:t.map(e=>(0,G.jsx)(j9,{value:e.id,children:e.name},e.id))})]})}),(0,G.jsx)(P9,{label:`模型`,children:(0,G.jsxs)(D9,{items:x.models.map(e=>({value:e.id,label:e.label??e.id})),value:C,onValueChange:e=>d(e),children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:dD.DROPDOWN_IN_MODAL,children:x.models.map(e=>(0,G.jsx)(j9,{value:e.id,children:e.label??e.id},e.id))})]})}),(0,G.jsx)(P9,{label:`审批模式`,children:(0,G.jsxs)(D9,{items:Object.keys(M9).map(e=>({value:e,label:M9[e]})),value:f,onValueChange:e=>p(e),children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:dD.DROPDOWN_IN_MODAL,children:Object.keys(M9).map(e=>(0,G.jsx)(j9,{value:e,children:M9[e]},e))})]})}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`推理`}),(0,G.jsx)(dN,{checked:m,onCheckedChange:h})]}),m&&(0,G.jsx)(P9,{label:`推理档位`,children:(0,G.jsxs)(D9,{items:Object.keys(N9).map(e=>({value:e,label:N9[e]})),value:g,onValueChange:e=>_(e),children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:dD.DROPDOWN_IN_MODAL,children:Object.keys(N9).map(e=>(0,G.jsx)(j9,{value:e,children:N9[e]},e))})]})}),e.length===0&&(0,G.jsx)(`p`,{className:`text-destructive text-xs`,children:`桌面端还没有项目,请先在桌面添加。`}),e.length>0&&t.length===0&&(0,G.jsx)(`p`,{className:`text-destructive text-xs`,children:`桌面端没有可用的模型服务。`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-1`,children:[(0,G.jsx)(wa,{variant:`outline`,onClick:i,children:`取消`}),(0,G.jsx)(wa,{disabled:!w,onClick:()=>a({projectId:b,providerId:S,modelId:C,approvalMode:f,...m?{reasoningEnabled:m,thinkingLevel:g}:{}}),children:`创建`})]})]})]})})}function P9({label:e,children:t}){return(0,G.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e}),t]})}var Die={pending:`待发送`,sending:`发送中…`,failed:`发送失败`};function Oie({items:e,readOnly:t,onRetry:n,onDiscard:r}){return e.length===0?null:(0,G.jsx)(`div`,{className:`mb-1 space-y-1`,children:e.map(e=>(0,G.jsxs)(`div`,{className:W(`flex flex-wrap items-center gap-2 rounded-xl border px-2.5 py-1.5 text-xs`,e.status===`failed`?`border-destructive/40 bg-destructive/5`:`bg-muted/40`),children:[(0,G.jsx)(`span`,{className:W(`min-w-0 flex-1`,e.status===`failed`?`whitespace-pre-wrap break-words select-text`:`truncate`),children:e.text||(e.images?.length?`[${e.images.length} 张图片]`:``)}),(0,G.jsxs)(`span`,{className:W(`min-w-0 break-words`,e.status===`failed`?`text-destructive`:`text-muted-foreground`),children:[e.error?.startsWith(`outbox-discard`)?`移除消息`:e.error===`delivery-unconfirmed`?`结果未确认`:Die[e.status],e.status===`failed`&&e.error?`:${wre(e.error)}`:``]}),e.status===`failed`&&!e.error?.startsWith(`outbox-discard`)&&!t&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`重试`,onClick:()=>n(e.deliveryId),className:`shrink-0 rounded p-0.5 text-foreground hover:bg-accent`,children:(0,G.jsx)(An,{className:`h-3.5 w-3.5`})}),e.status!==`sending`&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`删除`,disabled:e.error===`outbox-discarding`,onClick:()=>r(e.deliveryId),className:`shrink-0 rounded p-0.5 text-muted-foreground hover:bg-accent`,children:(0,G.jsx)(er,{className:`h-3.5 w-3.5`})})]},e.deliveryId))})}function kie(){let e=globalThis.BarcodeDetector;if(!e)return null;let t=new e({formats:[`qr_code`]});return{async scan(e){return(await t.detect(e))[0]?.rawValue??null}}}async function Aie(){let{default:t}=await q(async()=>{let{default:t}=await import(`./jsQR-B1eQcpQl.js`).then(t=>e(t.default,1));return{default:t}},__vite__mapDeps([148,1])),n=document.createElement(`canvas`),r=n.getContext(`2d`,{willReadFrequently:!0});return{async scan(e){if(!r||!e.videoWidth)return null;let i=Math.min(1,640/Math.max(e.videoWidth,e.videoHeight));n.width=Math.round(e.videoWidth*i),n.height=Math.round(e.videoHeight*i),r.drawImage(e,0,0,n.width,n.height);let{data:a,width:o,height:s}=r.getImageData(0,0,n.width,n.height);return t(a,o,s,{inversionAttempts:`dontInvert`})?.data??null}}}async function jie(){return kie()??await Aie()}function Mie(e){try{return we(e),!0}catch{return!1}}function Nie({onPaired:e,autoInvite:t,onCancel:n,notice:r}){let[i,a]=(0,H.useState)(``),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(!1),f=(0,H.useRef)(null),p=(0,H.useRef)(null),m=()=>{for(let e of p.current?.getTracks()??[])e.stop();p.current=null,d(!1)},h=async t=>{s(!0),l(null);try{let n=we(t),r=/iPhone|iPad|Android/i.exec(navigator.userAgent)?.[0]??`Phone`,i=await De(n.relay,n.publicKey,r);e({pairId:i.pairId,token:i.deviceToken,contentKey:btoa(String.fromCharCode(...i.contentKey)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``),deviceName:r,relayUrl:n.relay,pairedAt:Date.now()})}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}},g=(0,H.useRef)(!1);(0,H.useEffect)(()=>{!t||g.current||(g.current=!0,h(t))},[t]);let _=(0,H.useRef)(()=>{});_.current=e=>{m(),h(e)};let v=async()=>{l(null);try{p.current=await navigator.mediaDevices.getUserMedia({video:{facingMode:`environment`}}),d(!0)}catch(e){l(window.isSecureContext?e instanceof DOMException&&e.name===`NotAllowedError`?`摄像头权限被拒绝,请在浏览器设置中允许后重试`:`无法访问摄像头,请粘贴配对码`:`扫码需要 HTTPS 环境,请改用粘贴配对码`),d(!1)}};return(0,H.useEffect)(()=>{if(!u)return;let e=f.current,t=p.current;if(!e||!t)return;let n=!1,r=0;return e.srcObject=t,e.muted=!0,(async()=>{try{await e.play();let t=await jie(),i=async()=>{if(!(n||!p.current)){try{let n=await t.scan(e);if(n&&Mie(n)){_.current(n);return}}catch{}r=requestAnimationFrame(()=>void i())}};await i()}catch{n||l(`无法开始预览,请粘贴配对码`)}})(),()=>{n=!0,cancelAnimationFrame(r)}},[u]),(0,G.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-5 px-6 pt-safe pb-safe`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5 text-center`,children:[(0,G.jsx)(`span`,{className:`mb-2 flex size-11 items-center justify-center rounded-[13px] border border-brand/20 bg-brand/8 text-brand dark:bg-brand/14`,children:(0,G.jsx)(kN,{className:`size-6`})}),(0,G.jsx)(`h1`,{className:`font-medium text-lg`,children:`连接到 EnsoCode`}),(0,G.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`在桌面端「设置 → 手机」生成配对码,扫码或粘贴。`}),r?(0,G.jsx)(`p`,{role:`status`,className:`mt-2 max-w-sm rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-left text-amber-700 text-xs dark:text-amber-300`,children:r}):null]}),u?(0,G.jsxs)(`div`,{className:`w-full max-w-sm space-y-2`,children:[(0,G.jsx)(`video`,{ref:f,playsInline:!0,muted:!0,className:`aspect-square w-full rounded-lg bg-black object-cover`}),(0,G.jsx)(wa,{variant:`outline`,className:`w-full`,onClick:m,children:`取消扫码`})]}):(0,G.jsxs)(wa,{className:`w-full max-w-sm`,onClick:()=>void v(),children:[(0,G.jsx)(pt,{className:`mr-1.5 h-4 w-4`}),`扫描二维码`]}),(0,G.jsxs)(`div`,{className:`flex w-full max-w-sm items-center gap-2`,children:[(0,G.jsx)(nW,{value:i,onChange:e=>a(e.target.value),placeholder:`enso://pair?relay=…`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,className:`font-mono text-xs`}),(0,G.jsx)(wa,{variant:`outline`,className:`shrink-0`,disabled:o||!i.trim(),onClick:()=>void h(i.trim()),children:o?(0,G.jsx)(an,{className:`h-4 w-4 animate-spin`}):`配对`})]}),c&&(0,G.jsx)(`p`,{className:`max-w-sm text-center text-destructive text-xs`,children:c}),n&&(0,G.jsx)(wa,{variant:`ghost`,className:`w-full max-w-sm`,onClick:n,children:`返回`})]})}var F9={minimal:`极低`,low:`低`,medium:`中`,high:`高`,xhigh:`极高`,max:`最高`};function Pie({providers:e,config:t,open:n,onClose:r,onSetModel:i,onSetReasoning:a,onSetThinking:o}){let s=e.find(e=>e.id===t.providerId),c=t.reasoningEnabled??!1,l=t.thinkingLevel??`medium`;return(0,G.jsx)(Y7,{open:n,onOpenChange:e=>!e&&r(),children:(0,G.jsxs)(X7,{side:`bottom`,className:`pb-safe`,children:[(0,G.jsx)(Z7,{children:(0,G.jsx)(Q7,{children:`会话设置`})}),(0,G.jsxs)(`div`,{className:`space-y-4 p-4 pt-0`,children:[(0,G.jsx)(I9,{label:`模型服务`,children:(0,G.jsxs)(D9,{items:e.map(e=>({value:e.id,label:e.name})),value:t.providerId??``,onValueChange:t=>{let n=e.find(e=>e.id===t),r=n?.models[0]?.id;n&&r&&i(n.id,r)},children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:dD.DROPDOWN_IN_MODAL,children:e.map(e=>(0,G.jsx)(j9,{value:e.id,children:e.name},e.id))})]})}),(0,G.jsx)(I9,{label:`模型`,children:(0,G.jsxs)(D9,{items:(s?.models??[]).map(e=>({value:e.id,label:e.label??e.id})),value:t.modelId??``,onValueChange:e=>{t.providerId&&i(t.providerId,e)},children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:dD.DROPDOWN_IN_MODAL,children:(s?.models??[]).map(e=>(0,G.jsx)(j9,{value:e.id,children:e.label??e.id},e.id))})]})}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`推理`}),(0,G.jsx)(dN,{checked:c,onCheckedChange:a})]}),c&&(0,G.jsx)(I9,{label:`推理档位`,children:(0,G.jsxs)(D9,{items:Object.keys(F9).map(e=>({value:e,label:F9[e]})),value:l,onValueChange:e=>o(e),children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:dD.DROPDOWN_IN_MODAL,children:Object.keys(F9).map(e=>(0,G.jsx)(j9,{value:e,children:F9[e]},e))})]})}),(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`模型切换对运行中的会话在下次启动时生效;推理档位即时生效。`})]})]})})}function I9({label:e,children:t}){return(0,G.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e}),t]})}var L9=`__all__`,Fie=`__ungrouped__`;function R9(e){return new Set(e.map(e=>e.id))}function z9(e,t){return t.includes(e)}function Iie(e,t){let n=e.groupId;return!n||!R9(t).has(n)}function Lie(e,t,n,r){let i=e.filter(e=>!z9(e.id,n));return r===`__all__`||r===`__recent__`?i:r===`__ungrouped__`?i.filter(e=>Iie(e,t)):i.filter(e=>e.groupId===r)}function Rie(e,t,n){let r=e.filter(e=>!z9(e.id,n)),i=[...t].sort((e,t)=>e.order-t.order),a=R9(t),o=i.map(e=>({groupId:e.id,group:e,projects:r.filter(t=>t.groupId===e.id)})),s=r.filter(e=>!e.groupId||!a.has(e.groupId));return s.length>0&&o.push({groupId:Fie,projects:s}),o}var zie=`default`;function Bie(e,t){return e===`__recent__`?{kind:`all`,fallbackFrom:`recent`}:e===`__ungrouped__`?{kind:`ungrouped`}:e!==`__all__`&&t.some(t=>t.id===e)?{kind:`group`,groupId:e}:{kind:`all`}}var Vie=e=>e?.secretaryOrigin?e.secretaryOrigin.secretaryId??zie:void 0;function Hie(e,t,{projects:n,projectGroups:r,conversations:i}){switch(t.kind){case`all`:return[...e];case`secretary`:return e.map(e=>({...e,ids:e.ids.filter(e=>Vie(i[e])===t.secretaryId)})).filter(e=>e.ids.length>0);default:{let i=new Set(r.map(e=>e.id));return e.filter(e=>{let r=n.find(t=>t.id===e.projectId)?.groupId;return t.kind===`group`?r===t.groupId:!r||!i.has(r)})}}}function Uie(e){return e.status===`failed`&&!e.spawning?`failed`:(e.pendingAskCount??0)>0?`waiting`:e.status===`running`||e.spawning||e.hasRunningChild?`running`:e.unread?`unread`:`idle`}function B9(e){return[...e].sort((e,t)=>(t.updatedAt??0)-(e.updatedAt??0))}function V9(e){let t=e=>(e.pendingAskCount??0)>0||(e.pendingApprovalCount??0)>0;return[...e.filter(t),...e.filter(e=>!t(e))]}function Wie(e,t){let n=B9(e),r=new Map(n.map(e=>[e.id,e])),i=[];for(let e of t){let t=r.get(e);t&&(i.push(t),r.delete(e))}return[...i,...V9([...r.values()])]}function H9(e){return V9([...B9(e.filter(e=>e.pinned)),...B9(e.filter(e=>!e.pinned))])}function Gie(e,t){return Uie({status:e.status,unread:e.unread,pendingAskCount:e.pendingAskCount,hasRunningChild:t})!==`idle`}function U9(e,t){return e<=0?0:Math.min(e,5+Math.max(0,t))}function Kie(e,t){return U9(e,t)>=e?0:Math.min(Math.max(0,e-5),t+15)}function qie(e){return Math.max(0,e-15)}var Jie=[{value:`auto`,label:`跟随桌面`},{value:`light`,label:`浅`},{value:`dark`,label:`深`}];function Yie({open:e,docked:t=!1,pinnable:n=!1,onTogglePinned:r,projects:i,groups:a=[],catalog:o,pinnedOrder:s=[],activeId:c,canCreate:l,devices:u,activeDevicePairId:d,remoteDesktop:f,connected:p,connectionLabel:m,pushEnabled:_,pushBusy:v,pushError:y,pushAvailability:b,pushConfigReady:x,onTogglePush:S,onClose:C,onSelect:w,onNewConversation:T,onSwitchDevice:E,onAddDevice:D,onRenameDevice:O,onUnpairDevice:k,botSegment:A}){let j=A?.active===!0,[M,N]=(0,H.useState)({}),[P,F]=(0,H.useState)({}),[I,ee]=(0,H.useState)(!1),[L,R]=(0,H.useState)(!1),[z,re]=(0,H.useState)(null),B=f?u.find(e=>e.pairId===d&&e.scope!==`read`):void 0,[ie,ae]=(0,H.useState)(g),[oe,se]=(0,H.useState)(()=>{try{return localStorage.getItem(`enso-phone-selected-project-group`)??`__all__`}catch{return L9}}),[ce,le]=(0,H.useState)({}),ue=oe===`__all__`||oe===`__ungrouped__`||a.some(e=>e.id===oe)?oe:L9;(0,H.useEffect)(()=>R(!1),[ue]),(0,H.useEffect)(()=>h(()=>ae(g())),[]),(0,H.useEffect)(()=>{e||re(null)},[e]);let[de,fe]=(0,H.useState)(()=>Date.now());(0,H.useEffect)(()=>{if(!e)return;fe(Date.now());let t=setInterval(()=>fe(Date.now()),6e4);return()=>clearInterval(t)},[e]);let pe=new Set(i.filter(e=>e.archived).map(e=>e.id)),me=[...pe],he=e=>e.archived||pe.has(e.projectId),ge=Lie(i,a,me,ue),_e=Rie(i,a,me),ve=new Set(ge.map(e=>e.id)),ye=o.filter(e=>!e.parentId),be=e=>!e.projectId||ve.has(e.projectId),xe=e=>o.some(t=>t.parentId===e&&t.status===`running`),Se=B9(ye.filter(e=>!he(e)&&be(e)&&Gie(e,xe(e.id)))),Ce=Wie(ye.filter(e=>e.pinned&&!he(e)&&be(e)),s),we=B9(ye.filter(he)),Te=Bie(ue,a),Ee=new Set(Hie(we.map(e=>({projectId:e.projectId,ids:[e.id]})),Te,{projects:i,projectGroups:a,conversations:{}}).flatMap(e=>e.ids)),De=we.filter(e=>Ee.has(e.id)),Oe=Te.kind!==`all`,ke=L?we:De,Ae=!Oe||L?`范围:全部归档`:Te.kind===`group`?`范围:分组「${a.find(e=>e.id===Te.groupId)?.name??``}」的归档`:`范围:未分组项目的归档`,je=ye.filter(e=>!he(e)),Me=new Set(i.map(e=>e.id)),Ne=H9(je.filter(e=>!Me.has(e.projectId)));return(0,G.jsxs)(G.Fragment,{children:[!t&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`关闭侧栏`,onClick:C,className:W(`fixed inset-0 z-40 bg-black/40 transition-[opacity,visibility] duration-200`,e?`visible opacity-100`:`invisible pointer-events-none opacity-0`)}),(0,G.jsxs)(`aside`,{className:W(`flex shrink-0 flex-col border-r bg-background`,t?`relative h-full w-72`:W(`fixed inset-y-0 left-0 z-50 w-[82vw] max-w-xs transition-transform duration-200`,e?`translate-x-0`:`-translate-x-full`)),children:[(0,G.jsxs)(`div`,{className:W(`flex h-12 shrink-0 items-center justify-between px-3 pt-safe`,a.length===0&&`border-b`),children:[A?(0,G.jsx)(`span`,{className:`flex rounded-lg bg-muted p-0.5 text-sm`,children:[`项目`,`Bot`].map(e=>{let t=e===`Bot`===A.active;return(0,G.jsx)(`button`,{type:`button`,"aria-pressed":t,onClick:()=>A.onChange(e===`Bot`),className:W(`rounded-md px-3 py-0.5 transition-colors`,t?`bg-background font-medium shadow-xs`:`text-muted-foreground`),children:e},e)})}):(0,G.jsx)(`span`,{className:`font-medium text-sm`,children:`项目`}),t?n&&r?(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`收起侧栏`,className:`rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(_n,{className:`h-4 w-4`})}):null:(0,G.jsxs)(`span`,{className:`flex items-center`,children:[n&&r&&(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`固定侧栏`,className:`rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(vn,{className:`h-4 w-4`})}),(0,G.jsx)(`button`,{type:`button`,onClick:C,"aria-label":`关闭侧栏`,className:`rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(er,{className:`h-4 w-4`})})]})]}),!j&&a.length>0&&(0,G.jsx)(`div`,{className:`shrink-0 border-b px-3 pb-2`,children:(0,G.jsxs)(D9,{items:[{value:`__all__`,label:`全部`},...a.slice().sort((e,t)=>e.order-t.order).map(e=>({value:e.id,label:`${e.emoji?`${e.emoji} `:``}${e.name}`})),{value:`__ungrouped__`,label:`未分组`}],value:ue,onValueChange:e=>{if(e){se(e);try{localStorage.setItem(`enso-phone-selected-project-group`,e)}catch{}}},children:[(0,G.jsx)(O9,{className:`w-full`,size:`sm`,children:(0,G.jsx)(k9,{})}),(0,G.jsxs)(A9,{zIndex:dD.DROPDOWN_IN_MODAL,children:[(0,G.jsx)(j9,{value:`__all__`,children:`全部`}),a.slice().sort((e,t)=>e.order-t.order).map(e=>(0,G.jsxs)(j9,{value:e.id,children:[e.emoji?`${e.emoji} `:``,e.name]},e.id)),(0,G.jsx)(j9,{value:`__ungrouped__`,children:`未分组`})]})]})}),j?A?.panel:(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-2`,children:[i.length===0&&(0,G.jsx)(`p`,{className:`rounded-lg border border-dashed px-3 py-6 text-center text-muted-foreground text-sm`,children:`桌面端还没有项目`}),Se.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`flex items-center gap-1.5 px-2 py-2`,children:(0,G.jsx)(`span`,{className:`font-medium text-sm`,children:`活跃中`})}),(0,G.jsx)(`div`,{className:`flex flex-col gap-y-0.5`,children:Se.map(e=>(0,G.jsx)(W9,{session:e,active:c===e.id,nowTick:de,onSelect:w},e.id))})]}),Ce.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-2`,children:[(0,G.jsx)(Sn,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`font-medium text-sm`,children:`置顶`})]}),(0,G.jsx)(`div`,{className:`flex flex-col gap-y-0.5`,children:Ce.map(e=>(0,G.jsx)(W9,{session:e,active:c===e.id,nowTick:de,onSelect:w},e.id))})]}),(ue===`__all__`&&a.length>0?_e.flatMap(e=>{let t=ce[e.groupId]===!0;return[{kind:`header`,section:e,folded:t},...t?[]:e.projects.map(e=>({kind:`project`,project:e}))]}):ge.map(e=>({kind:`project`,project:e}))).map(e=>e.kind===`header`?(0,G.jsxs)(`button`,{type:`button`,onClick:()=>le(t=>({...t,[e.section.groupId]:!t[e.section.groupId]})),className:`flex h-7 w-full items-center gap-1 rounded-md px-2 text-left text-xs font-medium text-muted-foreground`,children:[(0,G.jsx)(gt,{className:W(`h-3.5 w-3.5 shrink-0 transition-transform duration-150`,!e.folded&&`rotate-90`)}),e.section.group?.emoji&&(0,G.jsx)(`span`,{className:`shrink-0 text-sm`,children:e.section.group.emoji}),e.section.group?.color&&(0,G.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full`,style:{backgroundColor:e.section.group.color}}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.section.group?.name??`未分组`}),(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground/70`,children:e.section.projects.length})]},`hdr-${e.section.groupId}`):(0,G.jsx)(G9,{name:W7(e.project),badge:U7(e.project),sessions:H9(je.filter(t=>t.projectId===e.project.id)),folded:M[e.project.id]===!0,revealedExtra:P[e.project.id]??0,activeId:c,nowTick:de,canCreate:l,onToggleFold:()=>N(t=>({...t,[e.project.id]:!t[e.project.id]})),onRevealMore:t=>F(n=>({...n,[e.project.id]:t})),onSelect:w,onNew:()=>T(e.project.id)},e.project.id)),Ne.length>0&&(0,G.jsx)(G9,{name:`其他`,sessions:Ne,folded:M.__orphan===!0,revealedExtra:P.__orphan??0,activeId:c,nowTick:de,canCreate:!1,onToggleFold:()=>N(e=>({...e,__orphan:!e.__orphan})),onRevealMore:e=>F(t=>({...t,__orphan:e})),onSelect:w})]}),!j&&(0,G.jsxs)(`div`,{className:`shrink-0 border-t p-2`,children:[I&&(0,G.jsxs)(`div`,{className:`mb-0.5 flex max-h-64 flex-col gap-y-0.5 overflow-y-auto`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1`,children:[(0,G.jsx)(`span`,{"data-slot":`archive-scope`,className:`min-w-0 flex-1 truncate text-[11px] text-muted-foreground`,children:Ae}),Oe&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>R(e=>!e),className:`shrink-0 rounded-full border px-2 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted/60`,children:L?`仅本分组`:`全部归档`})]}),ke.length===0&&(0,G.jsx)(`p`,{className:`px-2 py-3 text-center text-muted-foreground text-xs`,children:`没有归档会话`}),ke.map(e=>(0,G.jsx)(W9,{session:e,active:c===e.id,nowTick:de,subtitle:(()=>{let t=i.find(t=>t.id===e.projectId);return t?W7(t):void 0})(),onSelect:w},e.id))]}),(0,G.jsxs)(`button`,{type:`button`,"data-slot":`archived-button`,"data-empty":De.length===0||void 0,onClick:()=>ee(e=>!e),className:W(`flex w-full items-center gap-1 rounded-lg px-2 py-2 text-left transition-colors hover:bg-muted/60`,De.length===0&&`opacity-55`),children:[(0,G.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center`,children:(0,G.jsx)(gt,{className:W(`h-3.5 w-3.5 text-muted-foreground transition-transform duration-200`,I?`-rotate-90`:`rotate-0`)})}),(0,G.jsx)(nt,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground text-sm`,children:`已归档`}),(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground tabular-nums`,children:De.length})]})]}),(0,G.jsxs)(`div`,{className:`shrink-0 space-y-1 border-t p-2 pb-safe`,children:[!z&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5`,children:[(0,G.jsx)(gn,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 text-muted-foreground text-sm`,children:`主题`}),(0,G.jsx)(`div`,{className:`flex shrink-0 gap-0.5 rounded-md border p-0.5`,children:Jie.map(e=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>te(e.value),className:W(`rounded px-2 py-1 text-[11px] transition-colors`,ie===e.value?`bg-primary text-primary-foreground`:`text-muted-foreground hover:bg-accent`),children:e.label},e.value))})]}),!z&&B&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5`,children:[(0,G.jsx)(pn,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 text-muted-foreground text-sm`,children:`界面`}),(0,G.jsxs)(`div`,{className:`flex shrink-0 gap-0.5 rounded-md border p-0.5`,children:[(0,G.jsx)(`span`,{className:`rounded bg-primary px-2 py-1 text-[11px] text-primary-foreground`,children:`精简`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{window.location.href=ne(B.pairId)},className:`rounded px-2 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-accent`,children:`完整`})]})]}),!z&&(0,G.jsxs)(`div`,{className:`px-2 py-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(lt,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 text-muted-foreground text-sm`,children:`推送通知`}),(0,G.jsx)(dN,{checked:_,disabled:v||b!==`ok`||!p||!x,onCheckedChange:S})]}),V({busy:v,error:y,availability:b,connected:p,configReady:x}).map(e=>(0,G.jsx)(`p`,{className:W(`mt-1 pl-6 text-[11px]`,e.error?`text-destructive`:`text-muted-foreground`),children:e.text},e.text))]}),(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[u.map(e=>{let t=e.pairId===d;return z===e.pairId?(0,G.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-dashed p-3`,children:[(0,G.jsxs)(`p`,{className:`text-xs`,children:[`解绑「`,e.label,`」后需重新扫码才能连接,确定吗?`]}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,G.jsx)(wa,{variant:`outline`,size:`sm`,onClick:()=>re(null),children:`取消`}),(0,G.jsx)(wa,{variant:`destructive`,size:`sm`,onClick:()=>{re(null),k(e.pairId)},children:`确定解绑`})]})]},e.pairId):(0,G.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>E(e.pairId),className:W(`flex min-w-0 flex-1 items-center gap-2 rounded-lg px-2 py-2 text-left text-sm transition-colors hover:bg-muted/60`,t?`text-foreground`:`text-muted-foreground`),children:[(0,G.jsx)(tn,{className:`h-4 w-4 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),t&&(0,G.jsx)(`span`,{className:W(`shrink-0 text-[10px]`,p?`text-muted-foreground`:`text-destructive`),children:m})]}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`重命名 ${e.label}`,onClick:()=>{let t=window.prompt(`给这台电脑起个名:`,e.label);t?.trim()&&O(e.pairId,t)},className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground`,children:(0,G.jsx)(xn,{className:`h-3.5 w-3.5`})}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`解绑 ${e.label}`,onClick:()=>re(e.pairId),className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-accent hover:text-destructive`,children:(0,G.jsx)(Yn,{className:`h-3.5 w-3.5`})})]},e.pairId)}),(0,G.jsxs)(`button`,{type:`button`,onClick:D,className:`flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-muted-foreground text-sm transition-colors hover:bg-muted/60 hover:text-foreground`,children:[(0,G.jsx)(Tn,{className:`h-4 w-4 shrink-0`}),(0,G.jsx)(`span`,{children:`配对新电脑`})]})]}),(0,G.jsxs)(`p`,{className:`px-2 pt-0.5 text-center text-[10px] text-muted-foreground/60`,children:[`版本 `,`38c0569`]})]})]})]})}function W9({session:e,active:t,nowTick:n,subtitle:r,onSelect:i}){return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:W(`flex w-full items-center gap-2 rounded-lg py-2 pr-2 pl-4 text-left text-sm transition-colors`,t?`bg-brand/10 dark:bg-brand/15`:`hover:bg-muted/60`),children:[(0,G.jsx)(Xie,{status:e.status,unread:e.unread}),e.pinned&&(0,G.jsx)(Sn,{className:`h-3 w-3 shrink-0 text-muted-foreground`,"aria-hidden":!0}),e.muted&&(0,G.jsx)(ct,{className:`h-3 w-3 shrink-0 text-muted-foreground`,"aria-label":`静音`}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.title||`新对话`,r&&(0,G.jsx)(`span`,{className:`ml-1.5 text-[10px] text-muted-foreground`,children:r})]}),e.updatedAt&&(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground/80 tabular-nums`,children:$7(e.updatedAt,`zh`,n)})]})}function G9({name:e,badge:t,sessions:n,folded:r,revealedExtra:i,activeId:a,nowTick:o,canCreate:s,onToggleFold:c,onRevealMore:l,onSelect:u,onNew:d}){let{t:f}=K(),p=U9(n.length,i),m=n.slice(0,p),h=n.length-p;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex w-full items-center gap-1 rounded-lg px-2 py-2 transition-colors hover:bg-muted/60`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:c,className:`flex min-w-0 flex-1 items-center gap-1 text-left`,children:[(0,G.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center`,children:(0,G.jsx)(gt,{className:W(`h-3.5 w-3.5 text-muted-foreground transition-transform duration-200`,!r&&`rotate-90`)})}),(0,G.jsx)(Ht,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-sm`,children:[e,t&&(0,G.jsx)(`span`,{className:`ml-1.5 rounded bg-muted px-1 py-0.5 text-[10px] font-normal text-muted-foreground`,children:t})]}),(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground tabular-nums`,children:n.length})]}),s&&d&&(0,G.jsx)(`button`,{type:`button`,onClick:d,className:`shrink-0 rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(ln,{className:`h-3.5 w-3.5`})})]}),!r&&(0,G.jsxs)(`div`,{className:`mt-0.5 flex flex-col gap-y-0.5`,children:[m.map(e=>(0,G.jsx)(W9,{session:e,active:a===e.id,nowTick:o,onSelect:u},e.id)),n.length>5&&(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[h>0&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>l(Kie(n.length,i)),className:`flex-1 rounded-lg py-1 text-center text-muted-foreground text-xs transition-colors hover:bg-muted/60 hover:text-foreground`,children:f(`Show {{n}} more`,{n:h})}),i>0&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>l(qie(i)),className:`flex-1 rounded-lg py-1 text-center text-muted-foreground text-xs transition-colors hover:bg-muted/60 hover:text-foreground`,children:f(`Collapse`)})]})]})]})}function Xie({status:e,unread:t}){let n=e===`running`,r=!n&&e===`failed`,i=!n&&!r&&t===!0;return(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 shrink-0 rounded-full`,n&&`animate-pulse bg-brand`,r&&`bg-destructive`,i&&`bg-green-500`,!n&&!r&&!i&&`bg-muted-foreground/30`)})}function K9(e,t){return e?t.some(e=>e.status===`running`||typeof e.pendingAskCount==`number`&&e.pendingAskCount>0||typeof e.pendingApprovalCount==`number`&&e.pendingApprovalCount>0):!1}var q9=null;async function J9(e,t=typeof navigator>`u`?void 0:navigator.wakeLock){if(!e||!t){if(!q9)return;let e=q9;q9=null;try{await e.release()}catch{}return}if(!q9)try{let e=await t.request(`screen`);q9=e,e.addEventListener(`release`,()=>{q9===e&&(q9=null)})}catch{q9=null}}function Zie(){if(!window.location.hash.replace(/^#/,``).includes(`pk=`))return null;let e=window.location.href;return history.replaceState(null,``,window.location.pathname+window.location.search),e}var Y9=`enso-phone-sidebar-pinned`,Qie=o();function $ie(){let e=O(window.location.search);if(!e)return null;let t=new URLSearchParams(window.location.search);t.delete(`session`);let n=t.toString();return history.replaceState(null,``,window.location.pathname+(n?`?${n}`:``)),e}function eae(){return se()?`ok`:/iphone|ipad|ipod/i.test(navigator.userAgent)&&!R()?`needs-install`:`unsupported`}function tae(){let[e,t]=(0,H.useState)(P),[n,i]=(0,H.useState)(ke),o=b(e,n),[c]=(0,H.useState)(Zie),[u]=(0,H.useState)(he),[f,m]=(0,H.useState)(u),[h,g]=(0,H.useState)(null),_=o!==null;(0,H.useEffect)(()=>{if(_)return;let e=!1;return r().then(t=>{e||g(S({paired:!1,marked:t,standalone:R()}))}),()=>{e=!0}},[_]);let[y,x]=(0,H.useState)(`connecting`),[C,w]=(0,H.useState)(`relay`),[T,D]=(0,H.useState)(null),[O,k]=(0,H.useState)([]),[j,N]=(0,H.useState)([]),[F,I]=(0,H.useState)([]),[L,te]=(0,H.useState)([]),[z,re]=(0,H.useState)([]),[ie]=(0,H.useState)($ie),[ae]=(0,H.useState)(()=>d(o?.pairId??null,ie)),[V,se]=(0,H.useState)(ae.activeId),[ue,de]=(0,H.useState)(null),[fe,me]=(0,H.useState)(!1),[ge,ye]=(0,H.useState)(new Set),[be,xe]=(0,H.useState)([]),[Ce,we]=(0,H.useState)(!1),Te=Yre(Xre),[Ee,De]=(0,H.useState)(()=>localStorage.getItem(Y9)!==`off`),Oe=Te&&Ee,Ae=()=>{De(e=>(localStorage.setItem(Y9,e?`off`:`on`),!e))},[je,Pe]=(0,H.useState)(!1),[Fe,Le]=(0,H.useState)(null),[Re,ze]=(0,H.useState)(!1),[Be,Ve]=(0,H.useState)(()=>localStorage.getItem(ce)===`on`),[He,Ue]=(0,H.useState)(!1),[We,Ke]=(0,H.useState)(!1),[qe,Je]=(0,H.useState)(!1),[Ye,Xe]=(0,H.useState)(!1),[Ze,Qe]=(0,H.useState)(!1),[$e,et]=(0,H.useState)(null),[U,tt]=(0,H.useState)(!1),[nt,rt]=(0,H.useState)(!1),[it,at]=(0,H.useState)(!1),ot=(0,H.useRef)(!1),[st,ct]=(0,H.useState)(!1),[lt,ut]=(0,H.useState)(!1),dt=(0,H.useRef)(!1),[ft,pt]=(0,H.useState)([]),[mt,ht]=(0,H.useState)([]),[gt,_t]=(0,H.useState)([]),[vt,yt]=(0,H.useState)(!1),[bt,xt]=(0,H.useState)([]),[St,Ct]=(0,H.useState)({items:[],offset:0}),[wt,Tt]=(0,H.useState)(()=>q7(!0,ae.botChatId)),[Et,Dt]=(0,H.useState)(ae.botChatId),[Ot,kt]=(0,H.useState)(null),[At,jt]=(0,H.useState)({}),[Mt,Nt]=(0,H.useState)({}),[Pt,Ft]=(0,H.useState)({}),[It,Lt]=(0,H.useState)(null),Rt=(0,H.useRef)(null),zt=(0,H.useMemo)(()=>new Ba(e=>Wt.current?.send(e)),[]),Bt=(0,H.useMemo)(()=>new ms(e=>Wt.current?.send(e)),[]),Vt=(0,H.useMemo)(()=>new gs(e=>Wt.current?.send(e)),[]),[Ht,Ut]=(0,H.useState)([]),Wt=(0,H.useRef)(null),Gt=(0,H.useRef)(V),Kt=(0,H.useRef)(O),qt=(0,H.useRef)(ue);Kt.current=O,qt.current=ue,Gt.current=V;let Jt=Et?gt.find(e=>e.id===Et):void 0,Yt=Jt?.kind===`group`?qo(Jt,ft):void 0,Xt=Yt?.current??Jt,Zt=Jt?.kind===`direct`?Jt.sessions[Jt.members[0]]?.conversationId??null:null,Qt=Et?Zt??Ot:V,$t=(0,H.useRef)(Qt);$t.current=Qt;let en=(0,H.useRef)(gt);en.current=gt;let tn=(0,H.useRef)(Et);tn.current=Et;let nn=(0,H.useRef)(null);nn.current=Yt?.current.id??null;let rn=(0,H.useRef)(new Set);rn.current=new Set(Yt?Object.values(Yt.current.sessions).map(e=>e.conversationId):[]);let an=(0,H.useRef)(null),on=(0,H.useRef)(new Map),sn=(0,H.useRef)(null),[cn,ln]=(0,H.useState)(!1),un=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(Me(),!(`serviceWorker`in navigator))return;let e=e=>{let t=e.data;if(t?.type!==`open-session`)return;let n=p(t.sessionId);if(!n)return;let r=en.current.find(e=>Object.values(e.sessions).some(e=>e.conversationId===n));r?(Dt(r.id),kt(null)):(Dt(null),se(n)),On()};return navigator.serviceWorker.addEventListener(`message`,e),()=>navigator.serviceWorker.removeEventListener(`message`,e)},[]),(0,H.useEffect)(()=>{Da(Ta(O))},[O]),(0,H.useEffect)(()=>{let e=()=>{J9(K9(document.visibilityState===`visible`&&y===`online`,O))};return e(),document.addEventListener(`visibilitychange`,e),document.addEventListener(`pointerdown`,e,{passive:!0}),()=>{document.removeEventListener(`visibilitychange`,e),document.removeEventListener(`pointerdown`,e),J9(!1)}},[O,y]),(0,H.useEffect)(()=>{if(ie){v();return}v().then(e=>{e&&(Dt(null),kt(null),se(e),On())})},[ie]),(0,H.useEffect)(()=>{c&&e.length>0&&m(!0)},[]),(0,H.useEffect)(()=>{if(!o)return;un.current=null,Ue(!1),ye(new Set),w(`relay`),Ke(!1),Je(!1),Xe(!1),rt(!1),at(!1),ot.current=!1,ct(!1),ut(!1),dt.current=!1;let e=()=>{Ke(!0),Xe(!0)},t=new ee(o,{onState:e=>{e!==`online`&&(Rt.current?.interrupted(),zt.reset(),Bt.reset(),Vt.reset(),rt(!1),ct(!1)),x(e)},onBotArtifacts:e=>zt.receive(e),onBotArtifactImage:e=>zt.receiveImage(e),onBotNewSessionResult:t=>{Bt.receive(t),t.error===`read-only`&&e()},onBotThreadResult:t=>{Vt.receive(t),t.error===`read-only`&&e()},onTransport:e=>{w(e),D(null)},onRtt:D,onRemoteDesktop:Je,onReadOnly:e=>{Ke(e),e||Xe(!1)},onCommandRejected:(t,n)=>{n===`read-only`&&e()},onCatalog:(e,t)=>{k(e),N(t??[])},onProjects:(e,t)=>{I(e),te(t??[])},onProviders:re,onSession:(e,t)=>{de(n=>e===$t.current?t:n),rn.current.has(e)&&Ft(n=>({...n,[e]:t}))},onBotCatalog:(e,t,n,r)=>{tt(e),rt(e&&n),ct(e&&r),ht(t),!e&&(_t([]),pt([]),xt([]),Ct({items:[],offset:0}),Dt(null),kt(null),Tt(!1))},onBotChats:(e,t)=>{_t(e),pt(t),yt(!0)},onBotInbox:xt,onBotActivity:(e,t)=>{for(let t of e)on.current.set(t.conversationId,t.botId);Ct({items:e,offset:t})},onGroupTimeline:e=>{e.beforeSeq!==void 0&&sn.current===`${e.chatId}:${e.beforeSeq}`&&(sn.current=null,ln(!1)),jt(t=>({...t,[e.chatId]:Zo(t[e.chatId],e)}))},onBotChatState:({type:e,chatId:t,...n})=>Nt(e=>({...e,[t]:n})),onBotEvent:e=>{if(e.kind===`model-notice`){e.text&&(e.chatId===tn.current||e.chatId===nn.current)&&Lt(e.text);return}!e.chatId||e.chatId!==nn.current||an.current||(an.current=setTimeout(()=>{an.current=null;let e=nn.current;e&&t.send({type:`bot-chat-open`,chatId:e})},200))},onBotSendResult:t=>{Rt.current?.settle(t.deliveryId,t.ok,t.error),t.error===`read-only`&&e()},onBotRetryResult:e=>{e.chatId===nn.current&&Lt(e.ok?`已开始重试`:`重试失败:${e.error===`session-busy`?`请等当前回复结束`:`该回复已过期或无法恢复,请重新发送需求`}`)},onSync:e=>me(e===`syncing`),onGhostSession:e=>{e===Gt.current&&se(null)},onHistoryPending:(e,t)=>{ye(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},onPushConfig:e=>{un.current=e,Ue(!0),localStorage.getItem(`enso-phone-push`)===`on`&&B(e).then(e=>{e.ok&&t.send({type:`push-subscribe`,subscription:e.subscription})})}});Wt.current=t,t.connect();let n=()=>{document.visibilityState===`visible`?(t.nudge(`visibility`),t.send({type:`presence`,visible:!0}),r()):(t.conceal(),t.send({type:`presence`,visible:!1}),t.flushCache())},r=()=>navigator.serviceWorker?.controller?.postMessage({type:`badge-clear`});r();let i=()=>{document.visibilityState===`visible`&&(t.nudge(`online`),t.send({type:`presence`,visible:!0}),r())},a=e=>{document.visibilityState===`visible`&&(t.nudge(e.persisted?`online`:`visibility`),t.send({type:`presence`,visible:!0}),r())},s=()=>{document.visibilityState===`visible`&&t.nudge(`visibility`)},c=()=>{t.conceal(),t.flushCache()};return document.addEventListener(`visibilitychange`,n),window.addEventListener(`online`,i),window.addEventListener(`pageshow`,a),window.addEventListener(`focus`,s),window.addEventListener(`pagehide`,c),()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`online`,i),window.removeEventListener(`pageshow`,a),window.removeEventListener(`focus`,s),window.removeEventListener(`pagehide`,c),an.current&&clearTimeout(an.current),an.current=null,t.close(),Wt.current=null,Bt.reset(),Vt.reset()}},[o?.pairId,o?.token,o?.relayUrl,o?.contentKey]);let dn=(0,H.useRef)(new Set);(0,H.useEffect)(()=>{let e=Qt!==null&&dn.current.has(Qt);Wt.current?.subscribe(Qt,{fresh:e});for(let e of dn.current)e!==Qt&&dn.current.delete(e);de(Qt?Wt.current?.getSession(Qt)??null:null)},[Qt,o?.pairId]);let fn=o?.pairId;(0,H.useEffect)(()=>{fn&&pe(fn,{activeId:V,botChatId:Et})},[V,Et,fn]),(0,H.useEffect)(()=>{if(!fn)return;let e=new ve(le,fn);Rt.current=e,Ut([]);let t=e.subscribe(e=>Ut([...e]));return e.restore().catch(()=>Lt(`离线消息读取失败,请勿清除浏览器数据;恢复存储后可重试。`)),()=>{t(),Rt.current===e&&(Rt.current=null)}},[fn]),(0,H.useEffect)(()=>{if(y===`online`)for(let e of Rt.current?.drain()??[])Wt.current?.send({type:`bot-send`,chatId:e.chatId,text:e.text,...e.images?.length?{images:e.images}:{},deliveryId:e.deliveryId})},[y,Ht]),(0,H.useEffect)(()=>{let e=setInterval(()=>Rt.current?.expire(),1e3);return()=>clearInterval(e)},[]);let pn=Yt?.current.id??null;(0,H.useEffect)(()=>{!pn||y!==`online`||(sn.current=null,ln(!1),Wt.current?.send({type:`bot-chat-open`,chatId:pn}))},[pn,y]),(0,H.useEffect)(()=>{if(!cn)return;let e=setTimeout(()=>{sn.current=null,ln(!1),Lt(`历史加载未完成,请点击加载重试。`)},1e4);return()=>clearTimeout(e)},[cn]),(0,H.useEffect)(()=>{let e={};for(let t of rn.current){let n=Wt.current?.getSession(t);n&&(e[t]=n)}Ft(e)},[pn,Yt?.current.sessions]),(0,H.useEffect)(()=>{if(!V||Et)return;let e=gt.find(e=>Object.values(e.sessions).some(e=>e.conversationId===V));e&&(Dt(e.id),se(null))},[V,Et,gt]),(0,H.useEffect)(()=>{let e=(e,t)=>{let n=Kt.current.find(t=>t.id===e)?.queued,r=vre(n,e,t,z7(e===Gt.current&&qt.current?[...qt.current.messages.values()]:[]));r&&xe(e=>[...e,r])};jN({removeQueuedMessage:(e,t)=>Wt.current?.send({type:`queue-remove`,sessionId:e,messageId:t}),updateQueuedMessage:(e,t,n)=>Wt.current?.send({type:`queue-update`,sessionId:e,messageId:t,text:n}),sendQueuedNow:(t,n)=>{e(t,n),Wt.current?.send({type:`queue-send-now`,sessionId:t,messageId:n})},interruptAndSendQueued:async(t,n)=>{e(t,n),Wt.current?.send({type:`queue-interrupt-send`,sessionId:t,messageId:n})},pauseGoal:e=>Wt.current?.send({type:`goal-pause`,sessionId:e}),resumeGoal:e=>Wt.current?.send({type:`goal-resume`,sessionId:e}),clearGoal:e=>Wt.current?.send({type:`goal-clear`,sessionId:e}),rewind:(e,t,n)=>Wt.current?.send({type:`rewind`,sessionId:e,userIndexFromEnd:t,...n?{restoreFiles:n}:{}}),retry:e=>Wt.current?.send({type:`retry`,sessionId:e})}),Ie({stopTask:(e,t)=>Wt.current?.send({type:`task-stop`,sessionId:e,taskId:t}),stopSubagent:(e,t)=>Wt.current?.send({type:`subagent-stop`,sessionId:e,agentId:t})})},[]);let mn=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(!V)return;let e=z7(ue?[...ue.messages.values()]:[]),t=ue?.status===`running`,n=mn.current,r=n?.id===V&&n.running&&!t;mn.current={id:V,running:t},xe(t=>{let n=xre(t,V,e,{turnSettled:r});return n.length===t.length&&n.every((e,n)=>e===t[n])?t:n})},[ue,V]);let hn=O.find(e=>!e.parentId)?.id;(0,H.useEffect)(()=>{!Et&&!V&&hn&&se(hn)},[V,Et,hn]);let gn=(0,H.useMemo)(()=>O.find(e=>e.id===V),[O,V]),_n=(0,H.useMemo)(()=>{if(!gn)return;let e=gn.parentId?O.find(e=>e.id===gn.parentId):gn;if(!e)return;let t=O.filter(t=>t.parentId===e.id);return t.length>0?{parent:e,children:t}:void 0},[O,gn]),vn=gn&&!gn.parentId,bn=vn?z.find(e=>e.id===gn.providerId)?.models.find(e=>e.id===gn.modelId)?.label??gn.modelId??`选择模型`:void 0,xn=y===`online`?a(C,T):Ne[y],Sn=e=>{k([]),N([]),I([]),te([]),re([]),de(null),me(!1),xe([]),D(null),tt(!1),ht([]),_t([]),pt([]),yt(!1),Dt(e.botChatId),Tt(e.botChatId!==null),kt(null),jt({}),Nt({}),Ct({items:[],offset:0}),Ft({}),Lt(null),se(e.activeId)},Cn=e=>{e!==o?.pairId&&(l(e),i(e),x(`connecting`),Sn(d(e)),On())},wn=n=>{let r=A(e,n);if(E(r),l(n.pairId),u&&n.scope!==`read`){window.location.replace(ne(n.pairId));return}t(r),i(n.pairId),Sn(d(n.pairId)),m(!1)},Tn=n=>{n===o?.pairId&&Wt.current?.close();let{devices:r,fallback:a}=s(e,n,o?.pairId??null);t(r),a!==void 0&&(i(a?.pairId??null),a&&x(`connecting`),Sn(d(a?.pairId??null)),a||On())},En=(n,r)=>{t(M(e,n,r))};if(!o||f)return(0,G.jsx)(Nie,{autoInvite:c,onPaired:wn,onCancel:o?()=>{u?window.location.replace(ne(o.pairId)):m(!1)}:void 0,notice:o?null:h});if(y===`unauthorized`){let t=e.length>1;return(0,G.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,G.jsx)(Rn,{className:`h-8 w-8 text-muted-foreground`}),(0,G.jsx)(`h1`,{className:`font-medium text-lg`,children:`配对已失效`}),(0,G.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[`「`,o.label,`」已解绑此设备,`,t?`可移除它并切到其他电脑。`:`请重新扫码配对。`]}),(0,G.jsx)(wa,{onClick:()=>Tn(o.pairId),children:t?`移除此配对`:`重新配对`})]})}if(y===`replaced`)return(0,G.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,G.jsx)(Rn,{className:`h-8 w-8 text-muted-foreground`}),(0,G.jsx)(`h1`,{className:`font-medium text-lg`,children:`已在其他页面打开`}),(0,G.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[`「`,o.label,`」正被另一个页面连着,同一时间只能有一个页面。`]}),(0,G.jsx)(wa,{onClick:()=>window.location.reload(),children:`在这个页面重连`})]});let Dn=e=>Wt.current?.send(e),On=()=>{(localStorage.getItem(Y9)===`off`||!window.matchMedia(`(min-width: 900px)`).matches)&&we(!1)},kn=()=>{Tt(q7(U,Et)),we(!0),U&&Dn({type:`bot-catalog-request`})},An=(e,t,n=[])=>{Lt(null),Rt.current?.enqueue({chatId:e,text:t,images:n})},jn=e=>(0,G.jsx)(Oie,{items:Ht.filter(t=>t.chatId===e),readOnly:We,onRetry:e=>Rt.current?.retry(e),onDiscard:e=>Rt.current?.discard(e)}),Mn=new Map(mt.map(e=>[e.id,e])),Nn=e=>We?`只读设备不能新建会话`:y===`online`?nt?it?`正在新建会话…`:Ht.some(t=>t.chatId===e)?`请先处理待发送消息`:void 0:`请升级桌面端以支持新建会话`:`请先连接桌面端`,Pn=async e=>{if(Nn(e)||ot.current)return;let t=Wt.current;ot.current=!0,at(!0),Lt(null);try{let n=await Bt.start(e,()=>t===Wt.current&&tn.current===e&&window.confirm(`群聊中仍有回复、排队或委派任务。新建会话将停止成员回复,并取消未标记保留的委派。旧消息会保留。继续吗?`));if(t!==Wt.current||tn.current!==e)return;Lt(!n||n.ok?null:n.error===`read-only`?`只读设备不能新建会话`:n.error===`timeout`||n.error===`offline`?`未收到新会话确认,请连接后核对聊天状态,勿重复操作`:`新建会话失败:${n.error??`请稍后重试`}`),n?.ok&&(t?.send({type:`bot-catalog-request`}),t?.send({type:`bot-chat-open`,chatId:e}))}finally{t===Wt.current&&(ot.current=!1,at(!1))}},Fn=We?`只读设备不能切换或新建话题`:y===`online`?lt?`正在处理话题…`:void 0:`请先连接桌面端`,In=async e=>{if(Fn||dt.current)return;let t=Wt.current;dt.current=!0,ut(!0),Lt(null);try{let n=await Vt.request(e);if(t!==Wt.current||tn.current!==e.chatId)return;n.ok?kt(null):Lt(n.error===`read-only`?`只读设备不能切换或新建话题`:n.error===`timeout`||n.error===`offline`?`未收到桌面确认,请连接后核对当前话题`:n.error===`invalid`?`该话题已不存在或群已归档`:`话题操作失败:${n.error??`请稍后重试`}`)}finally{t===Wt.current&&(dt.current=!1,ut(!1))}},Ln=e=>{if(e.kind===`group`&&!Ot){let t=Object.entries(e.sessions).flatMap(([e,{conversationId:t}])=>{let n=Pt[t];return n?[{sessionId:t,botId:e,view:n}]:[]});return(0,G.jsx)(Jre,{chat:e,bots:Mn,timeline:At[e.id],state:Mt[e.id],pending:t,activities:ls(St.items,e.id),clockOffset:St.offset,connState:y,stateLabel:xn,notice:It,outbox:jn(e.id),deviceReadOnly:We,readOnlyRejected:Ye,onOpenDrawer:kn,drawerDocked:Oe,onNewSession:()=>void Pn(e.id),canCreate:!Nn(e.id),newSessionHint:Nn(e.id),newSessionBusy:it,threads:st&&Yt&&Jt?{entries:Yt.entries,currentId:e.id,rootId:Jt.id,disabledHint:Fn,onSelect:e=>void In({type:`bot-thread-select`,chatId:Jt.id,threadId:e}),onCreate:()=>void In({type:`bot-thread-create`,chatId:Jt.id})}:void 0,onLoadOlder:()=>{let t=At[e.id]?.entries[0]?.seq,n=`${e.id}:${t}`;y!==`online`||t===void 0||sn.current||(sn.current=n,ln(!0),Dn({type:`bot-timeline`,chatId:e.id,beforeSeq:t}))},historyLoading:cn,onJumpLatest:()=>{sn.current=null,ln(!1),jt(t=>{let n={...t};return delete n[e.id],n}),Dn({type:`bot-chat-open`,chatId:e.id})},onSend:(t,n)=>An(e.id,t,n),onStop:()=>Dn({type:`bot-stop`,chatId:e.id}),onRetry:t=>{Lt(`正在请求重试…`),Dn({type:`bot-retry`,chatId:e.id,entryId:t})},onOpenProcess:kt,onApproval:(e,t,n)=>Dn({type:`approval-respond`,sessionId:e,requestId:t,decision:n}),onAsk:(e,t,n)=>Dn({type:`ask-respond`,sessionId:e,requestId:t,answer:n})})}let t=e.kind===`group`,n=At[e.id]?.entries.find(e=>e.kind===`bot`&&e.conversationId===Ot),r=Ot?on.current.get(Ot):void 0,i=Mn.get(t?n?.kind===`bot`?n.botId:r??``:e.members[0]);return(0,G.jsx)(V7,{sessionId:Qt??`bot-chat:${e.id}`,clockOffset:St.offset,title:t?`${i?.name??`成员`} · 过程`:i?.name??e.title,projectName:t?e.title:i?.title??``,view:Qt?ue:Qie,connState:y,stateLabel:xn,syncing:fe&&!!Qt,onOpenDrawer:kn,drawerDocked:Oe,onNewSession:()=>!t&&void Pn(e.id),canCreate:!t&&!Nn(e.id),newSessionHint:Nn(e.id),newSessionBusy:it,hasOlder:!!(Qt&&ue&&ue.messages.size>0&&Math.min(...ue.messages.keys())>0),historyLoading:!!(Qt&&ge.has(Qt)),onLoadOlder:()=>Qt&&Wt.current?.requestHistory(Qt),bot:t?{readOnly:!0,onBack:()=>kt(null)}:{chatId:e.id,notice:It,outbox:jn(e.id)},artifacts:!t&&Qt?{chatId:e.id,conversationId:Qt}:void 0,deviceReadOnly:We,readOnlyRejected:Ye,onSend:(t,n)=>An(e.id,t,n),onAbort:()=>Qt&&Dn({type:`abort`,sessionId:Qt}),onApproval:(e,t)=>Qt&&Dn({type:`approval-respond`,sessionId:Qt,requestId:e,decision:t}),onAsk:(e,t)=>Qt&&Dn({type:`ask-respond`,sessionId:Qt,requestId:e,answer:t})})},zn=async e=>{et(null);let t=oe(Dn);if(!e){Ve(!1),Se(t);return}let n=un.current;if(!n)return;Ve(!0),Qe(!0);let r=await _e(n,t);Qe(!1),r.ok||(Ve(!1),et(r.reason))};return(0,G.jsxs)(`div`,{className:`phone-app-root flex h-full min-h-0`,children:[(0,G.jsx)(Yie,{open:Oe||Ce,docked:Oe,pinnable:Te,onTogglePinned:Ae,projects:F,groups:L,catalog:O,pinnedOrder:j,activeId:Et?null:V,canCreate:y===`online`&&!We,devices:e,activeDevicePairId:o.pairId,remoteDesktop:qe,connected:y===`online`,connectionLabel:xn,onClose:()=>On(),onSelect:e=>{Dt(null),kt(null),se(e),On()},onNewConversation:e=>{On(),Le(e),Pe(!0)},pushEnabled:Be,pushBusy:Ze,pushError:$e,pushAvailability:eae(),pushConfigReady:He,onTogglePush:e=>void zn(e),onSwitchDevice:Cn,onAddDevice:()=>{On(),m(!0)},onRenameDevice:En,onUnpairDevice:Tn,botSegment:U?{active:wt,onChange:e=>{Tt(e),Nre(e?`bot`:`code`),e&&Dn({type:`bot-catalog-request`})},panel:(0,G.jsx)(ps,{bots:mt,chats:gt,activeChatId:Et,inbox:bt,activities:St.items,onDismiss:We?void 0:e=>Dn({type:`bot-inbox-dismiss`,key:e}),onSelect:e=>{Dt(e),kt(null),Lt(null),On()}})}:void 0}),(0,G.jsxs)(`div`,{className:`flex h-full min-w-0 flex-1 flex-col`,children:[Te&&!Oe&&!Ce&&(0,G.jsx)(`button`,{type:`button`,onClick:kn,"aria-label":`打开会话列表`,className:`fixed top-1/2 left-0 z-40 flex h-16 w-6 -translate-y-1/2 items-center justify-center rounded-r-lg border border-l-0 bg-background/90 text-muted-foreground shadow-sm backdrop-blur transition-colors hover:bg-accent hover:text-foreground`,children:(0,G.jsx)(yn,{className:`h-4.5 w-4.5`})}),Jt?(0,G.jsx)(Ua.Provider,{value:{port:zt,online:y===`online`},children:Ln(Xt??Jt)}):Et?(0,G.jsxs)(`div`,{className:`relative flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[!Oe&&(0,G.jsx)(`button`,{type:`button`,onClick:kn,"aria-label":`打开会话列表`,className:`absolute top-2 left-2 flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:(0,G.jsx)(yn,{className:`h-4.5 w-4.5`})}),(0,G.jsx)(`p`,{children:vt?`该 Bot 聊天已不存在或不可用`:`正在恢复 Bot 聊天…`}),(0,G.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:xn}),(0,G.jsx)(wa,{onClick:kn,children:`选择聊天`})]}):(0,G.jsx)(V7,{sessionId:V,title:gn?.title||(V?`会话`:`EnsoCode`),projectName:gn?.projectName??``,cwd:gn?.cwd,view:ue,connState:y,stateLabel:xn,syncing:fe&&!!V,onOpenDrawer:kn,drawerDocked:Oe,onNewSession:()=>{Le(null),Pe(!0)},canCreate:y===`online`&&F.length>0&&!We,modelLabel:y===`online`?bn:void 0,onOpenConfig:()=>ze(!0),tabGroup:_n,onSelectTab:se,hasOlder:!!(V&&ue&&ue.messages.size>0&&Math.min(...ue.messages.keys())>0),historyLoading:!!(V&&ge.has(V)),onLoadOlder:()=>V&&Wt.current?.requestHistory(V),queued:yre(gn?.queued,be,V??``),echoes:be,goal:gn?.goal,context:gn?.context,usageTotals:gn?.usageTotals,slashCommands:gn?.slashCommands,deviceReadOnly:We,readOnlyRejected:Ye,onSend:(e,t)=>{if(!V)return;let n=Ge(e);if(n){Dn({type:`compact`,sessionId:V,...n.instructions?{instructions:n.instructions}:{}});return}let r=/^\/goal(?:\s+([\s\S]+))?$/.exec(e.trim());if(r){let e=r[1]?.trim();if(!e)return;Dn(e===`clear`?{type:`goal-clear`,sessionId:V}:e===`pause`?{type:`goal-pause`,sessionId:V}:e===`resume`?{type:`goal-resume`,sessionId:V}:{type:`goal-set`,sessionId:V,text:e});return}Dn({type:ue?.status===`running`?`enqueue`:`prompt`,sessionId:V,text:e,...t.length?{images:t}:{}})},onAbort:()=>V&&Dn({type:`abort`,sessionId:V}),onApproval:(e,t)=>V&&Dn({type:`approval-respond`,sessionId:V,requestId:e,decision:t}),onAsk:(e,t)=>V&&Dn({type:`ask-respond`,sessionId:V,requestId:e,answer:t})}),(0,G.jsx)(Eie,{open:je&&!We,projects:F,providers:z,preferredProjectId:Fe,onClose:()=>{Pe(!1),Le(null)},onCreate:e=>{let t=crypto.randomUUID();Dn({type:`spawn`,sessionId:t,...e}),dn.current.add(t),Pe(!1),Le(null),Dt(null),kt(null),se(t)}}),vn&&V&&!We&&(0,G.jsx)(Pie,{open:Re,providers:z,config:{providerId:gn.providerId,modelId:gn.modelId,reasoningEnabled:gn.reasoningEnabled,thinkingLevel:gn.thinkingLevel},onClose:()=>ze(!1),onSetModel:(e,t)=>Dn({type:`set-model`,sessionId:V,providerId:e,modelId:t}),onSetReasoning:e=>Dn({type:`set-reasoning`,sessionId:V,enabled:e}),onSetThinking:e=>Dn({type:`set-thinking`,sessionId:V,level:e})})]})]})}function nae(e){return!e.appleMobile||!e.standalone||e.safeTop<=0||e.innerHeight<=e.innerWidth?!1:e.innerHeight>=Math.max(e.screenWidth,e.screenHeight)-1}function rae(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e&&!/^viewport-fit\s*=/i.test(e)).join(`, `)}function iae(){return/iphone|ipad|ipod/i.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1}function aae(){let e=document.querySelector(`meta[name="viewport"]`);if(!e||!iae())return;let t=document.createElement(`div`);t.setAttribute(`aria-hidden`,`true`),t.style.cssText=`position:fixed;visibility:hidden;pointer-events:none;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)`,document.body.appendChild(t);let n=()=>{let r=getComputedStyle(t);if(!nae({appleMobile:!0,standalone:R(),safeTop:Number.parseFloat(r.paddingTop)||0,innerWidth:window.innerWidth,innerHeight:window.innerHeight,screenWidth:window.screen.width,screenHeight:window.screen.height}))return;let i=Number.parseFloat(r.paddingBottom)||0;document.documentElement.style.setProperty(`--phone-safe-bottom`,`${i}px`),e.content=rae(e.content),window.removeEventListener(`resize`,n),document.removeEventListener(`visibilitychange`,n),t.remove()};window.addEventListener(`resize`,n),document.addEventListener(`visibilitychange`,n),n()}var X9=new URLSearchParams(location.search);if(X9.get(`mode`)===`phone`){ae(`phone`),X9.delete(`mode`);let e=X9.toString();history.replaceState(null,``,`${location.pathname}${e?`?${e}`:``}${location.hash}`)}var Z9=P(),Q9=be(location.search,Te(),Z9,ke());Q9?location.replace(Q9):Z9.length>0&&(de(),w(!0)),I(),aae(),Q9||ye(window),!Q9&&`serviceWorker`in navigator&&Ee({container:navigator.serviceWorker,doc:document,storage:sessionStorage,canReloadNow:()=>!1,reload:()=>location.reload()});var $9=document.getElementById(`root`);$9&&!Q9&&(0,Ue.createRoot)($9).render((0,G.jsx)(H.StrictMode,{children:(0,G.jsx)(tae,{})}));export{K1 as a,$f as c,qs as d,q as f,V0 as i,bu as l,Ha as m,D2 as n,c_ as o,K as p,B0 as r,Qp as s,i3 as t,Cc as u};
|