@inkeep/open-knowledge 0.42.0-beta.13 → 0.42.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-PwxCSk8L.mjs → acp-harness-probe-CAE-EIAO.mjs} +2 -2
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/{build-fAc55Z_L.mjs → build-DYQrG4v7.mjs} +1 -1
- package/dist/build-DcqN8tua.mjs +1 -0
- package/dist/{chunk-TLSUDHID-BOrmK-jg.mjs → chunk-TLSUDHID-B0bd8ZfM.mjs} +2 -2
- package/dist/cli.mjs +57 -57
- package/dist/config-schema.json +154 -0
- package/dist/config.project.schema.json +154 -0
- package/dist/constants-BZl1G87U.mjs +2 -0
- package/dist/{diff-HJF2MPDN-BvwqXcA5.mjs → diff-HJF2MPDN-DhZaF2MX.mjs} +1 -1
- package/dist/{flag-coverage-6JEX67RU-D3X0I2ha.mjs → flag-coverage-6JEX67RU-D1byxsyF.mjs} +2 -2
- package/dist/fs-traced-B9Czc2nP.mjs +1 -0
- package/dist/{fs-traced-Cc6WsRtP.mjs → fs-traced-BmZQL7v9.mjs} +2 -2
- package/dist/{git-handle-B1TJqyoh.mjs → git-handle-DPgGAaBb.mjs} +2 -2
- package/dist/git-handle-mU3AzxE3.mjs +1 -0
- package/dist/index.d.mts +37 -13
- package/dist/index.mjs +1 -1
- package/dist/init-CJbmqYq7.mjs +1 -0
- package/dist/{init-C_ZFDDwH.mjs → init-COanttdJ.mjs} +37 -37
- package/dist/{launch-json-removal-DPvJksib.mjs → launch-json-removal-DxmjjRz1.mjs} +2 -2
- package/dist/{lib-CE7ieLC-.mjs → lib-BS_oZ9bm.mjs} +4 -4
- package/dist/{libesm-CG75CrN9.mjs → libesm-DzwC_yFw.mjs} +1 -1
- package/dist/loader-CdTuY6uH.mjs +1 -0
- package/dist/{loader-0YCBN4cH.mjs → loader-Dfh3vrvm.mjs} +2 -2
- package/dist/md-manager-Dy92M9Co.mjs +2 -0
- package/dist/{open-browser-CXby8R3t.mjs → open-browser-DVHIE120.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-Cjg4sLCV.mjs → preview-BXBmqQHa.mjs} +2 -2
- package/dist/preview-C6YDS1mn.mjs +1 -0
- package/dist/public/assets/ActivityModeContent-C2P34Oxp.js +1 -0
- package/dist/public/assets/{AgentDiffPane-f8e9_JvG.js → AgentDiffPane-DcYd6e4i.js} +2 -2
- package/dist/public/assets/{AgentThreadClientBinder-UR-Kf4b1.js → AgentThreadClientBinder-Dc_ZvYaC.js} +1 -1
- package/dist/public/assets/CodeMirrorPropInput-BDWvXsen.js +3 -0
- package/dist/public/assets/{ConsentDialogBody-BjbzWR8D.js → ConsentDialogBody-CerQg1mw.js} +1 -1
- package/dist/public/assets/DocumentContext-DYNMnkEK.js +38 -0
- package/dist/public/assets/{EditorModeToggle-BjJNUMBS.js → EditorModeToggle-DUpVsmPc.js} +2 -2
- package/dist/public/assets/{EnableSyncConfirmDialog-B05Urde9.js → EnableSyncConfirmDialog-ByznA2PW.js} +1 -1
- package/dist/public/assets/FeedbackForm-GiDmtTV5.js +1 -0
- package/dist/public/assets/{GraphPanel-Bc99r1NG.js → GraphPanel-CqaIMvPS.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-gSyEWnW_.js → LintConfigEditor-2sMpGsvn.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-Bv97X2Kw.js +1 -0
- package/dist/public/assets/{McpConsentDialogBody-BT0tOjYc.js → McpConsentDialogBody-g1cYKWmV.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-ppbCwqCZ.js → MermaidDocEditor-peOyXfDP.js} +1 -1
- package/dist/public/assets/PropertyPanel-TNLuDkLB.js +2 -0
- package/dist/public/assets/{ReportBugDialogBody-CkyHWZh9.js → ReportBugDialogBody-CFAfyMu8.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-5fvtp9pn.js → SchemaConfigEditor-CINC-UXE.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-DYHvNSXS.js → SettingsDialogBody-DXovj0IS.js} +3 -3
- package/dist/public/assets/{ShareBranchSwitchDialog-DEHPks5w.js → ShareBranchSwitchDialog-Dfc-qPui.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-IX_2OQ-z.js → ShareReceiveDialog-mjee2gdk.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-BsHBuFKr.js → ShareReceiveMissDialog-RIU6HaEy.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-Bg7DEmMN.js → SkillEditorActions-ghSewPgo.js} +1 -1
- package/dist/public/assets/SourceEditor-C5A403lL.js +1 -0
- package/dist/public/assets/{TerminalPanel-xzIwFtxc.js → TerminalPanel-B26SgJgt.js} +2 -2
- package/dist/public/assets/{TerminalSessionsHost-DPN4hpOi.js → TerminalSessionsHost-DXQM6Nk-.js} +2 -2
- package/dist/public/assets/{TerminalWindowApp-BEx4mQbz.js → TerminalWindowApp-DFkdh_Dr.js} +1 -1
- package/dist/public/assets/{ThreadView-BEUMdycz.js → ThreadView-meVyXMtJ.js} +2 -2
- package/dist/public/assets/{TimelineDiffPane-60Mqrg_1.js → TimelineDiffPane-CzDAeswG.js} +2 -2
- package/dist/public/assets/{abnfDiagram-VRR7QNED-BN6xOaJK.js → abnfDiagram-VRR7QNED-CpaiDrfg.js} +1 -1
- package/dist/public/assets/{agent-diff-store-D9meLWbh.js → agent-diff-store-CgUtJ40J.js} +1 -1
- package/dist/public/assets/{agent-visibility-CYbXZE0k.js → agent-visibility-Q7iJ3Wrj.js} +1 -1
- package/dist/public/assets/{arc-DXLgvp45.js → arc-CvzmZpaI.js} +1 -1
- package/dist/public/assets/architecture-TIHT7OUA-DJqhUxi8.js +1 -0
- package/dist/public/assets/{architectureDiagram-ZJ3FMSHR-sAL9H8K0.js → architectureDiagram-ZJ3FMSHR-CUPpKaNe.js} +1 -1
- package/dist/public/assets/{auth-state-cache-B9EBu3Gl.js → auth-state-cache-BGbpopsu.js} +3 -3
- package/dist/public/assets/awareness-heartbeat.worker-BYkbsKQ2.js +1 -0
- package/dist/public/assets/{blockDiagram-677ZJIJ3-CecPiwgF.js → blockDiagram-677ZJIJ3-BHPvFhpI.js} +1 -1
- package/dist/public/assets/{c4Diagram-LMCZKHZV-D8mdqYYS.js → c4Diagram-LMCZKHZV-DJHIa26M.js} +1 -1
- package/dist/public/assets/{calendar-DEDeJBdZ.js → calendar-Cbj0oPjD.js} +1 -1
- package/dist/public/assets/channel-DJju_46x.js +1 -0
- package/dist/public/assets/chunk-2Q5K7J3B-BThJ0ACJ.js +1 -0
- package/dist/public/assets/{chunk-32BRIVSS-JpxGJ5ji.js → chunk-32BRIVSS-BwgPzOKX.js} +1 -1
- package/dist/public/assets/{chunk-52WLFC77-C_iSxcYL.js → chunk-52WLFC77-BbFy67yI.js} +1 -1
- package/dist/public/assets/{chunk-5FCAYU7R-Bq8uZn8B.js → chunk-5FCAYU7R-b-dJCCK-.js} +1 -1
- package/dist/public/assets/{chunk-5HE753X5-Canmf8DQ.js → chunk-5HE753X5-BQBFOg3H.js} +1 -1
- package/dist/public/assets/{chunk-5JV3BV7I-Dtexaqo4.js → chunk-5JV3BV7I-DjT6jnuJ.js} +1 -1
- package/dist/public/assets/{chunk-5TONJI2A-QaNyDyr1.js → chunk-5TONJI2A-CmHBNIPA.js} +1 -1
- package/dist/public/assets/{chunk-5VM5RSS4-DnRDZx9C.js → chunk-5VM5RSS4-Do0yPUxJ.js} +1 -1
- package/dist/public/assets/{chunk-7BUUIJ7U-CjwBXrEk.js → chunk-7BUUIJ7U-BNZcf0tz.js} +1 -1
- package/dist/public/assets/{chunk-BIQX33UG-CwPTWPTQ.js → chunk-BIQX33UG-UfugZvJI.js} +1 -1
- package/dist/public/assets/{chunk-BO2N2NFS-BTXsfKML.js → chunk-BO2N2NFS-BIBt7Qku.js} +3 -3
- package/dist/public/assets/{chunk-C7G6YPKG-yRQSkwCz.js → chunk-C7G6YPKG-Do2eDGGY.js} +1 -1
- package/dist/public/assets/{chunk-CQNSW5MT-BzGo9Za_.js → chunk-CQNSW5MT-CnhzhYO8.js} +1 -1
- package/dist/public/assets/{chunk-CYSBUYHQ-CKmnpHug.js → chunk-CYSBUYHQ--r3UnEvE.js} +1 -1
- package/dist/public/assets/{chunk-EMLP6XTP-_x7IkQoS.js → chunk-EMLP6XTP-DrfV6ENZ.js} +1 -1
- package/dist/public/assets/{chunk-EX3LRPZG-Dp9dLoos.js → chunk-EX3LRPZG-5ZShCZOk.js} +1 -1
- package/dist/public/assets/{chunk-FWX5IMBZ-DS2bi_oI.js → chunk-FWX5IMBZ-o2qZZUCd.js} +2 -2
- package/dist/public/assets/{chunk-HOUHSVGY-CiAzcmEO.js → chunk-HOUHSVGY-Df48_U0n.js} +1 -1
- package/dist/public/assets/{chunk-ICXQ74PX-COjRz7aI.js → chunk-ICXQ74PX-C5pgH7nt.js} +1 -1
- package/dist/public/assets/{chunk-JG7HCLWE-BIqqOtX1.js → chunk-JG7HCLWE-BML1eBLo.js} +1 -1
- package/dist/public/assets/{chunk-JWPE2WC7-DKmcMFEN.js → chunk-JWPE2WC7-CdhLoJ2N.js} +1 -1
- package/dist/public/assets/{chunk-MOJQB5TN-BJQv3CxF.js → chunk-MOJQB5TN-DlER2Egr.js} +1 -1
- package/dist/public/assets/{chunk-MOZMSUNE-Cy6wrRA7.js → chunk-MOZMSUNE-DUrRQaqL.js} +1 -1
- package/dist/public/assets/{chunk-OGEWGWER-C7C3Oiaz.js → chunk-OGEWGWER-CSwz10O0.js} +1 -1
- package/dist/public/assets/{chunk-OSBZ3O6U-DmX-gaPq.js → chunk-OSBZ3O6U-81uAnz70.js} +1 -1
- package/dist/public/assets/{chunk-PUDLZKDR-ZoTPQ917.js → chunk-PUDLZKDR-DpE61GzF.js} +1 -1
- package/dist/public/assets/{chunk-Q4XR5HBZ-sjes-Yon.js → chunk-Q4XR5HBZ-BEUOBfte.js} +1 -1
- package/dist/public/assets/{chunk-QBLGF6JB-BiU9LEk8.js → chunk-QBLGF6JB-BLRJJJog.js} +1 -1
- package/dist/public/assets/{chunk-R7FJI6CG-BAfUnNIm.js → chunk-R7FJI6CG-DrLC9WW_.js} +1 -1
- package/dist/public/assets/{chunk-RYQCIY6F-IRvgwbUs.js → chunk-RYQCIY6F-C2zE8SC6.js} +1 -1
- package/dist/public/assets/{chunk-U6XO7XAA-2Ds3FX_A.js → chunk-U6XO7XAA-CzoIuhZL.js} +1 -1
- package/dist/public/assets/{chunk-V7JOEXUC-Xkrljz-l.js → chunk-V7JOEXUC-BQfpu3-5.js} +1 -1
- package/dist/public/assets/chunk-VAUOI2AC-BeKYmt6g.js +1 -0
- package/dist/public/assets/{chunk-VR4S4FIN-Db6y0lij.js → chunk-VR4S4FIN-QXoKTwNU.js} +1 -1
- package/dist/public/assets/{chunk-WYO6CB5R-WjatCbeP.js → chunk-WYO6CB5R-DAWl___9.js} +1 -1
- package/dist/public/assets/chunk-XXDRQBXY-BVenPdkF.js +1 -0
- package/dist/public/assets/{chunk-YOTPTUD7-BDIMzFfd.js → chunk-YOTPTUD7-BaSlFT1K.js} +1 -1
- package/dist/public/assets/{chunk-ZGVPDNZ5-DKtGLh__.js → chunk-ZGVPDNZ5-CApzXV8d.js} +1 -1
- package/dist/public/assets/{chunk-ZIRB5QZD-JvsKOaWe.js → chunk-ZIRB5QZD-DcyZ3zVD.js} +1 -1
- package/dist/public/assets/classDiagram-OUVF2IWQ-C-jB8GCV.js +1 -0
- package/dist/public/assets/classDiagram-v2-EOCWNBFH-YdtbtmeU.js +1 -0
- package/dist/public/assets/{client-version-D5pI6rXA.js → client-version-q6Dhv1UB.js} +1 -1
- package/dist/public/assets/{config-provider-DjoTPI46.js → config-provider-BlhsBCJH.js} +2 -2
- package/dist/public/assets/{cose-bilkent-JH36ORCC-B5xjEHuC.js → cose-bilkent-JH36ORCC-CA17ejsA.js} +1 -1
- package/dist/public/assets/cynefin-VYW2F7L2-D2sHOfu_.js +1 -0
- package/dist/public/assets/{cynefinDiagram-TSTJHNR4-BeGFvfoc.js → cynefinDiagram-TSTJHNR4-C1SvaQSj.js} +1 -1
- package/dist/public/assets/{dagre-CLVncoxl.js → dagre-BePblgKB.js} +1 -1
- package/dist/public/assets/{dagre-VKFMJZFB-D98i06T_.js → dagre-VKFMJZFB-DEzcQzQ_.js} +1 -1
- package/dist/public/assets/{diagram-FQU43EPY--u6SeKWp.js → diagram-FQU43EPY-CbY2dMOG.js} +1 -1
- package/dist/public/assets/{diagram-G47NLZAW-BqkpNwsF.js → diagram-G47NLZAW-DqCIUGeN.js} +1 -1
- package/dist/public/assets/{diagram-NH7WQ7WH-eeVqGH2O.js → diagram-NH7WQ7WH-Cw8bUyPJ.js} +1 -1
- package/dist/public/assets/{diagram-OA4YK3LP-D_SnUALW.js → diagram-OA4YK3LP-U82pbdIM.js} +1 -1
- package/dist/public/assets/{diagram-WEI45ONY-DKlVw8je.js → diagram-WEI45ONY-Q03Igfxy.js} +1 -1
- package/dist/public/assets/dist-BX94flmC.js +1 -0
- package/dist/public/assets/dist-C6PM6Xz4.js +2 -0
- package/dist/public/assets/{dist-DbWN0KUu.js → dist-D9TmfgYW.js} +122 -120
- package/dist/public/assets/{dist-DQ4RxLMf.js → dist-fh4pGZKU.js} +1 -1
- package/dist/public/assets/{doc-hash-Ds3Xt5sU.js → doc-hash-By0RtZb7.js} +1 -1
- package/dist/public/assets/{documents-events-CeD7Nm0E.js → documents-events-BRsI2hJl.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-CCIWWBDH-d0cDPEQB.js → ebnfDiagram-CCIWWBDH-DZowrdm4.js} +1 -1
- package/dist/public/assets/{erDiagram-Q63AITRT-BsZ0tL6Z.js → erDiagram-Q63AITRT-CmoXSu-r.js} +1 -1
- package/dist/public/assets/eventmodeling-45OFAUF4-LqLB3TNh.js +1 -0
- package/dist/public/assets/{file-tree-adapter-UXgwHNRD.js → file-tree-adapter-NqeYDxT9.js} +1 -1
- package/dist/public/assets/{file-tree-utils-CKB7vhwx.js → file-tree-utils-BmEujY3K.js} +1 -1
- package/dist/public/assets/flowDiagram-23GEKE2U-4rTcseMm.js +1 -0
- package/dist/public/assets/{ganttDiagram-NO4QXBWP-DPxkIh3b.js → ganttDiagram-NO4QXBWP-C0xOCx7Q.js} +1 -1
- package/dist/public/assets/gitGraph-TEB2WS4Q-BEPuDtJ5.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-IHSO6WYX-vSvxugX5.js → gitGraphDiagram-IHSO6WYX-_EJiD41h.js} +1 -1
- package/dist/public/assets/globals-Box5QldL.css +1 -0
- package/dist/public/assets/{globals-Bo785x8X.js → globals-DFE-MLkJ.js} +1 -1
- package/dist/public/assets/{graphlib-C4UD57Nn.js → graphlib-DnpO72b_.js} +1 -1
- package/dist/public/assets/{highlighted-body-OFNGDK62-DCKUiY8r.js → highlighted-body-OFNGDK62-CNSPR2wA.js} +1 -1
- package/dist/public/assets/index-Cb5OrOZT.js +2014 -0
- package/dist/public/assets/info-DKCQHKI2-CMS65hg4.js +1 -0
- package/dist/public/assets/{infoDiagram-FWYZ7A6U-Crh0f5aw.js → infoDiagram-FWYZ7A6U-CS6V0kHh.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-FXEZZL3T-DBJ4jEKk.js → ishikawaDiagram-FXEZZL3T-CyR5Ajwf.js} +1 -1
- package/dist/public/assets/{journeyDiagram-5HDEW3XC-CUDo0rzP.js → journeyDiagram-5HDEW3XC-CDLzkiDv.js} +1 -1
- package/dist/public/assets/{kanban-definition-HUTT4EX6-CJD8Oexf.js → kanban-definition-HUTT4EX6-DpgKHF6a.js} +1 -1
- package/dist/public/assets/{line-ClsiHw5g.js → line-5y1fbUZx.js} +1 -1
- package/dist/public/assets/{linear-BklRBRnp.js → linear-Cr_l_wiY.js} +1 -1
- package/dist/public/assets/{lint-config-client-CU8tKrUp.js → lint-config-client-m2-s0Ntp.js} +1 -1
- package/dist/public/assets/{map-CMaVsxPf.js → map-Y1ICr5kQ.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-D-lKa2AX.js → markdownlint-rule-browser-D59yIUvb.js} +1 -1
- package/dist/public/assets/mermaid-GHXKKRXX-cKMuWw6m.js +1 -0
- package/dist/public/assets/{mermaid-parser.core-D-rj2UdW.js → mermaid-parser.core-CqW0l_dJ.js} +2 -2
- package/dist/public/assets/{mermaid.core-DZGNq3YZ.js → mermaid.core-DTAF4MBn.js} +3 -3
- package/dist/public/assets/{mindmap-definition-LN4V7U3C-Drk1V3-q.js → mindmap-definition-LN4V7U3C-D_O_QNPK.js} +1 -1
- package/dist/public/assets/{navigation-targets-DlApq0F4.js → navigation-targets-BNXyYGqo.js} +1 -1
- package/dist/public/assets/{now-Ck_JVNC2.js → now-DZKi6vJC.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-C_zW-xH-.js → open-managed-artifact-tab-B_XkGOR4.js} +1 -1
- package/dist/public/assets/{ordinal-DrDHGs3t.js → ordinal-BWNniVDk.js} +1 -1
- package/dist/public/assets/packet-7NZHBO7P-BHMeVRDP.js +1 -0
- package/dist/public/assets/{pegDiagram-2B236MQR-CM3AjMbx.js → pegDiagram-2B236MQR-CdihzSPE.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-CRA3584T.js → pending-receive-nav-store-lH450qAv.js} +1 -1
- package/dist/public/assets/pie-RZYD4A2V-04-GDYum.js +1 -0
- package/dist/public/assets/{pieDiagram-ENE6RG2P-D8wIwdwS.js → pieDiagram-ENE6RG2P-ChFgOvHp.js} +1 -1
- package/dist/public/assets/{prop-types-Bp7ajkYA.js → prop-types-CYlKPf0N.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-ABIIQ3AL-h2Dtd1uI.js → quadrantDiagram-ABIIQ3AL-BSsBk-PK.js} +1 -1
- package/dist/public/assets/radar-I7S5WNFK-CFV8GxSd.js +1 -0
- package/dist/public/assets/railroad-3IZDKUUU-HocUJIPa.js +1 -0
- package/dist/public/assets/railroad-abnf-AHOZXSZD-BjtQnDLf.js +1 -0
- package/dist/public/assets/railroad-ebnf-EBAXGLYW-CB0AKoda.js +1 -0
- package/dist/public/assets/railroad-peg-LSFZ7HO6-D14HGrNX.js +1 -0
- package/dist/public/assets/{railroadDiagram-RFXS5EU6-CLc68_Sv.js → railroadDiagram-RFXS5EU6-CZtrUy7I.js} +1 -1
- package/dist/public/assets/{receive-store-CmOFuJ5o.js → receive-store-CnPZW2Nl.js} +1 -1
- package/dist/public/assets/{requirementDiagram-TGXJPOKE-DtJA-6Zq.js → requirementDiagram-TGXJPOKE-4y0MwGkb.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-HTMAVEWB-Dw4-_oAZ.js → sankeyDiagram-HTMAVEWB-DU6fqR-t.js} +1 -1
- package/dist/public/assets/{selection-context-DJG3xvFp.js → selection-context-LHeRMlQS.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-DBY2YBRQ-B4Af8Tp3.js → sequenceDiagram-DBY2YBRQ-BLOHid4z.js} +1 -1
- package/dist/public/assets/{sizeCapture-X5ZJPWSS-B7J9pg7l.js → sizeCapture-X5ZJPWSS-DHfk9Ljg.js} +1 -1
- package/dist/public/assets/skill-actions-CfCRZPoW.js +1 -0
- package/dist/public/assets/{skills-api-CN8Hksry.js → skills-api-BazENdP9.js} +1 -1
- package/dist/public/assets/{src-UzA84-l2.js → src-gwekitwz.js} +2 -2
- package/dist/public/assets/{src-D9eynQ26.js → src-xjlg9C_q.js} +1 -1
- package/dist/public/assets/{stateDiagram-2N3HPSRC-L3VR_LMr.js → stateDiagram-2N3HPSRC-BSUZgpoy.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-6OUMAXLB-BTi0JfLJ.js +1 -0
- package/dist/public/assets/{swimlanes-5IMT3BWC-CRfWYpqt.js → swimlanes-5IMT3BWC-DXdgh-Jw.js} +2 -2
- package/dist/public/assets/swimlanesDiagram-G3AALYLV-v3ze-Bpb.js +8 -0
- package/dist/public/assets/{tag-pill-input-DVEEYU9y.js → tag-pill-input-CRZHSDZk.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-DBKxmlEZ.js → target-navigation-intent-Dj_FUf4y.js} +1 -1
- package/dist/public/assets/{telemetry-impl-B0xfYfCD.js → telemetry-impl-P2IeKAaO.js} +2 -2
- package/dist/public/assets/{telemetry-startup-BYP0kNl2.js → telemetry-startup-DEYbhmGw.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-OZusAMc8.js → terminal-launch-events-DScIDElv.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-1gUD9W57.js → terminal-telemetry-DXukxrNb.js} +1 -1
- package/dist/public/assets/{timeline-definition-FHXFAJF6-C1Qc7Dba.js → timeline-definition-FHXFAJF6-DgwM8xnq.js} +1 -1
- package/dist/public/assets/treeView-QDETBFTQ-P-cJWDuJ.js +1 -0
- package/dist/public/assets/treemap-6X3UGDF4-DHfkEEZV.js +1 -0
- package/dist/public/assets/{typing-burst-detector-CjeuhXb7.js → typing-burst-detector-vTqYB3XL.js} +2 -2
- package/dist/public/assets/{uninstall-Cp4M347z.js → uninstall-BZCRgnr7.js} +1 -1
- package/dist/public/assets/{use-activity-panel-CZ8r7sJr.js → use-activity-panel-p45LX2Pn.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-kT3YWc5p.js → use-apply-config-color-theme-42OkirpU.js} +1 -1
- package/dist/public/assets/{use-collab-url-DPrY37Xq.js → use-collab-url-CD04O43Q.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-BYn_alYX.js → use-live-xterm-theme-DBloho-q.js} +1 -1
- package/dist/public/assets/{use-settings-route-DbIUNQxX.js → use-settings-route-CqFpylkf.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-BPcyrJJU.js → use-terminal-enabled-DJWPpDI0.js} +1 -1
- package/dist/public/assets/use-timeline-entry-diff-Buyw-iUn.js +6 -0
- package/dist/public/assets/{use-workspace-BJkoTGFP.js → use-workspace-KCjvxowE.js} +1 -1
- package/dist/public/assets/{vennDiagram-L72KCM5P-C4cNDPVl.js → vennDiagram-L72KCM5P-Ds0NnN2m.js} +1 -1
- package/dist/public/assets/wardley-OPB4EBWU-CYMtNsgm.js +1 -0
- package/dist/public/assets/{wardleyDiagram-EHGQE667-B2UY3KQf.js → wardleyDiagram-EHGQE667-CyCq4K63.js} +1 -1
- package/dist/public/assets/{workspace-paths-BYp4HrI_.js → workspace-paths-7c4g7gcc.js} +1 -1
- package/dist/public/assets/{xychartDiagram-FW5EYKEG-CMsrwnL2.js → xychartDiagram-FW5EYKEG-DKLKXonj.js} +1 -1
- package/dist/public/index.html +47 -46
- package/dist/public/uninstall.html +5 -5
- package/dist/{repair-launch-json-CZawWAqd.mjs → repair-launch-json-DI-m7k4O.mjs} +2 -2
- package/dist/{repair-mcp-configs-DpdVVhiU.mjs → repair-mcp-configs-CsyBggTD.mjs} +2 -2
- package/dist/repair-skills-CkFqORhu.mjs +1 -0
- package/dist/{repair-skills-DllMOsvZ.mjs → repair-skills-D1i6iLv9.mjs} +2 -2
- package/dist/schemas/v0/config.project.schema.json +154 -0
- package/dist/server-lock-CIgYSMil.mjs +1 -0
- package/dist/{server-lock-Cr23NqXF.mjs → server-lock-VVJOI8HF.mjs} +2 -2
- package/dist/{sleep-B2L0pvp4.mjs → sleep-DTzPXGtM.mjs} +5 -5
- package/dist/src-4plpVqWf.mjs +3268 -0
- package/dist/src-B1AwMBZC.mjs +20 -0
- package/dist/{src-CJ8mKCzo.mjs → src-ByC_RNGy.mjs} +120 -116
- package/dist/src-Dtqr3yLh.mjs +1 -0
- package/dist/{start-FUQOcvoI.mjs → start-BqYk_tuA.mjs} +2 -2
- package/dist/start-cL5kxmwb.mjs +1 -0
- package/dist/{write-project-skill-CeYehb7h.mjs → write-project-skill-wHG3k3iy.mjs} +4 -4
- package/package.json +4 -4
- package/dist/build-L3kflBeC.mjs +0 -1
- package/dist/constants-CcMCMPg3.mjs +0 -2
- package/dist/fs-traced-BpCA6YXG.mjs +0 -1
- package/dist/git-handle-Dqp-QyuN.mjs +0 -1
- package/dist/init-lRVOzPU9.mjs +0 -1
- package/dist/loader-CSY1M15w.mjs +0 -1
- package/dist/md-manager-B4llsKsm.mjs +0 -2
- package/dist/preview-CiaBar1u.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-Cj3BeHpK.js +0 -1
- package/dist/public/assets/CodeMirrorPropInput-B34vnmpV.js +0 -3
- package/dist/public/assets/DocumentContext-BiAlIaIL.js +0 -38
- package/dist/public/assets/FeedbackForm-BtLP5P4r.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-BHDbPsDj.js +0 -1
- package/dist/public/assets/PropertyPanel-Bke_n9xy.js +0 -2
- package/dist/public/assets/SourceEditor-rMBsqzFc.js +0 -1
- package/dist/public/assets/architecture-TIHT7OUA-D0qm7G-3.js +0 -1
- package/dist/public/assets/channel-DA_5WVVG.js +0 -1
- package/dist/public/assets/chunk-2Q5K7J3B-CZvundFv.js +0 -1
- package/dist/public/assets/chunk-VAUOI2AC-CzpwkaIj.js +0 -1
- package/dist/public/assets/chunk-XXDRQBXY-aujsIsPx.js +0 -1
- package/dist/public/assets/classDiagram-OUVF2IWQ-DaJYvXbz.js +0 -1
- package/dist/public/assets/classDiagram-v2-EOCWNBFH-naGS_xxO.js +0 -1
- package/dist/public/assets/cynefin-VYW2F7L2-BIoIBt-C.js +0 -1
- package/dist/public/assets/dist-B1qkpf98.js +0 -2
- package/dist/public/assets/eventmodeling-45OFAUF4-DJJWSxES.js +0 -1
- package/dist/public/assets/flowDiagram-23GEKE2U-BDvIWhMq.js +0 -1
- package/dist/public/assets/gitGraph-TEB2WS4Q-DbaUaLPe.js +0 -1
- package/dist/public/assets/globals-DF_8aGgC.css +0 -1
- package/dist/public/assets/index-CFaXQy8P.js +0 -2014
- package/dist/public/assets/info-DKCQHKI2-t_ReTPP2.js +0 -1
- package/dist/public/assets/mermaid-GHXKKRXX-Cj1_l2m9.js +0 -1
- package/dist/public/assets/packet-7NZHBO7P-DvVA7lgt.js +0 -1
- package/dist/public/assets/pie-RZYD4A2V-THg35hJ6.js +0 -1
- package/dist/public/assets/radar-I7S5WNFK-Cnae5YqF.js +0 -1
- package/dist/public/assets/railroad-3IZDKUUU-z19uKrUP.js +0 -1
- package/dist/public/assets/railroad-abnf-AHOZXSZD-BUg9AO49.js +0 -1
- package/dist/public/assets/railroad-ebnf-EBAXGLYW-DuBtfJ_K.js +0 -1
- package/dist/public/assets/railroad-peg-LSFZ7HO6-BSfcErEJ.js +0 -1
- package/dist/public/assets/skill-actions-CnJP2Bcc.js +0 -1
- package/dist/public/assets/stateDiagram-v2-6OUMAXLB-DM5o7mT7.js +0 -1
- package/dist/public/assets/swimlanesDiagram-G3AALYLV-BTrTvdTh.js +0 -8
- package/dist/public/assets/treeView-QDETBFTQ-nC4bzLZB.js +0 -1
- package/dist/public/assets/treemap-6X3UGDF4-D1MGcMAJ.js +0 -1
- package/dist/public/assets/use-timeline-entry-diff-vG8YRtnb.js +0 -6
- package/dist/public/assets/wardley-OPB4EBWU-Dt2lEMaH.js +0 -1
- package/dist/repair-skills-Buq5QlSJ.mjs +0 -1
- package/dist/server-lock-D335a5oG.mjs +0 -1
- package/dist/src-9fqRbYyu.mjs +0 -22
- package/dist/src-CIFd3tOE.mjs +0 -3267
- package/dist/src-DHVO9P4d.mjs +0 -1
- package/dist/start-eE4o515K.mjs +0 -1
- /package/dist/public/assets/{ActivityPanelDiffView-CSOgz1F9.js → ActivityPanelDiffView-BGKBr_no.js} +0 -0
- /package/dist/public/assets/{AppMenubar-CXadCCMc.js → AppMenubar-BU0HYo5c.js} +0 -0
- /package/dist/public/assets/{BugReportHistoryDialog-B5Yf5rAM.js → BugReportHistoryDialog-BZO4T3mM.js} +0 -0
- /package/dist/public/assets/{__vite-browser-external-T_MG5_bv.js → __vite-browser-external-BPhyXp2q.js} +0 -0
- /package/dist/public/assets/{agent-presence-CTJkQnoU.js → agent-presence-BDFQXhQj.js} +0 -0
- /package/dist/public/assets/{array-BAI_NyvG.js → array-DJgG7CD3.js} +0 -0
- /package/dist/public/assets/{chunk-KEIR6QF5-BSqm2tNO.js → chunk-KEIR6QF5-C3U0QMR_.js} +0 -0
- /package/dist/public/assets/{chunk-Y2CYZVJY-BCLrJxO_.js → chunk-Y2CYZVJY-WLanMySb.js} +0 -0
- /package/dist/public/assets/{clike-CkWR_Slw.js → clike-CsX0C1YS.js} +0 -0
- /package/dist/public/assets/{clipboard-adapter--Ja4oXEM.js → clipboard-adapter-B_gXWRIi.js} +0 -0
- /package/dist/public/assets/{colors-C1oQkVlI.js → colors-CWhKCDlb.js} +0 -0
- /package/dist/public/assets/{cytoscape.esm-ewu4kfMU.js → cytoscape.esm-2keAwKuv.js} +0 -0
- /package/dist/public/assets/{defaultLocale-C0VJf-tm.js → defaultLocale-CsPu2dQr.js} +0 -0
- /package/dist/public/assets/{diff-BsdYbIgD.js → diff-CbyZ1KYU.js} +0 -0
- /package/dist/public/assets/{dist-d-7NE8aL.js → dist-6exA4p3e.js} +0 -0
- /package/dist/public/assets/{dist-BocybIB-.js → dist-CmkBz4Vc.js} +0 -0
- /package/dist/public/assets/{dist-DDqBNQiG.js → dist-Ct4bmKYA.js} +0 -0
- /package/dist/public/assets/{dist-BF6U-ayK.js → dist-O02mGI7S.js} +0 -0
- /package/dist/public/assets/{follow-file-DBnmqlyk.js → follow-file-zwaRiP64.js} +0 -0
- /package/dist/public/assets/{form-D-z6QdLf.js → form-fGxW7-bd.js} +0 -0
- /package/dist/public/assets/{format-BVhfvqw3.js → format-CrtQIa7U.js} +0 -0
- /package/dist/public/assets/{go-D-ZJPtwk.js → go-Cx3BNpJ0.js} +0 -0
- /package/dist/public/assets/{init-BX0_4ZBD.js → init-tdyl3bNV.js} +0 -0
- /package/dist/public/assets/{isObject-BkQ5hIlp.js → isObject-CX6hKsbi.js} +0 -0
- /package/dist/public/assets/{libesm-CHqp8owk.js → libesm-JNr6wvfe.js} +0 -0
- /package/dist/public/assets/{lru-string-cache-hwDoWobi.js → lru-string-cache-BqWv9U_z.js} +0 -0
- /package/dist/public/assets/{lua-Cx3bDzQk.js → lua-u3LXwKmZ.js} +0 -0
- /package/dist/public/assets/{mcp-consent-store-Xk9UA_MB.js → mcp-consent-store-D31n_rvi.js} +0 -0
- /package/dist/public/assets/{min-Bd9Lorof.js → min-K63jgMN_.js} +0 -0
- /package/dist/public/assets/{panzoom.es-B9Lp3OVt.js → panzoom.es-CLhX4RTP.js} +0 -0
- /package/dist/public/assets/{path-C1_RvjGX.js → path-D0DHVP2m.js} +0 -0
- /package/dist/public/assets/{pdf-B7Y_z-D1.js → pdf-D1xNRDom.js} +0 -0
- /package/dist/public/assets/{pdf.worker-B6TdDPWM.js → pdf.worker-BoI-M0vk.js} +0 -0
- /package/dist/public/assets/{perl-CV3dlsd7.js → perl-Ds8HeZsB.js} +0 -0
- /package/dist/public/assets/{properties-D1GaCcfv.js → properties-CZlNTT94.js} +0 -0
- /package/dist/public/assets/{r-CHRF940O.js → r-fvx4gKsV.js} +0 -0
- /package/dist/public/assets/{rough.esm-B1nzhEZO.js → rough.esm-BNRxiiMT.js} +0 -0
- /package/dist/public/assets/{ruby-YzQuyklS.js → ruby-BGw-M-J7.js} +0 -0
- /package/dist/public/assets/{schema-fields-view-intent-Dz1ZzVCe.js → schema-fields-view-intent-BxfUZqrI.js} +0 -0
- /package/dist/public/assets/{share-metadata-rows-BlaR96La.js → share-metadata-rows-CheY4PXF.js} +0 -0
- /package/dist/public/assets/{shell-BvVJAeXE.js → shell-DTMPEhEr.js} +0 -0
- /package/dist/public/assets/{sortable.esm-B6whf_t-.js → sortable.esm-DGuuqLb9.js} +0 -0
- /package/dist/public/assets/{sql-CECtKdDi.js → sql-DoPu5kfc.js} +0 -0
- /package/dist/public/assets/{src-BaTc8y5c.js → src-Bipm8mTe.js} +0 -0
- /package/dist/public/assets/{swift-DLct3DJs.js → swift-CfZoxKRA.js} +0 -0
- /package/dist/public/assets/{textarea-RSYJwPz9.js → textarea-DII_Czak.js} +0 -0
- /package/dist/public/assets/{thread-client-CXDtD9Ce.js → thread-client-59Ryh_VO.js} +0 -0
- /package/dist/public/assets/{thread-draft-staging-B4_1TigQ.js → thread-draft-staging-YcpEkMiY.js} +0 -0
- /package/dist/public/assets/{toml-Bl-Vp4wG.js → toml-Br73Jx61.js} +0 -0
- /package/dist/public/assets/{useLintConfigViewMode-BYm6FwC5.js → useLintConfigViewMode-MQmCIk3b.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Gol9BgNB.js";import{a as ee,c as te,i as ne,n as re,o as ie,s as ae,t as oe}from"./dialog-TkFkuYVg.js";import{n as se,t as s}from"./git-branch-CMJAiYLz.js";import{t as c}from"./loader-circle-Cg5SU7AZ.js";import{n as ce,t as le}from"./miss-dialog-store-Bx4JLuKB.js";import{n as l}from"./dist-BLAMau9Z.js";import{t as u}from"./desktop-bridge-types--ZPzhkC9.js";import{n as d}from"./worktree-store-LSx9q9Ga.js";import{a as f,n as ue}from"./receive-store-CmOFuJ5o.js";import{t as de}from"./share-metadata-rows-BlaR96La.js";var p=e(n(),1),fe=a();function pe(e){let t=e.shareTargetExists,n=e.dirtyConflicts.conflicts,r=e.dirtyConflicts.files;return t&&!n?{kind:`A`,openCurrentEnabled:!0,switchEnabled:!0,conflictingFiles:r}:!t&&!n?{kind:`B`,openCurrentEnabled:!1,switchEnabled:!0,conflictingFiles:r}:t&&n?{kind:`C`,openCurrentEnabled:!0,switchEnabled:!1,conflictingFiles:r}:{kind:`D`,openCurrentEnabled:!1,switchEnabled:!1,conflictingFiles:r}}function me(e){return e.detached?e.currentHeadSha:e.currentBranch??`HEAD`}function m(e){if(e.ok)return{action:`await-cc1`};switch(e.reason){case`dirty-conflict`:return{action:`rerender-conflict`,files:e.files??[]};case`branch-not-found`:return{action:`dismiss-with-toast`,reason:`branch-not-found`};case`fetch-failed`:case`checkout-failed`:return{action:`stay-with-toast`,reason:e.reason};case`branch-in-other-worktree`:{let t=e.otherWorktreePath;return t===void 0||t.length===0?{action:`stay-with-toast`,reason:`checkout-failed`}:{action:`pivot-to-other-worktree`,otherWorktreePath:t}}case`ff-diverged`:return{action:`branch-diverged`};default:{let t=e.reason;throw Error(`Unhandled CheckoutFailureReason: ${String(t)}`)}}}var he={phase:`loading`};function ge(e,t){return e.phase===`loading`?t===null?{phase:`error`}:{phase:`ready`,info:t}:e}function _e(e,t){return e.phase!==`ready`&&e.phase!==`verdict`?e:{phase:`switching`,info:e.info,pendingDoc:t}}function ve(e){return e.phase===`ready`?{phase:`creating-worktree`,info:e.info}:e}function ye(e){return pe(e).kind===`B`&&e.shareTargetOnOriginBranch===!1}function be(e){return e.phase===`ready`?{phase:`verdict-pending`,info:e.info}:e}function xe(e,t){if(e.phase!==`verdict-pending`)return e;if(t===null||t.verdict===`unknown`||t.verdict===`changed-locally`)return{phase:`ready`,info:e.info};let n=t.verdict===`renamed`?{kind:`renamed`,renamedTo:t.renamedTo}:{kind:t.verdict};return{phase:`verdict`,info:e.info,resolution:n}}function Se(e,t){if(e.phase!==`switching`)return{state:e};if(t===null)return{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}};let n=m(t);return n.action===`await-cc1`?{state:{phase:`awaiting-cc1-recycle`,pendingDoc:e.pendingDoc}}:n.action===`rerender-conflict`?{state:{phase:`ready`,info:{...e.info,dirtyConflicts:{conflicts:!0,files:n.files.slice()}}}}:n.action===`pivot-to-other-worktree`?{state:{phase:`branch-in-other-worktree`,info:e.info,otherWorktreePath:n.otherWorktreePath,pendingDoc:e.pendingDoc}}:n.action===`dismiss-with-toast`?{state:{phase:`dismissed`,reason:n.reason},sideEffect:{kind:`toast`,reason:n.reason}}:n.action===`branch-diverged`?{state:{phase:`verdict`,info:e.info,resolution:{kind:`diverged`}}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:n.reason}}}function Ce(e,t){return e.phase===`creating-worktree`?t===null?{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}}:t.ok?{state:{phase:`opening-worktree`,path:t.path}}:t.reason===`branch-not-found`?{state:{phase:`dismissed`,reason:`branch-not-found`},sideEffect:{kind:`toast`,reason:`branch-not-found`}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,helper:t.helper}}:{state:e}}var h=t();function we(e){return e!==null&&e.kind===`project-branch-switch`}function g(e){let t=(0,fe.c)(217),{bridge:n,store:a}=e,m=a===void 0?ue:a,{_:g}=i(),_=(0,p.useSyncExternalStore)(m.subscribe,m.getSnapshot,je),[v,y]=(0,p.useState)(he),Me=(0,p.useRef)(!1),Ne=(0,p.useRef)(!1),Pe=(0,p.useRef)(!1),Fe=(0,p.useRef)(null),Ie;t[0]===_?Ie=t[1]:(Ie=we(_)?_:null,t[0]=_,t[1]=Ie);let b=Ie,Le;t[2]!==g||t[3]!==b?.share.target.kind?(Le=b?.share.target.kind===`folder`?g({id:`ugoTXs`}):g({id:`XH30C4`}),t[2]=g,t[3]=b?.share.target.kind,t[4]=Le):Le=t[4];let x=Le,Re;t[5]===b?Re=t[6]:(Re=()=>{y(he),Me.current=!1,Ne.current=!1,Pe.current=!1,Fe.current=b},t[5]=b,t[6]=Re);let ze;t[7]===_?ze=t[8]:(ze=[_],t[7]=_,t[8]=ze),(0,p.useEffect)(Re,ze);let Be;t[9]!==b||t[10]!==n?(Be=()=>{if(!b||Me.current)return;Me.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:b.projectPath,branch:b.share.branch,kind:b.share.target.kind,path:u(b.share.target)}).then(t=>{e||y(e=>ge(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),y(Ae))}),()=>{e=!0}},t[9]=b,t[10]=n,t[11]=Be):Be=t[11];let Ve;t[12]===b?Ve=t[13]:(Ve=[b],t[12]=b,t[13]=Ve),(0,p.useEffect)(Be,Ve);let He;t[14]!==b||t[15]!==v.info||t[16]!==v.phase||t[17]!==n?(He=()=>{if(!b||v.phase!==`ready`||Pe.current||!ye(v.info))return;Pe.current=!0,y(be);let e=b;n.project.fetchTargetStatus({projectPath:b.projectPath,branch:b.share.branch,kind:b.share.target.kind,path:u(b.share.target)}).then(t=>{Fe.current===e&&y(e=>xe(e,t))}).catch(t=>{Fe.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),y(ke))})},t[14]=b,t[15]=v.info,t[16]=v.phase,t[17]=n,t[18]=He):He=t[18];let Ue;t[19]!==b||t[20]!==v.phase?(Ue=[v.phase,b],t[19]=b,t[20]=v.phase,t[21]=Ue):Ue=t[21],(0,p.useEffect)(He,Ue);let We;t[22]!==b||t[23]!==v.phase||t[24]!==v.resolution||t[25]!==m?(We=()=>{if(v.phase!==`verdict`)return;let{kind:e}=v.resolution;e!==`deleted`&&e!==`never-on-branch`||b&&(le.arm({kind:b.share.target.kind,path:u(b.share.target),branch:b.share.branch}),m.dismiss())},t[22]=b,t[23]=v.phase,t[24]=v.resolution,t[25]=m,t[26]=We):We=t[26];let Ge;t[27]!==b||t[28]!==v||t[29]!==m?(Ge=[v,b,m],t[27]=b,t[28]=v,t[29]=m,t[30]=Ge):Ge=t[30],(0,p.useEffect)(We,Ge);let Ke;t[31]!==v.phase||t[32]!==v.resolution?(Ke=()=>{v.phase===`verdict`&&console.log(f({verdict_cell:v.resolution.kind}))},t[31]=v.phase,t[32]=v.resolution,t[33]=Ke):Ke=t[33];let qe;t[34]===v?qe=t[35]:(qe=[v],t[34]=v,t[35]=qe),(0,p.useEffect)(Ke,qe);let Je;t[36]!==g||t[37]!==b||t[38]!==v.pendingDoc||t[39]!==v.phase||t[40]!==n||t[41]!==m||t[42]!==x?(Je=()=>{if(v.phase!==`awaiting-cc1-recycle`||!b)return;let e=b.share.branch,t=v.pendingDoc;if(!e){m.dismiss();return}if(Ne.current)return;Ne.current=!0;let r=!1;return n.project.awaitBranchSwitched({projectPath:b.projectPath,branch:e,timeoutMs:3e4}).then(i=>{if(!r){if(i.ok){console.log(f({branch_dialog_action:`branch-switch-complete`,branch:e})),n.project.open({path:b.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:b.share.target.kind,path:t},pendingBranch:e}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=switch`,e instanceof Error?e.message:e),l.error(g({id:`gQV-9w`,values:{targetNoun:x}}))}),m.dismiss();return}console.log(f({branch_dialog_action:`branch-switch-timeout`,branch:e})),l.error(g({id:`LBwUR6`,values:{targetNoun:x}})),m.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),l.error(g({id:`Jw6EC4`,values:{targetNoun:x}})),m.dismiss())}),()=>{r=!0}},t[36]=g,t[37]=b,t[38]=v.pendingDoc,t[39]=v.phase,t[40]=n,t[41]=m,t[42]=x,t[43]=Je):Je=t[43];let Ye;if(t[44]!==b||t[45]!==v.phase?(Ye=[v.phase,b],t[44]=b,t[45]=v.phase,t[46]=Ye):Ye=t[46],(0,p.useEffect)(Je,Ye),!b)return null;let{share:S,projectPath:C,currentBranch:w}=b,T=S.branch,Xe;t[47]!==g||t[48]!==n.project||t[49]!==C||t[50]!==T||t[51]!==m?(Xe=function(e,t,r){console.log(f({branch_dialog_action:`switch`,branch_action:`switch`,branch:T,verdict_cell:r})),y(t=>_e(t,e)),n.project.runCheckout(t?{projectPath:C,branch:T,fastForward:!0}:{projectPath:C,branch:T}).then(e=>{let t=null,n=!1;y(r=>{let{state:i,sideEffect:a}=Se(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?l.error(g({id:`NJyQi_`,values:{shareBranch:T}})):t===`fetch-failed`?l.error(g({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&l.error(g({id:`c863eW`,values:{shareBranch:T}})),n&&m.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),y(Oe),l.error(g({id:`c863eW`,values:{shareBranch:T}}))})},t[47]=g,t[48]=n.project,t[49]=C,t[50]=T,t[51]=m,t[52]=Xe):Xe=t[52];let E=Xe,Ze;t[53]!==v.info||t[54]!==v.phase||t[55]!==E||t[56]!==S.target?(Ze=function(){v.phase===`ready`&&pe(v.info).switchEnabled&&E(u(S.target),!1)},t[53]=v.info,t[54]=v.phase,t[55]=E,t[56]=S.target,t[57]=Ze):Ze=t[57];let Qe=Ze,$e;t[58]!==v.phase||t[59]!==v.resolution||t[60]!==E||t[61]!==S.target?($e=function(){v.phase===`verdict`&&E(u(S.target),!0,v.resolution.kind)},t[58]=v.phase,t[59]=v.resolution,t[60]=E,t[61]=S.target,t[62]=$e):$e=t[62];let et=$e,tt;t[63]!==v.phase||t[64]!==v.resolution||t[65]!==E?(tt=function(){v.phase===`verdict`&&v.resolution.kind===`renamed`&&E(v.resolution.renamedTo,!0,v.resolution.kind)},t[63]=v.phase,t[64]=v.resolution,t[65]=E,t[66]=tt):tt=t[66];let nt=tt,rt;t[67]!==v.phase||t[68]!==v.resolution||t[69]!==E||t[70]!==S.target?(rt=function(){v.phase===`verdict`&&E(u(S.target),!1,v.resolution.kind)},t[67]=v.phase,t[68]=v.resolution,t[69]=E,t[70]=S.target,t[71]=rt):rt=t[71];let it=rt,at;t[72]!==g||t[73]!==n.project||t[74]!==C||t[75]!==S.target||t[76]!==T||t[77]!==m||t[78]!==x?(at=function(){console.log(f({branch_dialog_action:`open-current`,branch:T})),n.project.open({path:C,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:S.target.kind,path:u(S.target)}}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),l.error(g({id:`b5aNbi`,values:{targetNoun:x}}))}),m.dismiss()},t[72]=g,t[73]=n.project,t[74]=C,t[75]=S.target,t[76]=T,t[77]=m,t[78]=x,t[79]=at):at=t[79];let ot=at,st;t[80]!==g||t[81]!==T?(st=function(e,t){switch(e){case`helper-not-found`:{let e=t??g({id:`cHhH3i`});l.error(g({id:`Z7x_Zh`,values:{tool:e}}));return}case`branch-not-found`:l.error(g({id:`NJyQi_`,values:{shareBranch:T}}));return;case`fetch-failed`:l.error(g({id:`bWLmRK`}));return;case`already-checked-out`:l.error(g({id:`ljHjfg`}));return;case`branch-exists`:l.error(g({id:`h3QZcB`,values:{shareBranch:T}}));return;case`path-exists`:l.error(g({id:`cN1Gcp`,values:{shareBranch:T}}));return;case`no-git`:l.error(g({id:`CFnavk`}));return;case`invalid-branch`:l.error(g({id:`JfPuv7`,values:{shareBranch:T}}));return;case`proxy-null`:case`error`:l.error(g({id:`e8zYa8`,values:{shareBranch:T}}));return;default:throw Error(`Unhandled worktree failure reason: ${String(e)}`)}},t[80]=g,t[81]=T,t[82]=st):st=t[82];let ct=st,lt;t[83]!==g||t[84]!==n.project||t[85]!==S.target||t[86]!==T||t[87]!==ct||t[88]!==m?(lt=function(e){let t=null,r,i=!1,a=null;if(y(n=>{let{state:o,sideEffect:ee}=Ce(n,e);return ee&&(t=ee.reason,r=ee.helper,i=o.phase===`dismissed`),o.phase===`opening-worktree`&&(a=o.path),o}),t!==null&&(console.log(f({branch_dialog_action:`open-worktree-failed:${t}`,branch:T})),ct(t,r)),a!==null){d();let e=a;n.project.open({path:e,target:`new-window`,entryPoint:`worktree`,pendingDeepLinkTarget:{kind:S.target.kind,path:u(S.target)},pendingBranch:T}).catch(t=>{console.warn(`[receive] worktree-open-failed branch_dialog_action=open-worktree`,t instanceof Error?t.message:t),l.error(g({id:`LdABLa`,values:{target:e}}))}),m.dismiss()}i&&m.dismiss()},t[83]=g,t[84]=n.project,t[85]=S.target,t[86]=T,t[87]=ct,t[88]=m,t[89]=lt):lt=t[89];let ut=lt,dt;t[90]!==ut||t[91]!==v.phase||t[92]!==n.worktree||t[93]!==T?(dt=function(){v.phase===`ready`&&(console.log(f({branch_dialog_action:`open-worktree`,branch:T})),y(ve),n.worktree.checkout({branch:T}).then(e=>{ut(e)}).catch(e=>{console.warn(`[receive] worktree-checkout rejected branch_dialog_action=open-worktree`,e instanceof Error?e.message:e),ut(null)}))},t[90]=ut,t[91]=v.phase,t[92]=n.worktree,t[93]=T,t[94]=dt):dt=t[94];let ft=dt,pt;t[95]!==g||t[96]!==v.otherWorktreePath||t[97]!==v.phase||t[98]!==n.project||t[99]!==S.target||t[100]!==T||t[101]!==m?(pt=function(){if(v.phase!==`branch-in-other-worktree`)return;let e=v.otherWorktreePath;console.log(f({branch_dialog_action:`pivot-to-other-worktree`,branch:T})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:S.target.kind,path:u(S.target)},pendingBranch:T}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),l.error(g({id:`LdABLa`,values:{target:e}}))}),m.dismiss()},t[95]=g,t[96]=v.otherWorktreePath,t[97]=v.phase,t[98]=n.project,t[99]=S.target,t[100]=T,t[101]=m,t[102]=pt):pt=t[102];let mt=pt,ht;t[103]!==v.phase||t[104]!==v.resolution||t[105]!==m?(ht=function(){console.log(f({branch_dialog_action:`cancel`,verdict_cell:v.phase===`verdict`?v.resolution.kind:void 0})),m.dismiss()},t[103]=v.phase,t[104]=v.resolution,t[105]=m,t[106]=ht):ht=t[106];let D=ht,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K;if(t[107]!==g||t[108]!==v.info||t[109]!==v.otherWorktreePath||t[110]!==v.phase||t[111]!==v.resolution||t[112]!==D||t[113]!==w||t[114]!==S.branch||t[115]!==S.owner||t[116]!==S.repo||t[117]!==S.target||t[118]!==T||t[119]!==x){G=v.phase===`ready`||v.phase===`switching`||v.phase===`creating-worktree`?pe(v.info):null;let e;t[139]!==v.info||t[140]!==v.phase||t[141]!==w?(e=v.phase===`ready`||v.phase===`switching`||v.phase===`creating-worktree`?me(v.info):w??`HEAD`,t[139]=v.info,t[140]=v.phase,t[141]=w,t[142]=e):e=t[142];let n=e;P=v.phase===`switching`||v.phase===`awaiting-cc1-recycle`,j=v.phase===`creating-worktree`;let i;t[143]===g?i=t[144]:(i=g({id:`OuY8t9`}),t[143]=g,t[144]=i),M=i;let a;t[145]===g?a=t[146]:(a=g({id:`XZkdtg`}),t[145]=g,t[146]=a),N=a;let o;t[147]===g?o=t[148]:(o=g({id:`VTulZj`}),t[147]=g,t[148]=o),K=o;let ie=v.phase===`loading`,se=v.phase===`error`;A=oe,U=!0,t[149]===D?W=t[150]:(W=e=>{e||D()},t[149]=D,t[150]=W),k=ne,R=`sm:max-w-xl`,z=`share-branch-switch-dialog`,B=De,V=Ee;let s;t[151]===x?s=t[152]:(s=(0,h.jsx)(te,{children:(0,h.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:x}})}),t[151]=x,t[152]=s);let ce=S.owner,le=S.repo,l;t[153]===S.target?l=t[154]:(l=u(S.target),t[153]=S.target,t[154]=l);let d;t[155]!==S.owner||t[156]!==S.repo||t[157]!==l?(d=(0,h.jsx)(ee,{className:`sr-only`,children:(0,h.jsx)(r,{id:`f8jU-L`,values:{0:ce,1:le,2:l}})}),t[155]=S.owner,t[156]=S.repo,t[157]=l,t[158]=d):d=t[158],t[159]!==s||t[160]!==d?(H=(0,h.jsxs)(ae,{children:[s,d]}),t[159]=s,t[160]=d,t[161]=H):H=t[161],O=re;let f=S.owner,ue=S.repo,p;t[162]===S.target?p=t[163]:(p=u(S.target),t[162]=S.target,t[163]=p),t[164]!==S.branch||t[165]!==S.owner||t[166]!==S.repo||t[167]!==S.target.kind||t[168]!==p?(F=(0,h.jsx)(`div`,{className:`mb-4`,children:(0,h.jsx)(de,{owner:f,repo:ue,path:p,kind:S.target.kind,branch:S.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[164]=S.branch,t[165]=S.owner,t[166]=S.repo,t[167]=S.target.kind,t[168]=p,t[169]=F):F=t[169],I=v.phase===`branch-in-other-worktree`?(0,h.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,h.jsx)(`p`,{className:`leading-6`,children:(0,h.jsx)(r,{id:`yjExfe`,values:{shareBranch:T},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,h.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-branch-switch-in-other-worktree-path`,children:v.otherWorktreePath})]}):v.phase===`verdict-pending`?(0,h.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-pending`,role:`status`,"aria-live":`polite`,children:[(0,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`c8jBgX`})]}):v.phase===`verdict`?v.resolution.kind===`on-origin`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,h.jsx)(r,{id:`Uay5NL`,values:{targetNoun:x,shareBranch:T},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):v.resolution.kind===`renamed`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,h.jsx)(r,{id:`P0HC30`,values:{0:v.resolution.renamedTo,targetNoun:x},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):v.resolution.kind===`diverged`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,h.jsx)(r,{id:`kLv8d3`,values:{shareBranch:T,targetNoun:x},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,h.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-handoff`,role:`status`,"aria-live":`polite`,children:[(0,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`c8jBgX`})]}):ie?(0,h.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-loading`,role:`status`,"aria-live":`polite`,children:[(0,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`jerqF0`})]}):se?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,h.jsx)(r,{id:`w4hMYl`})}):G?.kind===`D`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,h.jsx)(r,{id:`DTI-fp`,values:{targetNoun:x,shareBranch:T},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):G?.kind===`B`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,h.jsx)(r,{id:`sZ2IOu`,values:{targetNoun:x,shareBranch:T,currentLabel:n},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,h.jsx)(r,{id:`_902BE`,values:{targetNoun:x,shareBranch:T,currentLabel:n},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),L=G&&!G.switchEnabled&&G.conflictingFiles.length>0?(0,h.jsxs)(`div`,{className:`mt-3 rounded-md border border-border bg-muted/30 p-3 text-1sm`,"data-testid":`share-branch-switch-conflict`,children:[(0,h.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,h.jsx)(r,{id:`n2lRue`})}),(0,h.jsx)(`ul`,{id:`share-receive-branch-conflict-files`,className:`mt-1 list-disc space-y-0.5 pl-5 text-muted-foreground`,children:G.conflictingFiles.map(Te)})]}):null,t[107]=g,t[108]=v.info,t[109]=v.otherWorktreePath,t[110]=v.phase,t[111]=v.resolution,t[112]=D,t[113]=w,t[114]=S.branch,t[115]=S.owner,t[116]=S.repo,t[117]=S.target,t[118]=T,t[119]=x,t[120]=O,t[121]=k,t[122]=A,t[123]=j,t[124]=M,t[125]=N,t[126]=P,t[127]=F,t[128]=I,t[129]=L,t[130]=R,t[131]=z,t[132]=B,t[133]=V,t[134]=H,t[135]=U,t[136]=W,t[137]=G,t[138]=K}else O=t[120],k=t[121],A=t[122],j=t[123],M=t[124],N=t[125],P=t[126],F=t[127],I=t[128],L=t[129],R=t[130],z=t[131],B=t[132],V=t[133],H=t[134],U=t[135],W=t[136],G=t[137],K=t[138];let q;t[170]===P?q=t[171]:(q=P?(0,h.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-switching`,role:`status`,"aria-live":`polite`,children:[(0,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`CU3AiE`})]}):null,t[170]=P,t[171]=q);let J;t[172]===j?J=t[173]:(J=j?(0,h.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-creating-worktree`,role:`status`,"aria-live":`polite`,children:[(0,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`PZtgO0`})]}):null,t[172]=j,t[173]=J);let Y;t[174]!==O||t[175]!==F||t[176]!==I||t[177]!==L||t[178]!==q||t[179]!==J?(Y=(0,h.jsxs)(O,{children:[F,I,L,q,J]}),t[174]=O,t[175]=F,t[176]=I,t[177]=L,t[178]=q,t[179]=J,t[180]=Y):Y=t[180];let gt;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,h.jsx)(r,{id:`dEgA5A`}),t[181]=gt):gt=t[181];let X;t[182]===D?X=t[183]:(X=(0,h.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:D,"data-testid":`share-branch-switch-cancel`,children:gt}),t[182]=D,t[183]=X);let Z;t[184]!==v.phase||t[185]!==v.resolution||t[186]!==j||t[187]!==ot||t[188]!==nt||t[189]!==ft||t[190]!==mt||t[191]!==it||t[192]!==Qe||t[193]!==et||t[194]!==M||t[195]!==N||t[196]!==P||t[197]!==G||t[198]!==K?(Z=v.phase===`branch-in-other-worktree`?(0,h.jsx)(o,{onClick:mt,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,h.jsx)(r,{id:`hyCxJY`})}):v.phase===`verdict`?v.resolution.kind===`on-origin`?(0,h.jsxs)(o,{onClick:et,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,h.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),(0,h.jsx)(r,{id:`uA_jXp`})]}):v.resolution.kind===`renamed`?(0,h.jsxs)(o,{onClick:nt,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,h.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),(0,h.jsx)(r,{id:`AItsE5`})]}):v.resolution.kind===`diverged`?(0,h.jsxs)(o,{onClick:it,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,h.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),N]}):null:(0,h.jsxs)(`div`,{className:`flex min-w-0 flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end sm:gap-2`,children:[G?.openCurrentEnabled?(0,h.jsxs)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:ot,disabled:P||j,"data-testid":`share-branch-switch-open-current`,children:[(0,h.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),M]}):null,(0,h.jsx)(o,{variant:`outline`,onClick:Qe,disabled:!G?.switchEnabled||P||j,"aria-disabled":!G?.switchEnabled||P||j,"aria-describedby":G&&!G.switchEnabled&&G.conflictingFiles.length>0?`share-receive-branch-conflict-files`:void 0,"data-testid":`share-branch-switch-switch`,children:P?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),N]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),N]})}),(0,h.jsx)(o,{onClick:ft,disabled:!G||P||j,"data-testid":`share-branch-switch-worktree`,children:j?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),K]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),K]})})]}),t[184]=v.phase,t[185]=v.resolution,t[186]=j,t[187]=ot,t[188]=nt,t[189]=ft,t[190]=mt,t[191]=it,t[192]=Qe,t[193]=et,t[194]=M,t[195]=N,t[196]=P,t[197]=G,t[198]=K,t[199]=Z):Z=t[199];let Q;t[200]!==X||t[201]!==Z?(Q=(0,h.jsxs)(ie,{className:`sm:justify-between`,children:[X,Z]}),t[200]=X,t[201]=Z,t[202]=Q):Q=t[202];let $;t[203]!==k||t[204]!==R||t[205]!==z||t[206]!==B||t[207]!==V||t[208]!==H||t[209]!==Y||t[210]!==Q?($=(0,h.jsxs)(k,{className:R,"data-testid":z,onInteractOutside:B,onPointerDownOutside:V,children:[H,Y,Q]}),t[203]=k,t[204]=R,t[205]=z,t[206]=B,t[207]=V,t[208]=H,t[209]=Y,t[210]=Q,t[211]=$):$=t[211];let _t;return t[212]!==A||t[213]!==U||t[214]!==W||t[215]!==$?(_t=(0,h.jsx)(A,{open:U,onOpenChange:W,children:$}),t[212]=A,t[213]=U,t[214]=W,t[215]=$,t[216]=_t):_t=t[216],_t}function Te(e){return(0,h.jsx)(`li`,{children:(0,h.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function Ee(e){e.preventDefault()}function De(e){e.preventDefault()}function Oe(e){return Se(e,null).state}function ke(e){return xe(e,null)}function Ae(e){return ge(e,null)}function je(){return null}export{g as ShareBranchSwitchDialog};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Gol9BgNB.js";import{a as ee,c as te,i as ne,n as re,o as ie,s as ae,t as oe}from"./dialog-TkFkuYVg.js";import{n as se,t as s}from"./git-branch-CMJAiYLz.js";import{t as c}from"./loader-circle-Cg5SU7AZ.js";import{n as ce,t as le}from"./miss-dialog-store-Bx4JLuKB.js";import{n as l}from"./dist-BLAMau9Z.js";import{t as u}from"./desktop-bridge-types--ZPzhkC9.js";import{n as d}from"./worktree-store-LSx9q9Ga.js";import{a as f,n as ue}from"./receive-store-CnPZW2Nl.js";import{t as de}from"./share-metadata-rows-CheY4PXF.js";var p=e(n(),1),fe=a();function pe(e){let t=e.shareTargetExists,n=e.dirtyConflicts.conflicts,r=e.dirtyConflicts.files;return t&&!n?{kind:`A`,openCurrentEnabled:!0,switchEnabled:!0,conflictingFiles:r}:!t&&!n?{kind:`B`,openCurrentEnabled:!1,switchEnabled:!0,conflictingFiles:r}:t&&n?{kind:`C`,openCurrentEnabled:!0,switchEnabled:!1,conflictingFiles:r}:{kind:`D`,openCurrentEnabled:!1,switchEnabled:!1,conflictingFiles:r}}function me(e){return e.detached?e.currentHeadSha:e.currentBranch??`HEAD`}function m(e){if(e.ok)return{action:`await-cc1`};switch(e.reason){case`dirty-conflict`:return{action:`rerender-conflict`,files:e.files??[]};case`branch-not-found`:return{action:`dismiss-with-toast`,reason:`branch-not-found`};case`fetch-failed`:case`checkout-failed`:return{action:`stay-with-toast`,reason:e.reason};case`branch-in-other-worktree`:{let t=e.otherWorktreePath;return t===void 0||t.length===0?{action:`stay-with-toast`,reason:`checkout-failed`}:{action:`pivot-to-other-worktree`,otherWorktreePath:t}}case`ff-diverged`:return{action:`branch-diverged`};default:{let t=e.reason;throw Error(`Unhandled CheckoutFailureReason: ${String(t)}`)}}}var he={phase:`loading`};function ge(e,t){return e.phase===`loading`?t===null?{phase:`error`}:{phase:`ready`,info:t}:e}function _e(e,t){return e.phase!==`ready`&&e.phase!==`verdict`?e:{phase:`switching`,info:e.info,pendingDoc:t}}function ve(e){return e.phase===`ready`?{phase:`creating-worktree`,info:e.info}:e}function ye(e){return pe(e).kind===`B`&&e.shareTargetOnOriginBranch===!1}function be(e){return e.phase===`ready`?{phase:`verdict-pending`,info:e.info}:e}function xe(e,t){if(e.phase!==`verdict-pending`)return e;if(t===null||t.verdict===`unknown`||t.verdict===`changed-locally`)return{phase:`ready`,info:e.info};let n=t.verdict===`renamed`?{kind:`renamed`,renamedTo:t.renamedTo}:{kind:t.verdict};return{phase:`verdict`,info:e.info,resolution:n}}function Se(e,t){if(e.phase!==`switching`)return{state:e};if(t===null)return{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}};let n=m(t);return n.action===`await-cc1`?{state:{phase:`awaiting-cc1-recycle`,pendingDoc:e.pendingDoc}}:n.action===`rerender-conflict`?{state:{phase:`ready`,info:{...e.info,dirtyConflicts:{conflicts:!0,files:n.files.slice()}}}}:n.action===`pivot-to-other-worktree`?{state:{phase:`branch-in-other-worktree`,info:e.info,otherWorktreePath:n.otherWorktreePath,pendingDoc:e.pendingDoc}}:n.action===`dismiss-with-toast`?{state:{phase:`dismissed`,reason:n.reason},sideEffect:{kind:`toast`,reason:n.reason}}:n.action===`branch-diverged`?{state:{phase:`verdict`,info:e.info,resolution:{kind:`diverged`}}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:n.reason}}}function Ce(e,t){return e.phase===`creating-worktree`?t===null?{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}}:t.ok?{state:{phase:`opening-worktree`,path:t.path}}:t.reason===`branch-not-found`?{state:{phase:`dismissed`,reason:`branch-not-found`},sideEffect:{kind:`toast`,reason:`branch-not-found`}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,helper:t.helper}}:{state:e}}var h=t();function we(e){return e!==null&&e.kind===`project-branch-switch`}function g(e){let t=(0,fe.c)(217),{bridge:n,store:a}=e,m=a===void 0?ue:a,{_:g}=i(),_=(0,p.useSyncExternalStore)(m.subscribe,m.getSnapshot,je),[v,y]=(0,p.useState)(he),Me=(0,p.useRef)(!1),Ne=(0,p.useRef)(!1),Pe=(0,p.useRef)(!1),Fe=(0,p.useRef)(null),Ie;t[0]===_?Ie=t[1]:(Ie=we(_)?_:null,t[0]=_,t[1]=Ie);let b=Ie,Le;t[2]!==g||t[3]!==b?.share.target.kind?(Le=b?.share.target.kind===`folder`?g({id:`ugoTXs`}):g({id:`XH30C4`}),t[2]=g,t[3]=b?.share.target.kind,t[4]=Le):Le=t[4];let x=Le,Re;t[5]===b?Re=t[6]:(Re=()=>{y(he),Me.current=!1,Ne.current=!1,Pe.current=!1,Fe.current=b},t[5]=b,t[6]=Re);let ze;t[7]===_?ze=t[8]:(ze=[_],t[7]=_,t[8]=ze),(0,p.useEffect)(Re,ze);let Be;t[9]!==b||t[10]!==n?(Be=()=>{if(!b||Me.current)return;Me.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:b.projectPath,branch:b.share.branch,kind:b.share.target.kind,path:u(b.share.target)}).then(t=>{e||y(e=>ge(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),y(Ae))}),()=>{e=!0}},t[9]=b,t[10]=n,t[11]=Be):Be=t[11];let Ve;t[12]===b?Ve=t[13]:(Ve=[b],t[12]=b,t[13]=Ve),(0,p.useEffect)(Be,Ve);let He;t[14]!==b||t[15]!==v.info||t[16]!==v.phase||t[17]!==n?(He=()=>{if(!b||v.phase!==`ready`||Pe.current||!ye(v.info))return;Pe.current=!0,y(be);let e=b;n.project.fetchTargetStatus({projectPath:b.projectPath,branch:b.share.branch,kind:b.share.target.kind,path:u(b.share.target)}).then(t=>{Fe.current===e&&y(e=>xe(e,t))}).catch(t=>{Fe.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),y(ke))})},t[14]=b,t[15]=v.info,t[16]=v.phase,t[17]=n,t[18]=He):He=t[18];let Ue;t[19]!==b||t[20]!==v.phase?(Ue=[v.phase,b],t[19]=b,t[20]=v.phase,t[21]=Ue):Ue=t[21],(0,p.useEffect)(He,Ue);let We;t[22]!==b||t[23]!==v.phase||t[24]!==v.resolution||t[25]!==m?(We=()=>{if(v.phase!==`verdict`)return;let{kind:e}=v.resolution;e!==`deleted`&&e!==`never-on-branch`||b&&(le.arm({kind:b.share.target.kind,path:u(b.share.target),branch:b.share.branch}),m.dismiss())},t[22]=b,t[23]=v.phase,t[24]=v.resolution,t[25]=m,t[26]=We):We=t[26];let Ge;t[27]!==b||t[28]!==v||t[29]!==m?(Ge=[v,b,m],t[27]=b,t[28]=v,t[29]=m,t[30]=Ge):Ge=t[30],(0,p.useEffect)(We,Ge);let Ke;t[31]!==v.phase||t[32]!==v.resolution?(Ke=()=>{v.phase===`verdict`&&console.log(f({verdict_cell:v.resolution.kind}))},t[31]=v.phase,t[32]=v.resolution,t[33]=Ke):Ke=t[33];let qe;t[34]===v?qe=t[35]:(qe=[v],t[34]=v,t[35]=qe),(0,p.useEffect)(Ke,qe);let Je;t[36]!==g||t[37]!==b||t[38]!==v.pendingDoc||t[39]!==v.phase||t[40]!==n||t[41]!==m||t[42]!==x?(Je=()=>{if(v.phase!==`awaiting-cc1-recycle`||!b)return;let e=b.share.branch,t=v.pendingDoc;if(!e){m.dismiss();return}if(Ne.current)return;Ne.current=!0;let r=!1;return n.project.awaitBranchSwitched({projectPath:b.projectPath,branch:e,timeoutMs:3e4}).then(i=>{if(!r){if(i.ok){console.log(f({branch_dialog_action:`branch-switch-complete`,branch:e})),n.project.open({path:b.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:b.share.target.kind,path:t},pendingBranch:e}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=switch`,e instanceof Error?e.message:e),l.error(g({id:`gQV-9w`,values:{targetNoun:x}}))}),m.dismiss();return}console.log(f({branch_dialog_action:`branch-switch-timeout`,branch:e})),l.error(g({id:`LBwUR6`,values:{targetNoun:x}})),m.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),l.error(g({id:`Jw6EC4`,values:{targetNoun:x}})),m.dismiss())}),()=>{r=!0}},t[36]=g,t[37]=b,t[38]=v.pendingDoc,t[39]=v.phase,t[40]=n,t[41]=m,t[42]=x,t[43]=Je):Je=t[43];let Ye;if(t[44]!==b||t[45]!==v.phase?(Ye=[v.phase,b],t[44]=b,t[45]=v.phase,t[46]=Ye):Ye=t[46],(0,p.useEffect)(Je,Ye),!b)return null;let{share:S,projectPath:C,currentBranch:w}=b,T=S.branch,Xe;t[47]!==g||t[48]!==n.project||t[49]!==C||t[50]!==T||t[51]!==m?(Xe=function(e,t,r){console.log(f({branch_dialog_action:`switch`,branch_action:`switch`,branch:T,verdict_cell:r})),y(t=>_e(t,e)),n.project.runCheckout(t?{projectPath:C,branch:T,fastForward:!0}:{projectPath:C,branch:T}).then(e=>{let t=null,n=!1;y(r=>{let{state:i,sideEffect:a}=Se(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?l.error(g({id:`NJyQi_`,values:{shareBranch:T}})):t===`fetch-failed`?l.error(g({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&l.error(g({id:`c863eW`,values:{shareBranch:T}})),n&&m.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),y(Oe),l.error(g({id:`c863eW`,values:{shareBranch:T}}))})},t[47]=g,t[48]=n.project,t[49]=C,t[50]=T,t[51]=m,t[52]=Xe):Xe=t[52];let E=Xe,Ze;t[53]!==v.info||t[54]!==v.phase||t[55]!==E||t[56]!==S.target?(Ze=function(){v.phase===`ready`&&pe(v.info).switchEnabled&&E(u(S.target),!1)},t[53]=v.info,t[54]=v.phase,t[55]=E,t[56]=S.target,t[57]=Ze):Ze=t[57];let Qe=Ze,$e;t[58]!==v.phase||t[59]!==v.resolution||t[60]!==E||t[61]!==S.target?($e=function(){v.phase===`verdict`&&E(u(S.target),!0,v.resolution.kind)},t[58]=v.phase,t[59]=v.resolution,t[60]=E,t[61]=S.target,t[62]=$e):$e=t[62];let et=$e,tt;t[63]!==v.phase||t[64]!==v.resolution||t[65]!==E?(tt=function(){v.phase===`verdict`&&v.resolution.kind===`renamed`&&E(v.resolution.renamedTo,!0,v.resolution.kind)},t[63]=v.phase,t[64]=v.resolution,t[65]=E,t[66]=tt):tt=t[66];let nt=tt,rt;t[67]!==v.phase||t[68]!==v.resolution||t[69]!==E||t[70]!==S.target?(rt=function(){v.phase===`verdict`&&E(u(S.target),!1,v.resolution.kind)},t[67]=v.phase,t[68]=v.resolution,t[69]=E,t[70]=S.target,t[71]=rt):rt=t[71];let it=rt,at;t[72]!==g||t[73]!==n.project||t[74]!==C||t[75]!==S.target||t[76]!==T||t[77]!==m||t[78]!==x?(at=function(){console.log(f({branch_dialog_action:`open-current`,branch:T})),n.project.open({path:C,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:S.target.kind,path:u(S.target)}}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),l.error(g({id:`b5aNbi`,values:{targetNoun:x}}))}),m.dismiss()},t[72]=g,t[73]=n.project,t[74]=C,t[75]=S.target,t[76]=T,t[77]=m,t[78]=x,t[79]=at):at=t[79];let ot=at,st;t[80]!==g||t[81]!==T?(st=function(e,t){switch(e){case`helper-not-found`:{let e=t??g({id:`cHhH3i`});l.error(g({id:`Z7x_Zh`,values:{tool:e}}));return}case`branch-not-found`:l.error(g({id:`NJyQi_`,values:{shareBranch:T}}));return;case`fetch-failed`:l.error(g({id:`bWLmRK`}));return;case`already-checked-out`:l.error(g({id:`ljHjfg`}));return;case`branch-exists`:l.error(g({id:`h3QZcB`,values:{shareBranch:T}}));return;case`path-exists`:l.error(g({id:`cN1Gcp`,values:{shareBranch:T}}));return;case`no-git`:l.error(g({id:`CFnavk`}));return;case`invalid-branch`:l.error(g({id:`JfPuv7`,values:{shareBranch:T}}));return;case`proxy-null`:case`error`:l.error(g({id:`e8zYa8`,values:{shareBranch:T}}));return;default:throw Error(`Unhandled worktree failure reason: ${String(e)}`)}},t[80]=g,t[81]=T,t[82]=st):st=t[82];let ct=st,lt;t[83]!==g||t[84]!==n.project||t[85]!==S.target||t[86]!==T||t[87]!==ct||t[88]!==m?(lt=function(e){let t=null,r,i=!1,a=null;if(y(n=>{let{state:o,sideEffect:ee}=Ce(n,e);return ee&&(t=ee.reason,r=ee.helper,i=o.phase===`dismissed`),o.phase===`opening-worktree`&&(a=o.path),o}),t!==null&&(console.log(f({branch_dialog_action:`open-worktree-failed:${t}`,branch:T})),ct(t,r)),a!==null){d();let e=a;n.project.open({path:e,target:`new-window`,entryPoint:`worktree`,pendingDeepLinkTarget:{kind:S.target.kind,path:u(S.target)},pendingBranch:T}).catch(t=>{console.warn(`[receive] worktree-open-failed branch_dialog_action=open-worktree`,t instanceof Error?t.message:t),l.error(g({id:`LdABLa`,values:{target:e}}))}),m.dismiss()}i&&m.dismiss()},t[83]=g,t[84]=n.project,t[85]=S.target,t[86]=T,t[87]=ct,t[88]=m,t[89]=lt):lt=t[89];let ut=lt,dt;t[90]!==ut||t[91]!==v.phase||t[92]!==n.worktree||t[93]!==T?(dt=function(){v.phase===`ready`&&(console.log(f({branch_dialog_action:`open-worktree`,branch:T})),y(ve),n.worktree.checkout({branch:T}).then(e=>{ut(e)}).catch(e=>{console.warn(`[receive] worktree-checkout rejected branch_dialog_action=open-worktree`,e instanceof Error?e.message:e),ut(null)}))},t[90]=ut,t[91]=v.phase,t[92]=n.worktree,t[93]=T,t[94]=dt):dt=t[94];let ft=dt,pt;t[95]!==g||t[96]!==v.otherWorktreePath||t[97]!==v.phase||t[98]!==n.project||t[99]!==S.target||t[100]!==T||t[101]!==m?(pt=function(){if(v.phase!==`branch-in-other-worktree`)return;let e=v.otherWorktreePath;console.log(f({branch_dialog_action:`pivot-to-other-worktree`,branch:T})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:S.target.kind,path:u(S.target)},pendingBranch:T}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),l.error(g({id:`LdABLa`,values:{target:e}}))}),m.dismiss()},t[95]=g,t[96]=v.otherWorktreePath,t[97]=v.phase,t[98]=n.project,t[99]=S.target,t[100]=T,t[101]=m,t[102]=pt):pt=t[102];let mt=pt,ht;t[103]!==v.phase||t[104]!==v.resolution||t[105]!==m?(ht=function(){console.log(f({branch_dialog_action:`cancel`,verdict_cell:v.phase===`verdict`?v.resolution.kind:void 0})),m.dismiss()},t[103]=v.phase,t[104]=v.resolution,t[105]=m,t[106]=ht):ht=t[106];let D=ht,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K;if(t[107]!==g||t[108]!==v.info||t[109]!==v.otherWorktreePath||t[110]!==v.phase||t[111]!==v.resolution||t[112]!==D||t[113]!==w||t[114]!==S.branch||t[115]!==S.owner||t[116]!==S.repo||t[117]!==S.target||t[118]!==T||t[119]!==x){G=v.phase===`ready`||v.phase===`switching`||v.phase===`creating-worktree`?pe(v.info):null;let e;t[139]!==v.info||t[140]!==v.phase||t[141]!==w?(e=v.phase===`ready`||v.phase===`switching`||v.phase===`creating-worktree`?me(v.info):w??`HEAD`,t[139]=v.info,t[140]=v.phase,t[141]=w,t[142]=e):e=t[142];let n=e;P=v.phase===`switching`||v.phase===`awaiting-cc1-recycle`,j=v.phase===`creating-worktree`;let i;t[143]===g?i=t[144]:(i=g({id:`OuY8t9`}),t[143]=g,t[144]=i),M=i;let a;t[145]===g?a=t[146]:(a=g({id:`XZkdtg`}),t[145]=g,t[146]=a),N=a;let o;t[147]===g?o=t[148]:(o=g({id:`VTulZj`}),t[147]=g,t[148]=o),K=o;let ie=v.phase===`loading`,se=v.phase===`error`;A=oe,U=!0,t[149]===D?W=t[150]:(W=e=>{e||D()},t[149]=D,t[150]=W),k=ne,R=`sm:max-w-xl`,z=`share-branch-switch-dialog`,B=De,V=Ee;let s;t[151]===x?s=t[152]:(s=(0,h.jsx)(te,{children:(0,h.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:x}})}),t[151]=x,t[152]=s);let ce=S.owner,le=S.repo,l;t[153]===S.target?l=t[154]:(l=u(S.target),t[153]=S.target,t[154]=l);let d;t[155]!==S.owner||t[156]!==S.repo||t[157]!==l?(d=(0,h.jsx)(ee,{className:`sr-only`,children:(0,h.jsx)(r,{id:`f8jU-L`,values:{0:ce,1:le,2:l}})}),t[155]=S.owner,t[156]=S.repo,t[157]=l,t[158]=d):d=t[158],t[159]!==s||t[160]!==d?(H=(0,h.jsxs)(ae,{children:[s,d]}),t[159]=s,t[160]=d,t[161]=H):H=t[161],O=re;let f=S.owner,ue=S.repo,p;t[162]===S.target?p=t[163]:(p=u(S.target),t[162]=S.target,t[163]=p),t[164]!==S.branch||t[165]!==S.owner||t[166]!==S.repo||t[167]!==S.target.kind||t[168]!==p?(F=(0,h.jsx)(`div`,{className:`mb-4`,children:(0,h.jsx)(de,{owner:f,repo:ue,path:p,kind:S.target.kind,branch:S.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[164]=S.branch,t[165]=S.owner,t[166]=S.repo,t[167]=S.target.kind,t[168]=p,t[169]=F):F=t[169],I=v.phase===`branch-in-other-worktree`?(0,h.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,h.jsx)(`p`,{className:`leading-6`,children:(0,h.jsx)(r,{id:`yjExfe`,values:{shareBranch:T},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,h.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-branch-switch-in-other-worktree-path`,children:v.otherWorktreePath})]}):v.phase===`verdict-pending`?(0,h.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-pending`,role:`status`,"aria-live":`polite`,children:[(0,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`c8jBgX`})]}):v.phase===`verdict`?v.resolution.kind===`on-origin`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,h.jsx)(r,{id:`Uay5NL`,values:{targetNoun:x,shareBranch:T},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):v.resolution.kind===`renamed`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,h.jsx)(r,{id:`P0HC30`,values:{0:v.resolution.renamedTo,targetNoun:x},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):v.resolution.kind===`diverged`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,h.jsx)(r,{id:`kLv8d3`,values:{shareBranch:T,targetNoun:x},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,h.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-handoff`,role:`status`,"aria-live":`polite`,children:[(0,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`c8jBgX`})]}):ie?(0,h.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-loading`,role:`status`,"aria-live":`polite`,children:[(0,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`jerqF0`})]}):se?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,h.jsx)(r,{id:`w4hMYl`})}):G?.kind===`D`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,h.jsx)(r,{id:`DTI-fp`,values:{targetNoun:x,shareBranch:T},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):G?.kind===`B`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,h.jsx)(r,{id:`sZ2IOu`,values:{targetNoun:x,shareBranch:T,currentLabel:n},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,h.jsx)(r,{id:`_902BE`,values:{targetNoun:x,shareBranch:T,currentLabel:n},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),L=G&&!G.switchEnabled&&G.conflictingFiles.length>0?(0,h.jsxs)(`div`,{className:`mt-3 rounded-md border border-border bg-muted/30 p-3 text-1sm`,"data-testid":`share-branch-switch-conflict`,children:[(0,h.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,h.jsx)(r,{id:`n2lRue`})}),(0,h.jsx)(`ul`,{id:`share-receive-branch-conflict-files`,className:`mt-1 list-disc space-y-0.5 pl-5 text-muted-foreground`,children:G.conflictingFiles.map(Te)})]}):null,t[107]=g,t[108]=v.info,t[109]=v.otherWorktreePath,t[110]=v.phase,t[111]=v.resolution,t[112]=D,t[113]=w,t[114]=S.branch,t[115]=S.owner,t[116]=S.repo,t[117]=S.target,t[118]=T,t[119]=x,t[120]=O,t[121]=k,t[122]=A,t[123]=j,t[124]=M,t[125]=N,t[126]=P,t[127]=F,t[128]=I,t[129]=L,t[130]=R,t[131]=z,t[132]=B,t[133]=V,t[134]=H,t[135]=U,t[136]=W,t[137]=G,t[138]=K}else O=t[120],k=t[121],A=t[122],j=t[123],M=t[124],N=t[125],P=t[126],F=t[127],I=t[128],L=t[129],R=t[130],z=t[131],B=t[132],V=t[133],H=t[134],U=t[135],W=t[136],G=t[137],K=t[138];let q;t[170]===P?q=t[171]:(q=P?(0,h.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-switching`,role:`status`,"aria-live":`polite`,children:[(0,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`CU3AiE`})]}):null,t[170]=P,t[171]=q);let J;t[172]===j?J=t[173]:(J=j?(0,h.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-creating-worktree`,role:`status`,"aria-live":`polite`,children:[(0,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`PZtgO0`})]}):null,t[172]=j,t[173]=J);let Y;t[174]!==O||t[175]!==F||t[176]!==I||t[177]!==L||t[178]!==q||t[179]!==J?(Y=(0,h.jsxs)(O,{children:[F,I,L,q,J]}),t[174]=O,t[175]=F,t[176]=I,t[177]=L,t[178]=q,t[179]=J,t[180]=Y):Y=t[180];let gt;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,h.jsx)(r,{id:`dEgA5A`}),t[181]=gt):gt=t[181];let X;t[182]===D?X=t[183]:(X=(0,h.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:D,"data-testid":`share-branch-switch-cancel`,children:gt}),t[182]=D,t[183]=X);let Z;t[184]!==v.phase||t[185]!==v.resolution||t[186]!==j||t[187]!==ot||t[188]!==nt||t[189]!==ft||t[190]!==mt||t[191]!==it||t[192]!==Qe||t[193]!==et||t[194]!==M||t[195]!==N||t[196]!==P||t[197]!==G||t[198]!==K?(Z=v.phase===`branch-in-other-worktree`?(0,h.jsx)(o,{onClick:mt,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,h.jsx)(r,{id:`hyCxJY`})}):v.phase===`verdict`?v.resolution.kind===`on-origin`?(0,h.jsxs)(o,{onClick:et,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,h.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),(0,h.jsx)(r,{id:`uA_jXp`})]}):v.resolution.kind===`renamed`?(0,h.jsxs)(o,{onClick:nt,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,h.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),(0,h.jsx)(r,{id:`AItsE5`})]}):v.resolution.kind===`diverged`?(0,h.jsxs)(o,{onClick:it,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,h.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),N]}):null:(0,h.jsxs)(`div`,{className:`flex min-w-0 flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end sm:gap-2`,children:[G?.openCurrentEnabled?(0,h.jsxs)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:ot,disabled:P||j,"data-testid":`share-branch-switch-open-current`,children:[(0,h.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),M]}):null,(0,h.jsx)(o,{variant:`outline`,onClick:Qe,disabled:!G?.switchEnabled||P||j,"aria-disabled":!G?.switchEnabled||P||j,"aria-describedby":G&&!G.switchEnabled&&G.conflictingFiles.length>0?`share-receive-branch-conflict-files`:void 0,"data-testid":`share-branch-switch-switch`,children:P?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),N]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),N]})}),(0,h.jsx)(o,{onClick:ft,disabled:!G||P||j,"data-testid":`share-branch-switch-worktree`,children:j?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),K]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),K]})})]}),t[184]=v.phase,t[185]=v.resolution,t[186]=j,t[187]=ot,t[188]=nt,t[189]=ft,t[190]=mt,t[191]=it,t[192]=Qe,t[193]=et,t[194]=M,t[195]=N,t[196]=P,t[197]=G,t[198]=K,t[199]=Z):Z=t[199];let Q;t[200]!==X||t[201]!==Z?(Q=(0,h.jsxs)(ie,{className:`sm:justify-between`,children:[X,Z]}),t[200]=X,t[201]=Z,t[202]=Q):Q=t[202];let $;t[203]!==k||t[204]!==R||t[205]!==z||t[206]!==B||t[207]!==V||t[208]!==H||t[209]!==Y||t[210]!==Q?($=(0,h.jsxs)(k,{className:R,"data-testid":z,onInteractOutside:B,onPointerDownOutside:V,children:[H,Y,Q]}),t[203]=k,t[204]=R,t[205]=z,t[206]=B,t[207]=V,t[208]=H,t[209]=Y,t[210]=Q,t[211]=$):$=t[211];let _t;return t[212]!==A||t[213]!==U||t[214]!==W||t[215]!==$?(_t=(0,h.jsx)(A,{open:U,onOpenChange:W,children:$}),t[212]=A,t[213]=U,t[214]=W,t[215]=$,t[216]=_t):_t=t[216],_t}function Te(e){return(0,h.jsx)(`li`,{children:(0,h.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function Ee(e){e.preventDefault()}function De(e){e.preventDefault()}function Oe(e){return Se(e,null).state}function ke(e){return xe(e,null)}function Ae(e){return ge(e,null)}function je(){return null}export{g as ShareBranchSwitchDialog};
|
package/dist/public/assets/{ShareReceiveDialog-IX_2OQ-z.js → ShareReceiveDialog-mjee2gdk.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Gol9BgNB.js";import{a as ee,c as te,i as ne,n as re,o as s,s as c,t as l}from"./dialog-TkFkuYVg.js";import{dn as u,ln as d}from"./dist-DbWN0KUu.js";import{t as ie}from"./loader-circle-Cg5SU7AZ.js";import{n as f}from"./dist-BLAMau9Z.js";import{t as p}from"./desktop-bridge-types--ZPzhkC9.js";import{a as ae,i as m,n as h,o as g,r as oe,s as _}from"./receive-store-CmOFuJ5o.js";import{t as se}from"./share-metadata-rows-BlaR96La.js";var v=e(n(),1),y=a(),b=e=>({phase:`ready`,seed:e});function x(e){return e.phase===`ready`?{phase:`initializing`,seed:e.seed}:e}function S(e,t){return e.phase===`initializing`?t.ok?{phase:`opening`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:t.reason,message:t.message}:e}function C(e,t){return e.phase===`opening`?t.ok?{phase:`done`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:`network-error`,message:t.message}:e}function w(e){return e.phase===`done`||e.phase===`cancelled`||e.phase===`error`?e:{phase:`cancelled`,seed:e.seed}}var T=t();function E(e){return e!==null&&e.kind===`launcher-consent`}function D(e){return e!==null&&e.kind===`launcher-miss`}function O(e){let t=(0,y.c)(14),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?h:i,o=(0,v.useSyncExternalStore)(a.subscribe,a.getSnapshot,A),[ee,te]=(0,v.useState)(0),[ne,re]=(0,v.useState)(o);o!==ne&&(re(o),te(k));let s,c;t[0]!==o||t[1]!==a?(s=()=>{if(!o)return;let e=_(o);e&&(f.error(e.message),a.dismiss())},c=[o,a],t[0]=o,t[1]=a,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,v.useEffect)(s,c);let l;t[4]===o?l=t[5]:(l=D(o)?o:null,t[4]=o,t[5]=l);let u=l,d;t[6]===o?d=t[7]:(d=E(o)?o:null,t[6]=o,t[7]=d);let ie=d??u;if(!ie)return null;let p;return t[8]!==ie||t[9]!==n||t[10]!==r||t[11]!==ee||t[12]!==a?(p=(0,T.jsx)(j,{payload:ie,bridge:n,cloneController:r,store:a},ee),t[8]=ie,t[9]=n,t[10]=r,t[11]=ee,t[12]=a,t[13]=p):p=t[13],p}function k(e){return e+1}function A(){return null}function j(e){let t=(0,y.c)(165),{payload:n,bridge:a,cloneController:h,store:_}=e,{_:x}=i(),[w,O]=(0,v.useState)(!1),[k,A]=(0,v.useState)(null),[j,fe]=(0,v.useState)(!1),[N,pe]=(0,v.useState)(!1),[P,me]=(0,v.useState)(null),[F,I]=(0,v.useState)(null),he=(0,v.useRef)(!1),ge=(0,v.useRef)(null),_e,ve;t[0]===P?(_e=t[1],ve=t[2]):(_e=()=>{P&&ge.current?.focus()},ve=[P],t[0]=P,t[1]=_e,t[2]=ve),(0,v.useEffect)(_e,ve);let ye;t[3]!==F||t[4]!==n?(ye=()=>{E(n)&&F===null&&(console.warn(`[receive] q1_hit=true selection=branch_match_non_ok candidate=${n.candidatePath}`),I(b({candidatePath:n.candidatePath,branch:n.share.branch,targetPath:p(n.share.target),targetKind:n.share.target.kind,parentProjectName:n.parentProjectName})))},t[3]=F,t[4]=n,t[5]=ye):ye=t[5];let be;t[6]===n?be=t[7]:(be=[n],t[6]=n,t[7]=be),(0,v.useEffect)(ye,be);let xe;t[8]!==k||t[9]!==h||t[10]!==n?(xe=()=>{if(!h||!D(n)||k!==null||he.current)return;he.current=!0,fe(!0);let e=n.share.host;h.getAuthStatus(e).then(e=>{A(e)}).catch(t=>{console.warn(`[receive] auth pre-flight probe failed`,t instanceof Error?t.message:t),A({authenticated:!1,host:e})}).finally(()=>{fe(!1)})},t[8]=k,t[9]=h,t[10]=n,t[11]=xe):xe=t[11];let Se;t[12]!==k||t[13]!==n?(Se=[n,k],t[12]=k,t[13]=n,t[14]=Se):Se=t[14],(0,v.useEffect)(xe,Se);let L=D(n)?n:null,Ce=E(n)?n:null,R=L?.share??Ce?.share??null,z,B,V,H,U,we,W,G;if(t[15]!==x||t[16]!==j||t[17]!==a||t[18]!==h||t[19]!==N||t[20]!==F||t[21]!==L||t[22]!==w||t[23]!==R||t[24]!==_){W=Symbol.for(`react.early_return_sentinel`);bb0:{let e=R?{host:R.host,owner:R.owner,repo:R.repo}:null,n;t[33]!==x||t[34]!==R?.target.kind?(n=R?.target.kind===`folder`?x({id:`ugoTXs`}):x({id:`XH30C4`}),t[33]=x,t[34]=R?.target.kind,t[35]=n):n=t[35],G=n,V=async function(){if(!L||!e)return;if(console.log(ae({q2_path:`clone`})),!h){f.info(x({id:`27XW26`}),{action:{label:x({id:`B3NAZC`}),onClick:()=>{a.navigator.open()}},duration:8e3});return}if(N)return;me(null),pe(!0);let t=oe(e),n;try{n=await h.runClone({url:t,branch:L.share.branch})}catch(e){let t=e;console.warn(`[receive] runClone threw unexpectedly`,t),pe(!1),me({detail:t instanceof Error?t.message:String(t)});return}if(pe(!1),n.kind===`error`){me({detail:n.detail??null});return}if(n.kind===`ok`){try{await a.project.open({path:n.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:L.share.target.kind,path:p(L.share.target)}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] project open after clone failed`,t instanceof Error?t.message:t),f.error(x({id:`438Fca`}))}return}};let i;t[36]!==x||t[37]!==j||t[38]!==h?(i=async function(){if(!(!h||j)){fe(!0);try{let e=await h.startSignIn();fe(!1),e!==null&&A(e)}catch(e){let t=e;fe(!1),console.warn(`[receive] startSignIn failed`,t instanceof Error?t.message:t),f.error(x({id:`lzwo7p`}))}}},t[36]=x,t[37]=j,t[38]=h,t[39]=i):i=t[39],U=i,H=async function(){if(!(!L||!e||w)){me(null),O(!0),console.log(ae({q2_path:`local`}));try{for(;;){let t=await a.dialog.openFolder();if(!t)break;let n=await a.share.validateLocalFolder({folderPath:t,host:e.host,owner:e.owner,repo:e.repo});if(console.log(ae({folder_validate:n.kind})),n.kind===`ok`){let e=L.share.branch,n={currentBranch:null,headSha:null,detached:!1};try{n=await a.project.readHeadBranch(t)}catch(e){let t=e;console.warn(`[receive] local-folder readHeadBranch failed`,t instanceof Error?t.message:t)}let r=u(e,n)!==`true`;try{await a.project.open({path:t,target:`new-window`,entryPoint:`share-receive`,...r?{pendingShareBranchSwitch:{share:L.share,projectPath:t,currentBranch:n.currentBranch}}:{pendingDeepLinkTarget:{kind:L.share.target.kind,path:p(L.share.target)}}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] local-folder-open failed`,t instanceof Error?t.message:t),f.error(x({id:`phM8Kh`}))}break}let r=g(n,e);r&&f.error(r)}}catch(e){let t=e;console.warn(`[receive] local-folder-validate failed`,t instanceof Error?t.message:t),f.error(x({id:`rlUzXK`}))}O(!1)}};let m;t[40]!==x||t[41]!==a||t[42]!==F||t[43]!==_?(m=function(){if(F===null||F.phase!==`ready`)return;let e=F.seed;console.warn(`[receive] consent_dialog action=initialize worktree=${e.candidatePath}`),I(de),a.project.okInit({projectPath:e.candidatePath}).then(async t=>{if(t.ok===!0){I(e=>e===null?e:S(e,{ok:!0,projectPath:t.projectPath}));try{await a.project.open({path:t.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:e.targetKind,path:e.targetPath},pendingBranch:e.branch}),I(ue),_.dismiss()}catch(t){let n=t,r=n instanceof Error?n.message:String(n);I(e=>e===null?e:C(e,{ok:!1,message:r})),f.error(x({id:`nDT8qt`,values:{0:e.candidatePath}}))}return}let n=t.reason,r=t.message||`Initialization failed.`;I(e=>e===null?e:S(e,{ok:!1,reason:n,message:r})),f.error(r)}).catch(t=>{let n=t instanceof Error?t.message:String(t);I(e=>e===null?e:S(e,{ok:!1,reason:`network-error`,message:n})),f.error(x({id:`3Mwaly`,values:{0:e.candidatePath}}))})},t[40]=x,t[41]=a,t[42]=F,t[43]=_,t[44]=m):m=t[44];let v=m,y;t[45]!==F||t[46]!==_?(y=function(){F!==null&&console.warn(`[receive] consent_dialog action=cancel worktree=${F.seed.candidatePath}`),I(M),_.dismiss()},t[45]=F,t[46]=_,t[47]=y):y=t[47];let b=y;if(F!==null&&F.phase!==`cancelled`&&F.phase!==`done`&&R!==null){let e=F.seed,n=F.phase===`initializing`||F.phase===`opening`,i;t[48]===b?i=t[49]:(i=e=>{e||b()},t[48]=b,t[49]=i);let a;t[50]===G?a=t[51]:(a=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:G}})}),t[50]=G,t[51]=a);let u;t[52]===R.target?u=t[53]:(u=p(R.target)?`— ${p(R.target)}`:``,t[52]=R.target,t[53]=u);let d;t[54]!==R.owner||t[55]!==R.repo||t[56]!==u?(d=(0,T.jsx)(ee,{className:`sr-only`,children:(0,T.jsx)(r,{id:`pgq_xf`,values:{0:R.owner,1:R.repo,2:u}})}),t[54]=R.owner,t[55]=R.repo,t[56]=u,t[57]=d):d=t[57];let f=R.owner,ae=R.repo,m;t[58]===R.target?m=t[59]:(m=p(R.target),t[58]=R.target,t[59]=m);let h;t[60]!==R.branch||t[61]!==R.owner||t[62]!==R.repo||t[63]!==R.target.kind||t[64]!==m?(h=(0,T.jsx)(se,{owner:f,repo:ae,path:m,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[60]=R.branch,t[61]=R.owner,t[62]=R.repo,t[63]=R.target.kind,t[64]=m,t[65]=h):h=t[65];let g;t[66]!==a||t[67]!==d||t[68]!==h?(g=(0,T.jsxs)(c,{children:[a,d,h]}),t[66]=a,t[67]=d,t[68]=h,t[69]=g):g=t[69];let oe;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`KsAPaB`})}),t[70]=oe):oe=t[70];let _;t[71]===e.candidatePath?_=t[72]:(_=(0,T.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-receive-consent-path`,children:e.candidatePath}),t[71]=e.candidatePath,t[72]=_);let y;t[73]===e.parentProjectName?y=t[74]:(y=e.parentProjectName===null?null:(0,T.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`share-receive-consent-parent`,children:(0,T.jsx)(r,{id:`JmfgFc`,values:{0:e.parentProjectName}})}),t[73]=e.parentProjectName,t[74]=y);let x;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`w7SsvI`})}),t[75]=x):x=t[75];let S;t[76]!==F.message||t[77]!==F.phase?(S=F.phase===`error`?(0,T.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,"data-testid":`share-receive-consent-error`,role:`alert`,children:F.message}):null,t[76]=F.message,t[77]=F.phase,t[78]=S):S=t[78];let C;t[79]!==_||t[80]!==y||t[81]!==S?(C=(0,T.jsxs)(re,{children:[oe,_,y,x,S]}),t[79]=_,t[80]=y,t[81]=S,t[82]=C):C=t[82];let w;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,T.jsx)(r,{id:`dEgA5A`}),t[83]=w):w=t[83];let E;t[84]===b?E=t[85]:(E=(0,T.jsx)(o,{variant:`ghost`,onClick:b,"data-testid":`share-receive-consent-cancel`,children:w}),t[84]=b,t[85]=E);let D=n||F.phase===`error`,O=n||F.phase===`error`,k;t[86]===n?k=t[87]:(k=n?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ie,{className:`mr-2 h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,T.jsx)(r,{id:`NKkZXl`})]}):(0,T.jsx)(r,{id:`NKkZXl`}),t[86]=n,t[87]=k);let A;t[88]!==v||t[89]!==D||t[90]!==O||t[91]!==k?(A=(0,T.jsx)(o,{onClick:v,disabled:D,"aria-disabled":O,"data-testid":`share-receive-consent-initialize`,children:k}),t[88]=v,t[89]=D,t[90]=O,t[91]=k,t[92]=A):A=t[92];let j;t[93]!==E||t[94]!==A?(j=(0,T.jsxs)(s,{children:[E,A]}),t[93]=E,t[94]=A,t[95]=j):j=t[95];let M;t[96]!==g||t[97]!==C||t[98]!==j?(M=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-consent-dialog`,onInteractOutside:le,onPointerDownOutside:ce,children:[g,C,j]}),t[96]=g,t[97]=C,t[98]=j,t[99]=M):M=t[99];let ue;t[100]!==i||t[101]!==M?(ue=(0,T.jsx)(l,{open:!0,onOpenChange:i,children:M}),t[100]=i,t[101]=M,t[102]=ue):ue=t[102],W=ue;break bb0}if(!L||!R||!e){W=null;break bb0}z=h!==void 0&&!N;let E;t[103]!==x||t[104]!==N?(E=x(N?{id:`YjhKI5`}:{id:`LE7t79`}),t[103]=x,t[104]=N,t[105]=E):E=t[105],B=E,we=d(e)}t[15]=x,t[16]=j,t[17]=a,t[18]=h,t[19]=N,t[20]=F,t[21]=L,t[22]=w,t[23]=R,t[24]=_,t[25]=z,t[26]=B,t[27]=V,t[28]=H,t[29]=U,t[30]=we,t[31]=W,t[32]=G}else z=t[25],B=t[26],V=t[27],H=t[28],U=t[29],we=t[30],W=t[31],G=t[32];if(W!==Symbol.for(`react.early_return_sentinel`))return W;let Te=we,Ee=k?.authenticated?k.login:void 0,De;t[106]===P?De=t[107]:(De=P?.detail?m(P.detail):``,t[106]=P,t[107]=De);let Oe=De,K;t[108]===_?K=t[109]:(K=e=>{e||_.dismiss()},t[108]=_,t[109]=K);let q;t[110]===G?q=t[111]:(q=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:G}})}),t[110]=G,t[111]=q);let J;t[112]===R.target?J=t[113]:(J=p(R.target)?` — ${p(R.target)}`:null,t[112]=R.target,t[113]=J);let Y;t[114]!==R.owner||t[115]!==R.repo||t[116]!==J?(Y=(0,T.jsxs)(ee,{className:`sr-only`,children:[R.owner,`/`,R.repo,J]}),t[114]=R.owner,t[115]=R.repo,t[116]=J,t[117]=Y):Y=t[117];let ke=R.owner,Ae=R.repo,X;t[118]===R.target?X=t[119]:(X=p(R.target),t[118]=R.target,t[119]=X);let Z;t[120]!==R.branch||t[121]!==R.owner||t[122]!==R.repo||t[123]!==R.target.kind||t[124]!==X?(Z=(0,T.jsx)(se,{owner:ke,repo:Ae,path:X,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[120]=R.branch,t[121]=R.owner,t[122]=R.repo,t[123]=R.target.kind,t[124]=X,t[125]=Z):Z=t[125];let Q;t[126]!==q||t[127]!==Y||t[128]!==Z?(Q=(0,T.jsxs)(c,{children:[q,Y,Z]}),t[126]=q,t[127]=Y,t[128]=Z,t[129]=Q):Q=t[129];let $;t[130]!==h||t[131]!==z||t[132]!==P||t[133]!==Oe||t[134]!==B||t[135]!==N||t[136]!==V||t[137]!==H||t[138]!==w?($=P?(0,T.jsxs)(`div`,{ref:ge,tabIndex:-1,className:`rounded-lg border border-destructive/40 bg-destructive/5 p-4 outline-none`,"data-testid":`share-receive-clone-error`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,role:`alert`,children:(0,T.jsx)(r,{id:`aiArms`})}),Oe?(0,T.jsxs)(`p`,{className:`mt-2 break-words text-xs text-destructive`,"data-testid":`share-receive-clone-error-message`,children:[(0,T.jsx)(r,{id:`4BITzH`}),` `,(0,T.jsxs)(`span`,{className:`font-mono text-foreground/80`,children:[`"`,Oe,`"`]})]}):null,(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`Llyqvo`})}),(0,T.jsxs)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,"data-testid":`share-receive-clone-error-reasons`,children:[(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`6LbUG7`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`_pY_Vq`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`J6mxC1`})})]}),(0,T.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,T.jsx)(o,{onClick:()=>{V()},"data-testid":`share-receive-clone-retry`,children:(0,T.jsx)(r,{id:`KDw4GX`})}),(0,T.jsx)(o,{variant:`outline`,onClick:()=>{H()},disabled:w||N,"data-testid":`share-receive-error-local`,children:(0,T.jsx)(r,{id:`xFQRu4`})})]})]}):(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border border-primary/50 bg-primary/5 p-4 text-left transition hover:border-primary hover:bg-primary/10 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/50 disabled:hover:bg-primary/5`,onClick:()=>{V()},disabled:h!==void 0&&!z,"aria-disabled":h!==void 0&&!z,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:B}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`fj5YiP`})})]}),(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,onClick:()=>{H()},disabled:w||N,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:(0,T.jsx)(r,{id:`HfI1dR`})}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`_qD6mn`})})]})]}),t[130]=h,t[131]=z,t[132]=P,t[133]=Oe,t[134]=B,t[135]=N,t[136]=V,t[137]=H,t[138]=w,t[139]=$):$=t[139];let je;t[140]!==j||t[141]!==k||t[142]!==h||t[143]!==U||t[144]!==Ee?(je=h?(0,T.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,role:`status`,"aria-live":`polite`,children:k===null?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`UDFrWm`})}):k.authenticated?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`VAHWL_`,values:{signedInLogin:Ee},components:{0:(0,T.jsx)(`span`,{className:`font-medium text-foreground/90`})}})}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`SgKLfA`})}),(0,T.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{U()},disabled:j,children:j?(0,T.jsx)(r,{id:`PKLY-1`}):(0,T.jsx)(r,{id:`3jod3l`})})]})}):null,t[140]=j,t[141]=k,t[142]=h,t[143]=U,t[144]=Ee,t[145]=je):je=t[145];let Me;t[146]!==P||t[147]!==Te?(Me=P?null:(0,T.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`RJ3a8Z`,values:{lookingForUrl:Te},components:{0:(0,T.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),t[146]=P,t[147]=Te,t[148]=Me):Me=t[148];let Ne;t[149]!==$||t[150]!==je||t[151]!==Me?(Ne=(0,T.jsxs)(re,{children:[$,je,Me]}),t[149]=$,t[150]=je,t[151]=Me,t[152]=Ne):Ne=t[152];let Pe;t[153]===_?Pe=t[154]:(Pe=()=>_.dismiss(),t[153]=_,t[154]=Pe);let Fe;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,T.jsx)(r,{id:`dEgA5A`}),t[155]=Fe):Fe=t[155];let Ie;t[156]===Pe?Ie=t[157]:(Ie=(0,T.jsx)(s,{children:(0,T.jsx)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:Pe,children:Fe})}),t[156]=Pe,t[157]=Ie);let Le;t[158]!==Q||t[159]!==Ne||t[160]!==Ie?(Le=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[Q,Ne,Ie]}),t[158]=Q,t[159]=Ne,t[160]=Ie,t[161]=Le):Le=t[161];let Re;return t[162]!==K||t[163]!==Le?(Re=(0,T.jsx)(l,{open:!0,onOpenChange:K,children:Le}),t[162]=K,t[163]=Le,t[164]=Re):Re=t[164],Re}function ce(e){return e.preventDefault()}function le(e){return e.preventDefault()}function M(e){return e===null?e:w(e)}function ue(e){return e===null?e:C(e,{ok:!0})}function de(e){return e===null?e:x(e)}export{O as ShareReceiveDialog};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Gol9BgNB.js";import{a as ee,c as te,i as ne,n as re,o as s,s as c,t as l}from"./dialog-TkFkuYVg.js";import{dn as u,ln as d}from"./dist-D9TmfgYW.js";import{t as ie}from"./loader-circle-Cg5SU7AZ.js";import{n as f}from"./dist-BLAMau9Z.js";import{t as p}from"./desktop-bridge-types--ZPzhkC9.js";import{a as ae,i as m,n as h,o as g,r as oe,s as _}from"./receive-store-CnPZW2Nl.js";import{t as se}from"./share-metadata-rows-CheY4PXF.js";var v=e(n(),1),y=a(),b=e=>({phase:`ready`,seed:e});function x(e){return e.phase===`ready`?{phase:`initializing`,seed:e.seed}:e}function S(e,t){return e.phase===`initializing`?t.ok?{phase:`opening`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:t.reason,message:t.message}:e}function C(e,t){return e.phase===`opening`?t.ok?{phase:`done`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:`network-error`,message:t.message}:e}function w(e){return e.phase===`done`||e.phase===`cancelled`||e.phase===`error`?e:{phase:`cancelled`,seed:e.seed}}var T=t();function E(e){return e!==null&&e.kind===`launcher-consent`}function D(e){return e!==null&&e.kind===`launcher-miss`}function O(e){let t=(0,y.c)(14),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?h:i,o=(0,v.useSyncExternalStore)(a.subscribe,a.getSnapshot,A),[ee,te]=(0,v.useState)(0),[ne,re]=(0,v.useState)(o);o!==ne&&(re(o),te(k));let s,c;t[0]!==o||t[1]!==a?(s=()=>{if(!o)return;let e=_(o);e&&(f.error(e.message),a.dismiss())},c=[o,a],t[0]=o,t[1]=a,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,v.useEffect)(s,c);let l;t[4]===o?l=t[5]:(l=D(o)?o:null,t[4]=o,t[5]=l);let u=l,d;t[6]===o?d=t[7]:(d=E(o)?o:null,t[6]=o,t[7]=d);let ie=d??u;if(!ie)return null;let p;return t[8]!==ie||t[9]!==n||t[10]!==r||t[11]!==ee||t[12]!==a?(p=(0,T.jsx)(j,{payload:ie,bridge:n,cloneController:r,store:a},ee),t[8]=ie,t[9]=n,t[10]=r,t[11]=ee,t[12]=a,t[13]=p):p=t[13],p}function k(e){return e+1}function A(){return null}function j(e){let t=(0,y.c)(165),{payload:n,bridge:a,cloneController:h,store:_}=e,{_:x}=i(),[w,O]=(0,v.useState)(!1),[k,A]=(0,v.useState)(null),[j,fe]=(0,v.useState)(!1),[N,pe]=(0,v.useState)(!1),[P,me]=(0,v.useState)(null),[F,I]=(0,v.useState)(null),he=(0,v.useRef)(!1),ge=(0,v.useRef)(null),_e,ve;t[0]===P?(_e=t[1],ve=t[2]):(_e=()=>{P&&ge.current?.focus()},ve=[P],t[0]=P,t[1]=_e,t[2]=ve),(0,v.useEffect)(_e,ve);let ye;t[3]!==F||t[4]!==n?(ye=()=>{E(n)&&F===null&&(console.warn(`[receive] q1_hit=true selection=branch_match_non_ok candidate=${n.candidatePath}`),I(b({candidatePath:n.candidatePath,branch:n.share.branch,targetPath:p(n.share.target),targetKind:n.share.target.kind,parentProjectName:n.parentProjectName})))},t[3]=F,t[4]=n,t[5]=ye):ye=t[5];let be;t[6]===n?be=t[7]:(be=[n],t[6]=n,t[7]=be),(0,v.useEffect)(ye,be);let xe;t[8]!==k||t[9]!==h||t[10]!==n?(xe=()=>{if(!h||!D(n)||k!==null||he.current)return;he.current=!0,fe(!0);let e=n.share.host;h.getAuthStatus(e).then(e=>{A(e)}).catch(t=>{console.warn(`[receive] auth pre-flight probe failed`,t instanceof Error?t.message:t),A({authenticated:!1,host:e})}).finally(()=>{fe(!1)})},t[8]=k,t[9]=h,t[10]=n,t[11]=xe):xe=t[11];let Se;t[12]!==k||t[13]!==n?(Se=[n,k],t[12]=k,t[13]=n,t[14]=Se):Se=t[14],(0,v.useEffect)(xe,Se);let L=D(n)?n:null,Ce=E(n)?n:null,R=L?.share??Ce?.share??null,z,B,V,H,U,we,W,G;if(t[15]!==x||t[16]!==j||t[17]!==a||t[18]!==h||t[19]!==N||t[20]!==F||t[21]!==L||t[22]!==w||t[23]!==R||t[24]!==_){W=Symbol.for(`react.early_return_sentinel`);bb0:{let e=R?{host:R.host,owner:R.owner,repo:R.repo}:null,n;t[33]!==x||t[34]!==R?.target.kind?(n=R?.target.kind===`folder`?x({id:`ugoTXs`}):x({id:`XH30C4`}),t[33]=x,t[34]=R?.target.kind,t[35]=n):n=t[35],G=n,V=async function(){if(!L||!e)return;if(console.log(ae({q2_path:`clone`})),!h){f.info(x({id:`27XW26`}),{action:{label:x({id:`B3NAZC`}),onClick:()=>{a.navigator.open()}},duration:8e3});return}if(N)return;me(null),pe(!0);let t=oe(e),n;try{n=await h.runClone({url:t,branch:L.share.branch})}catch(e){let t=e;console.warn(`[receive] runClone threw unexpectedly`,t),pe(!1),me({detail:t instanceof Error?t.message:String(t)});return}if(pe(!1),n.kind===`error`){me({detail:n.detail??null});return}if(n.kind===`ok`){try{await a.project.open({path:n.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:L.share.target.kind,path:p(L.share.target)}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] project open after clone failed`,t instanceof Error?t.message:t),f.error(x({id:`438Fca`}))}return}};let i;t[36]!==x||t[37]!==j||t[38]!==h?(i=async function(){if(!(!h||j)){fe(!0);try{let e=await h.startSignIn();fe(!1),e!==null&&A(e)}catch(e){let t=e;fe(!1),console.warn(`[receive] startSignIn failed`,t instanceof Error?t.message:t),f.error(x({id:`lzwo7p`}))}}},t[36]=x,t[37]=j,t[38]=h,t[39]=i):i=t[39],U=i,H=async function(){if(!(!L||!e||w)){me(null),O(!0),console.log(ae({q2_path:`local`}));try{for(;;){let t=await a.dialog.openFolder();if(!t)break;let n=await a.share.validateLocalFolder({folderPath:t,host:e.host,owner:e.owner,repo:e.repo});if(console.log(ae({folder_validate:n.kind})),n.kind===`ok`){let e=L.share.branch,n={currentBranch:null,headSha:null,detached:!1};try{n=await a.project.readHeadBranch(t)}catch(e){let t=e;console.warn(`[receive] local-folder readHeadBranch failed`,t instanceof Error?t.message:t)}let r=u(e,n)!==`true`;try{await a.project.open({path:t,target:`new-window`,entryPoint:`share-receive`,...r?{pendingShareBranchSwitch:{share:L.share,projectPath:t,currentBranch:n.currentBranch}}:{pendingDeepLinkTarget:{kind:L.share.target.kind,path:p(L.share.target)}}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] local-folder-open failed`,t instanceof Error?t.message:t),f.error(x({id:`phM8Kh`}))}break}let r=g(n,e);r&&f.error(r)}}catch(e){let t=e;console.warn(`[receive] local-folder-validate failed`,t instanceof Error?t.message:t),f.error(x({id:`rlUzXK`}))}O(!1)}};let m;t[40]!==x||t[41]!==a||t[42]!==F||t[43]!==_?(m=function(){if(F===null||F.phase!==`ready`)return;let e=F.seed;console.warn(`[receive] consent_dialog action=initialize worktree=${e.candidatePath}`),I(de),a.project.okInit({projectPath:e.candidatePath}).then(async t=>{if(t.ok===!0){I(e=>e===null?e:S(e,{ok:!0,projectPath:t.projectPath}));try{await a.project.open({path:t.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:e.targetKind,path:e.targetPath},pendingBranch:e.branch}),I(ue),_.dismiss()}catch(t){let n=t,r=n instanceof Error?n.message:String(n);I(e=>e===null?e:C(e,{ok:!1,message:r})),f.error(x({id:`nDT8qt`,values:{0:e.candidatePath}}))}return}let n=t.reason,r=t.message||`Initialization failed.`;I(e=>e===null?e:S(e,{ok:!1,reason:n,message:r})),f.error(r)}).catch(t=>{let n=t instanceof Error?t.message:String(t);I(e=>e===null?e:S(e,{ok:!1,reason:`network-error`,message:n})),f.error(x({id:`3Mwaly`,values:{0:e.candidatePath}}))})},t[40]=x,t[41]=a,t[42]=F,t[43]=_,t[44]=m):m=t[44];let v=m,y;t[45]!==F||t[46]!==_?(y=function(){F!==null&&console.warn(`[receive] consent_dialog action=cancel worktree=${F.seed.candidatePath}`),I(M),_.dismiss()},t[45]=F,t[46]=_,t[47]=y):y=t[47];let b=y;if(F!==null&&F.phase!==`cancelled`&&F.phase!==`done`&&R!==null){let e=F.seed,n=F.phase===`initializing`||F.phase===`opening`,i;t[48]===b?i=t[49]:(i=e=>{e||b()},t[48]=b,t[49]=i);let a;t[50]===G?a=t[51]:(a=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:G}})}),t[50]=G,t[51]=a);let u;t[52]===R.target?u=t[53]:(u=p(R.target)?`— ${p(R.target)}`:``,t[52]=R.target,t[53]=u);let d;t[54]!==R.owner||t[55]!==R.repo||t[56]!==u?(d=(0,T.jsx)(ee,{className:`sr-only`,children:(0,T.jsx)(r,{id:`pgq_xf`,values:{0:R.owner,1:R.repo,2:u}})}),t[54]=R.owner,t[55]=R.repo,t[56]=u,t[57]=d):d=t[57];let f=R.owner,ae=R.repo,m;t[58]===R.target?m=t[59]:(m=p(R.target),t[58]=R.target,t[59]=m);let h;t[60]!==R.branch||t[61]!==R.owner||t[62]!==R.repo||t[63]!==R.target.kind||t[64]!==m?(h=(0,T.jsx)(se,{owner:f,repo:ae,path:m,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[60]=R.branch,t[61]=R.owner,t[62]=R.repo,t[63]=R.target.kind,t[64]=m,t[65]=h):h=t[65];let g;t[66]!==a||t[67]!==d||t[68]!==h?(g=(0,T.jsxs)(c,{children:[a,d,h]}),t[66]=a,t[67]=d,t[68]=h,t[69]=g):g=t[69];let oe;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`KsAPaB`})}),t[70]=oe):oe=t[70];let _;t[71]===e.candidatePath?_=t[72]:(_=(0,T.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-receive-consent-path`,children:e.candidatePath}),t[71]=e.candidatePath,t[72]=_);let y;t[73]===e.parentProjectName?y=t[74]:(y=e.parentProjectName===null?null:(0,T.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`share-receive-consent-parent`,children:(0,T.jsx)(r,{id:`JmfgFc`,values:{0:e.parentProjectName}})}),t[73]=e.parentProjectName,t[74]=y);let x;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`w7SsvI`})}),t[75]=x):x=t[75];let S;t[76]!==F.message||t[77]!==F.phase?(S=F.phase===`error`?(0,T.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,"data-testid":`share-receive-consent-error`,role:`alert`,children:F.message}):null,t[76]=F.message,t[77]=F.phase,t[78]=S):S=t[78];let C;t[79]!==_||t[80]!==y||t[81]!==S?(C=(0,T.jsxs)(re,{children:[oe,_,y,x,S]}),t[79]=_,t[80]=y,t[81]=S,t[82]=C):C=t[82];let w;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,T.jsx)(r,{id:`dEgA5A`}),t[83]=w):w=t[83];let E;t[84]===b?E=t[85]:(E=(0,T.jsx)(o,{variant:`ghost`,onClick:b,"data-testid":`share-receive-consent-cancel`,children:w}),t[84]=b,t[85]=E);let D=n||F.phase===`error`,O=n||F.phase===`error`,k;t[86]===n?k=t[87]:(k=n?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ie,{className:`mr-2 h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,T.jsx)(r,{id:`NKkZXl`})]}):(0,T.jsx)(r,{id:`NKkZXl`}),t[86]=n,t[87]=k);let A;t[88]!==v||t[89]!==D||t[90]!==O||t[91]!==k?(A=(0,T.jsx)(o,{onClick:v,disabled:D,"aria-disabled":O,"data-testid":`share-receive-consent-initialize`,children:k}),t[88]=v,t[89]=D,t[90]=O,t[91]=k,t[92]=A):A=t[92];let j;t[93]!==E||t[94]!==A?(j=(0,T.jsxs)(s,{children:[E,A]}),t[93]=E,t[94]=A,t[95]=j):j=t[95];let M;t[96]!==g||t[97]!==C||t[98]!==j?(M=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-consent-dialog`,onInteractOutside:le,onPointerDownOutside:ce,children:[g,C,j]}),t[96]=g,t[97]=C,t[98]=j,t[99]=M):M=t[99];let ue;t[100]!==i||t[101]!==M?(ue=(0,T.jsx)(l,{open:!0,onOpenChange:i,children:M}),t[100]=i,t[101]=M,t[102]=ue):ue=t[102],W=ue;break bb0}if(!L||!R||!e){W=null;break bb0}z=h!==void 0&&!N;let E;t[103]!==x||t[104]!==N?(E=x(N?{id:`YjhKI5`}:{id:`LE7t79`}),t[103]=x,t[104]=N,t[105]=E):E=t[105],B=E,we=d(e)}t[15]=x,t[16]=j,t[17]=a,t[18]=h,t[19]=N,t[20]=F,t[21]=L,t[22]=w,t[23]=R,t[24]=_,t[25]=z,t[26]=B,t[27]=V,t[28]=H,t[29]=U,t[30]=we,t[31]=W,t[32]=G}else z=t[25],B=t[26],V=t[27],H=t[28],U=t[29],we=t[30],W=t[31],G=t[32];if(W!==Symbol.for(`react.early_return_sentinel`))return W;let Te=we,Ee=k?.authenticated?k.login:void 0,De;t[106]===P?De=t[107]:(De=P?.detail?m(P.detail):``,t[106]=P,t[107]=De);let Oe=De,K;t[108]===_?K=t[109]:(K=e=>{e||_.dismiss()},t[108]=_,t[109]=K);let q;t[110]===G?q=t[111]:(q=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:G}})}),t[110]=G,t[111]=q);let J;t[112]===R.target?J=t[113]:(J=p(R.target)?` — ${p(R.target)}`:null,t[112]=R.target,t[113]=J);let Y;t[114]!==R.owner||t[115]!==R.repo||t[116]!==J?(Y=(0,T.jsxs)(ee,{className:`sr-only`,children:[R.owner,`/`,R.repo,J]}),t[114]=R.owner,t[115]=R.repo,t[116]=J,t[117]=Y):Y=t[117];let ke=R.owner,Ae=R.repo,X;t[118]===R.target?X=t[119]:(X=p(R.target),t[118]=R.target,t[119]=X);let Z;t[120]!==R.branch||t[121]!==R.owner||t[122]!==R.repo||t[123]!==R.target.kind||t[124]!==X?(Z=(0,T.jsx)(se,{owner:ke,repo:Ae,path:X,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[120]=R.branch,t[121]=R.owner,t[122]=R.repo,t[123]=R.target.kind,t[124]=X,t[125]=Z):Z=t[125];let Q;t[126]!==q||t[127]!==Y||t[128]!==Z?(Q=(0,T.jsxs)(c,{children:[q,Y,Z]}),t[126]=q,t[127]=Y,t[128]=Z,t[129]=Q):Q=t[129];let $;t[130]!==h||t[131]!==z||t[132]!==P||t[133]!==Oe||t[134]!==B||t[135]!==N||t[136]!==V||t[137]!==H||t[138]!==w?($=P?(0,T.jsxs)(`div`,{ref:ge,tabIndex:-1,className:`rounded-lg border border-destructive/40 bg-destructive/5 p-4 outline-none`,"data-testid":`share-receive-clone-error`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,role:`alert`,children:(0,T.jsx)(r,{id:`aiArms`})}),Oe?(0,T.jsxs)(`p`,{className:`mt-2 break-words text-xs text-destructive`,"data-testid":`share-receive-clone-error-message`,children:[(0,T.jsx)(r,{id:`4BITzH`}),` `,(0,T.jsxs)(`span`,{className:`font-mono text-foreground/80`,children:[`"`,Oe,`"`]})]}):null,(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`Llyqvo`})}),(0,T.jsxs)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,"data-testid":`share-receive-clone-error-reasons`,children:[(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`6LbUG7`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`_pY_Vq`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`J6mxC1`})})]}),(0,T.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,T.jsx)(o,{onClick:()=>{V()},"data-testid":`share-receive-clone-retry`,children:(0,T.jsx)(r,{id:`KDw4GX`})}),(0,T.jsx)(o,{variant:`outline`,onClick:()=>{H()},disabled:w||N,"data-testid":`share-receive-error-local`,children:(0,T.jsx)(r,{id:`xFQRu4`})})]})]}):(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border border-primary/50 bg-primary/5 p-4 text-left transition hover:border-primary hover:bg-primary/10 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/50 disabled:hover:bg-primary/5`,onClick:()=>{V()},disabled:h!==void 0&&!z,"aria-disabled":h!==void 0&&!z,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:B}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`fj5YiP`})})]}),(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,onClick:()=>{H()},disabled:w||N,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:(0,T.jsx)(r,{id:`HfI1dR`})}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`_qD6mn`})})]})]}),t[130]=h,t[131]=z,t[132]=P,t[133]=Oe,t[134]=B,t[135]=N,t[136]=V,t[137]=H,t[138]=w,t[139]=$):$=t[139];let je;t[140]!==j||t[141]!==k||t[142]!==h||t[143]!==U||t[144]!==Ee?(je=h?(0,T.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,role:`status`,"aria-live":`polite`,children:k===null?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`UDFrWm`})}):k.authenticated?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`VAHWL_`,values:{signedInLogin:Ee},components:{0:(0,T.jsx)(`span`,{className:`font-medium text-foreground/90`})}})}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`SgKLfA`})}),(0,T.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{U()},disabled:j,children:j?(0,T.jsx)(r,{id:`PKLY-1`}):(0,T.jsx)(r,{id:`3jod3l`})})]})}):null,t[140]=j,t[141]=k,t[142]=h,t[143]=U,t[144]=Ee,t[145]=je):je=t[145];let Me;t[146]!==P||t[147]!==Te?(Me=P?null:(0,T.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`RJ3a8Z`,values:{lookingForUrl:Te},components:{0:(0,T.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),t[146]=P,t[147]=Te,t[148]=Me):Me=t[148];let Ne;t[149]!==$||t[150]!==je||t[151]!==Me?(Ne=(0,T.jsxs)(re,{children:[$,je,Me]}),t[149]=$,t[150]=je,t[151]=Me,t[152]=Ne):Ne=t[152];let Pe;t[153]===_?Pe=t[154]:(Pe=()=>_.dismiss(),t[153]=_,t[154]=Pe);let Fe;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,T.jsx)(r,{id:`dEgA5A`}),t[155]=Fe):Fe=t[155];let Ie;t[156]===Pe?Ie=t[157]:(Ie=(0,T.jsx)(s,{children:(0,T.jsx)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:Pe,children:Fe})}),t[156]=Pe,t[157]=Ie);let Le;t[158]!==Q||t[159]!==Ne||t[160]!==Ie?(Le=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[Q,Ne,Ie]}),t[158]=Q,t[159]=Ne,t[160]=Ie,t[161]=Le):Le=t[161];let Re;return t[162]!==K||t[163]!==Le?(Re=(0,T.jsx)(l,{open:!0,onOpenChange:K,children:Le}),t[162]=K,t[163]=Le,t[164]=Re):Re=t[164],Re}function ce(e){return e.preventDefault()}function le(e){return e.preventDefault()}function M(e){return e===null?e:w(e)}function ue(e){return e===null?e:C(e,{ok:!0})}function de(e){return e===null?e:x(e)}export{O as ShareReceiveDialog};
|
package/dist/public/assets/{ShareReceiveMissDialog-BsHBuFKr.js → ShareReceiveMissDialog-RIU6HaEy.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-TkFkuYVg.js";import{a as l,i as u,n as d,r as f}from"./pending-receive-nav-store-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-TkFkuYVg.js";import{a as l,i as u,n as d,r as f}from"./pending-receive-nav-store-lH450qAv.js";import{t as p}from"./miss-dialog-store-Bx4JLuKB.js";import{c as m,s as h}from"./doc-hash-By0RtZb7.js";var g=r(),_=e(n(),1),v=t();function y(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function b(){let e=(0,g.c)(2),t=(0,_.useSyncExternalStore)(p.subscribe,p.getSnapshot,x);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,v.jsx)(S,{nav:t},t.path),e[0]=t,e[1]=n),n}function x(){return null}function S(e){let t=(0,g.c)(29),{nav:n}=e,{state:r,refetch:_}=l(n),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(){p.dismiss()},t[0]=b):b=t[0];let x=b,S;t[1]===n.path?S=t[2]:(S=function(){window.location.hash=m(u(n.path)),x()},t[1]=n.path,t[2]=S);let C=S,w;t[3]!==n.branch||t[4]!==n.kind?(w=function(e){d.arm({kind:n.kind,path:e,branch:n.branch}),window.location.hash=n.kind===`folder`?m(e):h(e),x()},t[3]=n.branch,t[4]=n.kind,t[5]=w):w=t[5];let T=w,E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||x()},t[6]=E):E=t[6];let D=r.phase,O=r.phase===`resolved`?r.resolution.verdict:void 0,k;t[7]===n.path?k=t[8]:(k=y(n.path),t[7]=n.path,t[8]=k);let A;t[9]===k?A=t[10]:(A=(0,v.jsx)(s,{children:(0,v.jsx)(i,{className:`truncate`,children:k})}),t[9]=k,t[10]=A);let j=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,M;t[11]!==n.path||t[12]!==T?(M=()=>T(n.path),t[11]=n.path,t[12]=T,t[13]=M):M=t[13];let N;t[14]!==C||t[15]!==n||t[16]!==T||t[17]!==_||t[18]!==r||t[19]!==M?(N=(0,v.jsx)(f,{nav:n,state:r,onBrowseFolder:C,onOpenRenamed:T,onEnableAutoSync:x,onSyncCompleted:_,onPullApplied:M}),t[14]=C,t[15]=n,t[16]=T,t[17]=_,t[18]=r,t[19]=M,t[20]=N):N=t[20];let P;t[21]!==N||t[22]!==j?(P=(0,v.jsx)(o,{className:j,children:N}),t[21]=N,t[22]=j,t[23]=P):P=t[23];let F;return t[24]!==r.phase||t[25]!==P||t[26]!==O||t[27]!==A?(F=(0,v.jsx)(c,{open:!0,onOpenChange:E,children:(0,v.jsxs)(a,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":D,"data-verdict":O,children:[A,P]})}),t[24]=r.phase,t[25]=P,t[26]=O,t[27]=A,t[28]=F):F=t[28],F}export{b as ShareReceiveMissDialog};
|
package/dist/public/assets/{SkillEditorActions-Bg7DEmMN.js → SkillEditorActions-ghSewPgo.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{s as ee}from"./createLucideIcon-DAkhoPjT.js";import{t as a}from"./button-Gol9BgNB.js";import{a as o,m as te,n as s,o as ne,r as c,t as re,u as l}from"./dropdown-menu-xw8WTdb-.js";import{I as ie,It as u}from"./dist-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{s as ee}from"./createLucideIcon-DAkhoPjT.js";import{t as a}from"./button-Gol9BgNB.js";import{a as o,m as te,n as s,o as ne,r as c,t as re,u as l}from"./dropdown-menu-xw8WTdb-.js";import{I as ie,It as u}from"./dist-D9TmfgYW.js";import{t as d}from"./chevron-down-Bx9f3tW-.js";import{i as ae,r as oe}from"./skill-actions-CfCRZPoW.js";var se=i(),f=e(n(),1),p=t(),m=u.options;function h(e){let t=(0,se.c)(74),{scope:n,name:i}=e,u=ae(),h=oe(),g;t[0]!==i||t[1]!==n||t[2]!==u.data||t[3]!==u.status?(g=u.status===`ready`?u.data.find(e=>e.scope===n&&e.name===i):void 0,t[0]=i,t[1]=n,t[2]=u.data,t[3]=u.status,t[4]=g):g=t[4];let _=g,v;t[5]!==_||t[6]!==i||t[7]!==n?(v=_??{scope:n,name:i,path:i,description:``,installed:!1,hosts:[]},t[5]=_,t[6]=i,t[7]=n,t[8]=v):v=t[8];let y=v,b=h.installingName===i,[x,S]=(0,f.useState)(null),C=x??y.hosts,w;t[9]===C?w=t[10]:(w=new Set(C),t[9]=C,t[10]=w);let T=w,E=x?x.length>0:y.installed,D=(0,f.useRef)(y.hosts),O,k;t[11]!==x||t[12]!==y.hosts?(O=()=>{x===null&&(D.current=y.hosts)},k=[x,y.hosts],t[11]=x,t[12]=y.hosts,t[13]=O,t[14]=k):(O=t[13],k=t[14]),(0,f.useEffect)(O,k);let A;t[15]===y.hosts?A=t[16]:(A=[...y.hosts].sort().join(`,`),t[15]=y.hosts,t[16]=A);let j=A,M,N;t[17]===j?(M=t[18],N=t[19]):(M=()=>{S(e=>e&&[...e].sort().join(`,`)===j?null:e)},N=[j],t[17]=j,t[18]=M,t[19]=N),(0,f.useEffect)(M,N);let P=(0,f.useRef)(null),F,I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current)},F=[],t[20]=F,t[21]=I):(F=t[20],I=t[21]),(0,f.useEffect)(I,F);let L,R,z,B,V,H,U,W,G;if(t[22]!==h||t[23]!==T||t[24]!==E||t[25]!==b||t[26]!==y){z=function(e,t){D.current=e,S(e),P.current&&clearTimeout(P.current);let n=async()=>{(await h.install(y,e)).ok||S(null)};t?P.current=setTimeout(()=>void n(),350):n()};let e=function(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)};G=`flex items-center gap-1.5`,R=re;let n=E?`installed`:`draft`,i=E?`border-primary/50 bg-primary/5 text-primary hover:bg-primary/10 hover:text-primary`:`border-yellow-500/40 bg-yellow-500/10 text-yellow-600 hover:bg-yellow-500/20 hover:text-yellow-600`,o;t[36]===i?o=t[37]:(o=ee(`h-6 gap-1 rounded-sm border px-1.5 font-mono text-xs uppercase shadow-none`,i),t[36]=i,t[37]=o);let l;t[38]!==E||t[39]!==b?(l=b?(0,p.jsx)(r,{id:`b4itZn`}):E?(0,p.jsx)(r,{id:`eQkgKV`}):(0,p.jsx)(r,{id:`eneWvv`}),t[38]=E,t[39]=b,t[40]=l):l=t[40];let u;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,p.jsx)(d,{"aria-hidden":!0}),t[41]=u):u=t[41],t[42]!==b||t[43]!==n||t[44]!==o||t[45]!==l?(W=(0,p.jsx)(te,{asChild:!0,children:(0,p.jsxs)(a,{variant:`outline`,size:`sm`,disabled:b,"data-testid":`skill-install-menu-trigger`,"data-state":n,className:o,children:[l,u]})}),t[42]=b,t[43]=n,t[44]=o,t[45]=l,t[46]=W):W=t[46],L=c,B=`end`,V=`min-w-52`,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsx)(ne,{children:(0,p.jsx)(r,{id:`npcziF`})}),t[47]=H):H=t[47],U=m.map(t=>(0,p.jsx)(s,{checked:T.has(t),onCheckedChange:n=>e(t,n===!0),"data-testid":`skill-install-editor-${t}`,children:ie[t]},t)),t[22]=h,t[23]=T,t[24]=E,t[25]=b,t[26]=y,t[27]=L,t[28]=R,t[29]=z,t[30]=B,t[31]=V,t[32]=H,t[33]=U,t[34]=W,t[35]=G}else L=t[27],R=t[28],z=t[29],B=t[30],V=t[31],H=t[32],U=t[33],W=t[34],G=t[35];let K;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,p.jsx)(l,{}),t[48]=K):K=t[48];let q;t[49]===z?q=t[50]:(q=()=>z([...m],!1),t[49]=z,t[50]=q);let J;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,p.jsx)(r,{id:`x-5mJ1`}),t[51]=J):J=t[51];let Y;t[52]===q?Y=t[53]:(Y=(0,p.jsx)(o,{"data-testid":`skill-install-all`,onSelect:q,children:J}),t[52]=q,t[53]=Y);let X;t[54]!==h||t[55]!==E||t[56]!==y?(X=E?(0,p.jsx)(o,{"data-testid":`skill-uninstall`,onSelect:()=>{P.current&&clearTimeout(P.current),D.current=[],S([]),(async()=>{(await h.uninstall(y)).ok||S(null)})()},children:(0,p.jsx)(r,{id:`t422_7`})}):null,t[54]=h,t[55]=E,t[56]=y,t[57]=X):X=t[57];let Z;t[58]!==L||t[59]!==B||t[60]!==V||t[61]!==H||t[62]!==U||t[63]!==Y||t[64]!==X?(Z=(0,p.jsxs)(L,{align:B,className:V,children:[H,U,K,Y,X]}),t[58]=L,t[59]=B,t[60]=V,t[61]=H,t[62]=U,t[63]=Y,t[64]=X,t[65]=Z):Z=t[65];let Q;t[66]!==R||t[67]!==W||t[68]!==Z?(Q=(0,p.jsxs)(R,{children:[W,Z]}),t[66]=R,t[67]=W,t[68]=Z,t[69]=Q):Q=t[69];let $;return t[70]!==h.dialogs||t[71]!==G||t[72]!==Q?($=(0,p.jsxs)(`div`,{className:G,children:[Q,h.dialogs]}),t[70]=h.dialogs,t[71]=G,t[72]=Q,t[73]=$):$=t[73],$}export{h as SkillEditorActions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{E as n,N as r,at as i,it as a}from"./DocumentContext-DYNMnkEK.js";import{t as o}from"./react-f2sANaYj.js";import{n as s}from"./dist-PQ5KMVDh.js";import{t as c}from"./compiler-runtime-BfE3aGVn.js";import{E as l,a as u,i as ee,o as d}from"./CodeMirrorPropInput-BDWvXsen.js";import{Dr as f,Ki as te,O as p,kn as m,li as h,z as g}from"./dist-D9TmfgYW.js";import{g as ne}from"./use-settings-route-CqFpylkf.js";import"./config-provider-BlhsBCJH.js";import{Dt as _,E as v,Et as y,It as re,J as b,N as x,Ot as ie,P as S,Q as C,X as w,_ as T,ct as E,dt as D,f as O,ft as k,ht as A,l as j,lt as M,mt as ae,nt as N,rt as P,st as F,tt as I,y as L}from"./dist-DNwOaDhC.js";import{o as oe,r as R}from"./esm-HV7Pxfbn.js";import{i as z,n as B,o as V,r as H}from"./dist-CiPafPDy.js";import{n as se}from"./config-context-gd3BC-iY.js";import{o as ce,r as le}from"./selection-context-LHeRMlQS.js";import{c as ue,g as de,n as fe,r as pe,v as me,y as he}from"./typing-burst-detector-vTqYB3XL.js";import{l as ge}from"./lint-config-client-m2-s0Ntp.js";import{a as _e,i as U,n as W,o as G,r as K,t as q}from"./dist-C6PM6Xz4.js";import{n as ve,t as ye}from"./src-gwekitwz.js";var J=e(o(),1),be=c();function xe(e,t){return e.enabled?[q(),K(async n=>X(n.state.doc,await f(n.state.doc.toString(),e,t)),{delay:600})]:[]}function Y(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function X(e,t){let n=[];for(let r of t){let t=Y(e,r.range.start),i=Y(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=Z(r);o&&(a.actions=[o]),n.push(a)}return n}function Z(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:Y(n,e.range.start),to:Y(n,e.range.end),insert:e.newText}))})}}}var Se=[k(),E(),M(),T(),N(),P(),ie.allowMultipleSelections.of(!0),v(),x(O,{fallback:!0}),j(),H(),B(),A(),I(),F(),U(),D.of([...z,...R,...G,...L,...V,...W])],Q=b.mark({class:`cm-link-ref-broken`}),$=/^\s{0,3}\[([^\]]+)\]:\s/,Ce=/\[([^\]]*)\]\[([^\]]*)\]/g,we=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function Te(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function Ee(e){let t=[];return S(e).iterate({enter(e){if(we.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function De(e){let t=new Set,n=[],r=e.doc,i=Ee(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(Te(n.from,i))continue;let a=$.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!Te(t.from,i)&&!$.test(t.text))for(Ce.lastIndex=0;;){let e=Ce.exec(t.text);if(!e)break;let r=t.from+e.index;if(Te(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(Q.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),b.set(a)}var Oe=re.define({create(e){return De(e)},update(e,t){return t.docChanged?De(t.state):e},provide:e=>w.decorations.from(e)}),ke=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,Ae=b.mark({class:`cm-del`}),je=b.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),Me=b.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function Ne(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function Pe(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!g.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(g.test(r.text))return{from:t.from,to:r.to}}return null}function Fe(e,t){let n=[],r=S(e),i=Pe(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(Ae.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=ke.exec(r.text),a=i?i[1].length:2,o=b.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=Ne(r.text),a=b.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(je.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(Me.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(Me.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),b.set(n)}var Ie=class{decorations;constructor(e){this.decorations=Fe(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||S(e.startState)!==S(e.state))&&(this.decorations=Fe(e.view.state,e.view.visibleRanges))}},Le=C.fromClass(Ie,{decorations:e=>e.decorations});function Re(){return[Le,Oe]}var ze=t(),Be=56;function Ve(e,t){let n=e.state.doc,r=1;if(n.lines>=1&&g.test(n.line(1).text)){for(let e=2;e<=n.lines;e++)if(g.test(n.line(e).text)){r=e+1;break}}let i=m(),a=0;for(let o=r;o<=n.lines;o++){let r=n.line(o);if(!i(r.text)&&/^#{1,6}\s/.test(r.text)){if(a===t.index){e.dispatch({selection:_.cursor(r.from),effects:w.scrollIntoView(r.from,{y:`start`})}),e.focus();return}a++}}}function He(e,t){requestAnimationFrame(()=>{let n=e.state.doc,r=Math.min(t.offset,n.length);e.dispatch({selection:_.cursor(r),effects:w.scrollIntoView(r,{y:`center`})}),e.focus()})}function Ue(e,t){let n=e.state.doc,r=Math.min(Math.max(t.line,1),n.lines),i=n.line(r),a=Math.min(i.from+Math.max(0,t.column-1),i.to);e.dispatch({selection:_.cursor(a),effects:w.scrollIntoView(a,{y:`start`})}),e.focus()}function We(e){let t=(0,be.c)(49),{docName:o,ytext:c,provider:l,placeholder:f,isSourceModeActive:m}=e,g=(0,J.useRef)(null),_=(0,J.useRef)(null),[v,re]=(0,J.useState)(null);if(v)throw v;let{resolvedTheme:b}=s(),{merged:x}=se(),S=(0,J.useRef)(m),C=x?.editor?.wordWrap??!0,{data:T}=ge(o),E;t[0]!==T?.effective||t[1]!==x?(E=T?.effective??(x?.contentRules?h(x.contentRules):p),t[0]=T?.effective,t[1]=x,t[2]=E):E=t[2];let O=E,k;t[3]===O?k=t[4]:(k=JSON.stringify(O),t[3]=O,t[4]=k);let A=k,j,M;t[5]===m?(j=t[6],M=t[7]):(j=()=>{S.current=m},M=[m],t[5]=m,t[6]=j,t[7]=M),(0,J.useEffect)(j,M);let N=(0,J.useRef)(null),P;t[8]!==o||t[9]!==O||t[10]!==f||t[11]!==l||t[12]!==b||t[13]!==C||t[14]!==c?(P=()=>{let e=g.current;if(!e)return;let t=l.configuration.name??``,s,u=qe;try{s=a({docName:t,container:e,sizeStats:{viewCount:0,bytes:c.length},factory:e=>{let i=null,a=n({ydoc:l.document,ytext:c}),s=new y,d=new y,p=new y,m=new y,h=new w({state:ie.create({doc:c.toString(),extensions:[Se,_e({scrollToMatch:Ke}),D.of([oe]),ye(c,l.awareness),D.of(ve),...ee({themeCompartment:s,resolvedTheme:b,ydoc:l.document,wordWrapCompartment:d,wordWrap:C,currentDocName:t}),Re(),m.of(xe(O,o)),a,w.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(i!==null&&clearTimeout(i),i=setTimeout(()=>{i=null,fe(t,`source`,pe(e.view)),le(t,`source`,ce(e.view,t))},120))}),w.domEventHandlers({keydown:(e,t)=>!S.current||!te()||!ne(e,`edit-with-ai`)?!1:(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),r(),!0)}),p.of(ae(f??``)),w.theme({"&":{height:`100%`}}),w.scrollMargins.of(Ge)]}),parent:e});fe(t,`source`,pe(h)),le(t,`source`,ce(h,t));let g=h.contentDOM;return g.addEventListener(`keydown`,u),g.addEventListener(`paste`,u),g.addEventListener(`drop`,u),g.addEventListener(`cut`,u),{view:h,ydoc:l.document,ytext:c,provider:l,themeCompartment:s,wordWrapCompartment:d,placeholderCompartment:p,lintCompartment:m}}}),N.current=s,_.current=s.view}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),N.current=null,_.current=null,re(t instanceof Error?t:Error(String(t)))}return()=>{let e=N.current;e&&i(e),N.current=null,_.current=null}},t[8]=o,t[9]=O,t[10]=f,t[11]=l,t[12]=b,t[13]=C,t[14]=c,t[15]=P):P=t[15];let F;t[16]!==l||t[17]!==c?(F=[c,l],t[16]=l,t[17]=c,t[18]=F):F=t[18],(0,J.useEffect)(P,F);let I,L;t[19]===o?(I=t[20],L=t[21]):(I=()=>{},L=[o],t[19]=o,t[20]=I,t[21]=L),(0,J.useEffect)(I,L);let R,z;t[22]===b?(R=t[23],z=t[24]):(z=()=>{let e=N.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(b===`dark`?u:d)})},R=[b],t[22]=b,t[23]=R,t[24]=z),(0,J.useEffect)(z,R);let B,V;t[25]===C?(B=t[26],V=t[27]):(B=()=>{let e=N.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(C?w.lineWrapping:[])})},V=[C],t[25]=C,t[26]=B,t[27]=V),(0,J.useEffect)(B,V);let H,U;t[28]===f?(H=t[29],U=t[30]):(H=()=>{let e=N.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ae(f??``))})},U=[f],t[28]=f,t[29]=H,t[30]=U),(0,J.useEffect)(H,U);let W;t[31]!==o||t[32]!==O?(W=()=>{let e=N.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(xe(O,o))})},t[31]=o,t[32]=O,t[33]=W):W=t[33];let G;t[34]===A?G=t[35]:(G=[A],t[34]=A,t[35]=G),(0,J.useEffect)(W,G);let K,q;t[36]!==o||t[37]!==m?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`source`||!m)return;let n=_.current;n&&(Ve(n,t),me(o))};return window.addEventListener(de,e),()=>window.removeEventListener(de,e)},q=[o,m],t[36]=o,t[37]=m,t[38]=K,t[39]=q):(K=t[38],q=t[39]),(0,J.useEffect)(K,q);let Y,X;t[40]!==o||t[41]!==m?(Y=()=>{let e=function(e){let t=e.detail;if(!t||!m)return;let n=_.current;n&&(Ue(n,t),me(o))};return window.addEventListener(ue,e),()=>window.removeEventListener(ue,e)},X=[o,m],t[40]=o,t[41]=m,t[42]=Y,t[43]=X):(Y=t[42],X=t[43]),(0,J.useEffect)(Y,X);let Z,Q;t[44]!==o||t[45]!==m?(Z=()=>{if(!m)return;let e=_.current;if(!e)return;let t=he(o);if(t){if(t.kind===`outline`){Ve(e,t.detail);return}if(t.kind===`lint`){Ue(e,t.detail);return}He(e,t.detail)}},Q=[o,m],t[44]=o,t[45]=m,t[46]=Z,t[47]=Q):(Z=t[46],Q=t[47]),(0,J.useEffect)(Z,Q);let $;return t[48]===Symbol.for(`react.memo_cache_sentinel`)?($=(0,ze.jsx)(`div`,{ref:g,className:`source-editor h-full pb-3`}),t[48]=$):$=t[48],$}function Ge(){return{top:Be}}function Ke(e){return w.scrollIntoView(e,{y:`start`})}function qe(){return l()}export{We as SourceEditor};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{s as o}from"./createLucideIcon-DAkhoPjT.js";import{t as s}from"./button-Gol9BgNB.js";import{Bt as c,cn as l,
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{s as o}from"./createLucideIcon-DAkhoPjT.js";import{t as s}from"./button-Gol9BgNB.js";import{Bt as c,cn as l,ii as u,in as d,ni as f}from"./dist-D9TmfgYW.js";import{t as p}from"./x-DVkpYo5d.js";import{n as m}from"./dist-BLAMau9Z.js";import{d as h}from"./navigation-targets-BNXyYGqo.js";import{a as g,c as _,s as v}from"./doc-hash-By0RtZb7.js";import{t as y}from"./config-context-gd3BC-iY.js";import{f as b,m as x}from"./file-tree-adapter-NqeYDxT9.js";import{t as ee}from"./use-live-xterm-theme-DBloho-q.js";var S=a(),C=2,w=1,te=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(C,Math.floor(u/e.css.cell.width)),rows:Math.max(w,Math.floor(l/e.css.cell.height))}}},T=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],ne=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],E;function re(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var ie=class{constructor(){if(this.version=`6`,!E){E=new Uint8Array(65536),E.fill(1),E[0]=0,E.fill(0,1,32),E.fill(0,127,160),E.fill(2,4352,4448),E[9001]=2,E[9002]=2,E.fill(2,11904,42192),E[12351]=1,E.fill(2,44032,55204),E.fill(2,63744,64256),E.fill(2,65040,65050),E.fill(2,65072,65136),E.fill(2,65280,65377),E.fill(2,65504,65511);for(let e=0;e<T.length;++e)E.fill(0,T[e][0],T[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?E[e]:re(e,ne)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=$e.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return $e.createPropertyValue(0,n,r)}},ae=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?se.isErrorNoTelemetry(e)?new se(e.message+`
|
|
2
2
|
|
|
3
3
|
`+e.stack):Error(e.message+`
|
|
4
4
|
|
|
@@ -143,4 +143,4 @@ ${s.join(`
|
|
|
143
143
|
`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(H(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(R(()=>{Yp?this._debugRootContainer.remove():this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<Jp+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
144
144
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Jp+1&&(this._liveRegion.textContent+=io.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(!(!a||!o)){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};Xp=I([L(1,Mo),L(2,Vo),L(3,Uo)],Xp);var Zp=class extends z{constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new V),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new V),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(R(()=>{Ss(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(H(this._element,`mouseleave`,()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(H(this._element,`mousemove`,this._handleMouseMove.bind(this))),this._register(H(this._element,`mousedown`,this._handleMouseDown.bind(this))),this._register(H(this._element,`mouseup`,this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(e=>{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,t=>{if(this._isMouseOut)return;let i=t?.map(e=>({link:e}));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)(!this._activeProviderReplies.has(t)||this._activeProviderReplies.get(t))&&(i=!0);if(!i&&r){let e=r.find(e=>this._linkAtPosition(e.link,t));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find(e=>this._linkAtPosition(e.link,t));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&Qp(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Ss(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};Zp=I([L(1,Ho),L(2,Uo),L(3,Oo),L(4,qo)],Zp);function Qp(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var $p=class extends Rp{constructor(e={}){super(e),this._linkifier=this._register(new Es),this.browser=md,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Es),this._onCursorMove=this._register(new V),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new V),this.onKey=this._onKey.event,this._onRender=this._register(new V),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new V),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new V),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new V),this.onBell=this._onBell.event,this._onFocus=this._register(new V),this._onBlur=this._register(new V),this._onA11yCharEmitter=this._register(new V),this._onA11yTabEmitter=this._register(new V),this._onWillOpen=this._register(new V),this._setup(),this._decorationService=this._instantiationService.createInstance(Wp),this._instantiationService.setService(Lo,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ld),this._instantiationService.setService(qo,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Ro)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(Fs.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Fs.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Fs.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Fs.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(R(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=K.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${U.ESC}]${n};${Sp(r)}${Du.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors(e=>e.ansi[t.index]=G.toColor(...t.color));else{let n=e;this._themeService.modifyColors(e=>e[n]=G.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Xp,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this._register(H(this.element,`copy`,e=>{this.hasSelection()&&so(e,this._selectionService)}));let e=e=>co(e,this.textarea,this.coreService,this.optionsService);this._register(H(this.textarea,`paste`,e)),this._register(H(this.element,`paste`,e)),vd?this._register(H(this.element,`mousedown`,e=>{e.button===2&&fo(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(H(this.element,`contextmenu`,e=>{fo(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Ed&&this._register(H(this.element,`auxclick`,e=>{e.button===1&&uo(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(H(this.textarea,`keyup`,e=>this._keyUp(e),!0)),this._register(H(this.textarea,`keydown`,e=>this._keyDown(e),!0)),this._register(H(this.textarea,`keypress`,e=>this._keyPress(e),!0)),this._register(H(this.textarea,`compositionstart`,()=>this._compositionHelper.compositionstart())),this._register(H(this.textarea,`compositionupdate`,e=>this._compositionHelper.compositionupdate(e))),this._register(H(this.textarea,`compositionend`,()=>this._compositionHelper.compositionend())),this._register(H(this.textarea,`input`,e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._register(H(this.screenElement,`mousemove`,e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement(`textarea`);this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,no.get()),Dd||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange(`disableStdin`,()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(sd,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(Vo,this._coreBrowserService),this._register(H(this.textarea,`focus`,e=>this._handleTextAreaFocus(e))),this._register(H(this.textarea,`blur`,()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(rd,this._document,this._helperContainer),this._instantiationService.setService(Bo,this._charSizeService),this._themeService=this._instantiationService.createInstance(df),this._instantiationService.setService(Ko,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Ru),this._instantiationService.setService(Go,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Nd,this.rows,this.screenElement)),this._instantiationService.setService(Uo,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(Ou,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(fd),this._instantiationService.setService(Ho,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(Zp,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(yu,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(tf,this.element,this.screenElement,r)),this._instantiationService.setService(Wo,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(Fs.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(bu,this.screenElement)),this._register(H(this.element,`mousedown`,e=>this._selectionService.handleMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Xp,this)),this._register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Tu,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRuler`,e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Tu,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(nd,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=t.buttons&1?0:t.buttons&4?1:t.buttons&2?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&e._customWheelEventHandler(t)===!1)return!1;let n=t.deltaY;if(n===0||e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;i=n<0?0:1,r=4;break;default:return!1}return i===void 0||r===void 0||r>4?!1:e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this._register(this.coreMouseService.onProtocolChange(e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),e&8?r.mousemove||=(t.addEventListener(`mousemove`,i.mousemove),i.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),e&16?r.wheel||=(t.addEventListener(`wheel`,i.wheel,{passive:!1}),i.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),e&2?r.mouseup||=i.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),e&4?r.mousedrag||=i.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(H(t,`mousedown`,e=>{if(e.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(e)))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)})),this._register(H(t,`wheel`,t=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(t)===!1)return!1;if(!this.buffer.hasScrollback){if(t.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(t,!0);let n=U.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(t.deltaY<0?`A`:`B`);return this.coreService.triggerDataEvent(n,!0),this.cancel(t,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){lo(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key===`Dead`||e.key===`AltGraph`)&&(this._unprocessedDeadKey=!0);let n=Bp(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===U.ETX||n.key===U.CR)&&(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(em(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Z));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent(U.ESC+`[I`):this.coreService.triggerDataEvent(U.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${U.ESC}[4;${t};${e}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${U.ESC}[6;${r};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function em(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var tm=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},nm=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new xo)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},rm=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new nm(t)}getNullCell(){return new xo}},im=class extends z{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new V),this.onBufferChange=this._onBufferChange.event,this._normal=new rm(this._core.buffers.normal,`normal`),this._alternate=new rm(this._core.buffers.alt,`alternate`),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error(`Active buffer is neither normal nor alternate`)}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},am=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(e,n)=>t(e,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},om=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},sm=[`cols`,`rows`],cm=0,lm=class extends z{constructor(e){super(),this._core=this._register(new $p(e)),this._addonManager=this._register(new tm),this._publicOptions={...this._core.options};let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(sm.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error(`You must set the allowProposedApi option to true to use proposed API`)}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||=new am(this._core),this._parser}get unicode(){return this._checkProposedApi(),new om(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||=this._register(new im(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`;break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
145
145
|
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return no.get()},set promptLabel(e){no.set(e)},get tooMuchOutput(){return io.get()},set tooMuchOutput(e){io.set(e)}}}_verifyIntegers(...e){for(cm of e)if(cm===1/0||isNaN(cm)||cm%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(cm of e)if(cm&&(cm===1/0||isNaN(cm)||cm%1!=0||cm<0))throw Error(`This API only accepts positive integers`)}},um=e(n(),1),$=t(),dm=`https://docs.claude.com/en/docs/claude-code`;function fm(e){return e.claude===`not-found`?`claude-missing`:e.claude===`present`&&e.mcp===`needs-rewire`?`mcp-needs-rewire`:null}function pm(e){let t=(0,S.c)(29),{readiness:n,bridge:i,onDismiss:a}=e,{_:o}=r(),c;t[0]===n?c=t[1]:(c=fm(n),t[0]=n,t[1]=c);let l=c;if(l===null)return null;let u=l===`claude-missing`,d;t[2]!==o||t[3]!==u?(d=o(u?{id:`dNM58w`}:{id:`_bth6g`}),t[2]=o,t[3]=u,t[4]=d):d=t[4];let f=d,h;t[5]!==o||t[6]!==u?(h=o(u?{id:`E1tG2u`}:{id:`gfohmY`}),t[5]=o,t[6]=u,t[7]=h):h=t[7];let g=h,_;t[8]!==o||t[9]!==i.shell||t[10]!==i.terminal||t[11]!==u||t[12]!==a?(_=function(){if(u){i.shell.openExternal(dm);return}i.terminal.rewireClaudeMcp().then(e=>{if(e.rewireError!=null){m.error(o({id:`cn1sLi`}));return}a()}).catch(e=>{console.warn(`[terminal] rewireClaudeMcp failed:`,e),m.error(o({id:`cn1sLi`}))})},t[8]=o,t[9]=i.shell,t[10]=i.terminal,t[11]=u,t[12]=a,t[13]=_):_=t[13];let v=_,y;t[14]===f?y=t[15]:(y=(0,$.jsx)(`p`,{className:`min-w-0 flex-1`,children:f}),t[14]=f,t[15]=y);let b;t[16]!==g||t[17]!==v?(b=(0,$.jsx)(s,{size:`sm`,variant:`secondary`,className:`shrink-0`,onClick:v,children:g}),t[16]=g,t[17]=v,t[18]=b):b=t[18];let x;t[19]===o?x=t[20]:(x=o({id:`1QfxQT`}),t[19]=o,t[20]=x);let ee;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(p,{"aria-hidden":`true`,className:`size-4`}),t[21]=ee):ee=t[21];let C;t[22]!==a||t[23]!==x?(C=(0,$.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":x,className:`size-6 shrink-0`,onClick:a,children:ee}),t[22]=a,t[23]=x,t[24]=C):C=t[24];let w;return t[25]!==y||t[26]!==b||t[27]!==C?(w=(0,$.jsxs)(`div`,{role:`status`,"data-testid":`terminal-readiness-banner`,className:`flex shrink-0 items-center gap-3 border-border border-b bg-muted px-3 py-2 text-foreground text-xs`,children:[y,b,C]}),t[25]=y,t[26]=b,t[27]=C,t[28]=w):w=t[28],w}function mm(e){let t=(0,S.c)(25),{cli:n,bridge:i,onDismiss:a}=e,{_:o}=r(),{bin:l,displayName:u,docsUrl:d}=c[n],f;t[0]!==o||t[1]!==l||t[2]!==u?(f=o({id:`rSoi6g`,values:{displayName:u,bin:l}}),t[0]=o,t[1]=l,t[2]=u,t[3]=f):f=t[3];let m;t[4]===f?m=t[5]:(m=(0,$.jsx)(`p`,{className:`min-w-0 flex-1`,children:f}),t[4]=f,t[5]=m);let h;t[6]!==i.shell||t[7]!==d?(h=()=>void i.shell.openExternal(d),t[6]=i.shell,t[7]=d,t[8]=h):h=t[8];let g;t[9]!==o||t[10]!==u?(g=o({id:`F0OA00`,values:{displayName:u}}),t[9]=o,t[10]=u,t[11]=g):g=t[11];let _;t[12]!==h||t[13]!==g?(_=(0,$.jsx)(s,{size:`sm`,variant:`secondary`,className:`shrink-0`,onClick:h,children:g}),t[12]=h,t[13]=g,t[14]=_):_=t[14];let v;t[15]===o?v=t[16]:(v=o({id:`1QfxQT`}),t[15]=o,t[16]=v);let y;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(p,{"aria-hidden":`true`,className:`size-4`}),t[17]=y):y=t[17];let b;t[18]!==a||t[19]!==v?(b=(0,$.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":v,className:`size-6 shrink-0`,onClick:a,children:y}),t[18]=a,t[19]=v,t[20]=b):b=t[20];let x;return t[21]!==m||t[22]!==_||t[23]!==b?(x=(0,$.jsxs)(`div`,{role:`status`,className:`flex shrink-0 items-center gap-3 border-border border-b bg-muted px-3 py-2 text-foreground text-xs`,children:[m,_,b]}),t[21]=m,t[22]=_,t[23]=b,t[24]=x):x=t[24],x}function hm(e){let t=(0,S.c)(20),{info:n,onRestart:i}=e,{_:a}=r(),o;if(n.error!=null){let e;t[0]===a?e=t[1]:(e=a({id:`uL_Wx8`}),t[0]=a,t[1]=e),o=e}else if(n.signal!=null&&n.signal!==0){let e;t[2]!==a||t[3]!==n.signal?(e=a({id:`ubMwcO`,values:{0:n.signal}}),t[2]=a,t[3]=n.signal,t[4]=e):e=t[4],o=e}else if(n.exitCode!==0){let e;t[5]!==a||t[6]!==n.exitCode?(e=a({id:`q4YJl_`,values:{0:n.exitCode}}),t[5]=a,t[6]=n.exitCode,t[7]=e):e=t[7],o=e}else{let e;t[8]===a?e=t[9]:(e=a({id:`AE7BY3`}),t[8]=a,t[9]=e),o=e}let c;t[10]===o?c=t[11]:(c=(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:o}),t[10]=o,t[11]=c);let l;t[12]===a?l=t[13]:(l=a({id:`BQKHuL`}),t[12]=a,t[13]=l);let u;t[14]!==i||t[15]!==l?(u=(0,$.jsx)(s,{size:`sm`,variant:`outline`,className:`uppercase font-mono`,onClick:i,children:l}),t[14]=i,t[15]=l,t[16]=u):u=t[16];let d;return t[17]!==c||t[18]!==u?(d=(0,$.jsxs)(`div`,{role:`alert`,className:`absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 bg-background/90 dark:bg-transparent p-6 text-center`,children:[c,u]}),t[17]=c,t[18]=u,t[19]=d):d=t[19],d}function gm(e){let t=(0,S.c)(11),{reason:n,onClose:i}=e,{_:a}=r(),o;t[0]!==a||t[1]!==n?(o=a(n===`not-consented`?{id:`Khxcyu`}:{id:`fBHvBn`}),t[0]=a,t[1]=n,t[2]=o):o=t[2];let c=o,l;t[3]===c?l=t[4]:(l=(0,$.jsx)(`p`,{className:`max-w-sm text-sm`,children:c}),t[3]=c,t[4]=l);let u;t[5]!==a||t[6]!==i?(u=i?(0,$.jsx)(s,{size:`sm`,variant:`secondary`,onClick:i,children:a({id:`Iq8zdU`})}):null,t[5]=a,t[6]=i,t[7]=u):u=t[7];let d;return t[8]!==l||t[9]!==u?(d=(0,$.jsxs)(`div`,{role:`alert`,className:`absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 bg-background/90 p-6 text-center text-foreground`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10],d}function _m(e,t){let n=Om(e,t);return n===null?e.startsWith(`/`)?e===vm(t)?null:{kind:`external`,absPath:e}:null:{kind:`in-project`,relPath:n}}function vm(e){return e.replace(/\/+$/,``)}var ym=2e3,bm=/[^\s<>"'`|(){}[\]\0]+/g,xm=/:\d+(?::\d+)?$/,Sm=/^[a-z][a-z0-9+.-]*:\/\//i,Cm=/\.[A-Za-z0-9]+$/;function wm(e){return Cm.test(e)}function Tm(e,t=10){if(e.length===0||e.length>ym)return[];let n=[];for(let r of e.matchAll(bm)){if(n.length>=t)break;let e=r[0],i=r.index;if(Sm.test(e))continue;let a=e.replace(/[.,;:!?]+$/,``),o=a.match(xm);o&&(a=a.slice(0,o.index));let s=a.endsWith(`/`),c=s?a.slice(0,-1):a;if(!Dm(c))continue;let l=i+c.length;n.push({path:c,startIndex:i,endIndex:l,trailingSlash:s})}return n}function Em(e,t,n,r){let i=r>0?r:2**53-1,a=Math.max(e,t-1),o=e=>({x:e%i+1,y:n+Math.floor(e/i)});return{start:o(e),end:o(a)}}function Dm(e){return e.length<2||e.startsWith(`~`)?!1:e.includes(`/`)?!0:Cm.test(e)}function Om(e,t){if(!e||!t)return null;let n=vm(t),r;if(e.startsWith(`/`)){if(e===n)return null;let t=`${n}/`;if(!e.startsWith(t))return null;r=e.slice(t.length)}else r=e.startsWith(`./`)?e.slice(2):e;let i=[];for(let e of r.split(`/`))if(!(e===``||e===`.`)){if(e===`..`)return null;i.push(e)}return i.length===0?null:i.join(`/`)}function km(e,t,n){return t||n?.folderPaths.has(e)?`folder`:e.endsWith(`.md`)||e.endsWith(`.mdx`)||n?.pages.has(g(e))?`doc`:`asset`}function Am(e=300){let t=null;return(n,r)=>t!==null&&t.uri===n&&r-t.at<e?!0:(t={uri:n,at:r},!1)}function jm(e,t,n){return n?t?n.folderPaths.has(e):n.pages.has(g(e))||n.assetPaths?.has(e)||n.filePaths?.has(e)?!0:n.folderPaths.has(e):!1}var Mm=1e3;function Nm(e){let t=e.maxLinksPerLine??10,n=new Map,r=!1,i=!1;async function a(t,i){let a=`${t}:${i}`,o=n.get(a);if(o!==void 0)return o;let s=!1;try{s=await e.checkTargetExists(t,i)===`exists`}catch(e){s=!1,r||(r=!0,console.warn(`[terminal] checkTargetExists probe failed; file-path links suppressed:`,e))}return n.size>=Mm&&n.clear(),n.set(a,s),s}async function o(e,t,n){let r=km(e,t,n);return jm(e,t,n)?{kind:r,relPath:e}:r===`folder`?await a(`folder`,e)?{kind:r,relPath:e}:null:await a(`doc`,e)?{kind:r,relPath:e}:!wm(e)&&await a(`folder`,e)?{kind:`folder`,relPath:e}:null}return{provideLinks(n,r){let a=e.readLogicalLine(n);if(!a||a.text.length===0){r(void 0);return}let{text:s,startLine:c,cols:l}=a,u=Tm(s,t);if(u.length===0){r(void 0);return}let d=e.getSnapshot();Promise.all(u.map(async t=>{let n=_m(t.path,e.projectPath);if(n===null)return null;let r;if(n.kind===`external`)r={kind:`external`,absPath:n.absPath};else{let e=await o(n.relPath,t.trailingSlash,d);if(e===null)return null;r=e}return{text:t.path,range:Em(t.startIndex,t.endIndex,c,l),activate:()=>e.onActivate(r)}})).then(e=>{let t=e.filter(e=>e!==null);r(t.length>0?t:void 0)}).catch(e=>{i||(i=!0,console.warn(`[terminal] link provider failed to compute links:`,e)),r(void 0)})}}}function Pm(e,t=console.warn){let n=!1;return()=>{e.refresh(0,e.rows-1);let r=e._core?._renderService?._renderDebouncer;typeof r?._innerRefresh==`function`?r._innerRefresh():n||(n=!0,t(`[terminal] xterm render-debouncer internal not found; resize repaint deferring to the next frame. An xterm upgrade may have moved _core._renderService._renderDebouncer.`))}}var Fm={setTimer:(e,t)=>setTimeout(e,t),clearTimer:e=>clearTimeout(e)};function Im(e,t,n=Fm){let r=null,i=!1;function a(){r=n.setTimer(()=>{r=null,i&&(i=!1,e(),a())},t)}return{request(){if(r!==null){i=!0;return}e(),a()},cancel(){r!==null&&(n.clearTimer(r),r=null),i=!1}}}var Lm=1,Rm=2;function zm(e,t,n,r){let i=n+(t===Lm?e:t===Rm?e*r.viewportRows:e/r.cellHeight)*r.sensitivity,a=Math.trunc(i);return a===0?{count:0,button:65,accumulator:i}:{count:Math.min(Math.abs(a),r.maxRowsPerEvent),button:a<0?64:65,accumulator:i-a}}var Bm=9;function Vm(e,t,n){let r=n.cellWidth!==void 0&&n.cellWidth>0?n.cellWidth:void 0,i=(e,t)=>Math.min(Math.max(e,1),t);if(n.pixels){let a=Math.round((r??Bm)*n.cols),o=Math.round(n.cellHeight*n.rows);return{x:Hm(e)?i(Math.floor(e)+1,a):Math.ceil(a/2),y:Hm(t)?i(Math.floor(t)+1,o):Math.ceil(o/2)}}return{x:Hm(e)&&r!==void 0?i(Math.floor(e/r)+1,n.cols):Math.ceil(n.cols/2),y:Hm(t)?i(Math.floor(t/n.cellHeight)+1,n.rows):Math.ceil(n.rows/2)}}function Hm(e){return e!==void 0&&Number.isFinite(e)}function Um(e,t){return`\x1b[<${e};${t.x};${t.y}M`}var Wm=100;function Gm(e){let t=(0,S.c)(21),{bridge:n,className:a,onClose:s,onExit:c,onTitleChange:l,launch:u,adoptPtyId:d,onPtyId:f}=e,p=u===void 0?null:u,m=d===void 0?null:d,{_:h}=r(),{resolvedTheme:g}=i(),_=ee(g),[v,y]=(0,um.useState)(0),b=v===0?m:null,x;t[0]===h?x=t[1]:(x=h({id:`ALhMYW`}),t[0]=h,t[1]=x);let C;t[2]===_.background?C=t[3]:(C={backgroundColor:_.background},t[2]=_.background,t[3]=C);let w;t[4]===a?w=t[5]:(w=o(`relative flex h-full w-full flex-col overflow-hidden`,a),t[4]=a,t[5]=w);let te;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(te=()=>y(Km),t[6]=te):te=t[6];let T;t[7]!==b||t[8]!==n||t[9]!==p||t[10]!==s||t[11]!==c||t[12]!==f||t[13]!==l||t[14]!==v?(T=(0,$.jsx)(`div`,{className:`relative min-h-0 flex-1`,children:(0,$.jsx)(qm,{bridge:n,onClose:s,onExit:c,onTitleChange:l,onRestart:te,launch:p,adoptPtyId:b,onPtyId:f},v)}),t[7]=b,t[8]=n,t[9]=p,t[10]=s,t[11]=c,t[12]=f,t[13]=l,t[14]=v,t[15]=T):T=t[15];let ne;return t[16]!==x||t[17]!==C||t[18]!==w||t[19]!==T?(ne=(0,$.jsx)(`section`,{"aria-label":x,style:C,className:w,children:T}),t[16]=x,t[17]=C,t[18]=w,t[19]=T,t[20]=ne):ne=t[20],ne}function Km(e){return e+1}function qm(e){let t=(0,S.c)(51),{bridge:n,onClose:r,onExit:a,onTitleChange:o,onRestart:s,launch:c,adoptPtyId:p,onPtyId:m}=e,C=c===void 0?null:c,w=p===void 0?null:p,T=(0,um.useRef)(null),ne=(0,um.useRef)(a),E=(0,um.useRef)(o),re=(0,um.useRef)(m),{resolvedTheme:ie}=i(),ae=ee(ie),D=(0,um.useRef)(null),O=(0,um.useRef)(ae),[k,oe]=(0,um.useState)(`starting`),[se,ce]=(0,um.useState)(null),[le,ue]=(0,um.useState)(null),A=(0,um.useRef)(null),[de,fe]=(0,um.useState)(null),pe=(0,um.use)(y),me=(0,um.useRef)(pe?.userConfig?.agents?.autoApproveOkTools??!0),he;t[0]!==pe?.userConfig?.agents?.autoApproveOkTools||t[1]!==a||t[2]!==m||t[3]!==o?(he=()=>{ne.current=a,E.current=o,re.current=m,me.current=pe?.userConfig?.agents?.autoApproveOkTools??!0},t[0]=pe?.userConfig?.agents?.autoApproveOkTools,t[1]=a,t[2]=m,t[3]=o,t[4]=he):he=t[4],(0,um.useEffect)(he);let ge;t[5]!==w||t[6]!==n.accessibility||t[7]!==n.config||t[8]!==n.project||t[9]!==n.shell||t[10]!==n.terminal||t[11]!==C?(ge=()=>{let e=T.current;if(!e)return;let t=!1,r=null,i,a,o,s,c,f,p,m,y,b=n.config.e2eSmoke===!0||(n.accessibility?.isScreenReaderActive()??!0),x=Am(),ee=e=>{D.current?.modes.mouseTrackingMode===`none`&&(x(e,Date.now())||n.shell.openExternal(e))},S=new lm({screenReaderMode:b,minimumContrastRatio:4.5,allowProposedApi:!0,cursorBlink:!0,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, monospace`,fontSize:13,scrollback:1e4,smoothScrollDuration:125,scrollSensitivity:3,linkHandler:{activate:(e,t)=>ee(t)},theme:O.current});D.current=S;let ie=new te;if(S.loadAddon(ie),S.loadAddon(new st),S.unicode.activeVersion=`11`,S.loadAddon(new pt((e,t)=>ee(t))),S.open(e),f=S.registerLinkProvider(Nm({projectPath:n.config.projectPath,readLogicalLine:e=>{let t=S.buffer.active,n=e-1;if(!t.getLine(n))return;let r=n;for(;r>0&&t.getLine(r)?.isWrapped;)r--;let i=n;for(;t.getLine(i+1)?.isWrapped;)i++;let a=``;for(let e=r;e<=i;e++)a+=t.getLine(e)?.translateToString(!1)??``;return{text:a,startLine:r+1,cols:S.cols}},getSnapshot:h,checkTargetExists:(e,t)=>n.project.checkTargetExists({projectPath:n.config.projectPath,kind:e,path:t}),onActivate:e=>{switch(e.kind){case`doc`:window.location.hash=v(g(e.relPath));return;case`folder`:window.location.hash=_(e.relPath);return;case`external`:n.shell.revealExternal(e.absPath).catch(th);return;case`asset`:n.shell.openAsset(e.relPath).then(t=>{if(!t.ok){if(t.reason===`extension-blocked`){n.shell.revealAsset(e.relPath).catch(eh);return}console.warn(`[terminal] openAsset refused:`,t.reason)}}).catch($m);return;default:return e}}})),n.config.e2eSmoke!==!0)try{let e=new Za;e.onContextLoss(()=>{console.warn(`[terminal] WebGL context lost, falling back to DOM renderer`),e.dispose()}),S.loadAddon(e)}catch(e){let t=e;(t instanceof Error&&/webgl2?|context/i.test(t.message)?console.warn:console.error)(`[terminal] WebGL addon failed, using DOM renderer:`,t)}ie.fit();let ae=Pm(S),k=e.querySelector(`.xterm-screen canvas`);if(k!==null){m=new ResizeObserver(()=>ae());try{m.observe(k,{box:`device-pixel-content-box`})}catch(e){console.warn(`[terminal] device-pixel canvas observe failed:`,e),m.disconnect(),m=void 0}}c=S.onTitleChange(e=>{t||E.current?.(e)}),S.attachCustomKeyEventHandler(e=>{if(e.type!==`keydown`||!e.shiftKey)return!0;if(e.key===`Tab`)return e.preventDefault(),!0;if(e.key===`Enter`){let t=A.current;return t===null?!0:(e.preventDefault(),n.terminal.input(t,`
|
|
146
|
-
`),!1)}return!0});let se=0,le=!1;S.attachCustomWheelEventHandler(e=>{let t=S._core,r=t?.coreMouseService?.activeEncoding;if(!(S.modes.mouseTrackingMode!==`none`&&(r===`SGR`||r===`SGR_PIXELS`)))return se=0,!0;let i=A.current;if(i===null||e.deltaY===0)return!0;let a=t?._renderService?.dimensions?.css?.cell?.height;a===void 0&&!le&&(le=!0,console.warn(`[terminal] xterm cell-height internal not found; wheel scroll using fallback. An xterm upgrade may have moved _core._renderService.dimensions.css.cell.height.`));let o=a??17,{count:s,button:c,accumulator:l}=zm(e.deltaY,e.deltaMode,se,{cellHeight:o,sensitivity:1.5,maxRowsPerEvent:20,viewportRows:S.rows});if(se=l,s>0){let a=(S.element?.querySelector(`.xterm-screen`)??S.element)?.getBoundingClientRect(),l=Vm(a===void 0?void 0:e.clientX-a.left,a===void 0?void 0:e.clientY-a.top,{cellWidth:t?._renderService?.dimensions?.css?.cell?.width,cellHeight:o,cols:S.cols,rows:S.rows,pixels:r===`SGR_PIXELS`});n.terminal.input(i,Um(c,l).repeat(s))}return!1});let de=s=>{r=s,A.current=s,re.current?.(s),oe(`running`),S.onData(e=>{r&&n.terminal.input(r,e)}),i=n.terminal.onData(e=>{e.ptyId===r&&(S.write(e.data,()=>n.terminal.drain(e.ptyId,e.data.length)),o?.(e.data))}),a=n.terminal.onExit(e=>{e.ptyId===r&&(ue({exitCode:e.exitCode,signal:e.signal,error:e.error}),oe(`exited`),ne.current?.({exitCode:e.exitCode,signal:e.signal}))}),y=Im(()=>{r&&n.terminal.resize(r,S.cols,S.rows)},Wm),p=new ResizeObserver(()=>{let e=S.cols,t=S.rows;ie.fit(),(S.cols!==e||S.rows!==t)&&ae(),y?.request()}),p.observe(e),S.focus(),C!==null&&w===null||n.terminal.claudePreflight().then(e=>{t||ce(e)}).catch(Qm)},pe=async e=>{if(e.cli===`claude`){try{let r=await n.terminal.claudePreflight();if(r.claude===`present`)return t||ce(r),
|
|
146
|
+
`),!1)}return!0});let se=0,le=!1;S.attachCustomWheelEventHandler(e=>{let t=S._core,r=t?.coreMouseService?.activeEncoding;if(!(S.modes.mouseTrackingMode!==`none`&&(r===`SGR`||r===`SGR_PIXELS`)))return se=0,!0;let i=A.current;if(i===null||e.deltaY===0)return!0;let a=t?._renderService?.dimensions?.css?.cell?.height;a===void 0&&!le&&(le=!0,console.warn(`[terminal] xterm cell-height internal not found; wheel scroll using fallback. An xterm upgrade may have moved _core._renderService.dimensions.css.cell.height.`));let o=a??17,{count:s,button:c,accumulator:l}=zm(e.deltaY,e.deltaMode,se,{cellHeight:o,sensitivity:1.5,maxRowsPerEvent:20,viewportRows:S.rows});if(se=l,s>0){let a=(S.element?.querySelector(`.xterm-screen`)??S.element)?.getBoundingClientRect(),l=Vm(a===void 0?void 0:e.clientX-a.left,a===void 0?void 0:e.clientY-a.top,{cellWidth:t?._renderService?.dimensions?.css?.cell?.width,cellHeight:o,cols:S.cols,rows:S.rows,pixels:r===`SGR_PIXELS`});n.terminal.input(i,Um(c,l).repeat(s))}return!1});let de=s=>{r=s,A.current=s,re.current?.(s),oe(`running`),S.onData(e=>{r&&n.terminal.input(r,e)}),i=n.terminal.onData(e=>{e.ptyId===r&&(S.write(e.data,()=>n.terminal.drain(e.ptyId,e.data.length)),o?.(e.data))}),a=n.terminal.onExit(e=>{e.ptyId===r&&(ue({exitCode:e.exitCode,signal:e.signal,error:e.error}),oe(`exited`),ne.current?.({exitCode:e.exitCode,signal:e.signal}))}),y=Im(()=>{r&&n.terminal.resize(r,S.cols,S.rows)},Wm),p=new ResizeObserver(()=>{let e=S.cols,t=S.rows;ie.fit(),(S.cols!==e||S.rows!==t)&&ae(),y?.request()}),p.observe(e),S.focus(),C!==null&&w===null||n.terminal.claudePreflight().then(e=>{t||ce(e)}).catch(Qm)},pe=async e=>{if(e.cli===`claude`){try{let r=await n.terminal.claudePreflight();if(r.claude===`present`)return t||ce(r),d(`claude`,e.prompt,{mcpPreApprove:r.mcpPreApprovable===!0,autoApproveOkTools:me.current&&r.mcpPreApprovable===!0});t||ce(r.claude===`not-found`?r:{claude:`not-found`,mcp:r.mcp,mcpPreApprovable:!1})}catch(e){console.warn(`[terminal] claude launch preflight failed`,e),t||ce({claude:`not-found`,mcp:`needs-rewire`,mcpPreApprovable:!1})}return}try{let r=await n.terminal.cliPreflight(e.cli);if(r.onPath===`unknown`){if(t)return;r=await n.terminal.cliPreflight(e.cli)}if(r.onPath===`present`)return d(e.cli,e.prompt,{autoApproveOkTools:e.cli===`codex`&&r.okServerConfigured===!0&&me.current})}catch(t){let n=t;console.warn(`[terminal] cliPreflight failed`,{cli:e.cli,err:n})}t||fe(e.cli)},he;return(async()=>{if(w!==null){let e;try{e=await n.terminal.adopt(w)}catch(t){console.error(`[terminal] adopt() failed:`,t),e={ok:!1,reason:`unknown-session`}}if(t)return;if(e.ok){e.replay&&S.write(e.replay),de(w),n.terminal.resize(w,S.cols,S.rows);return}}let e;if(C!==null&&w===null&&(e=await pe(C),t))return;let r;try{r=await n.terminal.create({cols:S.cols,rows:S.rows,launchCommand:e})}catch(e){let n=e;if(console.error(`[terminal] create() failed:`,n),t)return;ue({exitCode:1,signal:null,error:n instanceof Error?n.message:String(n)}),oe(`exited`);return}if(t){r.ok&&n.terminal.kill(r.ptyId).catch(Zm);return}if(!r.ok){oe(r.reason===`not-consented`?`not-consented`:`no-project`);return}de(r.ptyId);let i=C?.stagePaste,a=C!=null&&e!==void 0&&C.prompt!=null?l(C.cli,C.prompt):null;if(a!=null&&C!=null){let e=u(C.cli),r=e?.settleMs??500,i=e?.readyMarker,c=a,l=!1,d=()=>{l||(l=!0,o=void 0,he!==void 0&&clearTimeout(he),s!==void 0&&clearTimeout(s),!(t||A.current===null)&&(n.terminal.input(A.current,c),S.focus()))};if(s=setTimeout(d,e?.capMs??r),i!=null){let e=``;o=t=>{if(!(l||he!==void 0)){if(e+=t,e.includes(i)){o=void 0,he=setTimeout(d,r);return}e.length>i.length+256&&(e=e.slice(-(i.length+256)))}}}else he=setTimeout(d,r)}else C!=null&&C.prompt!=null&&i!=null?console.warn(`[terminal] TerminalLaunchIntent carried both prompt and stagePaste; dropping stagePaste`):e!==void 0&&i!=null&&i!==``&&(he=setTimeout(()=>{t||A.current===null||(n.terminal.input(A.current,i),S.focus())},500))})(),()=>{t=!0,he!==void 0&&clearTimeout(he),s!==void 0&&clearTimeout(s),o=void 0,A.current=null,re.current?.(null),D.current=null,p?.disconnect(),m?.disconnect(),y?.cancel(),i?.(),a?.(),c?.dispose(),f?.dispose(),S.dispose(),r&&n.terminal.kill(r).catch(Xm)}},t[5]=w,t[6]=n.accessibility,t[7]=n.config,t[8]=n.project,t[9]=n.shell,t[10]=n.terminal,t[11]=C,t[12]=ge):ge=t[12];let _e;t[13]!==w||t[14]!==n||t[15]!==C?(_e=[n,w,C],t[13]=w,t[14]=n,t[15]=C,t[16]=_e):_e=t[16],(0,um.useEffect)(ge,_e);let ve,ye;t[17]===ae?(ve=t[18],ye=t[19]):(ve=()=>{let e=D.current;e!==null&&(e.options.theme=ae)},ye=[ae],t[17]=ae,t[18]=ve,t[19]=ye),(0,um.useEffect)(ve,ye);let be;t[20]!==n.accessibility||t[21]!==n.config?(be=()=>{let e=n.accessibility;if(!(e==null||n.config.e2eSmoke===!0))return e.onScreenReaderChanged(e=>{let t=D.current;t!==null&&(t.options.screenReaderMode=e)})},t[20]=n.accessibility,t[21]=n.config,t[22]=be):be=t[22];let xe;t[23]===n?xe=t[24]:(xe=[n],t[23]=n,t[24]=xe),(0,um.useEffect)(be,xe);let Se,Ce;t[25]===n?(Se=t[26],Ce=t[27]):(Se=()=>{let e=T.current;if(e===null)return;let t=function(e){x(e)&&e.preventDefault()},r=function(e){if(!x(e))return;e.preventDefault();let t=A.current;if(t===null)return;let r=b(e).map(e=>n.getPathForFile(e)).filter(Jm);r.length!==0&&n.terminal.input(t,`${r.map(f).join(` `)} `)};return e.addEventListener(`dragover`,t,{capture:!0}),e.addEventListener(`drop`,r,{capture:!0}),()=>{e.removeEventListener(`dragover`,t,{capture:!0}),e.removeEventListener(`drop`,r,{capture:!0})}},Ce=[n],t[25]=n,t[26]=Se,t[27]=Ce),(0,um.useEffect)(Se,Ce);let we;t[28]!==n||t[29]!==se||t[30]!==k?(we=k===`running`&&se?(0,$.jsx)(pm,{readiness:se,bridge:n,onDismiss:()=>ce(null)}):null,t[28]=n,t[29]=se,t[30]=k,t[31]=we):we=t[31];let Te;t[32]!==n||t[33]!==de||t[34]!==k?(Te=k===`running`&&de?(0,$.jsx)(mm,{cli:de,bridge:n,onDismiss:()=>fe(null)}):null,t[32]=n,t[33]=de,t[34]=k,t[35]=Te):Te=t[35];let Ee;t[36]===k?Ee=t[37]:(Ee=(0,$.jsx)(`div`,{ref:T,"data-terminal-status":k,className:`min-h-0 flex-1 px-1.5`}),t[36]=k,t[37]=Ee);let De;t[38]!==le||t[39]!==s||t[40]!==k?(De=k===`exited`&&le?(0,$.jsx)(hm,{info:le,onRestart:s}):null,t[38]=le,t[39]=s,t[40]=k,t[41]=De):De=t[41];let Oe;t[42]!==r||t[43]!==k?(Oe=k===`no-project`||k===`not-consented`?(0,$.jsx)(gm,{reason:k,onClose:r}):null,t[42]=r,t[43]=k,t[44]=Oe):Oe=t[44];let ke;return t[45]!==we||t[46]!==Te||t[47]!==Ee||t[48]!==De||t[49]!==Oe?(ke=(0,$.jsxs)(`div`,{className:`flex h-full w-full flex-col`,children:[we,Te,Ee,De,Oe]}),t[45]=we,t[46]=Te,t[47]=Ee,t[48]=De,t[49]=Oe,t[50]=ke):ke=t[50],ke}function Jm(e){return e!==null&&e!==``&&!Array.from(e).some(Ym)}function Ym(e){return e.charCodeAt(0)<32}function Xm(e){return console.warn(`[terminal] kill on unmount failed:`,e)}function Zm(e){return console.warn(`[terminal] kill after cancelled mount failed:`,e)}function Qm(e){console.warn(`[terminal] claude readiness preflight failed`,e)}function $m(e){return console.warn(`[terminal] openAsset failed:`,e)}function eh(e){return console.warn(`[terminal] revealAsset failed:`,e)}function th(e){return console.warn(`[terminal] revealExternal failed:`,e)}export{Gm as TerminalPanel};
|