@marimo-team/frontend 0.15.5 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-Cn5-l2X1.js → ConnectedDataExplorerComponent-BErMbWvG.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-CEXMKKA4.js → ImageComparisonComponent-fTHv1Ih0.js} +1 -1
- package/dist/assets/{VegaLite-Bt14Ds9k.js → VegaLite-Bdi-TyfY.js} +6 -6
- package/dist/assets/_baseEach-CNBxBxvS.js +1 -0
- package/dist/assets/_baseMap-D1WHjKrd.js +1 -0
- package/dist/assets/_baseUniq-CCgDNtZb.js +1 -0
- package/dist/assets/_createAggregator-DcD0kTA5.js +1 -0
- package/dist/assets/agent-panel-Crv430aI.js +268 -0
- package/dist/assets/agent-panel-D92Mfy1i.css +1 -0
- package/dist/assets/{any-language-editor-DiwNT6zp.js → any-language-editor-CQh552Wu.js} +1 -1
- package/dist/assets/architectureDiagram-W76B3OCA-BAJeBxzt.js +36 -0
- package/dist/assets/{between-horizontal-start-FyewyCGn.js → between-horizontal-start-Boxgxbt_.js} +1 -1
- package/dist/assets/{blockDiagram-QIGZ2CNN-BrOkAf_c.js → blockDiagram-QIGZ2CNN-CL-1svEK.js} +1 -1
- package/dist/assets/{c4Diagram-FPNF74CW-BHPzDxE2.js → c4Diagram-FPNF74CW-BbEqbCTl.js} +5 -5
- package/dist/assets/channel-_2eNSz0n.js +1 -0
- package/dist/assets/chat-panel-CXh5Wl6C.js +3 -0
- package/dist/assets/{chunk-4BX2VUAB-DLxaCNYh.js → chunk-4BX2VUAB-C--8TXeE.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-DdzvO3HR.js → chunk-55IACEB6-Bj00HDqq.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-R5o-nSiG.js → chunk-FMBD7UC4-C-lhB6hN.js} +1 -1
- package/dist/assets/{chunk-K7UQS3LO-DxaMrGgG.js → chunk-K7UQS3LO-B-pGTXPt.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-DqS9-FYm.js → chunk-QN33PNHL-DqUzGhvm.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-BZ-TzajS.js → chunk-QZHKN3VN-TntJHfSk.js} +1 -1
- package/dist/assets/{chunk-TVAH2DTR-BsgP2dyv.js → chunk-TVAH2DTR-HUJb1psV.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-D-h3ahXI.js → chunk-TZMSLE5B-BK3C__t3.js} +1 -1
- package/dist/assets/{circle-play-CQtRZ-rT.js → circle-play-DBLOv1Yu.js} +1 -1
- package/dist/assets/classDiagram-KNZD7YFC-BGmh9POF.js +1 -0
- package/dist/assets/classDiagram-v2-RKCZMP56-BGmh9POF.js +1 -0
- package/dist/assets/{clear-button-BY6Z_ViL.js → clear-button-BeoFbEKH.js} +1 -1
- package/dist/assets/clone-BFDSPAj3.js +1 -0
- package/dist/assets/command-palette-CXZiSv0I.js +1 -0
- package/dist/assets/common-C7oJcmCT.js +1 -0
- package/dist/assets/{compile-Ct_jzdKr.js → compile-7L0MwhyI.js} +1 -1
- package/dist/assets/cose-bilkent-S5V4N54A-BMkGLcVC.js +1 -0
- package/dist/assets/dagre-5GWH7T2D-BJtRienS.js +4 -0
- package/dist/assets/{data-grid-overlay-editor-BN_wulc3.js → data-grid-overlay-editor-DBkmGtNs.js} +1 -1
- package/dist/assets/datasources-panel-B7FbYLiy.js +1 -0
- package/dist/assets/{dependency-graph-panel-BOmSCZf7.js → dependency-graph-panel-DEdOxp2X.js} +4 -4
- package/dist/assets/diagram-N5W7TBWH-CmECY3nb.js +24 -0
- package/dist/assets/diagram-QEK2KX5R-DMOVSNKD.js +43 -0
- package/dist/assets/diagram-S2PKOQOG-BiJ96PNQ.js +24 -0
- package/dist/assets/{documentation-panel-BxjJO_Gw.js → documentation-panel-xULhaEv3.js} +1 -1
- package/dist/assets/edit-page-BrYda9VE.js +129 -0
- package/dist/assets/{ellipsis-vertical-UHbmjI2n.js → ellipsis-vertical-BBqXIlc2.js} +1 -1
- package/dist/assets/{empty-state-BIBXzY_0.js → empty-state-B3dA3G5P.js} +1 -1
- package/dist/assets/{erDiagram-AWTI2OKA-E84mAle_.js → erDiagram-AWTI2OKA-MP1DiFRo.js} +1 -1
- package/dist/assets/{error-panel-MEvQ6K7h.js → error-panel-Cc1sv-Ag.js} +1 -1
- package/dist/assets/file-explorer-panel-Bw59Kva1.js +1 -0
- package/dist/assets/{flowDiagram-PVAE7QVJ-DfbIRSAW.js → flowDiagram-PVAE7QVJ-BX7caPp7.js} +1 -1
- package/dist/assets/{ganttDiagram-OWAHRB6G-DR4HZ1z_.js → ganttDiagram-OWAHRB6G-B462g4Yf.js} +3 -3
- package/dist/assets/gitGraphDiagram-NY62KEGX-CGgvZ9-9.js +65 -0
- package/dist/assets/{glide-data-editor-nNmo1lPq.js → glide-data-editor-C0gUFZON.js} +4 -4
- package/dist/assets/graph-CHRVBzY5.js +1 -0
- package/dist/assets/{home-page-9eW6qida.js → home-page-Fb2osjys.js} +3 -3
- package/dist/assets/{index-DMomwMcN.js → index-BVgAenPd.js} +1 -1
- package/dist/assets/{index-B8llrTSo.js → index-BY93Ejhl.js} +1 -1
- package/dist/assets/{index-BFSnz7iM.js → index-C-8WADat.js} +1 -1
- package/dist/assets/{index-CPN7TRA1.js → index-C-GhZ7ti.js} +1 -1
- package/dist/assets/{index-DyLSuOH1.js → index-C1v_Z9et.js} +1 -1
- package/dist/assets/{index-VPWqq2Pg.js → index-C4Tn5NvJ.js} +1 -1
- package/dist/assets/{index-BAH034Ue.js → index-C77h_TXN.js} +1 -1
- package/dist/assets/{index-Dt9UWeWn.js → index-CQDrxQ0j.js} +1 -1
- package/dist/assets/{index-DWOaniGT.js → index-CWMgowgL.js} +1 -1
- package/dist/assets/{index-B1_GXGaP.js → index-Clbi_Yaq.js} +1 -1
- package/dist/assets/{index-B7yXbrLa.js → index-CpTPJo4k.js} +1 -1
- package/dist/assets/{index-CknhX2Vy.css → index-Cx0bsY1w.css} +1 -1
- package/dist/assets/{index-DqzMPAC8.js → index-D1vmG6DS.js} +2 -2
- package/dist/assets/{index-c6If577Q.js → index-D9UKkrr2.js} +1 -1
- package/dist/assets/{index-CB2pnVQG.js → index-DEQvTChO.js} +1 -1
- package/dist/assets/{index-OC46250R.js → index-DKEudB02.js} +205 -197
- package/dist/assets/{index-CSgxTUzD.js → index-DRMm6SNo.js} +1 -1
- package/dist/assets/{index-Bq516OmX.js → index-DoRmcrKM.js} +1 -1
- package/dist/assets/{index-DSU75csX.js → index-lYa_leQE.js} +1 -1
- package/dist/assets/{index-BLu5CX6z.js → index-vmICa5KN.js} +1 -1
- package/dist/assets/{index-uacyUula.js → index-z9bohSQJ.js} +1 -1
- package/dist/assets/infoDiagram-STP46IZ2-CVyrdLc8.js +2 -0
- package/dist/assets/isEmpty-DU_ogP_D.js +1 -0
- package/dist/assets/{journeyDiagram-BIP6EPQ6-BBiFyygf.js → journeyDiagram-BIP6EPQ6-C6EgLP_Q.js} +1 -1
- package/dist/assets/{kanban-definition-6OIFK2YF-DhgA6Nt6.js → kanban-definition-6OIFK2YF-BXzYO1yj.js} +4 -4
- package/dist/assets/layout-jihVw5-i.js +1 -0
- package/dist/assets/linear-C4blANlC.js +1 -0
- package/dist/assets/{links-CbvGxbsJ.js → links-D59GIweI.js} +3 -3
- package/dist/assets/{logs-panel-B9SmTZAW.js → logs-panel-D401qzZh.js} +1 -1
- package/dist/assets/markdown-renderer-Cd9eYyaL.js +263 -0
- package/dist/assets/{agent-panel-DpQ6muj-.css → markdown-renderer-ClyzDMmG.css} +1 -1
- package/dist/assets/mermaid-BEVuRz_O.js +1 -0
- package/dist/assets/{mermaid.core-4nVOEVX3.js → mermaid.core-CaSnaLH0.js} +41 -41
- package/dist/assets/min-DUMu_zeK.js +1 -0
- package/dist/assets/{mindmap-definition-Q6HEUPPD-CVLQNn1q.js → mindmap-definition-Q6HEUPPD-BXUM5MT2.js} +2 -2
- package/dist/assets/{number-overlay-editor-CzRzXLcd.js → number-overlay-editor-4uWXGlPG.js} +1 -1
- package/dist/assets/{outline-panel-uvsS-YEQ.js → outline-panel-DIzkvm2I.js} +1 -1
- package/dist/assets/packages-panel-CJL0MVlj.js +1 -0
- package/dist/assets/{pieDiagram-ADFJNKIX-C5IQ5DBZ.js → pieDiagram-ADFJNKIX-Dxt5PVNo.js} +3 -3
- package/dist/assets/{quadrantDiagram-LMRXKWRM-CFXFnQxx.js → quadrantDiagram-LMRXKWRM-D4pUaA31.js} +1 -1
- package/dist/assets/{react-plotly-mzdv02_Y.js → react-plotly-cJZ0VWBq.js} +1 -1
- package/dist/assets/{requirementDiagram-4UW4RH46-D9bPC89T.js → requirementDiagram-4UW4RH46-DVRTjgas.js} +1 -1
- package/dist/assets/run-page-BUEnMC9w.js +1 -0
- package/dist/assets/sankeyDiagram-GR3RE2ED-CVFnD9C-.js +10 -0
- package/dist/assets/scratchpad-panel-BIgRENkI.js +1 -0
- package/dist/assets/secrets-panel-xY5-V_BD.js +1 -0
- package/dist/assets/{sequenceDiagram-C3RYC4MD-6N7_hY4k.js → sequenceDiagram-C3RYC4MD-_lY4ZN_S.js} +4 -4
- package/dist/assets/{slides-component-EcjC8sDK.js → slides-component-Xjymwj7X.js} +1 -1
- package/dist/assets/snippets-panel-CTPYW41n.js +1 -0
- package/dist/assets/sortBy-BNZKwiq_.js +1 -0
- package/dist/assets/state-C4NiC9tO.js +1 -0
- package/dist/assets/stateDiagram-KXAO66HF-Da0JQWCn.js +1 -0
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-D5lYZOOt.js +1 -0
- package/dist/assets/storage-CMdLzB_c.js +26 -0
- package/dist/assets/terminal-BPwTkXae.js +10 -0
- package/dist/assets/time-Dv5_Ouz_.js +1 -0
- package/dist/assets/{timeline-definition-XQNQX7LJ-BEaynAiY.js → timeline-definition-XQNQX7LJ-Dxh5Zu2e.js} +1 -1
- package/dist/assets/tracing-BCIurUfa.js +2 -0
- package/dist/assets/{tracing-panel-BmuHLPrY.js → tracing-panel-DAzrzNmm.js} +2 -2
- package/dist/assets/{trash-UBqfK4mR.js → trash-Dc6DSjz_.js} +1 -1
- package/dist/assets/{tree-XiEycetl.js → tree-jheoerAX.js} +1 -1
- package/dist/assets/{treemap-75Q7IDZK-CnuVFbBG.js → treemap-75Q7IDZK-IgpxeGaf.js} +21 -21
- package/dist/assets/{ts-tags-CloPe9IY.js → ts-tags-DxCDHihD.js} +1 -1
- package/dist/assets/variable-panel-DYAiLBmF.js +1 -0
- package/dist/assets/{vega-component-DsTH4tuX.js → vega-component-BpfpiPKI.js} +1 -1
- package/dist/assets/{xychartDiagram-6GGTOJPD-Dcz3O-A3.js → xychartDiagram-6GGTOJPD-CmNigJ31.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +8 -4
- package/src/__tests__/mocks.ts +43 -0
- package/src/components/app-config/user-config-form.tsx +32 -0
- package/src/components/chat/acp/__tests__/__snapshots__/prompt.test.ts.snap +55 -23
- package/src/components/chat/acp/__tests__/context-utils.test.ts +222 -0
- package/src/components/chat/acp/__tests__/prompt.test.ts +1 -1
- package/src/components/chat/acp/__tests__/state.test.ts +2 -6
- package/src/components/chat/acp/agent-docs.tsx +33 -6
- package/src/components/chat/acp/agent-panel.css +0 -18
- package/src/components/chat/acp/agent-panel.tsx +397 -72
- package/src/components/chat/acp/agent-selector.tsx +7 -1
- package/src/components/chat/acp/blocks.tsx +40 -10
- package/src/components/chat/acp/common.tsx +10 -2
- package/src/components/chat/acp/context-utils.ts +127 -0
- package/src/components/chat/acp/prompt.ts +34 -10
- package/src/components/chat/acp/state.ts +1 -1
- package/src/components/chat/acp/types.ts +8 -0
- package/src/components/chat/chat-panel.tsx +23 -88
- package/src/components/chat/chat-utils.ts +127 -1
- package/src/components/chat/markdown-renderer.css +39 -0
- package/src/components/chat/markdown-renderer.tsx +7 -38
- package/src/components/chat/tool-call-accordion.tsx +113 -23
- package/src/components/editor/Cell.tsx +6 -0
- package/src/components/editor/actions/name-cell-input.tsx +6 -1
- package/src/components/editor/actions/useCellActionButton.tsx +3 -1
- package/src/components/editor/ai/__tests__/completion-utils.test.ts +178 -1
- package/src/components/editor/ai/add-cell-with-ai.tsx +68 -66
- package/src/components/editor/ai/ai-completion-editor.tsx +29 -26
- package/src/components/editor/ai/completion-handlers.tsx +44 -6
- package/src/components/editor/ai/completion-utils.ts +92 -0
- package/src/components/editor/ai/transport/chat-transport.tsx +36 -0
- package/src/components/editor/cell/StagedAICell.tsx +51 -0
- package/src/components/editor/cell/cell-actions.tsx +2 -1
- package/src/components/terminal/__tests__/state.test.ts +207 -0
- package/src/components/terminal/hooks.ts +41 -0
- package/src/components/terminal/state.ts +75 -0
- package/src/components/terminal/terminal.tsx +334 -13
- package/src/components/terminal/theme.tsx +56 -0
- package/src/core/ai/__tests__/staged-cells.test.ts +356 -0
- package/src/core/ai/staged-cells.ts +208 -0
- package/src/core/cells/cells.ts +1 -1
- package/src/core/codemirror/lsp/federated-lsp.ts +1 -1
- package/src/core/islands/main.ts +2 -2
- package/src/core/kernel/messages.ts +8 -12
- package/src/core/saving/__tests__/filename.test.ts +37 -0
- package/src/core/static/__tests__/download-html.test.ts +43 -1
- package/src/core/websocket/useMarimoWebSocket.tsx +2 -2
- package/src/css/app/Cell.css +11 -0
- package/src/plugins/core/RenderHTML.tsx +36 -2
- package/src/plugins/core/__test__/RenderHTML.test.ts +72 -0
- package/src/plugins/core/registerReactComponent.tsx +28 -0
- package/src/plugins/impl/FileBrowserPlugin.tsx +8 -2
- package/src/stories/cell.stories.tsx +1 -1
- package/src/stories/layout/vertical/one-column.stories.tsx +1 -1
- package/src/utils/__tests__/cell-urls.test.ts +29 -0
- package/src/utils/__tests__/filenames.test.ts +18 -0
- package/src/utils/__tests__/path.test.ts +38 -0
- package/src/utils/__tests__/urls.test.ts +56 -1
- package/src/utils/errors.ts +9 -0
- package/dist/assets/_baseEach-C1FLm7WW.js +0 -1
- package/dist/assets/_baseMap-DBVArUYD.js +0 -1
- package/dist/assets/_baseUniq-Dk7ZPJ3N.js +0 -1
- package/dist/assets/_createAggregator-Bn38fDd3.js +0 -1
- package/dist/assets/agent-panel-COUYnuIK.js +0 -475
- package/dist/assets/architectureDiagram-W76B3OCA-DBzWQKKu.js +0 -36
- package/dist/assets/channel-CjhbjOv4.js +0 -1
- package/dist/assets/chat-panel-BPXKoTnZ.js +0 -7
- package/dist/assets/chat-panel-Brrs_eeH.css +0 -1
- package/dist/assets/classDiagram-KNZD7YFC-DHs5cFzy.js +0 -1
- package/dist/assets/classDiagram-v2-RKCZMP56-DHs5cFzy.js +0 -1
- package/dist/assets/clone-DM1YNjEn.js +0 -1
- package/dist/assets/command-palette-S0bzQp7v.js +0 -1
- package/dist/assets/common-B8U9k2Ly.js +0 -1
- package/dist/assets/cose-bilkent-S5V4N54A-wz1Sfx7j.js +0 -1
- package/dist/assets/dagre-5GWH7T2D-BfpcVBgq.js +0 -4
- package/dist/assets/datasources-panel-DfuURLJw.js +0 -1
- package/dist/assets/diagram-N5W7TBWH-Bf0oqqQh.js +0 -24
- package/dist/assets/diagram-QEK2KX5R-ZTc3qikh.js +0 -43
- package/dist/assets/diagram-S2PKOQOG-tLScBy7Z.js +0 -24
- package/dist/assets/edit-page-DJ8kJZ9w.js +0 -129
- package/dist/assets/file-explorer-panel-CzNUJ63G.js +0 -1
- package/dist/assets/gitGraphDiagram-NY62KEGX-C1t6QtVa.js +0 -65
- package/dist/assets/graph-CssCVWIq.js +0 -1
- package/dist/assets/index-DcCIe7np.js +0 -28
- package/dist/assets/infoDiagram-STP46IZ2-CwiAoz9f.js +0 -2
- package/dist/assets/layout-DpQrxGW-.js +0 -1
- package/dist/assets/linear-NsreOeBF.js +0 -1
- package/dist/assets/mermaid-DSt0r6IQ.js +0 -1
- package/dist/assets/min-D259kI3t.js +0 -1
- package/dist/assets/packages-panel-xMz9W2hW.js +0 -1
- package/dist/assets/run-page-Bb68qdhQ.js +0 -1
- package/dist/assets/sankeyDiagram-GR3RE2ED-BSJOau8E.js +0 -10
- package/dist/assets/scratchpad-panel-BF4BO-U4.js +0 -1
- package/dist/assets/secrets-panel-CdIX44dQ.js +0 -1
- package/dist/assets/snippets-panel-Dco9h0rb.js +0 -1
- package/dist/assets/sortBy-aLGA-PGK.js +0 -1
- package/dist/assets/stateDiagram-KXAO66HF-Bd68WT3b.js +0 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-BXz_GSwb.js +0 -1
- package/dist/assets/storage-CGlP4lCF.js +0 -26
- package/dist/assets/terminal-CxkHubcu.js +0 -9
- package/dist/assets/time-D2nr1UgQ.js +0 -1
- package/dist/assets/tracing-kTqHxa7q.js +0 -2
- package/dist/assets/variable-panel-noTnH-AQ.js +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{c as ot,d as ze,r as fe,df as at,cI as Ce,fm as ht,L as ye,j as _e,a8 as ct,T as je,f7 as lt,$ as dt,fn as _t,a as ut,fo as ft,__tla as vt}from"./index-DKEudB02.js";import{u as gt,a as pt}from"./state-C4NiC9tO.js";import{j as mt,__tla as St}from"./edit-page-BrYda9VE.js";import"./links-D59GIweI.js";import{__tla as Ct}from"./storage-CMdLzB_c.js";import"./index-CQDrxQ0j.js";import"./index-C77h_TXN.js";import"./index-D1vmG6DS.js";import"./index-lYa_leQE.js";import"./index-DRMm6SNo.js";import"./index-vmICa5KN.js";import"./index-BY93Ejhl.js";import"./index-C-GhZ7ti.js";import"./index-C-8WADat.js";import"./index-DoRmcrKM.js";import"./index-DEQvTChO.js";import"./index-CWMgowgL.js";import"./index-D9UKkrr2.js";import"./apl-CXdQSnD-.js";import"./asciiarmor-D5V0T9Cu.js";import"./asn1-DWPaVWf6.js";import"./brainfuck-CtZaYBKt.js";import"./cobol-stawOqaz.js";import"./clike-BgBwzOhw.js";import"./clojure-DiuoqK-z.js";import"./css-ZjFoif2m.js";import"./cmake-DXn5xaP-.js";import"./coffeescript-BTDxI-eT.js";import"./commonlisp-vq6DHwts.js";import"./cypher-gJDei3ni.js";import"./python-DD-Q2bae.js";import"./crystal-CRzZ78HM.js";import"./d-BShv7fp-.js";import"./diff-UJJ5BM9S.js";import"./dtd-DI9Herc-.js";import"./dylan-DkEP81N9.js";import"./ecl-DPFc0Uaf.js";import"./eiffel-DR5c0IrL.js";import"./elm-DompmV0j.js";import"./erlang-BuqgqA5h.js";import"./factor-CFXhaUWb.js";import"./simple-mode-C3vEBAcb.js";import"./forth-POgR1ypr.js";import"./fortran-DL7KluxX.js";import"./mllike-3c2dg9RT.js";import"./gas-bV0CklSb.js";import"./gherkin-B6X1vGSW.js";import"./groovy-DnIzCrpZ.js";import"./haskell-CLQs6EAM.js";import"./haxe-D25e-2l-.js";import"./idl-pcmmZuaN.js";import"./javascript-BpzJj0-u.js";import"./jinja2-DhgKlfW7.js";import"./julia-DjdwvFuI.js";import"./livescript-HO6ttBFx.js";import"./lua-8DXOpKDz.js";import"./mirc-DkvFAiy5.js";import"./mathematica-IIbmv7SK.js";import"./modelica-DSrSSXCg.js";import"./mumps-zvxmGV4l.js";import"./mbox-z_N2Mo3d.js";import"./nsis-BvKfQ9lQ.js";import"./ntriples-BSwWqoLa.js";import"./octave-C4hdQ5Hf.js";import"./oz-qQq7irPq.js";import"./pascal-CafrKXZF.js";import"./perl-tdMlh9QA.js";import"./pig-CwGJVRC4.js";import"./powershell-D1ly3AHC.js";import"./properties-_nPj978X.js";import"./protobuf-B4y9do6W.js";import"./pug-BTvK5tSS.js";import"./puppet-Bc-yJKzi.js";import"./q-B0kTJ4cI.js";import"./r-BA4EbLKE.js";import"./rpm-DI_rRufH.js";import"./ruby-CR-u2WLS.js";import"./sas-Bqaci40L.js";import"./scheme-qjP0V5Ag.js";import"./shell-BLav31RL.js";import"./sieve-r025o_jW.js";import"./smalltalk-C7J3IyEP.js";import"./sparql-BRLJFz69.js";import"./stylus-Bdo_Aemu.js";import"./swift-B_XXVlXX.js";import"./verilog-B4LBqg_1.js";import"./tcl-B2fODqDH.js";import"./textile-BuVhTOzU.js";import"./toml-wcPdHu67.js";import"./troff-Ce85hlLp.js";import"./ttcn-BxnYHtq8.js";import"./ttcn-cfg-CKJxb-l2.js";import"./turtle-BkSuIpt-.js";import"./webidl-CGwyPRYs.js";import"./vb-BHgjm0DN.js";import"./vbscript-Dawdd5GZ.js";import"./velocity-BdD_26Jv.js";import"./vhdl-CWWH2SUo.js";import"./xquery-CVDBqZPY.js";import"./yacas-I8QjZlxf.js";import"./z80-D8p3gKXp.js";import"./mscgen-B2igx18G.js";import"./index-BVgAenPd.js";import"./trash-Dc6DSjz_.js";import"./_createAggregator-DcD0kTA5.js";import"./_baseEach-CNBxBxvS.js";import{__tla as bt}from"./loro_wasm_bg-C1ks32Vm.js";let qe,wt=Promise.all([(()=>{try{return vt}catch{}})(),(()=>{try{return St}catch{}})(),(()=>{try{return Ct}catch{}})(),(()=>{try{return bt}catch{}})()]).then(async()=>{const Ve=ot("text-select",[["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"M14 3h1",key:"1ec4yj"}],["path",{d:"M19 3a2 2 0 0 1 2 2",key:"18rm91"}],["path",{d:"M21 14v1",key:"169vum"}],["path",{d:"M21 19a2 2 0 0 1-2 2",key:"1j7049"}],["path",{d:"M21 9v1",key:"mxsmne"}],["path",{d:"M3 14v1",key:"vnatye"}],["path",{d:"M3 9v1",key:"1r0deq"}],["path",{d:"M5 21a2 2 0 0 1-2-2",key:"sbafld"}],["path",{d:"M5 3a2 2 0 0 0-2 2",key:"y57alp"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M9 21h1",key:"15o7lz"}],["path",{d:"M9 3h1",key:"1yesri"}]]);var xe,Le={exports:{}},be,Ee,Xe=xe?Le.exports:(xe=1,Le.exports=(be={},(()=>{var ne=be;function G(N,V,F){return N.addEventListener(V,F),{dispose:()=>{F&&N.removeEventListener(V,F)}}}Object.defineProperty(ne,"__esModule",{value:!0}),ne.AttachAddon=void 0,ne.AttachAddon=class{constructor(N,V){this._disposables=[],this._socket=N,this._socket.binaryType="arraybuffer",this._bidirectional=!(V&&V.bidirectional===!1)}activate(N){this._disposables.push(G(this._socket,"message",V=>{const F=V.data;N.write(typeof F=="string"?F:new Uint8Array(F))})),this._bidirectional&&(this._disposables.push(N.onData(V=>this._sendData(V))),this._disposables.push(N.onBinary(V=>this._sendBinary(V)))),this._disposables.push(G(this._socket,"close",()=>this.dispose())),this._disposables.push(G(this._socket,"error",()=>this.dispose()))}dispose(){for(const N of this._disposables)N.dispose()}_sendData(N){this._checkOpenSocket()&&this._socket.send(N)}_sendBinary(N){if(!this._checkOpenSocket())return;const V=new Uint8Array(N.length);for(let F=0;F<N.length;++F)V[F]=255&N.charCodeAt(F);this._socket.send(V)}_checkOpenSocket(){switch(this._socket.readyState){case WebSocket.OPEN:return!0;case WebSocket.CONNECTING:throw new Error("Attach addon was loaded before socket was open");case WebSocket.CLOSING:return console.warn("Attach addon socket is closing"),!1;case WebSocket.CLOSED:throw new Error("Attach addon socket is closed");default:throw new Error("Unexpected socket state")}}}})(),be)),ke={exports:{}},De,Re,Je=Ee?ke.exports:(Ee=1,De=()=>(()=>{var ne={903:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.BaseRenderLayer=void 0;const a=n(274),c=n(627),u=n(237),o=n(860),h=n(374),d=n(296),_=n(345),r=n(859),t=n(399),i=n(855);class e extends r.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var v;return(v=this._charAtlas)==null?void 0:v.pages[0].canvas}constructor(v,g,p,f,m,C,w,L,y,R){super(),this._terminal=v,this._container=g,this._alpha=m,this._themeService=C,this._bufferService=w,this._optionsService=L,this._decorationService=y,this._coreBrowserService=R,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,d.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new r.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new _.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new a.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${p}-layer`),this._canvas.style.zIndex=f.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors(A=>{this._refreshCharAtlas(A),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)})),this.register((0,r.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,h.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(v,g){}handleSelectionChanged(v,g,p=!1){this._selectionModel.update(this._terminal._core,v,g,p)}_setTransparency(v){if(v===this._alpha)return;const g=this._canvas;this._alpha=v,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,g),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(v){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,c.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,v,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,_.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let g=0;g<this._charAtlas.pages.length;g++)this._bitmapGenerator[g]=new s(this._charAtlas.pages[g].canvas)}}resize(v){this._deviceCellWidth=v.device.cell.width,this._deviceCellHeight=v.device.cell.height,this._deviceCharWidth=v.device.char.width,this._deviceCharHeight=v.device.char.height,this._deviceCharLeft=v.device.char.left,this._deviceCharTop=v.device.char.top,this._canvas.width=v.device.canvas.width,this._canvas.height=v.device.canvas.height,this._canvas.style.width=`${v.css.canvas.width}px`,this._canvas.style.height=`${v.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var v;(v=this._charAtlas)==null||v.clearTexture()}_fillCells(v,g,p,f){this._ctx.fillRect(v*this._deviceCellWidth,g*this._deviceCellHeight,p*this._deviceCellWidth,f*this._deviceCellHeight)}_fillMiddleLineAtCells(v,g,p=1){const f=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(v*this._deviceCellWidth,(g+1)*this._deviceCellHeight-f-this._coreBrowserService.dpr,p*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(v,g,p=1,f=0){this._ctx.fillRect(v*this._deviceCellWidth,(g+1)*this._deviceCellHeight+f-this._coreBrowserService.dpr-1,p*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(v,g,p=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const f=this._coreBrowserService.dpr;this._ctx.lineWidth=f;for(let m=0;m<p;m++){const C=(v+m)*this._deviceCellWidth,w=(v+m+.5)*this._deviceCellWidth,L=(v+m+1)*this._deviceCellWidth,y=(g+1)*this._deviceCellHeight-f-1,R=y-f,A=y+f;this._ctx.moveTo(C,y),this._ctx.bezierCurveTo(C,R,w,R,w,y),this._ctx.bezierCurveTo(w,A,L,A,L,y)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(v,g,p=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const f=this._coreBrowserService.dpr;this._ctx.lineWidth=f,this._ctx.setLineDash([2*f,f]);const m=v*this._deviceCellWidth,C=(g+1)*this._deviceCellHeight-f-1;this._ctx.moveTo(m,C);for(let w=0;w<p;w++){const L=(v+p+w)*this._deviceCellWidth;this._ctx.lineTo(L,C)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(v,g,p=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const f=this._coreBrowserService.dpr;this._ctx.lineWidth=f,this._ctx.setLineDash([4*f,3*f]);const m=v*this._deviceCellWidth,C=(v+p)*this._deviceCellWidth,w=(g+1)*this._deviceCellHeight-f-1;this._ctx.moveTo(m,w),this._ctx.lineTo(C,w),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(v,g,p){this._ctx.fillRect(v*this._deviceCellWidth,g*this._deviceCellHeight,this._coreBrowserService.dpr*p,this._deviceCellHeight)}_strokeRectAtCell(v,g,p,f){const m=this._coreBrowserService.dpr;this._ctx.lineWidth=m,this._ctx.strokeRect(v*this._deviceCellWidth+m/2,g*this._deviceCellHeight+m/2,p*this._deviceCellWidth-m,f*this._deviceCellHeight-m)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(v,g,p,f){this._alpha?this._ctx.clearRect(v*this._deviceCellWidth,g*this._deviceCellHeight,p*this._deviceCellWidth,f*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(v*this._deviceCellWidth,g*this._deviceCellHeight,p*this._deviceCellWidth,f*this._deviceCellHeight))}_fillCharTrueColor(v,g,p){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=u.TEXT_BASELINE,this._clipRow(p);let f=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(f=(0,o.tryDrawCustomChar)(this._ctx,v.getChars(),g*this._deviceCellWidth,p*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),f||this._ctx.fillText(v.getChars(),g*this._deviceCellWidth+this._deviceCharLeft,p*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(v,g,p){var y,R,A,B;const f=v.getChars(),m=v.getCode(),C=v.getWidth();if(this._cellColorResolver.resolve(v,g,this._bufferService.buffer.ydisp+p,this._deviceCellWidth),!this._charAtlas)return;let w;if(w=f&&f.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(f,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(v.getCode()||i.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!w.size.x||!w.size.y)return;this._ctx.save(),this._clipRow(p),this._bitmapGenerator[w.texturePage]&&this._charAtlas.pages[w.texturePage].canvas!==this._bitmapGenerator[w.texturePage].canvas&&((R=(y=this._bitmapGenerator[w.texturePage])==null?void 0:y.bitmap)==null||R.close(),delete this._bitmapGenerator[w.texturePage]),this._charAtlas.pages[w.texturePage].version!==((A=this._bitmapGenerator[w.texturePage])==null?void 0:A.version)&&(this._bitmapGenerator[w.texturePage]||(this._bitmapGenerator[w.texturePage]=new s(this._charAtlas.pages[w.texturePage].canvas)),this._bitmapGenerator[w.texturePage].refresh(),this._bitmapGenerator[w.texturePage].version=this._charAtlas.pages[w.texturePage].version);let L=w.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,h.allowRescaling)(m,C,w.size.x,this._deviceCellWidth)&&(L=this._deviceCellWidth-1),this._ctx.drawImage(((B=this._bitmapGenerator[w.texturePage])==null?void 0:B.bitmap)||this._charAtlas.pages[w.texturePage].canvas,w.texturePosition.x,w.texturePosition.y,w.size.x,w.size.y,g*this._deviceCellWidth+this._deviceCharLeft-w.offset.x,p*this._deviceCellHeight+this._deviceCharTop-w.offset.y,L,w.size.y),this._ctx.restore()}_clipRow(v){this._ctx.beginPath(),this._ctx.rect(0,v*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(v,g){return`${g?"italic":""} ${v?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}S.BaseRenderLayer=e;class s{get bitmap(){return this._bitmap}constructor(v){this.canvas=v,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var v;(v=this._bitmap)==null||v.close(),this._bitmap=void 0,t.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout(()=>this._generate(),100)),this._state===1&&(this._state=2))}_generate(){var v;this._state===0&&((v=this._bitmap)==null||v.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then(g=>{this._state===2?this.refresh():this._bitmap=g,this._state=0}),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.CanvasRenderer=void 0;const a=n(627),c=n(56),u=n(374),o=n(345),h=n(859),d=n(873),_=n(43),r=n(630),t=n(744);class i extends h.Disposable{constructor(s,l,v,g,p,f,m,C,w,L,y){super(),this._terminal=s,this._screenElement=l,this._bufferService=g,this._charSizeService=p,this._optionsService=f,this._coreBrowserService=w,this._themeService=y,this._observerDisposable=this.register(new h.MutableDisposable),this._onRequestRedraw=this.register(new o.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new o.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const R=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new t.TextRenderLayer(this._terminal,this._screenElement,0,R,this._bufferService,this._optionsService,m,L,this._coreBrowserService,y),new r.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,L,this._optionsService,y),new _.LinkRenderLayer(this._terminal,this._screenElement,2,v,this._bufferService,this._optionsService,L,this._coreBrowserService,y),new d.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,C,this._coreBrowserService,L,y)];for(const A of this._renderLayers)(0,o.forwardEvent)(A.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,u.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,c.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,(A,B)=>this._setCanvasDevicePixelDimensions(A,B)),this.register(this._coreBrowserService.onWindowChange(A=>{this._observerDisposable.value=(0,c.observeDevicePixelDimensions)(this._renderLayers[0].canvas,A,(B,T)=>this._setCanvasDevicePixelDimensions(B,T))})),this.register((0,h.toDisposable)(()=>{for(const A of this._renderLayers)A.dispose();(0,a.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(s,l){this._updateDimensions();for(const v of this._renderLayers)v.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation(s=>s.handleBlur())}handleFocus(){this._runOperation(s=>s.handleFocus())}handleSelectionChanged(s,l,v=!1){this._runOperation(g=>g.handleSelectionChanged(s,l,v)),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation(s=>s.handleCursorMove())}clear(){this._runOperation(s=>s.reset())}_runOperation(s){for(const l of this._renderLayers)s(l)}renderRows(s,l){for(const v of this._renderLayers)v.handleGridChanged(s,l)}clearTextureAtlas(){for(const s of this._renderLayers)s.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const s=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*s),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*s),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/s),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/s),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(s,l){this.dimensions.device.canvas.height=l,this.dimensions.device.canvas.width=s;for(const v of this._renderLayers)v.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}S.CanvasRenderer=i},873:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.CursorRenderLayer=void 0;const a=n(457),c=n(859),u=n(399),o=n(782),h=n(903);class d extends h.BaseRenderLayer{constructor(r,t,i,e,s,l,v,g,p,f){super(r,t,"cursor",i,!0,f,s,l,p,g),this._onRequestRedraw=e,this._coreService=v,this._cursorBlinkStateManager=this.register(new c.MutableDisposable),this._cell=new o.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(l.onOptionChange(()=>this._handleOptionsChanged())),this._handleOptionsChanged()}resize(r){super.resize(r),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var r;this._clearCursor(),(r=this._cursorBlinkStateManager.value)==null||r.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var r;(r=this._cursorBlinkStateManager.value)==null||r.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var r;(r=this._cursorBlinkStateManager.value)==null||r.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new a.CursorBlinkStateManager(()=>this._render(!0),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var r;(r=this._cursorBlinkStateManager.value)==null||r.restartBlinkAnimation()}handleGridChanged(r,t){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(r){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const t=this._bufferService.buffer.ybase+this._bufferService.buffer.y,i=t-this._bufferService.buffer.ydisp;if(i<0||i>=this._bufferService.rows)return void this._clearCursor();const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(t).loadCell(e,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const s=this._optionsService.rawOptions.cursorStyle,l=this._optionsService.rawOptions.cursorInactiveStyle;return l&&l!=="none"&&this._cursorRenderers[l](e,i,this._cell),this._ctx.restore(),this._state.x=e,this._state.y=i,this._state.isFocused=!1,this._state.style=s,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===e&&this._state.y===i&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](e,i,this._cell),this._ctx.restore(),this._state.x=e,this._state.y=i,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(u.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(r,t,i){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(r,t,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(r,t,i){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(r,t,i.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(i,r,t),this._ctx.restore()}_renderUnderlineCursor(r,t,i){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(r,t),this._ctx.restore()}_renderOutlineCursor(r,t,i){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(r,t,i.getWidth(),1),this._ctx.restore()}}S.CursorRenderLayer=d},574:(F,S)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.GridCache=void 0,S.GridCache=class{constructor(){this.cache=[]}resize(n,a){for(let c=0;c<n;c++){this.cache.length<=c&&this.cache.push([]);for(let u=this.cache[c].length;u<a;u++)this.cache[c].push(void 0);this.cache[c].length=a}this.cache.length=n}clear(){for(let n=0;n<this.cache.length;n++)for(let a=0;a<this.cache[n].length;a++)this.cache[n][a]=void 0}}},43:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.LinkRenderLayer=void 0;const a=n(197),c=n(237),u=n(903);class o extends u.BaseRenderLayer{constructor(d,_,r,t,i,e,s,l,v){super(d,_,"link",r,!0,v,i,e,s,l),this.register(t.onShowLinkUnderline(g=>this._handleShowLinkUnderline(g))),this.register(t.onHideLinkUnderline(g=>this._handleHideLinkUnderline(g)))}resize(d){super.resize(d),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const d=this._state.y2-this._state.y1-1;d>0&&this._clearCells(0,this._state.y1+1,this._state.cols,d),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(d){if(d.fg===c.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:d.fg&&(0,a.is256Color)(d.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[d.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,d.y1===d.y2)this._fillBottomLineAtCells(d.x1,d.y1,d.x2-d.x1);else{this._fillBottomLineAtCells(d.x1,d.y1,d.cols-d.x1);for(let _=d.y1+1;_<d.y2;_++)this._fillBottomLineAtCells(0,_,d.cols);this._fillBottomLineAtCells(0,d.y2,d.x2)}this._state=d}_handleHideLinkUnderline(d){this._clearCurrentLink()}}S.LinkRenderLayer=o},630:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.SelectionRenderLayer=void 0;const a=n(903);class c extends a.BaseRenderLayer{constructor(o,h,d,_,r,t,i,e){super(o,h,"selection",d,!0,e,_,i,t,r),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(o){super.resize(o),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(o,h,d){super.handleSelectionChanged(o,h,d),this._redrawSelection(o,h,d)}_redrawSelection(o,h,d){if(!this._didStateChange(o,h,d,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!o||!h)return void this._clearState();const _=o[1]-this._bufferService.buffer.ydisp,r=h[1]-this._bufferService.buffer.ydisp,t=Math.max(_,0),i=Math.min(r,this._bufferService.rows-1);if(t>=this._bufferService.rows||i<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,d){const e=o[0],s=h[0]-e,l=i-t+1;this._fillCells(e,t,s,l)}else{const e=_===t?o[0]:0,s=t===r?h[0]:this._bufferService.cols;this._fillCells(e,t,s-e,1);const l=Math.max(i-t-1,0);if(this._fillCells(0,t+1,this._bufferService.cols,l),t!==i){const v=r===i?h[0]:this._bufferService.cols;this._fillCells(0,i,v,1)}}this._state.start=[o[0],o[1]],this._state.end=[h[0],h[1]],this._state.columnSelectMode=d,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(o,h,d,_){return!this._areCoordinatesEqual(o,this._state.start)||!this._areCoordinatesEqual(h,this._state.end)||d!==this._state.columnSelectMode||_!==this._state.ydisp}_areCoordinatesEqual(o,h){return!(!o||!h)&&o[0]===h[0]&&o[1]===h[1]}}S.SelectionRenderLayer=c},744:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.TextRenderLayer=void 0;const a=n(577),c=n(147),u=n(782),o=n(855),h=n(903),d=n(574);class _ extends h.BaseRenderLayer{constructor(t,i,e,s,l,v,g,p,f,m){super(t,i,"text",e,s,m,l,v,p,f),this._characterJoinerService=g,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new u.CellData,this._state=new d.GridCache,this.register(v.onSpecificOptionChange("allowTransparency",C=>this._setTransparency(C)))}resize(t){super.resize(t);const i=this._getFont(!1,!1);this._characterWidth===t.device.char.width&&this._characterFont===i||(this._characterWidth=t.device.char.width,this._characterFont=i,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(t,i,e){for(let s=t;s<=i;s++){const l=s+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.lines.get(l),g=this._characterJoinerService.getJoinedCharacters(l);for(let p=0;p<this._bufferService.cols;p++){v.loadCell(p,this._workCell);let f=this._workCell,m=!1,C=p;if(f.getWidth()!==0){if(g.length>0&&p===g[0][0]){m=!0;const w=g.shift();f=new a.JoinedCellData(this._workCell,v.translateToString(!0,w[0],w[1]),w[1]-w[0]),C=w[1]-1}!m&&this._isOverlapping(f)&&C<v.length-1&&v.getCodePoint(C+1)===o.NULL_CELL_CODE&&(f.content&=-12582913,f.content|=8388608),e(f,p,s),p=C}}}}_drawBackground(t,i){const e=this._ctx,s=this._bufferService.cols;let l=0,v=0,g=null;e.save(),this._forEachCell(t,i,(p,f,m)=>{let C=null;p.isInverse()?C=p.isFgDefault()?this._themeService.colors.foreground.css:p.isFgRGB()?`rgb(${c.AttributeData.toColorRGB(p.getFgColor()).join(",")})`:this._themeService.colors.ansi[p.getFgColor()].css:p.isBgRGB()?C=`rgb(${c.AttributeData.toColorRGB(p.getBgColor()).join(",")})`:p.isBgPalette()&&(C=this._themeService.colors.ansi[p.getBgColor()].css);let w=!1;this._decorationService.forEachDecorationAtCell(f,this._bufferService.buffer.ydisp+m,void 0,L=>{L.options.layer!=="top"&&w||(L.backgroundColorRGB&&(C=L.backgroundColorRGB.css),w=L.options.layer==="top")}),g===null&&(l=f,v=m),m!==v?(e.fillStyle=g||"",this._fillCells(l,v,s-l,1),l=f,v=m):g!==C&&(e.fillStyle=g||"",this._fillCells(l,v,f-l,1),l=f,v=m),g=C}),g!==null&&(e.fillStyle=g,this._fillCells(l,v,s-l,1)),e.restore()}_drawForeground(t,i){this._forEachCell(t,i,(e,s,l)=>this._drawChars(e,s,l))}handleGridChanged(t,i){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,t,this._bufferService.cols,i-t+1),this._drawBackground(t,i),this._drawForeground(t,i))}_isOverlapping(t){if(t.getWidth()!==1||t.getCode()<256)return!1;const i=t.getChars();if(this._characterOverlapCache.hasOwnProperty(i))return this._characterOverlapCache[i];this._ctx.save(),this._ctx.font=this._characterFont;const e=Math.floor(this._ctx.measureText(i).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[i]=e,e}}S.TextRenderLayer=_},274:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.CellColorResolver=void 0;const a=n(855),c=n(160),u=n(374);let o,h=0,d=0,_=!1,r=!1,t=!1,i=0;S.CellColorResolver=class{constructor(e,s,l,v,g,p){this._terminal=e,this._optionService=s,this._selectionRenderModel=l,this._decorationService=v,this._coreBrowserService=g,this._themeService=p,this.result={fg:0,bg:0,ext:0}}resolve(e,s,l,v){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=268435456&e.bg?e.extended.ext:0,d=0,h=0,r=!1,_=!1,t=!1,o=this._themeService.colors,i=0,e.getCode()!==a.NULL_CELL_CODE&&e.extended.underlineStyle===4){const g=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));i=s*v%(2*Math.round(g))}if(this._decorationService.forEachDecorationAtCell(s,l,"bottom",g=>{g.backgroundColorRGB&&(d=g.backgroundColorRGB.rgba>>8&16777215,r=!0),g.foregroundColorRGB&&(h=g.foregroundColorRGB.rgba>>8&16777215,_=!0)}),t=this._selectionRenderModel.isCellSelected(this._terminal,s,l),t){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:d=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:d=(16777215&this.result.fg)<<8|255;break;default:d=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:d=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:d=(16777215&this.result.bg)<<8|255}d=c.rgba.blend(d,4294967040&(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else d=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,o.selectionForeground&&(h=o.selectionForeground.rgba>>8&16777215,_=!0),(0,u.treatGlyphAsBackgroundColor)(e.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))h=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:h=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:h=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:h=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:h=(16777215&this.result.fg)<<8|255;break;default:h=this._themeService.colors.foreground.rgba}h=c.rgba.blend(h,4294967040&(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}_=!0}}this._decorationService.forEachDecorationAtCell(s,l,"top",g=>{g.backgroundColorRGB&&(d=g.backgroundColorRGB.rgba>>8&16777215,r=!0),g.foregroundColorRGB&&(h=g.foregroundColorRGB.rgba>>8&16777215,_=!0)}),r&&(d=t?-16777216&e.bg&-134217729|d|50331648:-16777216&e.bg|d|50331648),_&&(h=-16777216&e.fg&-67108865|h|50331648),67108864&this.result.fg&&(r&&!_&&(h=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&o.background.rgba>>8|50331648,_=!0),!r&&_&&(d=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&o.foreground.rgba>>8|50331648,r=!0)),o=void 0,this.result.bg=r?d:this.result.bg,this.result.fg=_?h:this.result.fg,this.result.ext&=536870911,this.result.ext|=i<<29&3758096384}}},627:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.removeTerminalFromCache=S.acquireTextureAtlas=void 0;const a=n(509),c=n(197),u=[];S.acquireTextureAtlas=function(o,h,d,_,r,t,i,e){const s=(0,c.generateConfig)(_,r,t,i,h,d,e);for(let g=0;g<u.length;g++){const p=u[g],f=p.ownedBy.indexOf(o);if(f>=0){if((0,c.configEquals)(p.config,s))return p.atlas;p.ownedBy.length===1?(p.atlas.dispose(),u.splice(g,1)):p.ownedBy.splice(f,1);break}}for(let g=0;g<u.length;g++){const p=u[g];if((0,c.configEquals)(p.config,s))return p.ownedBy.push(o),p.atlas}const l=o._core,v={atlas:new a.TextureAtlas(document,s,l.unicodeService),config:s,ownedBy:[o]};return u.push(v),v.atlas},S.removeTerminalFromCache=function(o){for(let h=0;h<u.length;h++){const d=u[h].ownedBy.indexOf(o);if(d!==-1){u[h].ownedBy.length===1?(u[h].atlas.dispose(),u.splice(h,1)):u[h].ownedBy.splice(d,1);break}}}},197:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.is256Color=S.configEquals=S.generateConfig=void 0;const a=n(160);S.generateConfig=function(c,u,o,h,d,_,r){const t={foreground:_.foreground,background:_.background,cursor:a.NULL_COLOR,cursorAccent:a.NULL_COLOR,selectionForeground:a.NULL_COLOR,selectionBackgroundTransparent:a.NULL_COLOR,selectionBackgroundOpaque:a.NULL_COLOR,selectionInactiveBackgroundTransparent:a.NULL_COLOR,selectionInactiveBackgroundOpaque:a.NULL_COLOR,ansi:_.ansi.slice(),contrastCache:_.contrastCache,halfContrastCache:_.halfContrastCache};return{customGlyphs:d.customGlyphs,devicePixelRatio:r,letterSpacing:d.letterSpacing,lineHeight:d.lineHeight,deviceCellWidth:c,deviceCellHeight:u,deviceCharWidth:o,deviceCharHeight:h,fontFamily:d.fontFamily,fontSize:d.fontSize,fontWeight:d.fontWeight,fontWeightBold:d.fontWeightBold,allowTransparency:d.allowTransparency,drawBoldTextInBrightColors:d.drawBoldTextInBrightColors,minimumContrastRatio:d.minimumContrastRatio,colors:t}},S.configEquals=function(c,u){for(let o=0;o<c.colors.ansi.length;o++)if(c.colors.ansi[o].rgba!==u.colors.ansi[o].rgba)return!1;return c.devicePixelRatio===u.devicePixelRatio&&c.customGlyphs===u.customGlyphs&&c.lineHeight===u.lineHeight&&c.letterSpacing===u.letterSpacing&&c.fontFamily===u.fontFamily&&c.fontSize===u.fontSize&&c.fontWeight===u.fontWeight&&c.fontWeightBold===u.fontWeightBold&&c.allowTransparency===u.allowTransparency&&c.deviceCharWidth===u.deviceCharWidth&&c.deviceCharHeight===u.deviceCharHeight&&c.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&c.minimumContrastRatio===u.minimumContrastRatio&&c.colors.foreground.rgba===u.colors.foreground.rgba&&c.colors.background.rgba===u.colors.background.rgba},S.is256Color=function(c){return(50331648&c)==16777216||(50331648&c)==33554432}},237:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.TEXT_BASELINE=S.DIM_OPACITY=S.INVERTED_DEFAULT_COLOR=void 0;const a=n(399);S.INVERTED_DEFAULT_COLOR=257,S.DIM_OPACITY=.5,S.TEXT_BASELINE=a.isFirefox||a.isLegacyEdge?"bottom":"ideographic"},457:(F,S)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.CursorBlinkStateManager=void 0,S.CursorBlinkStateManager=class{constructor(n,a){this._renderCallback=n,this._coreBrowserService=a,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(n=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const a=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,a>0)return void this._restartInterval(a)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const a=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(a)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},n)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.tryDrawCustomChar=S.powerlineDefinitions=S.boxDrawingDefinitions=S.blockElementDefinitions=void 0;const a=n(374);S.blockElementDefinitions={"\u2580":[{x:0,y:0,w:8,h:4}],"\u2581":[{x:0,y:7,w:8,h:1}],"\u2582":[{x:0,y:6,w:8,h:2}],"\u2583":[{x:0,y:5,w:8,h:3}],"\u2584":[{x:0,y:4,w:8,h:4}],"\u2585":[{x:0,y:3,w:8,h:5}],"\u2586":[{x:0,y:2,w:8,h:6}],"\u2587":[{x:0,y:1,w:8,h:7}],"\u2588":[{x:0,y:0,w:8,h:8}],"\u2589":[{x:0,y:0,w:7,h:8}],"\u258A":[{x:0,y:0,w:6,h:8}],"\u258B":[{x:0,y:0,w:5,h:8}],"\u258C":[{x:0,y:0,w:4,h:8}],"\u258D":[{x:0,y:0,w:3,h:8}],"\u258E":[{x:0,y:0,w:2,h:8}],"\u258F":[{x:0,y:0,w:1,h:8}],"\u2590":[{x:4,y:0,w:4,h:8}],"\u2594":[{x:0,y:0,w:8,h:1}],"\u2595":[{x:7,y:0,w:1,h:8}],"\u2596":[{x:0,y:4,w:4,h:4}],"\u2597":[{x:4,y:4,w:4,h:4}],"\u2598":[{x:0,y:0,w:4,h:4}],"\u2599":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u259A":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"\u259B":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"\u259C":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"\u259D":[{x:4,y:0,w:4,h:4}],"\u259E":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"\u259F":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u{1FB70}":[{x:1,y:0,w:1,h:8}],"\u{1FB71}":[{x:2,y:0,w:1,h:8}],"\u{1FB72}":[{x:3,y:0,w:1,h:8}],"\u{1FB73}":[{x:4,y:0,w:1,h:8}],"\u{1FB74}":[{x:5,y:0,w:1,h:8}],"\u{1FB75}":[{x:6,y:0,w:1,h:8}],"\u{1FB76}":[{x:0,y:1,w:8,h:1}],"\u{1FB77}":[{x:0,y:2,w:8,h:1}],"\u{1FB78}":[{x:0,y:3,w:8,h:1}],"\u{1FB79}":[{x:0,y:4,w:8,h:1}],"\u{1FB7A}":[{x:0,y:5,w:8,h:1}],"\u{1FB7B}":[{x:0,y:6,w:8,h:1}],"\u{1FB7C}":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB7D}":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7E}":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7F}":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB80}":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB81}":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB82}":[{x:0,y:0,w:8,h:2}],"\u{1FB83}":[{x:0,y:0,w:8,h:3}],"\u{1FB84}":[{x:0,y:0,w:8,h:5}],"\u{1FB85}":[{x:0,y:0,w:8,h:6}],"\u{1FB86}":[{x:0,y:0,w:8,h:7}],"\u{1FB87}":[{x:6,y:0,w:2,h:8}],"\u{1FB88}":[{x:5,y:0,w:3,h:8}],"\u{1FB89}":[{x:3,y:0,w:5,h:8}],"\u{1FB8A}":[{x:2,y:0,w:6,h:8}],"\u{1FB8B}":[{x:1,y:0,w:7,h:8}],"\u{1FB95}":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"\u{1FB96}":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"\u{1FB97}":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const c={"\u2591":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"\u2592":[[1,0],[0,0],[0,1],[0,0]],"\u2593":[[0,1],[1,1],[1,0],[1,1]]};S.boxDrawingDefinitions={"\u2500":{1:"M0,.5 L1,.5"},"\u2501":{3:"M0,.5 L1,.5"},"\u2502":{1:"M.5,0 L.5,1"},"\u2503":{3:"M.5,0 L.5,1"},"\u250C":{1:"M0.5,1 L.5,.5 L1,.5"},"\u250F":{3:"M0.5,1 L.5,.5 L1,.5"},"\u2510":{1:"M0,.5 L.5,.5 L.5,1"},"\u2513":{3:"M0,.5 L.5,.5 L.5,1"},"\u2514":{1:"M.5,0 L.5,.5 L1,.5"},"\u2517":{3:"M.5,0 L.5,.5 L1,.5"},"\u2518":{1:"M.5,0 L.5,.5 L0,.5"},"\u251B":{3:"M.5,0 L.5,.5 L0,.5"},"\u251C":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u2523":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u2524":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u252B":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u252C":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2533":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2534":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"\u253B":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"\u253C":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"\u254B":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"\u2574":{1:"M.5,.5 L0,.5"},"\u2578":{3:"M.5,.5 L0,.5"},"\u2575":{1:"M.5,.5 L.5,0"},"\u2579":{3:"M.5,.5 L.5,0"},"\u2576":{1:"M.5,.5 L1,.5"},"\u257A":{3:"M.5,.5 L1,.5"},"\u2577":{1:"M.5,.5 L.5,1"},"\u257B":{3:"M.5,.5 L.5,1"},"\u2550":{1:(_,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"\u2551":{1:(_,r)=>`M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"\u2552":{1:(_,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"\u2553":{1:(_,r)=>`M${.5-_},1 L${.5-_},.5 L1,.5 M${.5+_},.5 L${.5+_},1`},"\u2554":{1:(_,r)=>`M1,${.5-r} L${.5-_},${.5-r} L${.5-_},1 M1,${.5+r} L${.5+_},${.5+r} L${.5+_},1`},"\u2555":{1:(_,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"\u2556":{1:(_,r)=>`M${.5+_},1 L${.5+_},.5 L0,.5 M${.5-_},.5 L${.5-_},1`},"\u2557":{1:(_,r)=>`M0,${.5+r} L${.5-_},${.5+r} L${.5-_},1 M0,${.5-r} L${.5+_},${.5-r} L${.5+_},1`},"\u2558":{1:(_,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"\u2559":{1:(_,r)=>`M1,.5 L${.5-_},.5 L${.5-_},0 M${.5+_},.5 L${.5+_},0`},"\u255A":{1:(_,r)=>`M1,${.5-r} L${.5+_},${.5-r} L${.5+_},0 M1,${.5+r} L${.5-_},${.5+r} L${.5-_},0`},"\u255B":{1:(_,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"\u255C":{1:(_,r)=>`M0,.5 L${.5+_},.5 L${.5+_},0 M${.5-_},.5 L${.5-_},0`},"\u255D":{1:(_,r)=>`M0,${.5-r} L${.5-_},${.5-r} L${.5-_},0 M0,${.5+r} L${.5+_},${.5+r} L${.5+_},0`},"\u255E":{1:(_,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"\u255F":{1:(_,r)=>`M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1 M${.5+_},.5 L1,.5`},"\u2560":{1:(_,r)=>`M${.5-_},0 L${.5-_},1 M1,${.5+r} L${.5+_},${.5+r} L${.5+_},1 M1,${.5-r} L${.5+_},${.5-r} L${.5+_},0`},"\u2561":{1:(_,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"\u2562":{1:(_,r)=>`M0,.5 L${.5-_},.5 M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"\u2563":{1:(_,r)=>`M${.5+_},0 L${.5+_},1 M0,${.5+r} L${.5-_},${.5+r} L${.5-_},1 M0,${.5-r} L${.5-_},${.5-r} L${.5-_},0`},"\u2564":{1:(_,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"\u2565":{1:(_,r)=>`M0,.5 L1,.5 M${.5-_},.5 L${.5-_},1 M${.5+_},.5 L${.5+_},1`},"\u2566":{1:(_,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-_},${.5+r} L${.5-_},1 M1,${.5+r} L${.5+_},${.5+r} L${.5+_},1`},"\u2567":{1:(_,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"\u2568":{1:(_,r)=>`M0,.5 L1,.5 M${.5-_},.5 L${.5-_},0 M${.5+_},.5 L${.5+_},0`},"\u2569":{1:(_,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-_},${.5-r} L${.5-_},0 M1,${.5-r} L${.5+_},${.5-r} L${.5+_},0`},"\u256A":{1:(_,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"\u256B":{1:(_,r)=>`M0,.5 L1,.5 M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"\u256C":{1:(_,r)=>`M0,${.5+r} L${.5-_},${.5+r} L${.5-_},1 M1,${.5+r} L${.5+_},${.5+r} L${.5+_},1 M0,${.5-r} L${.5-_},${.5-r} L${.5-_},0 M1,${.5-r} L${.5+_},${.5-r} L${.5+_},0`},"\u2571":{1:"M1,0 L0,1"},"\u2572":{1:"M0,0 L1,1"},"\u2573":{1:"M1,0 L0,1 M0,0 L1,1"},"\u257C":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u257D":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"\u257E":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u257F":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u250D":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"\u250E":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2511":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"\u2512":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"\u2515":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"\u2516":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u2519":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"\u251A":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"\u251D":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"\u251E":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u251F":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2520":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"\u2521":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"\u2522":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"\u2525":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"\u2526":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u2527":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"\u2528":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"\u2529":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"\u252A":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"\u252D":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u252E":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"\u252F":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"\u2530":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2531":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"\u2532":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"\u2535":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u2536":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u2537":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"\u2538":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u2539":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"\u253A":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"\u253D":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u253E":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u253F":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"\u2540":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u2541":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2542":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"\u2543":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"\u2544":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"\u2545":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"\u2546":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"\u2547":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"\u2548":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2549":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u254A":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u254C":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"\u254D":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"\u2504":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"\u2505":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"\u2508":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"\u2509":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"\u254E":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"\u254F":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"\u2506":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"\u2507":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"\u250A":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"\u250B":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"\u256D":{1:(_,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"\u256E":{1:(_,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"\u256F":{1:(_,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"\u2570":{1:(_,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,1,.5`}},S.powerlineDefinitions={"\uE0B0":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"\uE0B1":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0B2":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"\uE0B3":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0B4":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"\uE0B5":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"\uE0B6":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"\uE0B7":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"\uE0B8":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"\uE0B9":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0BA":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"\uE0BC":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"\uE0BD":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0BE":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},S.powerlineDefinitions["\uE0BB"]=S.powerlineDefinitions["\uE0BD"],S.powerlineDefinitions["\uE0BF"]=S.powerlineDefinitions["\uE0B9"],S.tryDrawCustomChar=function(_,r,t,i,e,s,l,v){const g=S.blockElementDefinitions[r];if(g)return(function(C,w,L,y,R,A){for(let B=0;B<w.length;B++){const T=w[B],P=R/8,b=A/8;C.fillRect(L+T.x*P,y+T.y*b,T.w*P,T.h*b)}})(_,g,t,i,e,s),!0;const p=c[r];if(p)return(function(C,w,L,y,R,A){let B=u.get(w);B||(B=new Map,u.set(w,B));const T=C.fillStyle;if(typeof T!="string")throw new Error(`Unexpected fillStyle type "${T}"`);let P=B.get(T);if(!P){const b=w[0].length,E=w.length,k=C.canvas.ownerDocument.createElement("canvas");k.width=b,k.height=E;const D=(0,a.throwIfFalsy)(k.getContext("2d")),I=new ImageData(b,E);let W,z,q,M;if(T.startsWith("#"))W=parseInt(T.slice(1,3),16),z=parseInt(T.slice(3,5),16),q=parseInt(T.slice(5,7),16),M=T.length>7&&parseInt(T.slice(7,9),16)||1;else{if(!T.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${T}" when drawing pattern glyph`);[W,z,q,M]=T.substring(5,T.length-1).split(",").map(x=>parseFloat(x))}for(let x=0;x<E;x++)for(let H=0;H<b;H++)I.data[4*(x*b+H)]=W,I.data[4*(x*b+H)+1]=z,I.data[4*(x*b+H)+2]=q,I.data[4*(x*b+H)+3]=w[x][H]*(255*M);D.putImageData(I,0,0),P=(0,a.throwIfFalsy)(C.createPattern(k,null)),B.set(T,P)}C.fillStyle=P,C.fillRect(L,y,R,A)})(_,p,t,i,e,s),!0;const f=S.boxDrawingDefinitions[r];if(f)return(function(C,w,L,y,R,A,B){C.strokeStyle=C.fillStyle;for(const[T,P]of Object.entries(w)){let b;C.beginPath(),C.lineWidth=B*Number.parseInt(T),b=typeof P=="function"?P(.15,.15/A*R):P;for(const E of b.split(" ")){const k=E[0],D=h[k];if(!D){console.error(`Could not find drawing instructions for "${k}"`);continue}const I=E.substring(1).split(",");I[0]&&I[1]&&D(C,d(I,R,A,L,y,!0,B))}C.stroke(),C.closePath()}})(_,f,t,i,e,s,v),!0;const m=S.powerlineDefinitions[r];return!!m&&((function(C,w,L,y,R,A,B,T){const P=new Path2D;P.rect(L,y,R,A),C.clip(P),C.beginPath();const b=B/12;C.lineWidth=T*b;for(const E of w.d.split(" ")){const k=E[0],D=h[k];if(!D){console.error(`Could not find drawing instructions for "${k}"`);continue}const I=E.substring(1).split(",");I[0]&&I[1]&&D(C,d(I,R,A,L,y,!1,T,(w.leftPadding??0)*(b/2),(w.rightPadding??0)*(b/2)))}w.type===1?(C.strokeStyle=C.fillStyle,C.stroke()):C.fill(),C.closePath()})(_,m,t,i,e,s,l,v),!0)};const u=new Map;function o(_,r,t=0){return Math.max(Math.min(_,r),t)}const h={C:(_,r)=>_.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(_,r)=>_.lineTo(r[0],r[1]),M:(_,r)=>_.moveTo(r[0],r[1])};function d(_,r,t,i,e,s,l,v=0,g=0){const p=_.map(f=>parseFloat(f)||parseInt(f));if(p.length<2)throw new Error("Too few arguments for instruction");for(let f=0;f<p.length;f+=2)p[f]*=r-v*l-g*l,s&&p[f]!==0&&(p[f]=o(Math.round(p[f]+.5)-.5,r,0)),p[f]+=i+v*l;for(let f=1;f<p.length;f+=2)p[f]*=t,s&&p[f]!==0&&(p[f]=o(Math.round(p[f]+.5)-.5,t,0)),p[f]+=e;return p}},56:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.observeDevicePixelDimensions=void 0;const a=n(859);S.observeDevicePixelDimensions=function(c,u,o){let h=new u.ResizeObserver(d=>{const _=d.find(i=>i.target===c);if(!_)return;if(!("devicePixelContentBoxSize"in _))return h==null||h.disconnect(),void(h=void 0);const r=_.devicePixelContentBoxSize[0].inlineSize,t=_.devicePixelContentBoxSize[0].blockSize;r>0&&t>0&&o(r,t)});try{h.observe(c,{box:["device-pixel-content-box"]})}catch{h.disconnect(),h=void 0}return(0,a.toDisposable)(()=>h==null?void 0:h.disconnect())}},374:(F,S)=>{function n(c){return 57508<=c&&c<=57558}function a(c){return c>=128512&&c<=128591||c>=127744&&c<=128511||c>=128640&&c<=128767||c>=9728&&c<=9983||c>=9984&&c<=10175||c>=65024&&c<=65039||c>=129280&&c<=129535||c>=127462&&c<=127487}Object.defineProperty(S,"__esModule",{value:!0}),S.computeNextVariantOffset=S.createRenderDimensions=S.treatGlyphAsBackgroundColor=S.allowRescaling=S.isEmoji=S.isRestrictedPowerlineGlyph=S.isPowerlineGlyph=S.throwIfFalsy=void 0,S.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},S.isPowerlineGlyph=n,S.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},S.isEmoji=a,S.allowRescaling=function(c,u,o,h){return u===1&&o>Math.ceil(1.5*h)&&c!==void 0&&c>255&&!a(c)&&!n(c)&&!(function(d){return 57344<=d&&d<=63743})(c)},S.treatGlyphAsBackgroundColor=function(c){return n(c)||(function(u){return 9472<=u&&u<=9631})(c)},S.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},S.computeNextVariantOffset=function(c,u,o=0){return(c-(2*Math.round(u)-o))%(2*Math.round(u))}},296:(F,S)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.createSelectionRenderModel=void 0;class n{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(c,u,o,h=!1){if(this.selectionStart=u,this.selectionEnd=o,!u||!o||u[0]===o[0]&&u[1]===o[1])return void this.clear();const d=c.buffers.active.ydisp,_=u[1]-d,r=o[1]-d,t=Math.max(_,0),i=Math.min(r,c.rows-1);t>=c.rows||i<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=h,this.viewportStartRow=_,this.viewportEndRow=r,this.viewportCappedStartRow=t,this.viewportCappedEndRow=i,this.startCol=u[0],this.endCol=o[0])}isCellSelected(c,u,o){return!!this.hasSelection&&(o-=c.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&o>=this.viewportCappedStartRow&&u<this.endCol&&o<=this.viewportCappedEndRow:u<this.startCol&&o>=this.viewportCappedStartRow&&u>=this.endCol&&o<=this.viewportCappedEndRow:o>this.viewportStartRow&&o<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&o===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&o===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&o===this.viewportStartRow&&u>=this.startCol)}}S.createSelectionRenderModel=function(){return new n}},509:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.TextureAtlas=void 0;const a=n(237),c=n(860),u=n(374),o=n(160),h=n(345),d=n(485),_=n(385),r=n(147),t=n(855),i={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let e;class s{get pages(){return this._pages}constructor(f,m,C){this._document=f,this._config=m,this._unicodeService=C,this._didWarmUp=!1,this._cacheMap=new d.FourKeyMap,this._cacheMapCombined=new d.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new r.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new h.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new h.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=g(f,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,u.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const f of this.pages)f.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const f=new _.IdleTaskQueue;for(let m=33;m<126;m++)f.enqueue(()=>{if(!this._cacheMap.get(m,t.DEFAULT_COLOR,t.DEFAULT_COLOR,t.DEFAULT_EXT)){const C=this._drawToCache(m,t.DEFAULT_COLOR,t.DEFAULT_COLOR,t.DEFAULT_EXT);this._cacheMap.set(m,t.DEFAULT_COLOR,t.DEFAULT_COLOR,t.DEFAULT_EXT,C)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const f of this._pages)f.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(s.maxAtlasPages&&this._pages.length>=Math.max(4,s.maxAtlasPages)){const m=this._pages.filter(B=>2*B.canvas.width<=(s.maxTextureSize||4096)).sort((B,T)=>T.canvas.width!==B.canvas.width?T.canvas.width-B.canvas.width:T.percentageUsed-B.percentageUsed);let C=-1,w=0;for(let B=0;B<m.length;B++)if(m[B].canvas.width!==w)C=B,w=m[B].canvas.width;else if(B-C==3)break;const L=m.slice(C,C+4),y=L.map(B=>B.glyphs[0].texturePage).sort((B,T)=>B>T?1:-1),R=this.pages.length-L.length,A=this._mergePages(L,R);A.version++;for(let B=y.length-1;B>=0;B--)this._deletePage(y[B]);this.pages.push(A),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(A.canvas)}const f=new l(this._document,this._textureSize);return this._pages.push(f),this._activePages.push(f),this._onAddTextureAtlasCanvas.fire(f.canvas),f}_mergePages(f,m){const C=2*f[0].canvas.width,w=new l(this._document,C,f);for(const[L,y]of f.entries()){const R=L*y.canvas.width%C,A=Math.floor(L/2)*y.canvas.height;w.ctx.drawImage(y.canvas,R,A);for(const T of y.glyphs)T.texturePage=m,T.sizeClipSpace.x=T.size.x/C,T.sizeClipSpace.y=T.size.y/C,T.texturePosition.x+=R,T.texturePosition.y+=A,T.texturePositionClipSpace.x=T.texturePosition.x/C,T.texturePositionClipSpace.y=T.texturePosition.y/C;this._onRemoveTextureAtlasCanvas.fire(y.canvas);const B=this._activePages.indexOf(y);B!==-1&&this._activePages.splice(B,1)}return w}_deletePage(f){this._pages.splice(f,1);for(let m=f;m<this._pages.length;m++){const C=this._pages[m];for(const w of C.glyphs)w.texturePage--;C.version++}}getRasterizedGlyphCombinedChar(f,m,C,w,L){return this._getFromCacheMap(this._cacheMapCombined,f,m,C,w,L)}getRasterizedGlyph(f,m,C,w,L){return this._getFromCacheMap(this._cacheMap,f,m,C,w,L)}_getFromCacheMap(f,m,C,w,L,y=!1){return e=f.get(m,C,w,L),e||(e=this._drawToCache(m,C,w,L,y),f.set(m,C,w,L,e)),e}_getColorFromAnsiIndex(f){if(f>=this._config.colors.ansi.length)throw new Error("No color found for idx "+f);return this._config.colors.ansi[f]}_getBackgroundColor(f,m,C,w){if(this._config.allowTransparency)return o.NULL_COLOR;let L;switch(f){case 16777216:case 33554432:L=this._getColorFromAnsiIndex(m);break;case 50331648:const y=r.AttributeData.toColorRGB(m);L=o.channels.toColor(y[0],y[1],y[2]);break;default:L=C?o.color.opaque(this._config.colors.foreground):this._config.colors.background}return L}_getForegroundColor(f,m,C,w,L,y,R,A,B,T){const P=this._getMinimumContrastColor(f,m,C,w,L,y,R,B,A,T);if(P)return P;let b;switch(L){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&B&&y<8&&(y+=8),b=this._getColorFromAnsiIndex(y);break;case 50331648:const E=r.AttributeData.toColorRGB(y);b=o.channels.toColor(E[0],E[1],E[2]);break;default:b=R?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(b=o.color.opaque(b)),A&&(b=o.color.multiplyOpacity(b,a.DIM_OPACITY)),b}_resolveBackgroundRgba(f,m,C){switch(f){case 16777216:case 33554432:return this._getColorFromAnsiIndex(m).rgba;case 50331648:return m<<8;default:return C?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(f,m,C,w){switch(f){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&w&&m<8&&(m+=8),this._getColorFromAnsiIndex(m).rgba;case 50331648:return m<<8;default:return C?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(f,m,C,w,L,y,R,A,B,T){if(this._config.minimumContrastRatio===1||T)return;const P=this._getContrastCache(B),b=P.getColor(f,w);if(b!==void 0)return b||void 0;const E=this._resolveBackgroundRgba(m,C,R),k=this._resolveForegroundRgba(L,y,R,A),D=o.rgba.ensureContrastRatio(E,k,this._config.minimumContrastRatio/(B?2:1));if(!D)return void P.setColor(f,w,null);const I=o.channels.toColor(D>>24&255,D>>16&255,D>>8&255);return P.setColor(f,w,I),I}_getContrastCache(f){return f?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(f,m,C,w,L=!1){const y=typeof f=="number"?String.fromCharCode(f):f,R=Math.min(this._config.deviceCellWidth*Math.max(y.length,2)+4,this._textureSize);this._tmpCanvas.width<R&&(this._tmpCanvas.width=R);const A=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<A&&(this._tmpCanvas.height=A),this._tmpCtx.save(),this._workAttributeData.fg=C,this._workAttributeData.bg=m,this._workAttributeData.extended.ext=w,this._workAttributeData.isInvisible())return i;const B=!!this._workAttributeData.isBold(),T=!!this._workAttributeData.isInverse(),P=!!this._workAttributeData.isDim(),b=!!this._workAttributeData.isItalic(),E=!!this._workAttributeData.isUnderline(),k=!!this._workAttributeData.isStrikethrough(),D=!!this._workAttributeData.isOverline();let I=this._workAttributeData.getFgColor(),W=this._workAttributeData.getFgColorMode(),z=this._workAttributeData.getBgColor(),q=this._workAttributeData.getBgColorMode();if(T){const K=I;I=z,z=K;const J=W;W=q,q=J}const M=this._getBackgroundColor(q,z,T,P);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=M.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const x=B?this._config.fontWeightBold:this._config.fontWeight,H=b?"italic":"";this._tmpCtx.font=`${H} ${x} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=a.TEXT_BASELINE;const O=y.length===1&&(0,u.isPowerlineGlyph)(y.charCodeAt(0)),U=y.length===1&&(0,u.isRestrictedPowerlineGlyph)(y.charCodeAt(0)),$=this._getForegroundColor(m,q,z,C,W,I,T,P,B,(0,u.treatGlyphAsBackgroundColor)(y.charCodeAt(0)));this._tmpCtx.fillStyle=$.css;const j=U?0:4;let se=!1;this._config.customGlyphs!==!1&&(se=(0,c.tryDrawCustomChar)(this._tmpCtx,y,j,j,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let ie,oe=!O;if(ie=typeof f=="number"?this._unicodeService.wcwidth(f):this._unicodeService.getStringCellWidth(f),E){this._tmpCtx.save();const K=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),J=K%2==1?.5:0;if(this._tmpCtx.lineWidth=K,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())oe=!1,this._tmpCtx.strokeStyle=`rgb(${r.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{oe=!1;let le=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&le<8&&(le+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(le).css}this._tmpCtx.beginPath();const he=j,ee=Math.ceil(j+this._config.deviceCharHeight)-J-(L?2*K:0),de=ee+K,ue=ee+2*K;let ce=this._workAttributeData.getUnderlineVariantOffset();for(let le=0;le<ie;le++){this._tmpCtx.save();const te=he+le*this._config.deviceCellWidth,ae=he+(le+1)*this._config.deviceCellWidth,re=te+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(te,ee),this._tmpCtx.lineTo(ae,ee),this._tmpCtx.moveTo(te,ue),this._tmpCtx.lineTo(ae,ue);break;case 3:const ge=K<=1?ue:Math.ceil(j+this._config.deviceCharHeight-K/2)-J,me=K<=1?ee:Math.ceil(j+this._config.deviceCharHeight+K/2)-J,$e=new Path2D;$e.rect(te,ee,this._config.deviceCellWidth,ue-ee),this._tmpCtx.clip($e),this._tmpCtx.moveTo(te-this._config.deviceCellWidth/2,de),this._tmpCtx.bezierCurveTo(te-this._config.deviceCellWidth/2,me,te,me,te,de),this._tmpCtx.bezierCurveTo(te,ge,re,ge,re,de),this._tmpCtx.bezierCurveTo(re,me,ae,me,ae,de),this._tmpCtx.bezierCurveTo(ae,ge,ae+this._config.deviceCellWidth/2,ge,ae+this._config.deviceCellWidth/2,de);break;case 4:const Se=ce===0?0:ce>=K?2*K-ce:K-ce;!(ce>=K)==0||Se===0?(this._tmpCtx.setLineDash([Math.round(K),Math.round(K)]),this._tmpCtx.moveTo(te+Se,ee),this._tmpCtx.lineTo(ae,ee)):(this._tmpCtx.setLineDash([Math.round(K),Math.round(K)]),this._tmpCtx.moveTo(te,ee),this._tmpCtx.lineTo(te+Se,ee),this._tmpCtx.moveTo(te+Se+K,ee),this._tmpCtx.lineTo(ae,ee)),ce=(0,u.computeNextVariantOffset)(ae-te,K,ce);break;case 5:const st=.6,rt=.3,we=ae-te,Ue=Math.floor(st*we),Ne=Math.floor(rt*we),nt=we-Ue-Ne;this._tmpCtx.setLineDash([Ue,Ne,nt]),this._tmpCtx.moveTo(te,ee),this._tmpCtx.lineTo(ae,ee);break;default:this._tmpCtx.moveTo(te,ee),this._tmpCtx.lineTo(ae,ee)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!se&&this._config.fontSize>=12&&!this._config.allowTransparency&&y!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const le=this._tmpCtx.measureText(y);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in le&&le.actualBoundingBoxDescent>0){this._tmpCtx.save();const te=new Path2D;te.rect(he,ee-Math.ceil(K/2),this._config.deviceCellWidth*ie,ue-ee+Math.ceil(K/2)),this._tmpCtx.clip(te),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=M.css,this._tmpCtx.strokeText(y,j,j+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(D){const K=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),J=K%2==1?.5:0;this._tmpCtx.lineWidth=K,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(j,j+J),this._tmpCtx.lineTo(j+this._config.deviceCharWidth*ie,j+J),this._tmpCtx.stroke()}if(se||this._tmpCtx.fillText(y,j,j+this._config.deviceCharHeight),y==="_"&&!this._config.allowTransparency){let K=v(this._tmpCtx.getImageData(j,j,this._config.deviceCellWidth,this._config.deviceCellHeight),M,$,oe);if(K)for(let J=1;J<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=M.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(y,j,j+this._config.deviceCharHeight-J),K=v(this._tmpCtx.getImageData(j,j,this._config.deviceCellWidth,this._config.deviceCellHeight),M,$,oe),K);J++);}if(k){const K=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),J=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=K,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(j,j+Math.floor(this._config.deviceCharHeight/2)-J),this._tmpCtx.lineTo(j+this._config.deviceCharWidth*ie,j+Math.floor(this._config.deviceCharHeight/2)-J),this._tmpCtx.stroke()}this._tmpCtx.restore();const X=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let ve;if(ve=this._config.allowTransparency?(function(K){for(let J=0;J<K.data.length;J+=4)if(K.data[J+3]>0)return!1;return!0})(X):v(X,M,$,oe),ve)return i;const Q=this._findGlyphBoundingBox(X,this._workBoundingBox,R,U,se,j);let Y,Z;for(;;){if(this._activePages.length===0){const K=this._createNewPage();Y=K,Z=K.currentRow,Z.height=Q.size.y;break}Y=this._activePages[this._activePages.length-1],Z=Y.currentRow;for(const K of this._activePages)Q.size.y<=K.currentRow.height&&(Y=K,Z=K.currentRow);for(let K=this._activePages.length-1;K>=0;K--)for(const J of this._activePages[K].fixedRows)J.height<=Z.height&&Q.size.y<=J.height&&(Y=this._activePages[K],Z=J);if(Z.y+Q.size.y>=Y.canvas.height||Z.height>Q.size.y+2){let K=!1;if(Y.currentRow.y+Y.currentRow.height+Q.size.y>=Y.canvas.height){let J;for(const he of this._activePages)if(he.currentRow.y+he.currentRow.height+Q.size.y<he.canvas.height){J=he;break}if(J)Y=J;else if(s.maxAtlasPages&&this._pages.length>=s.maxAtlasPages&&Z.y+Q.size.y<=Y.canvas.height&&Z.height>=Q.size.y&&Z.x+Q.size.x<=Y.canvas.width)K=!0;else{const he=this._createNewPage();Y=he,Z=he.currentRow,Z.height=Q.size.y,K=!0}}K||(Y.currentRow.height>0&&Y.fixedRows.push(Y.currentRow),Z={x:0,y:Y.currentRow.y+Y.currentRow.height,height:Q.size.y},Y.fixedRows.push(Z),Y.currentRow={x:0,y:Z.y+Z.height,height:0})}if(Z.x+Q.size.x<=Y.canvas.width)break;Z===Y.currentRow?(Z.x=0,Z.y+=Z.height,Z.height=0):Y.fixedRows.splice(Y.fixedRows.indexOf(Z),1)}return Q.texturePage=this._pages.indexOf(Y),Q.texturePosition.x=Z.x,Q.texturePosition.y=Z.y,Q.texturePositionClipSpace.x=Z.x/Y.canvas.width,Q.texturePositionClipSpace.y=Z.y/Y.canvas.height,Q.sizeClipSpace.x/=Y.canvas.width,Q.sizeClipSpace.y/=Y.canvas.height,Z.height=Math.max(Z.height,Q.size.y),Z.x+=Q.size.x,Y.ctx.putImageData(X,Q.texturePosition.x-this._workBoundingBox.left,Q.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Q.size.x,Q.size.y),Y.addGlyph(Q),Y.version++,Q}_findGlyphBoundingBox(f,m,C,w,L,y){m.top=0;const R=w?this._config.deviceCellHeight:this._tmpCanvas.height,A=w?this._config.deviceCellWidth:C;let B=!1;for(let T=0;T<R;T++){for(let P=0;P<A;P++){const b=T*this._tmpCanvas.width*4+4*P+3;if(f.data[b]!==0){m.top=T,B=!0;break}}if(B)break}m.left=0,B=!1;for(let T=0;T<y+A;T++){for(let P=0;P<R;P++){const b=P*this._tmpCanvas.width*4+4*T+3;if(f.data[b]!==0){m.left=T,B=!0;break}}if(B)break}m.right=A,B=!1;for(let T=y+A-1;T>=y;T--){for(let P=0;P<R;P++){const b=P*this._tmpCanvas.width*4+4*T+3;if(f.data[b]!==0){m.right=T,B=!0;break}}if(B)break}m.bottom=R,B=!1;for(let T=R-1;T>=0;T--){for(let P=0;P<A;P++){const b=T*this._tmpCanvas.width*4+4*P+3;if(f.data[b]!==0){m.bottom=T,B=!0;break}}if(B)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:m.right-m.left+1,y:m.bottom-m.top+1},sizeClipSpace:{x:m.right-m.left+1,y:m.bottom-m.top+1},offset:{x:-m.left+y+(w||L?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-m.top+y+(w||L?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}S.TextureAtlas=s;class l{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(f){this._glyphs.push(f),this._usedPixels+=f.size.x*f.size.y}constructor(f,m,C){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],C)for(const w of C)this._glyphs.push(...w.glyphs),this._usedPixels+=w._usedPixels;this.canvas=g(f,m,m),this.ctx=(0,u.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function v(p,f,m,C){const w=f.rgba>>>24,L=f.rgba>>>16&255,y=f.rgba>>>8&255,R=m.rgba>>>24,A=m.rgba>>>16&255,B=m.rgba>>>8&255,T=Math.floor((Math.abs(w-R)+Math.abs(L-A)+Math.abs(y-B))/12);let P=!0;for(let b=0;b<p.data.length;b+=4)p.data[b]===w&&p.data[b+1]===L&&p.data[b+2]===y||C&&Math.abs(p.data[b]-w)+Math.abs(p.data[b+1]-L)+Math.abs(p.data[b+2]-y)<T?p.data[b+3]=0:P=!1;return P}function g(p,f,m){const C=p.createElement("canvas");return C.width=f,C.height=m,C}},577:function(F,S,n){var a=this&&this.__decorate||function(t,i,e,s){var l,v=arguments.length,g=v<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,e):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(t,i,e,s);else for(var p=t.length-1;p>=0;p--)(l=t[p])&&(g=(v<3?l(g):v>3?l(i,e,g):l(i,e))||g);return v>3&&g&&Object.defineProperty(i,e,g),g},c=this&&this.__param||function(t,i){return function(e,s){i(e,s,t)}};Object.defineProperty(S,"__esModule",{value:!0}),S.CharacterJoinerService=S.JoinedCellData=void 0;const u=n(147),o=n(855),h=n(782),d=n(97);class _ extends u.AttributeData{constructor(i,e,s){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=e,this._width=s}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(i){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}S.JoinedCellData=_;let r=S.CharacterJoinerService=class Ke{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new h.CellData}register(i){const e={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(e),e.id}deregister(i){for(let e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===i)return this._characterJoiners.splice(e,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const e=this._bufferService.buffer.lines.get(i);if(!e||e.length===0)return[];const s=[],l=e.translateToString(!0);let v=0,g=0,p=0,f=e.getFg(0),m=e.getBg(0);for(let C=0;C<e.getTrimmedLength();C++)if(e.loadCell(C,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==f||this._workCell.bg!==m){if(C-v>1){const w=this._getJoinedRanges(l,p,g,e,v);for(let L=0;L<w.length;L++)s.push(w[L])}v=C,p=g,f=this._workCell.fg,m=this._workCell.bg}g+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-v>1){const C=this._getJoinedRanges(l,p,g,e,v);for(let w=0;w<C.length;w++)s.push(C[w])}return s}_getJoinedRanges(i,e,s,l,v){const g=i.substring(e,s);let p=[];try{p=this._characterJoiners[0].handler(g)}catch(f){console.error(f)}for(let f=1;f<this._characterJoiners.length;f++)try{const m=this._characterJoiners[f].handler(g);for(let C=0;C<m.length;C++)Ke._mergeRanges(p,m[C])}catch(m){console.error(m)}return this._stringRangesToCellRanges(p,l,v),p}_stringRangesToCellRanges(i,e,s){let l=0,v=!1,g=0,p=i[l];if(p){for(let f=s;f<this._bufferService.cols;f++){const m=e.getWidth(f),C=e.getString(f).length||o.WHITESPACE_CELL_CHAR.length;if(m!==0){if(!v&&p[0]<=g&&(p[0]=f,v=!0),p[1]<=g){if(p[1]=f,p=i[++l],!p)break;p[0]<=g?(p[0]=f,v=!0):v=!1}g+=C}}p&&(p[1]=this._bufferService.cols)}}static _mergeRanges(i,e){let s=!1;for(let l=0;l<i.length;l++){const v=i[l];if(s){if(e[1]<=v[0])return i[l-1][1]=e[1],i;if(e[1]<=v[1])return i[l-1][1]=Math.max(e[1],v[1]),i.splice(l,1),i;i.splice(l,1),l--}else{if(e[1]<=v[0])return i.splice(l,0,e),i;if(e[1]<=v[1])return v[0]=Math.min(e[0],v[0]),i;e[0]<v[1]&&(v[0]=Math.min(e[0],v[0]),s=!0)}}return s?i[i.length-1][1]=e[1]:i.push(e),i}};S.CharacterJoinerService=r=a([c(0,d.IBufferService)],r)},160:(F,S)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.contrastRatio=S.toPaddedHex=S.rgba=S.rgb=S.css=S.color=S.channels=S.NULL_COLOR=void 0;let n=0,a=0,c=0,u=0;var o,h,d,_,r;function t(e){const s=e.toString(16);return s.length<2?"0"+s:s}function i(e,s){return e<s?(s+.05)/(e+.05):(e+.05)/(s+.05)}S.NULL_COLOR={css:"#00000000",rgba:0},(function(e){e.toCss=function(s,l,v,g){return g!==void 0?`#${t(s)}${t(l)}${t(v)}${t(g)}`:`#${t(s)}${t(l)}${t(v)}`},e.toRgba=function(s,l,v,g=255){return(s<<24|l<<16|v<<8|g)>>>0},e.toColor=function(s,l,v,g){return{css:e.toCss(s,l,v,g),rgba:e.toRgba(s,l,v,g)}}})(o||(S.channels=o={})),(function(e){function s(l,v){return u=Math.round(255*v),[n,a,c]=r.toChannels(l.rgba),{css:o.toCss(n,a,c,u),rgba:o.toRgba(n,a,c,u)}}e.blend=function(l,v){if(u=(255&v.rgba)/255,u===1)return{css:v.css,rgba:v.rgba};const g=v.rgba>>24&255,p=v.rgba>>16&255,f=v.rgba>>8&255,m=l.rgba>>24&255,C=l.rgba>>16&255,w=l.rgba>>8&255;return n=m+Math.round((g-m)*u),a=C+Math.round((p-C)*u),c=w+Math.round((f-w)*u),{css:o.toCss(n,a,c),rgba:o.toRgba(n,a,c)}},e.isOpaque=function(l){return!(255&~l.rgba)},e.ensureContrastRatio=function(l,v,g){const p=r.ensureContrastRatio(l.rgba,v.rgba,g);if(p)return o.toColor(p>>24&255,p>>16&255,p>>8&255)},e.opaque=function(l){const v=(255|l.rgba)>>>0;return[n,a,c]=r.toChannels(v),{css:o.toCss(n,a,c),rgba:v}},e.opacity=s,e.multiplyOpacity=function(l,v){return u=255&l.rgba,s(l,u*v/255)},e.toColorRGB=function(l){return[l.rgba>>24&255,l.rgba>>16&255,l.rgba>>8&255]}})(h||(S.color=h={})),(function(e){let s,l;try{const v=document.createElement("canvas");v.width=1,v.height=1;const g=v.getContext("2d",{willReadFrequently:!0});g&&(s=g,s.globalCompositeOperation="copy",l=s.createLinearGradient(0,0,1,1))}catch{}e.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return n=parseInt(v.slice(1,2).repeat(2),16),a=parseInt(v.slice(2,3).repeat(2),16),c=parseInt(v.slice(3,4).repeat(2),16),o.toColor(n,a,c);case 5:return n=parseInt(v.slice(1,2).repeat(2),16),a=parseInt(v.slice(2,3).repeat(2),16),c=parseInt(v.slice(3,4).repeat(2),16),u=parseInt(v.slice(4,5).repeat(2),16),o.toColor(n,a,c,u);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const g=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(g)return n=parseInt(g[1]),a=parseInt(g[2]),c=parseInt(g[3]),u=Math.round(255*(g[5]===void 0?1:parseFloat(g[5]))),o.toColor(n,a,c,u);if(!s||!l)throw new Error("css.toColor: Unsupported css format");if(s.fillStyle=l,s.fillStyle=v,typeof s.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(s.fillRect(0,0,1,1),[n,a,c,u]=s.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:o.toRgba(n,a,c,u),css:v}}})(d||(S.css=d={})),(function(e){function s(l,v,g){const p=l/255,f=v/255,m=g/255;return .2126*(p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4))+.7152*(f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4))+.0722*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))}e.relativeLuminance=function(l){return s(l>>16&255,l>>8&255,255&l)},e.relativeLuminance2=s})(_||(S.rgb=_={})),(function(e){function s(v,g,p){const f=v>>24&255,m=v>>16&255,C=v>>8&255;let w=g>>24&255,L=g>>16&255,y=g>>8&255,R=i(_.relativeLuminance2(w,L,y),_.relativeLuminance2(f,m,C));for(;R<p&&(w>0||L>0||y>0);)w-=Math.max(0,Math.ceil(.1*w)),L-=Math.max(0,Math.ceil(.1*L)),y-=Math.max(0,Math.ceil(.1*y)),R=i(_.relativeLuminance2(w,L,y),_.relativeLuminance2(f,m,C));return(w<<24|L<<16|y<<8|255)>>>0}function l(v,g,p){const f=v>>24&255,m=v>>16&255,C=v>>8&255;let w=g>>24&255,L=g>>16&255,y=g>>8&255,R=i(_.relativeLuminance2(w,L,y),_.relativeLuminance2(f,m,C));for(;R<p&&(w<255||L<255||y<255);)w=Math.min(255,w+Math.ceil(.1*(255-w))),L=Math.min(255,L+Math.ceil(.1*(255-L))),y=Math.min(255,y+Math.ceil(.1*(255-y))),R=i(_.relativeLuminance2(w,L,y),_.relativeLuminance2(f,m,C));return(w<<24|L<<16|y<<8|255)>>>0}e.blend=function(v,g){if(u=(255&g)/255,u===1)return g;const p=g>>24&255,f=g>>16&255,m=g>>8&255,C=v>>24&255,w=v>>16&255,L=v>>8&255;return n=C+Math.round((p-C)*u),a=w+Math.round((f-w)*u),c=L+Math.round((m-L)*u),o.toRgba(n,a,c)},e.ensureContrastRatio=function(v,g,p){const f=_.relativeLuminance(v>>8),m=_.relativeLuminance(g>>8);if(i(f,m)<p){if(m<f){const L=s(v,g,p),y=i(f,_.relativeLuminance(L>>8));if(y<p){const R=l(v,g,p);return y>i(f,_.relativeLuminance(R>>8))?L:R}return L}const C=l(v,g,p),w=i(f,_.relativeLuminance(C>>8));if(w<p){const L=s(v,g,p);return w>i(f,_.relativeLuminance(L>>8))?C:L}return C}},e.reduceLuminance=s,e.increaseLuminance=l,e.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(S.rgba=r={})),S.toPaddedHex=t,S.contrastRatio=i},345:(F,S)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.runAndSubscribe=S.forwardEvent=S.EventEmitter=void 0,S.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=n=>(this._listeners.push(n),{dispose:()=>{if(!this._disposed){for(let a=0;a<this._listeners.length;a++)if(this._listeners[a]===n)return void this._listeners.splice(a,1)}}})),this._event}fire(n,a){const c=[];for(let u=0;u<this._listeners.length;u++)c.push(this._listeners[u]);for(let u=0;u<c.length;u++)c[u].call(void 0,n,a)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},S.forwardEvent=function(n,a){return n(c=>a.fire(c))},S.runAndSubscribe=function(n,a){return a(void 0),n(c=>a(c))}},859:(F,S)=>{function n(a){for(const c of a)c.dispose();a.length=0}Object.defineProperty(S,"__esModule",{value:!0}),S.getDisposeArrayDisposable=S.disposeArray=S.toDisposable=S.MutableDisposable=S.Disposable=void 0,S.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const a of this._disposables)a.dispose();this._disposables.length=0}register(a){return this._disposables.push(a),a}unregister(a){const c=this._disposables.indexOf(a);c!==-1&&this._disposables.splice(c,1)}},S.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(a){var c;this._isDisposed||a===this._value||((c=this._value)==null||c.dispose(),this._value=a)}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,(a=this._value)==null||a.dispose(),this._value=void 0}},S.toDisposable=function(a){return{dispose:a}},S.disposeArray=n,S.getDisposeArrayDisposable=function(a){return{dispose:()=>n(a)}}},485:(F,S)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.FourKeyMap=S.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(c,u,o){this._data[c]||(this._data[c]={}),this._data[c][u]=o}get(c,u){return this._data[c]?this._data[c][u]:void 0}clear(){this._data={}}}S.TwoKeyMap=n,S.FourKeyMap=class{constructor(){this._data=new n}set(a,c,u,o,h){this._data.get(a,c)||this._data.set(a,c,new n),this._data.get(a,c).set(u,o,h)}get(a,c,u,o){var h;return(h=this._data.get(a,c))==null?void 0:h.get(u,o)}clear(){this._data.clear()}}},399:(F,S)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.isChromeOS=S.isLinux=S.isWindows=S.isIphone=S.isIpad=S.isMac=S.getSafariVersion=S.isSafari=S.isLegacyEdge=S.isFirefox=S.isNode=void 0,S.isNode=typeof process<"u"&&"title"in process;const n=S.isNode?"node":navigator.userAgent,a=S.isNode?"node":navigator.platform;S.isFirefox=n.includes("Firefox"),S.isLegacyEdge=n.includes("Edge"),S.isSafari=/^((?!chrome|android).)*safari/i.test(n),S.getSafariVersion=function(){if(!S.isSafari)return 0;const c=n.match(/Version\/(\d+)/);return c===null||c.length<2?0:parseInt(c[1])},S.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(a),S.isIpad=a==="iPad",S.isIphone=a==="iPhone",S.isWindows=["Windows","Win16","Win32","WinCE"].includes(a),S.isLinux=a.indexOf("Linux")>=0,S.isChromeOS=/\bCrOS\b/.test(n)},385:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.DebouncedIdleTask=S.IdleTaskQueue=S.PriorityTaskQueue=void 0;const a=n(399);class c{constructor(){this._tasks=[],this._i=0}enqueue(h){this._tasks.push(h),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(h){this._idleCallback=void 0;let d=0,_=0,r=h.timeRemaining(),t=0;for(;this._i<this._tasks.length;){if(d=Date.now(),this._tasks[this._i]()||this._i++,d=Math.max(1,Date.now()-d),_=Math.max(d,_),t=h.timeRemaining(),1.5*_>t)return r-d<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-d))}ms`),void this._start();r=t}this.clear()}}class u extends c{_requestCallback(h){return setTimeout(()=>h(this._createDeadline(16)))}_cancelCallback(h){clearTimeout(h)}_createDeadline(h){const d=Date.now()+h;return{timeRemaining:()=>Math.max(0,d-Date.now())}}}S.PriorityTaskQueue=u,S.IdleTaskQueue=!a.isNode&&"requestIdleCallback"in window?class extends c{_requestCallback(o){return requestIdleCallback(o)}_cancelCallback(o){cancelIdleCallback(o)}}:u,S.DebouncedIdleTask=class{constructor(){this._queue=new S.IdleTaskQueue}set(o){this._queue.clear(),this._queue.enqueue(o)}flush(){this._queue.flush()}}},147:(F,S)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.ExtendedAttrs=S.AttributeData=void 0;class n{constructor(){this.fg=0,this.bg=0,this.extended=new a}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new n;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return!(50331648&~this.fg)}isBgRGB(){return!(50331648&~this.bg)}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return!(50331648&this.fg)}isBgDefault(){return!(50331648&this.bg)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?!(50331648&~this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?!(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}S.AttributeData=n;class a{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,o=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=o}clone(){return new a(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}S.ExtendedAttrs=a},782:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.CellData=void 0;const a=n(133),c=n(855),u=n(147);class o extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(d){const _=new o;return _.setFromCharData(d),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,a.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(d){this.fg=d[c.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(d[c.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(d[c.CHAR_DATA_CHAR_INDEX].length===2){const r=d[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const t=d[c.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=t&&t<=57343?this.content=1024*(r-55296)+t-56320+65536|d[c.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=d[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|d[c.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=d[c.CHAR_DATA_CHAR_INDEX],this.content=2097152|d[c.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}S.CellData=o},855:(F,S)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.WHITESPACE_CELL_CODE=S.WHITESPACE_CELL_WIDTH=S.WHITESPACE_CELL_CHAR=S.NULL_CELL_CODE=S.NULL_CELL_WIDTH=S.NULL_CELL_CHAR=S.CHAR_DATA_CODE_INDEX=S.CHAR_DATA_WIDTH_INDEX=S.CHAR_DATA_CHAR_INDEX=S.CHAR_DATA_ATTR_INDEX=S.DEFAULT_EXT=S.DEFAULT_ATTR=S.DEFAULT_COLOR=void 0,S.DEFAULT_COLOR=0,S.DEFAULT_ATTR=256|S.DEFAULT_COLOR<<9,S.DEFAULT_EXT=0,S.CHAR_DATA_ATTR_INDEX=0,S.CHAR_DATA_CHAR_INDEX=1,S.CHAR_DATA_WIDTH_INDEX=2,S.CHAR_DATA_CODE_INDEX=3,S.NULL_CELL_CHAR="",S.NULL_CELL_WIDTH=1,S.NULL_CELL_CODE=0,S.WHITESPACE_CELL_CHAR=" ",S.WHITESPACE_CELL_WIDTH=1,S.WHITESPACE_CELL_CODE=32},133:(F,S)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.Utf8ToUtf32=S.StringToUtf32=S.utf32ToString=S.stringFromCodePoint=void 0,S.stringFromCodePoint=function(n){return n>65535?(n-=65536,String.fromCharCode(55296+(n>>10))+String.fromCharCode(n%1024+56320)):String.fromCharCode(n)},S.utf32ToString=function(n,a=0,c=n.length){let u="";for(let o=a;o<c;++o){let h=n[o];h>65535?(h-=65536,u+=String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):u+=String.fromCharCode(h)}return u},S.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(n,a){const c=n.length;if(!c)return 0;let u=0,o=0;if(this._interim){const h=n.charCodeAt(o++);56320<=h&&h<=57343?a[u++]=1024*(this._interim-55296)+h-56320+65536:(a[u++]=this._interim,a[u++]=h),this._interim=0}for(let h=o;h<c;++h){const d=n.charCodeAt(h);if(55296<=d&&d<=56319){if(++h>=c)return this._interim=d,u;const _=n.charCodeAt(h);56320<=_&&_<=57343?a[u++]=1024*(d-55296)+_-56320+65536:(a[u++]=d,a[u++]=_)}else d!==65279&&(a[u++]=d)}return u}},S.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(n,a){const c=n.length;if(!c)return 0;let u,o,h,d,_=0,r=0,t=0;if(this.interim[0]){let s=!1,l=this.interim[0];l&=(224&l)==192?31:(240&l)==224?15:7;let v,g=0;for(;(v=63&this.interim[++g])&&g<4;)l<<=6,l|=v;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,f=p-g;for(;t<f;){if(t>=c)return 0;if(v=n[t++],(192&v)!=128){t--,s=!0;break}this.interim[g++]=v,l<<=6,l|=63&v}s||(p===2?l<128?t--:a[_++]=l:p===3?l<2048||l>=55296&&l<=57343||l===65279||(a[_++]=l):l<65536||l>1114111||(a[_++]=l)),this.interim.fill(0)}const i=c-4;let e=t;for(;e<c;){for(;!(!(e<i)||128&(u=n[e])||128&(o=n[e+1])||128&(h=n[e+2])||128&(d=n[e+3]));)a[_++]=u,a[_++]=o,a[_++]=h,a[_++]=d,e+=4;if(u=n[e++],u<128)a[_++]=u;else if((224&u)==192){if(e>=c)return this.interim[0]=u,_;if(o=n[e++],(192&o)!=128){e--;continue}if(r=(31&u)<<6|63&o,r<128){e--;continue}a[_++]=r}else if((240&u)==224){if(e>=c)return this.interim[0]=u,_;if(o=n[e++],(192&o)!=128){e--;continue}if(e>=c)return this.interim[0]=u,this.interim[1]=o,_;if(h=n[e++],(192&h)!=128){e--;continue}if(r=(15&u)<<12|(63&o)<<6|63&h,r<2048||r>=55296&&r<=57343||r===65279)continue;a[_++]=r}else if((248&u)==240){if(e>=c)return this.interim[0]=u,_;if(o=n[e++],(192&o)!=128){e--;continue}if(e>=c)return this.interim[0]=u,this.interim[1]=o,_;if(h=n[e++],(192&h)!=128){e--;continue}if(e>=c)return this.interim[0]=u,this.interim[1]=o,this.interim[2]=h,_;if(d=n[e++],(192&d)!=128){e--;continue}if(r=(7&u)<<18|(63&o)<<12|(63&h)<<6|63&d,r<65536||r>1114111)continue;a[_++]=r}}return _}}},776:function(F,S,n){var a=this&&this.__decorate||function(r,t,i,e){var s,l=arguments.length,v=l<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,t,i,e);else for(var g=r.length-1;g>=0;g--)(s=r[g])&&(v=(l<3?s(v):l>3?s(t,i,v):s(t,i))||v);return l>3&&v&&Object.defineProperty(t,i,v),v},c=this&&this.__param||function(r,t){return function(i,e){t(i,e,r)}};Object.defineProperty(S,"__esModule",{value:!0}),S.traceCall=S.setTraceLogger=S.LogService=void 0;const u=n(859),o=n(97),h={trace:o.LogLevelEnum.TRACE,debug:o.LogLevelEnum.DEBUG,info:o.LogLevelEnum.INFO,warn:o.LogLevelEnum.WARN,error:o.LogLevelEnum.ERROR,off:o.LogLevelEnum.OFF};let d,_=S.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=o.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),d=this}_updateLogLevel(){this._logLevel=h[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let t=0;t<r.length;t++)typeof r[t]=="function"&&(r[t]=r[t]())}_log(r,t,i){this._evalLazyOptionalParams(i),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+t,...i)}trace(r,...t){var i;this._logLevel<=o.LogLevelEnum.TRACE&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,r,t)}debug(r,...t){var i;this._logLevel<=o.LogLevelEnum.DEBUG&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,r,t)}info(r,...t){var i;this._logLevel<=o.LogLevelEnum.INFO&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,r,t)}warn(r,...t){var i;this._logLevel<=o.LogLevelEnum.WARN&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,r,t)}error(r,...t){var i;this._logLevel<=o.LogLevelEnum.ERROR&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,r,t)}};S.LogService=_=a([c(0,o.IOptionsService)],_),S.setTraceLogger=function(r){d=r},S.traceCall=function(r,t,i){if(typeof i.value!="function")throw new Error("not supported");const e=i.value;i.value=function(...s){if(d.logLevel!==o.LogLevelEnum.TRACE)return e.apply(this,s);d.trace(`GlyphRenderer#${e.name}(${s.map(v=>JSON.stringify(v)).join(", ")})`);const l=e.apply(this,s);return d.trace(`GlyphRenderer#${e.name} return`,l),l}}},726:(F,S)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.createDecorator=S.getServiceDependencies=S.serviceRegistry=void 0;const n="di$target",a="di$dependencies";S.serviceRegistry=new Map,S.getServiceDependencies=function(c){return c[a]||[]},S.createDecorator=function(c){if(S.serviceRegistry.has(c))return S.serviceRegistry.get(c);const u=function(o,h,d){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,r,t){r[n]===r?r[a].push({id:_,index:t}):(r[a]=[{id:_,index:t}],r[n]=r)})(u,o,d)};return u.toString=()=>c,S.serviceRegistry.set(c,u),u}},97:(F,S,n)=>{Object.defineProperty(S,"__esModule",{value:!0}),S.IDecorationService=S.IUnicodeService=S.IOscLinkService=S.IOptionsService=S.ILogService=S.LogLevelEnum=S.IInstantiationService=S.ICharsetService=S.ICoreService=S.ICoreMouseService=S.IBufferService=void 0;const a=n(726);var c;S.IBufferService=(0,a.createDecorator)("BufferService"),S.ICoreMouseService=(0,a.createDecorator)("CoreMouseService"),S.ICoreService=(0,a.createDecorator)("CoreService"),S.ICharsetService=(0,a.createDecorator)("CharsetService"),S.IInstantiationService=(0,a.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(c||(S.LogLevelEnum=c={})),S.ILogService=(0,a.createDecorator)("LogService"),S.IOptionsService=(0,a.createDecorator)("OptionsService"),S.IOscLinkService=(0,a.createDecorator)("OscLinkService"),S.IUnicodeService=(0,a.createDecorator)("UnicodeService"),S.IDecorationService=(0,a.createDecorator)("DecorationService")}},G={};function N(F){var S=G[F];if(S!==void 0)return S.exports;var n=G[F]={exports:{}};return ne[F].call(n.exports,n,n.exports,N),n.exports}var V={};return(()=>{var F=V;Object.defineProperty(F,"__esModule",{value:!0}),F.CanvasAddon=void 0;const S=N(345),n=N(859),a=N(776),c=N(949);class u extends n.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new S.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new S.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var h;return(h=this._renderer)==null?void 0:h.textureAtlas}activate(h){const d=h._core;if(!h.element)return void this.register(d.onWillOpen(()=>this.activate(h)));this._terminal=h;const _=d.coreService,r=d.optionsService,t=d.screenElement,i=d.linkifier,e=d,s=e._bufferService,l=e._renderService,v=e._characterJoinerService,g=e._charSizeService,p=e._coreBrowserService,f=e._decorationService,m=e._logService,C=e._themeService;(0,a.setTraceLogger)(m),this._renderer=new c.CanvasRenderer(h,t,i,s,g,r,v,_,p,f,C),this.register((0,S.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,S.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),l.setRenderer(this._renderer),l.handleResize(s.cols,s.rows),this.register((0,n.toDisposable)(()=>{var w;l.setRenderer(this._terminal._core._createRenderer()),l.handleResize(h.cols,h.rows),(w=this._renderer)==null||w.dispose(),this._renderer=void 0}))}clearTextureAtlas(){var h;(h=this._renderer)==null||h.clearTextureAtlas()}}F.CanvasAddon=u})(),V})(),ke.exports=De()),Me={exports:{}},Ae,Be,Ye=(Re||(Re=1,Ae=Me,(function(ne,G){Ae.exports=G()})(self,()=>(()=>{var ne={};return(()=>{var G=ne;Object.defineProperty(G,"__esModule",{value:!0}),G.FitAddon=void 0,G.FitAddon=class{activate(N){this._terminal=N}dispose(){}fit(){const N=this.proposeDimensions();if(!N||!this._terminal||isNaN(N.cols)||isNaN(N.rows))return;const V=this._terminal._core;this._terminal.rows===N.rows&&this._terminal.cols===N.cols||(V._renderService.clear(),this._terminal.resize(N.cols,N.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const N=this._terminal._core,V=N._renderService.dimensions;if(V.css.cell.width===0||V.css.cell.height===0)return;const F=this._terminal.options.scrollback===0?0:N.viewport.scrollBarWidth,S=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(S.getPropertyValue("height")),a=Math.max(0,parseInt(S.getPropertyValue("width"))),c=window.getComputedStyle(this._terminal.element),u=n-(parseInt(c.getPropertyValue("padding-top"))+parseInt(c.getPropertyValue("padding-bottom"))),o=a-(parseInt(c.getPropertyValue("padding-right"))+parseInt(c.getPropertyValue("padding-left")))-F;return{cols:Math.max(2,Math.floor(o/V.css.cell.width)),rows:Math.max(1,Math.floor(u/V.css.cell.height))}}}})(),ne})())),Me.exports),Te={exports:{}},Oe,Ze=(Be||(Be=1,(function(ne){(function(G,N){ne.exports=N()})(self,()=>(()=>{var G={345:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const u=[];for(let o=0;o<this._listeners.length;o++)u.push(this._listeners[o]);for(let o=0;o<u.length;o++)u[o].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(a,c){return a(u=>c.fire(u))},n.runAndSubscribe=function(a,c){return c(void 0),a(u=>c(u))}},859:(S,n)=>{function a(c){for(const u of c)u.dispose();c.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const u=this._disposables.indexOf(c);u!==-1&&this._disposables.splice(u,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var u;this._isDisposed||c===this._value||((u=this._value)==null||u.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},n.toDisposable=function(c){return{dispose:c}},n.disposeArray=a,n.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}}},N={};function V(S){var n=N[S];if(n!==void 0)return n.exports;var a=N[S]={exports:{}};return G[S](a,a.exports,V),a.exports}var F={};return(()=>{var S=F;Object.defineProperty(S,"__esModule",{value:!0}),S.SearchAddon=void 0;const n=V(345),a=V(859),c=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class u extends a.Disposable{constructor(h){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new a.MutableDisposable),this._linesCacheTimeoutId=0,this._linesCacheDisposables=new a.MutableDisposable,this._onDidChangeResults=this.register(new n.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(h==null?void 0:h.highlightLimit)??1e3}activate(h){this._terminal=h,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,a.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var h;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((h=this._lastSearchOptions)!=null&&h.decorations)&&(this._highlightTimeout=setTimeout(()=>{const d=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(d,{...this._lastSearchOptions,incremental:!0,noScroll:!0})},200))}clearDecorations(h){this._selectedDecoration.clear(),(0,a.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),h||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(h,d){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const _=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,d);this._lastSearchOptions=d,d!=null&&d.decorations&&(this._cachedSearchTerm===void 0||h!==this._cachedSearchTerm||_)&&this._highlightAllMatches(h,d);const r=this._findNextAndSelect(h,d);return this._fireResults(d),this._cachedSearchTerm=h,r}_highlightAllMatches(h,d){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!h||h.length===0)return void this.clearDecorations();d=d||{},this.clearDecorations(!0);const _=[];let r,t=this._find(h,0,0,d);for(;t&&((r==null?void 0:r.row)!==t.row||(r==null?void 0:r.col)!==t.col)&&!(_.length>=this._highlightLimit);)r=t,_.push(r),t=this._find(h,r.col+r.term.length>=this._terminal.cols?r.row+1:r.row,r.col+r.term.length>=this._terminal.cols?0:r.col+1,d);for(const i of _){const e=this._createResultDecoration(i,d.decorations);e&&(this._highlightedLines.add(e.marker.line),this._highlightDecorations.push({decoration:e,match:i,dispose(){e.dispose()}}))}}_find(h,d,_,r){var e;if(!this._terminal||!h||h.length===0)return(e=this._terminal)==null||e.clearSelection(),void this.clearDecorations();if(_>this._terminal.cols)throw new Error(`Invalid col: ${_} to search in terminal of ${this._terminal.cols} cols`);let t;this._initLinesCache();const i={startRow:d,startCol:_};if(t=this._findInLine(h,i,r),!t)for(let s=d+1;s<this._terminal.buffer.active.baseY+this._terminal.rows&&(i.startRow=s,i.startCol=0,t=this._findInLine(h,i,r),!t);s++);return t}_findNextAndSelect(h,d){var s;if(!this._terminal||!h||h.length===0)return(s=this._terminal)==null||s.clearSelection(),this.clearDecorations(),!1;const _=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=0,t=0;_&&(this._cachedSearchTerm===h?(r=_.end.x,t=_.end.y):(r=_.start.x,t=_.start.y)),this._initLinesCache();const i={startRow:t,startCol:r};let e=this._findInLine(h,i,d);if(!e)for(let l=t+1;l<this._terminal.buffer.active.baseY+this._terminal.rows&&(i.startRow=l,i.startCol=0,e=this._findInLine(h,i,d),!e);l++);if(!e&&t!==0)for(let l=0;l<t&&(i.startRow=l,i.startCol=0,e=this._findInLine(h,i,d),!e);l++);return!e&&_&&(i.startRow=_.start.y,i.startCol=0,e=this._findInLine(h,i,d)),this._selectResult(e,d==null?void 0:d.decorations,d==null?void 0:d.noScroll)}findPrevious(h,d){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const _=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,d);this._lastSearchOptions=d,d!=null&&d.decorations&&(this._cachedSearchTerm===void 0||h!==this._cachedSearchTerm||_)&&this._highlightAllMatches(h,d);const r=this._findPreviousAndSelect(h,d);return this._fireResults(d),this._cachedSearchTerm=h,r}_didOptionsChange(h,d){return!!d&&(h.caseSensitive!==d.caseSensitive||h.regex!==d.regex||h.wholeWord!==d.wholeWord)}_fireResults(h){if(h!=null&&h.decorations){let d=-1;if(this._selectedDecoration.value){const _=this._selectedDecoration.value.match;for(let r=0;r<this._highlightDecorations.length;r++){const t=this._highlightDecorations[r].match;if(t.row===_.row&&t.col===_.col&&t.size===_.size){d=r;break}}}this._onDidChangeResults.fire({resultIndex:d,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(h,d){var l;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!h||h.length===0)return(l=this._terminal)==null||l.clearSelection(),this.clearDecorations(),!1;const _=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=this._terminal.buffer.active.baseY+this._terminal.rows-1,t=this._terminal.cols;const i=!0;this._initLinesCache();const e={startRow:r,startCol:t};let s;if(_&&(e.startRow=r=_.start.y,e.startCol=t=_.start.x,this._cachedSearchTerm!==h&&(s=this._findInLine(h,e,d,!1),s||(e.startRow=r=_.end.y,e.startCol=t=_.end.x))),s||(s=this._findInLine(h,e,d,i)),!s){e.startCol=Math.max(e.startCol,this._terminal.cols);for(let v=r-1;v>=0&&(e.startRow=v,s=this._findInLine(h,e,d,i),!s);v--);}if(!s&&r!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let v=this._terminal.buffer.active.baseY+this._terminal.rows-1;v>=r&&(e.startRow=v,s=this._findInLine(h,e,d,i),!s);v--);return this._selectResult(s,d==null?void 0:d.decorations,d==null?void 0:d.noScroll)}_initLinesCache(){const h=this._terminal;this._linesCache||(this._linesCache=new Array(h.buffer.active.length),this._linesCacheDisposables.value=(0,a.getDisposeArrayDisposable)([h.onLineFeed(()=>this._destroyLinesCache()),h.onCursorMove(()=>this._destroyLinesCache()),h.onResize(()=>this._destroyLinesCache())])),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(h,d,_){return(h===0||c.includes(d[h-1]))&&(h+_.length===d.length||c.includes(d[h+_.length]))}_findInLine(h,d,_={},r=!1){var w;const t=this._terminal,i=d.startRow,e=d.startCol,s=t.buffer.active.getLine(i);if(s!=null&&s.isWrapped)return r?void(d.startCol+=t.cols):(d.startRow--,d.startCol+=t.cols,this._findInLine(h,d,_));let l=(w=this._linesCache)==null?void 0:w[i];l||(l=this._translateBufferLineToStringWithWrap(i,!0),this._linesCache&&(this._linesCache[i]=l));const[v,g]=l,p=this._bufferColsToStringOffset(i,e),f=_.caseSensitive?h:h.toLowerCase(),m=_.caseSensitive?v:v.toLowerCase();let C=-1;if(_.regex){const L=RegExp(f,"g");let y;if(r)for(;y=L.exec(m.slice(0,p));)C=L.lastIndex-y[0].length,h=y[0],L.lastIndex-=h.length-1;else y=L.exec(m.slice(p)),y&&y[0].length>0&&(C=p+(L.lastIndex-y[0].length),h=y[0])}else r?p-f.length>=0&&(C=m.lastIndexOf(f,p-f.length)):C=m.indexOf(f,p);if(C>=0){if(_.wholeWord&&!this._isWholeWord(C,m,h))return;let L=0;for(;L<g.length-1&&C>=g[L+1];)L++;let y=L;for(;y<g.length-1&&C+h.length>=g[y+1];)y++;const R=C-g[L],A=C+h.length-g[y],B=this._stringLengthToBufferSize(i+L,R);return{term:h,col:B,row:i+L,size:this._stringLengthToBufferSize(i+y,A)-B+t.cols*(y-L)}}}_stringLengthToBufferSize(h,d){const _=this._terminal.buffer.active.getLine(h);if(!_)return 0;for(let r=0;r<d;r++){const t=_.getCell(r);if(!t)break;const i=t.getChars();i.length>1&&(d-=i.length-1);const e=_.getCell(r+1);e&&e.getWidth()===0&&d++}return d}_bufferColsToStringOffset(h,d){const _=this._terminal;let r=h,t=0,i=_.buffer.active.getLine(r);for(;d>0&&i;){for(let e=0;e<d&&e<_.cols;e++){const s=i.getCell(e);if(!s)break;s.getWidth()&&(t+=s.getCode()===0?1:s.getChars().length)}if(r++,i=_.buffer.active.getLine(r),i&&!i.isWrapped)break;d-=_.cols}return t}_translateBufferLineToStringWithWrap(h,d){var e;const _=this._terminal,r=[],t=[0];let i=_.buffer.active.getLine(h);for(;i;){const s=_.buffer.active.getLine(h+1),l=!!s&&s.isWrapped;let v=i.translateToString(!l&&d);if(l&&s){const g=i.getCell(i.length-1);g&&g.getCode()===0&&g.getWidth()===1&&((e=s.getCell(0))==null?void 0:e.getWidth())===2&&(v=v.slice(0,-1))}if(r.push(v),!l)break;t.push(t[t.length-1]+v.length),h++,i=s}return[r.join(""),t]}_selectResult(h,d,_){const r=this._terminal;if(this._selectedDecoration.clear(),!h)return r.clearSelection(),!1;if(r.select(h.col,h.row,h.size),d){const t=r.registerMarker(-r.buffer.active.baseY-r.buffer.active.cursorY+h.row);if(t){const i=r.registerDecoration({marker:t,x:h.col,width:h.size,backgroundColor:d.activeMatchBackground,layer:"top",overviewRulerOptions:{color:d.activeMatchColorOverviewRuler}});if(i){const e=[];e.push(t),e.push(i.onRender(s=>this._applyStyles(s,d.activeMatchBorder,!0))),e.push(i.onDispose(()=>(0,a.disposeArray)(e))),this._selectedDecoration.value={decoration:i,match:h,dispose(){i.dispose()}}}}}if(!_&&(h.row>=r.buffer.active.viewportY+r.rows||h.row<r.buffer.active.viewportY)){let t=h.row-r.buffer.active.viewportY;t-=Math.floor(r.rows/2),r.scrollLines(t)}return!0}_applyStyles(h,d,_){h.classList.contains("xterm-find-result-decoration")||(h.classList.add("xterm-find-result-decoration"),d&&(h.style.outline=`1px solid ${d}`)),_&&h.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(h,d){const _=this._terminal,r=_.registerMarker(-_.buffer.active.baseY-_.buffer.active.cursorY+h.row);if(!r)return;const t=_.registerDecoration({marker:r,x:h.col,width:h.size,backgroundColor:d.matchBackground,overviewRulerOptions:this._highlightedLines.has(r.line)?void 0:{color:d.matchOverviewRuler,position:"center"}});if(t){const i=[];i.push(r),i.push(t.onRender(e=>this._applyStyles(e,d.matchBorder,!1))),i.push(t.onDispose(()=>(0,a.disposeArray)(i)))}return t}}S.SearchAddon=u})(),F})())})(Te)),Te.exports),Pe={exports:{}},Ie,Qe=(Oe||(Oe=1,(function(ne){(function(G,N){ne.exports=N()})(0,()=>(()=>{var G={433:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV11=void 0;const c=a(938),u=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],o=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],h=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],d=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let _;function r(t,i){let e,s=0,l=i.length-1;if(t<i[0][0]||t>i[l][1])return!1;for(;l>=s;)if(e=s+l>>1,t>i[e][1])s=e+1;else{if(!(t<i[e][0]))return!0;l=e-1}return!1}n.UnicodeV11=class{constructor(){if(this.version="11",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160);for(let t=0;t<u.length;++t)_.fill(0,u[t][0],u[t][1]+1);for(let t=0;t<h.length;++t)_.fill(2,h[t][0],h[t][1]+1)}}wcwidth(t){return t<32?0:t<127?1:t<65536?_[t]:r(t,o)?0:r(t,d)?2:1}charProperties(t,i){let e=this.wcwidth(t),s=e===0&&i!==0;if(s){const l=c.UnicodeService.extractWidth(i);l===0?s=!1:l>e&&(e=l)}return c.UnicodeService.createPropertyValue(0,e,s)}}},345:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const u=[];for(let o=0;o<this._listeners.length;o++)u.push(this._listeners[o]);for(let o=0;o<u.length;o++)u[o].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(a,c){return a(u=>c.fire(u))},n.runAndSubscribe=function(a,c){return c(void 0),a(u=>c(u))}},490:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const c=a(938),u=[[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]],o=[[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]];let h;n.UnicodeV6=class{constructor(){if(this.version="6",!h){h=new Uint8Array(65536),h.fill(1),h[0]=0,h.fill(0,1,32),h.fill(0,127,160),h.fill(2,4352,4448),h[9001]=2,h[9002]=2,h.fill(2,11904,42192),h[12351]=1,h.fill(2,44032,55204),h.fill(2,63744,64256),h.fill(2,65040,65050),h.fill(2,65072,65136),h.fill(2,65280,65377),h.fill(2,65504,65511);for(let d=0;d<u.length;++d)h.fill(0,u[d][0],u[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?h[d]:(function(_,r){let t,i=0,e=r.length-1;if(_<r[0][0]||_>r[e][1])return!1;for(;e>=i;)if(t=i+e>>1,_>r[t][1])i=t+1;else{if(!(_<r[t][0]))return!0;e=t-1}return!1})(d,o)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}charProperties(d,_){let r=this.wcwidth(d),t=r===0&&_!==0;if(t){const i=c.UnicodeService.extractWidth(_);i===0?t=!1:i>r&&(r=i)}return c.UnicodeService.createPropertyValue(0,r,t)}}},938:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const c=a(345),u=a(490);class o{static extractShouldJoin(d){return!!(1&d)}static extractWidth(d){return d>>1&3}static extractCharKind(d){return d>>3}static createPropertyValue(d,_,r=!1){return(16777215&d)<<3|(3&_)<<1|(r?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const d=new u.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let _=0,r=0;const t=d.length;for(let i=0;i<t;++i){let e=d.charCodeAt(i);if(55296<=e&&e<=56319){if(++i>=t)return _+this.wcwidth(e);const v=d.charCodeAt(i);56320<=v&&v<=57343?e=1024*(e-55296)+v-56320+65536:_+=this.wcwidth(v)}const s=this.charProperties(e,r);let l=o.extractWidth(s);o.extractShouldJoin(s)&&(l-=o.extractWidth(r)),_+=l,r=s}return _}charProperties(d,_){return this._activeProvider.charProperties(d,_)}}n.UnicodeService=o}},N={};function V(S){var n=N[S];if(n!==void 0)return n.exports;var a=N[S]={exports:{}};return G[S](a,a.exports,V),a.exports}var F={};return(()=>{var S=F;Object.defineProperty(S,"__esModule",{value:!0}),S.Unicode11Addon=void 0;const n=V(433);S.Unicode11Addon=class{activate(a){a.unicode.register(new n.UnicodeV11)}dispose(){}}})(),F})())})(Pe)),Pe.exports),He={exports:{}},Fe,et=(Ie||(Ie=1,(function(ne){(function(G,N){ne.exports=N()})(self,()=>(()=>{var G={6:(S,n)=>{function a(u){try{const o=new URL(u),h=o.password&&o.username?`${o.protocol}//${o.username}:${o.password}@${o.host}`:o.username?`${o.protocol}//${o.username}@${o.host}`:`${o.protocol}//${o.host}`;return u.toLocaleLowerCase().startsWith(h.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(n,"__esModule",{value:!0}),n.LinkComputer=n.WebLinkProvider=void 0,n.WebLinkProvider=class{constructor(u,o,h,d={}){this._terminal=u,this._regex=o,this._handler=h,this._options=d}provideLinks(u,o){const h=c.computeLink(u,this._regex,this._terminal,this._handler);o(this._addCallbacks(h))}_addCallbacks(u){return u.map(o=>(o.leave=this._options.leave,o.hover=(h,d)=>{if(this._options.hover){const{range:_}=o;this._options.hover(h,d,_)}},o))}};class c{static computeLink(o,h,d,_){const r=new RegExp(h.source,(h.flags||"")+"g"),[t,i]=c._getWindowedLineStrings(o-1,d),e=t.join("");let s;const l=[];for(;s=r.exec(e);){const v=s[0];if(!a(v))continue;const[g,p]=c._mapStrIdx(d,i,0,s.index),[f,m]=c._mapStrIdx(d,g,p,v.length);if(g===-1||p===-1||f===-1||m===-1)continue;const C={start:{x:p+1,y:g+1},end:{x:m,y:f+1}};l.push({range:C,text:v,activate:_})}return l}static _getWindowedLineStrings(o,h){let d,_=o,r=o,t=0,i="";const e=[];if(d=h.buffer.active.getLine(o)){const s=d.translateToString(!0);if(d.isWrapped&&s[0]!==" "){for(t=0;(d=h.buffer.active.getLine(--_))&&t<2048&&(i=d.translateToString(!0),t+=i.length,e.push(i),d.isWrapped&&i.indexOf(" ")===-1););e.reverse()}for(e.push(s),t=0;(d=h.buffer.active.getLine(++r))&&d.isWrapped&&t<2048&&(i=d.translateToString(!0),t+=i.length,e.push(i),i.indexOf(" ")===-1););}return[e,_]}static _mapStrIdx(o,h,d,_){const r=o.buffer.active,t=r.getNullCell();let i=d;for(;_;){const e=r.getLine(h);if(!e)return[-1,-1];for(let s=i;s<e.length;++s){e.getCell(s,t);const l=t.getChars();if(t.getWidth()&&(_-=l.length||1,s===e.length-1&&l==="")){const v=r.getLine(h+1);v&&v.isWrapped&&(v.getCell(0,t),t.getWidth()===2&&(_+=1))}if(_<0)return[h,s]}h++,i=0}return[h,i]}}n.LinkComputer=c}},N={};function V(S){var n=N[S];if(n!==void 0)return n.exports;var a=N[S]={exports:{}};return G[S](a,a.exports,V),a.exports}var F={};return(()=>{var S=F;Object.defineProperty(S,"__esModule",{value:!0}),S.WebLinksAddon=void 0;const n=V(6),a=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(u,o){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}S.WebLinksAddon=class{constructor(u=c,o={}){this._handler=u,this._options=o}activate(u){this._terminal=u;const o=this._options,h=o.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new n.WebLinkProvider(this._terminal,h,this._handler,o))}dispose(){var u;(u=this._linkProvider)==null||u.dispose()}}})(),F})())})(He)),He.exports),We={exports:{}},tt=(Fe||(Fe=1,(function(ne){(function(G,N){ne.exports=N()})(globalThis,()=>(()=>{var G={4567:function(S,n,a){var c=this&&this.__decorate||function(e,s,l,v){var g,p=arguments.length,f=p<3?s:v===null?v=Object.getOwnPropertyDescriptor(s,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,l,v);else for(var m=e.length-1;m>=0;m--)(g=e[m])&&(f=(p<3?g(f):p>3?g(s,l,f):g(s,l))||f);return p>3&&f&&Object.defineProperty(s,l,f),f},u=this&&this.__param||function(e,s){return function(l,v){s(l,v,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const o=a(9042),h=a(9924),d=a(844),_=a(4725),r=a(2585),t=a(3656);let i=n.AccessibilityManager=class extends d.Disposable{constructor(e,s,l,v){super(),this._terminal=e,this._coreBrowserService=l,this._renderService=v,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let g=0;g<this._terminal.rows;g++)this._rowElements[g]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[g]);if(this._topBoundaryFocusListener=g=>this._handleBoundaryFocus(g,0),this._bottomBoundaryFocusListener=g=>this._handleBoundaryFocus(g,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new h.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(g=>this._handleResize(g.rows))),this.register(this._terminal.onRender(g=>this._refreshRows(g.start,g.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(g=>this._handleChar(g))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
2
|
+
`))),this.register(this._terminal.onA11yTab(g=>this._handleTab(g))),this.register(this._terminal.onKey(g=>this._handleKey(g.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,t.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,d.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let s=0;s<e;s++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=o.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,s){this._liveRegionDebouncer.refresh(e,s,this._terminal.rows)}_renderRows(e,s){const l=this._terminal.buffer,v=l.lines.length.toString();for(let g=e;g<=s;g++){const p=l.lines.get(l.ydisp+g),f=[],m=(p==null?void 0:p.translateToString(!0,void 0,void 0,f))||"",C=(l.ydisp+g+1).toString(),w=this._rowElements[g];w&&(m.length===0?(w.innerText="\xA0",this._rowColumns.set(w,[0,1])):(w.textContent=m,this._rowColumns.set(w,f)),w.setAttribute("aria-posinset",C),w.setAttribute("aria-setsize",v))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,s){const l=e.target,v=this._rowElements[s===0?1:this._rowElements.length-2];if(l.getAttribute("aria-posinset")===(s===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==v)return;let g,p;if(s===0?(g=l,p=this._rowElements.pop(),this._rowContainer.removeChild(p)):(g=this._rowElements.shift(),p=l,this._rowContainer.removeChild(g)),g.removeEventListener("focus",this._topBoundaryFocusListener),p.removeEventListener("focus",this._bottomBoundaryFocusListener),s===0){const f=this._createAccessibilityTreeNode();this._rowElements.unshift(f),this._rowContainer.insertAdjacentElement("afterbegin",f)}else{const f=this._createAccessibilityTreeNode();this._rowElements.push(f),this._rowContainer.appendChild(f)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var m;if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let s={node:e.anchorNode,offset:e.anchorOffset},l={node:e.focusNode,offset:e.focusOffset};if((s.node.compareDocumentPosition(l.node)&Node.DOCUMENT_POSITION_PRECEDING||s.node===l.node&&s.offset>l.offset)&&([s,l]=[l,s]),s.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(s={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(s.node))return;const v=this._rowElements.slice(-1)[0];if(l.node.compareDocumentPosition(v)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(l={node:v,offset:((m=v.textContent)==null?void 0:m.length)??0}),!this._rowContainer.contains(l.node))return;const g=({node:C,offset:w})=>{const L=C instanceof Text?C.parentNode:C;let y=parseInt(L==null?void 0:L.getAttribute("aria-posinset"),10)-1;if(isNaN(y))return console.warn("row is invalid. Race condition?"),null;const R=this._rowColumns.get(L);if(!R)return console.warn("columns is null. Race condition?"),null;let A=w<R.length?R[w]:R.slice(-1)[0]+1;return A>=this._terminal.cols&&(++y,A=0),{row:y,column:A}},p=g(s),f=g(l);if(p&&f){if(p.row>f.row||p.row===f.row&&p.column>=f.column)throw new Error("invalid range");this._terminal.select(p.column,p.row,(f.row-p.row)*this._terminal.cols-p.column+f.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let s=this._rowContainer.children.length;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const 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){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}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])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=i=c([u(1,r.IInstantiationService),u(2,_.ICoreBrowserService),u(3,_.IRenderService)],i)},3614:(S,n)=>{function a(h){return h.replace(/\r?\n/g,"\r")}function c(h,d){return d?"\x1B[200~"+h+"\x1B[201~":h}function u(h,d,_,r){h=c(h=a(h),_.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),_.triggerDataEvent(h,!0),d.value=""}function o(h,d,_){const r=_.getBoundingClientRect(),t=h.clientX-r.left-10,i=h.clientY-r.top-10;d.style.width="20px",d.style.height="20px",d.style.left=`${t}px`,d.style.top=`${i}px`,d.style.zIndex="1000",d.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=a,n.bracketTextForPaste=c,n.copyHandler=function(h,d){h.clipboardData&&h.clipboardData.setData("text/plain",d.selectionText),h.preventDefault()},n.handlePasteEvent=function(h,d,_,r){h.stopPropagation(),h.clipboardData&&u(h.clipboardData.getData("text/plain"),d,_,r)},n.paste=u,n.moveTextAreaUnderMouseCursor=o,n.rightClickHandler=function(h,d,_,r,t){o(h,d,_),t&&r.rightClickSelect(h),d.value=r.selectionText,d.select()}},7239:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const c=a(1505);n.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(u,o,h){this._css.set(u,o,h)}getCss(u,o){return this._css.get(u,o)}setColor(u,o,h){this._color.set(u,o,h)}getColor(u,o){return this._color.get(u,o)}clear(){this._color.clear(),this._css.clear()}}},3656:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(a,c,u,o){a.addEventListener(c,u,o);let h=!1;return{dispose:()=>{h||(h=!0,a.removeEventListener(c,u,o))}}}},3551:function(S,n,a){var c=this&&this.__decorate||function(i,e,s,l){var v,g=arguments.length,p=g<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,e,s,l);else for(var f=i.length-1;f>=0;f--)(v=i[f])&&(p=(g<3?v(p):g>3?v(e,s,p):v(e,s))||p);return g>3&&p&&Object.defineProperty(e,s,p),p},u=this&&this.__param||function(i,e){return function(s,l){e(s,l,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const o=a(3656),h=a(8460),d=a(844),_=a(2585),r=a(4725);let t=n.Linkifier=class extends d.Disposable{get currentLink(){return this._currentLink}constructor(i,e,s,l,v){super(),this._element=i,this._mouseService=e,this._renderService=s,this._bufferService=l,this._linkProviderService=v,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new h.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new h.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,d.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,d.toDisposable)(()=>{var g;this._lastMouseEvent=void 0,(g=this._activeProviderReplies)==null||g.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,o.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,o.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(i){this._lastMouseEvent=i;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const s=i.composedPath();for(let l=0;l<s.length;l++){const v=s[l];if(v.classList.contains("xterm"))break;if(v.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(i){if(this._activeLine!==i.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(i,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,i)||(this._clearCurrentLink(),this._askForLink(i,!0))}_askForLink(i,e){var l,v;this._activeProviderReplies&&e||((l=this._activeProviderReplies)==null||l.forEach(g=>{g==null||g.forEach(p=>{p.link.dispose&&p.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=i.y);let s=!1;for(const[g,p]of this._linkProviderService.linkProviders.entries())e?(v=this._activeProviderReplies)!=null&&v.get(g)&&(s=this._checkLinkProviderResult(g,i,s)):p.provideLinks(i.y,f=>{var C,w;if(this._isMouseOut)return;const m=f==null?void 0:f.map(L=>({link:L}));(C=this._activeProviderReplies)==null||C.set(g,m),s=this._checkLinkProviderResult(g,i,s),((w=this._activeProviderReplies)==null?void 0:w.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(i.y,this._activeProviderReplies)})}_removeIntersectingLinks(i,e){const s=new Set;for(let l=0;l<e.size;l++){const v=e.get(l);if(v)for(let g=0;g<v.length;g++){const p=v[g],f=p.link.range.start.y<i?0:p.link.range.start.x,m=p.link.range.end.y>i?this._bufferService.cols:p.link.range.end.x;for(let C=f;C<=m;C++){if(s.has(C)){v.splice(g--,1);break}s.add(C)}}}}_checkLinkProviderResult(i,e,s){var g;if(!this._activeProviderReplies)return s;const l=this._activeProviderReplies.get(i);let v=!1;for(let p=0;p<i;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(v=!0);if(!v&&l){const p=l.find(f=>this._linkAtPosition(f.link,e));p&&(s=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let p=0;p<this._activeProviderReplies.size;p++){const f=(g=this._activeProviderReplies.get(p))==null?void 0:g.find(m=>this._linkAtPosition(m.link,e));if(f){s=!0,this._handleNewLink(f);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(i){if(!this._currentLink)return;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(i,this._currentLink.link.text)}_clearCurrentLink(i,e){this._currentLink&&this._lastMouseEvent&&(!i||!e||this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,d.disposeArray)(this._linkCacheDisposables))}_handleNewLink(i){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(i.link,e)&&(this._currentLink=i,this._currentLink.state={decorations:{underline:i.link.decorations===void 0||i.link.decorations.underline,pointerCursor:i.link.decorations===void 0||i.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,i.link,this._lastMouseEvent),i.link.decorations={},Object.defineProperties(i.link.decorations,{pointerCursor:{get:()=>{var s,l;return(l=(s=this._currentLink)==null?void 0:s.state)==null?void 0:l.decorations.pointerCursor},set:s=>{var l;(l=this._currentLink)!=null&&l.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>{var s,l;return(l=(s=this._currentLink)==null?void 0:s.state)==null?void 0:l.decorations.underline},set:s=>{var l,v,g;(l=this._currentLink)!=null&&l.state&&((g=(v=this._currentLink)==null?void 0:v.state)==null?void 0:g.decorations.underline)!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(i.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(s=>{if(!this._currentLink)return;const l=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=v&&(this._clearCurrentLink(l,v),this._lastMouseEvent)){const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._askForLink(g,!1)}})))}_linkHover(i,e,s){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&i.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(s,e.text)}_fireUnderlineEvent(i,e){const s=i.range,l=this._bufferService.buffer.ydisp,v=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-l-1,s.end.x,s.end.y-l-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(v)}_linkLeave(i,e,s){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&i.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(s,e.text)}_linkAtPosition(i,e){const s=i.range.start.y*this._bufferService.cols+i.range.start.x,l=i.range.end.y*this._bufferService.cols+i.range.end.x,v=e.y*this._bufferService.cols+e.x;return s<=v&&v<=l}_positionFromMouseEvent(i,e,s){const l=s.getCoords(i,e,this._bufferService.cols,this._bufferService.rows);if(l)return{x:l[0],y:l[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(i,e,s,l,v){return{x1:i,y1:e,x2:s,y2:l,cols:this._bufferService.cols,fg:v}}};n.Linkifier=t=c([u(1,r.IMouseService),u(2,r.IRenderService),u(3,_.IBufferService),u(4,r.ILinkProviderService)],t)},9042:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(S,n,a){var c=this&&this.__decorate||function(r,t,i,e){var s,l=arguments.length,v=l<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,t,i,e);else for(var g=r.length-1;g>=0;g--)(s=r[g])&&(v=(l<3?s(v):l>3?s(t,i,v):s(t,i))||v);return l>3&&v&&Object.defineProperty(t,i,v),v},u=this&&this.__param||function(r,t){return function(i,e){t(i,e,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const o=a(511),h=a(2585);let d=n.OscLinkProvider=class{constructor(r,t,i){this._bufferService=r,this._optionsService=t,this._oscLinkService=i}provideLinks(r,t){var m;const i=this._bufferService.buffer.lines.get(r-1);if(!i)return void t(void 0);const e=[],s=this._optionsService.rawOptions.linkHandler,l=new o.CellData,v=i.getTrimmedLength();let g=-1,p=-1,f=!1;for(let C=0;C<v;C++)if(p!==-1||i.hasContent(C)){if(i.loadCell(C,l),l.hasExtendedAttrs()&&l.extended.urlId){if(p===-1){p=C,g=l.extended.urlId;continue}f=l.extended.urlId!==g}else p!==-1&&(f=!0);if(f||p!==-1&&C===v-1){const w=(m=this._oscLinkService.getLinkData(g))==null?void 0:m.uri;if(w){const L={start:{x:p+1,y:r},end:{x:C+(f||C!==v-1?0:1),y:r}};let y=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{const R=new URL(w);["http:","https:"].includes(R.protocol)||(y=!0)}catch{y=!0}y||e.push({text:w,range:L,activate:(R,A)=>s?s.activate(R,A,L):_(0,A),hover:(R,A)=>{var B;return(B=s==null?void 0:s.hover)==null?void 0:B.call(s,R,A,L)},leave:(R,A)=>{var B;return(B=s==null?void 0:s.leave)==null?void 0:B.call(s,R,A,L)}})}f=!1,l.hasExtendedAttrs()&&l.extended.urlId?(p=C,g=l.extended.urlId):(p=-1,g=-1)}}t(e)}};function _(r,t){if(confirm(`Do you want to navigate to ${t}?
|
|
4
|
+
|
|
5
|
+
WARNING: This link could potentially be dangerous`)){const i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=d=c([u(0,h.IBufferService),u(1,h.IOptionsService),u(2,h.IOscLinkService)],d)},6193:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(a,c){this._renderCallback=a,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,c,u){this._rowCount=u,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const c=a(3614),u=a(3656),o=a(3551),h=a(9042),d=a(3730),_=a(1680),r=a(3107),t=a(5744),i=a(2950),e=a(1296),s=a(428),l=a(4269),v=a(5114),g=a(8934),p=a(3230),f=a(9312),m=a(4725),C=a(6731),w=a(8055),L=a(8969),y=a(8460),R=a(844),A=a(6114),B=a(8437),T=a(2584),P=a(7399),b=a(5941),E=a(9074),k=a(2585),D=a(5435),I=a(4567),W=a(779);class z extends L.CoreTerminal{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}constructor(M={}){super(M),this.browser=A,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new R.MutableDisposable),this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new y.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new y.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new y.EventEmitter),this._onBlur=this.register(new y.EventEmitter),this._onA11yCharEmitter=this.register(new y.EventEmitter),this._onA11yTabEmitter=this.register(new y.EventEmitter),this._onWillOpen=this.register(new y.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(E.DecorationService),this._instantiationService.setService(k.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(W.LinkProviderService),this._instantiationService.setService(m.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(d.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((x,H)=>this.refresh(x,H))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(x=>this._reportWindowsOptions(x))),this.register(this._inputHandler.onColor(x=>this._handleColorEvent(x))),this.register((0,y.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,y.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,y.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,y.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(x=>this._afterResize(x.cols,x.rows))),this.register((0,R.toDisposable)(()=>{var x,H;this._customKeyEventHandler=void 0,(H=(x=this.element)==null?void 0:x.parentNode)==null||H.removeChild(this.element)}))}_handleColorEvent(M){if(this._themeService)for(const x of M){let H,O="";switch(x.index){case 256:H="foreground",O="10";break;case 257:H="background",O="11";break;case 258:H="cursor",O="12";break;default:H="ansi",O="4;"+x.index}switch(x.type){case 0:const U=w.color.toColorRGB(H==="ansi"?this._themeService.colors.ansi[x.index]:this._themeService.colors[H]);this.coreService.triggerDataEvent(`${T.C0.ESC}]${O};${(0,b.toRgbString)(U)}${T.C1_ESCAPED.ST}`);break;case 1:if(H==="ansi")this._themeService.modifyColors($=>$.ansi[x.index]=w.channels.toColor(...x.color));else{const $=H;this._themeService.modifyColors(j=>j[$]=w.channels.toColor(...x.color))}break;case 2:this._themeService.restoreColor(x.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(M){M?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(M){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var M;return(M=this.textarea)==null?void 0:M.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const M=this.buffer.ybase+this.buffer.y,x=this.buffer.lines.get(M);if(!x)return;const H=Math.min(this.buffer.x,this.cols-1),O=this._renderService.dimensions.css.cell.height,U=x.getWidth(H),$=this._renderService.dimensions.css.cell.width*U,j=this.buffer.y*this._renderService.dimensions.css.cell.height,se=H*this._renderService.dimensions.css.cell.width;this.textarea.style.left=se+"px",this.textarea.style.top=j+"px",this.textarea.style.width=$+"px",this.textarea.style.height=O+"px",this.textarea.style.lineHeight=O+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,u.addDisposableDomListener)(this.element,"copy",x=>{this.hasSelection()&&(0,c.copyHandler)(x,this._selectionService)}));const M=x=>(0,c.handlePasteEvent)(x,this.textarea,this.coreService,this.optionsService);this.register((0,u.addDisposableDomListener)(this.textarea,"paste",M)),this.register((0,u.addDisposableDomListener)(this.element,"paste",M)),A.isFirefox?this.register((0,u.addDisposableDomListener)(this.element,"mousedown",x=>{x.button===2&&(0,c.rightClickHandler)(x,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,u.addDisposableDomListener)(this.element,"contextmenu",x=>{(0,c.rightClickHandler)(x,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),A.isLinux&&this.register((0,u.addDisposableDomListener)(this.element,"auxclick",x=>{x.button===1&&(0,c.moveTextAreaUnderMouseCursor)(x,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,u.addDisposableDomListener)(this.textarea,"keyup",M=>this._keyUp(M),!0)),this.register((0,u.addDisposableDomListener)(this.textarea,"keydown",M=>this._keyDown(M),!0)),this.register((0,u.addDisposableDomListener)(this.textarea,"keypress",M=>this._keyPress(M),!0)),this.register((0,u.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,u.addDisposableDomListener)(this.textarea,"compositionupdate",M=>this._compositionHelper.compositionupdate(M))),this.register((0,u.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,u.addDisposableDomListener)(this.textarea,"input",M=>this._inputEvent(M),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(M){var H;if(!M)throw new Error("Terminal requires a parent element.");if(M.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((H=this.element)==null?void 0:H.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=M.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"),M.appendChild(this.element);const x=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),x.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,u.addDisposableDomListener)(this.screenElement,"mousemove",O=>this.updateCursorStyle(O))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),x.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",h.promptLabel),A.isChromeOS||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._coreBrowserService=this.register(this._instantiationService.createInstance(v.CoreBrowserService,this.textarea,M.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(m.ICoreBrowserService,this._coreBrowserService),this.register((0,u.addDisposableDomListener)(this.textarea,"focus",O=>this._handleTextAreaFocus(O))),this.register((0,u.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(s.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(m.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(C.ThemeService),this._instantiationService.setService(m.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(l.CharacterJoinerService),this._instantiationService.setService(m.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(p.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(m.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(O=>this._onRender.fire(O))),this.onResize(O=>this._renderService.resize(O.cols,O.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(i.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(g.MouseService),this._instantiationService.setService(m.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(o.Linkifier,this.screenElement)),this.element.appendChild(x);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(_.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(O=>this.scrollLines(O.amount,O.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),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.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(f.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(m.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(O=>this.scrollLines(O.amount,O.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(O=>this._renderService.handleSelectionChanged(O.start,O.end,O.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(O=>{this.textarea.value=O,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(O=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(r.BufferDecorationRenderer,this.screenElement)),this.register((0,u.addDisposableDomListener)(this.element,"mousedown",O=>this._selectionService.handleMouseDown(O))),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(I.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",O=>this._handleScreenReaderModeOptionChange(O))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(t.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",O=>{!this._overviewRulerRenderer&&O&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(t.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const M=this,x=this.element;function H($){const j=M._mouseService.getMouseReportCoords($,M.screenElement);if(!j)return!1;let se,ie;switch($.overrideType||$.type){case"mousemove":ie=32,$.buttons===void 0?(se=3,$.button!==void 0&&(se=$.button<3?$.button:3)):se=1&$.buttons?0:4&$.buttons?1:2&$.buttons?2:3;break;case"mouseup":ie=0,se=$.button<3?$.button:3;break;case"mousedown":ie=1,se=$.button<3?$.button:3;break;case"wheel":if(M._customWheelEventHandler&&M._customWheelEventHandler($)===!1||M.viewport.getLinesScrolled($)===0)return!1;ie=$.deltaY<0?0:1,se=4;break;default:return!1}return!(ie===void 0||se===void 0||se>4)&&M.coreMouseService.triggerMouseEvent({col:j.col,row:j.row,x:j.x,y:j.y,button:se,action:ie,ctrl:$.ctrlKey,alt:$.altKey,shift:$.shiftKey})}const O={mouseup:null,wheel:null,mousedrag:null,mousemove:null},U={mouseup:$=>(H($),$.buttons||(this._document.removeEventListener("mouseup",O.mouseup),O.mousedrag&&this._document.removeEventListener("mousemove",O.mousedrag)),this.cancel($)),wheel:$=>(H($),this.cancel($,!0)),mousedrag:$=>{$.buttons&&H($)},mousemove:$=>{$.buttons||H($)}};this.register(this.coreMouseService.onProtocolChange($=>{$?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents($)),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()),8&$?O.mousemove||(x.addEventListener("mousemove",U.mousemove),O.mousemove=U.mousemove):(x.removeEventListener("mousemove",O.mousemove),O.mousemove=null),16&$?O.wheel||(x.addEventListener("wheel",U.wheel,{passive:!1}),O.wheel=U.wheel):(x.removeEventListener("wheel",O.wheel),O.wheel=null),2&$?O.mouseup||(O.mouseup=U.mouseup):(this._document.removeEventListener("mouseup",O.mouseup),O.mouseup=null),4&$?O.mousedrag||(O.mousedrag=U.mousedrag):(this._document.removeEventListener("mousemove",O.mousedrag),O.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,u.addDisposableDomListener)(x,"mousedown",$=>{if($.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection($))return H($),O.mouseup&&this._document.addEventListener("mouseup",O.mouseup),O.mousedrag&&this._document.addEventListener("mousemove",O.mousedrag),this.cancel($)})),this.register((0,u.addDisposableDomListener)(x,"wheel",$=>{if(!O.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler($)===!1)return!1;if(!this.buffer.hasScrollback){const j=this.viewport.getLinesScrolled($);if(j===0)return;const se=T.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+($.deltaY<0?"A":"B");let ie="";for(let oe=0;oe<Math.abs(j);oe++)ie+=se;return this.coreService.triggerDataEvent(ie,!0),this.cancel($,!0)}return this.viewport.handleWheel($)?this.cancel($):void 0}},{passive:!1})),this.register((0,u.addDisposableDomListener)(x,"touchstart",$=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart($),this.cancel($)},{passive:!0})),this.register((0,u.addDisposableDomListener)(x,"touchmove",$=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove($)?void 0:this.cancel($)},{passive:!1}))}refresh(M,x){var H;(H=this._renderService)==null||H.refreshRows(M,x)}updateCursorStyle(M){var x;(x=this._selectionService)!=null&&x.shouldColumnSelect(M)?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(M,x,H=0){var O;H===1?(super.scrollLines(M,x,H),this.refresh(0,this.rows-1)):(O=this.viewport)==null||O.scrollLines(M)}paste(M){(0,c.paste)(M,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(M){this._customKeyEventHandler=M}attachCustomWheelEventHandler(M){this._customWheelEventHandler=M}registerLinkProvider(M){return this._linkProviderService.registerLinkProvider(M)}registerCharacterJoiner(M){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const x=this._characterJoinerService.register(M);return this.refresh(0,this.rows-1),x}deregisterCharacterJoiner(M){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(M)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(M){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+M)}registerDecoration(M){return this._decorationService.registerDecoration(M)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(M,x,H){this._selectionService.setSelection(M,x,H)}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(){var M;(M=this._selectionService)==null||M.clearSelection()}selectAll(){var M;(M=this._selectionService)==null||M.selectAll()}selectLines(M,x){var H;(H=this._selectionService)==null||H.selectLines(M,x)}_keyDown(M){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1)return!1;const x=this.browser.isMac&&this.options.macOptionIsMeta&&M.altKey;if(!x&&!this._compositionHelper.keydown(M))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;x||M.key!=="Dead"&&M.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const H=(0,P.evaluateKeyboardEvent)(M,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(M),H.type===3||H.type===2){const O=this.rows-1;return this.scrollLines(H.type===2?-O:O),this.cancel(M,!0)}return H.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,M)||(H.cancel&&this.cancel(M,!0),!H.key||!!(M.key&&!M.ctrlKey&&!M.altKey&&!M.metaKey&&M.key.length===1&&M.key.charCodeAt(0)>=65&&M.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(H.key!==T.C0.ETX&&H.key!==T.C0.CR||(this.textarea.value=""),this._onKey.fire({key:H.key,domEvent:M}),this._showCursor(),this.coreService.triggerDataEvent(H.key,!0),!this.optionsService.rawOptions.screenReaderMode||M.altKey||M.ctrlKey?this.cancel(M,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(M,x){const H=M.isMac&&!this.options.macOptionIsMeta&&x.altKey&&!x.ctrlKey&&!x.metaKey||M.isWindows&&x.altKey&&x.ctrlKey&&!x.metaKey||M.isWindows&&x.getModifierState("AltGraph");return x.type==="keypress"?H:H&&(!x.keyCode||x.keyCode>47)}_keyUp(M){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1||((function(x){return x.keyCode===16||x.keyCode===17||x.keyCode===18})(M)||this.focus(),this.updateCursorStyle(M),this._keyPressHandled=!1)}_keyPress(M){let x;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1)return!1;if(this.cancel(M),M.charCode)x=M.charCode;else if(M.which===null||M.which===void 0)x=M.keyCode;else{if(M.which===0||M.charCode===0)return!1;x=M.which}return!(!x||(M.altKey||M.ctrlKey||M.metaKey)&&!this._isThirdLevelShift(this.browser,M)||(x=String.fromCharCode(x),this._onKey.fire({key:x,domEvent:M}),this._showCursor(),this.coreService.triggerDataEvent(x,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(M){if(M.data&&M.inputType==="insertText"&&(!M.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const x=M.data;return this.coreService.triggerDataEvent(x,!0),this.cancel(M),!0}return!1}resize(M,x){M!==this.cols||x!==this.rows?super.resize(M,x):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(M,x){var H,O;(H=this._charSizeService)==null||H.measure(),(O=this.viewport)==null||O.syncScrollArea(!0)}clear(){var M;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 x=1;x<this.rows;x++)this.buffer.lines.push(this.buffer.getBlankLine(B.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(M=this.viewport)==null||M.reset(),this.refresh(0,this.rows-1)}}reset(){var x,H;this.options.rows=this.rows,this.options.cols=this.cols;const M=this._customKeyEventHandler;this._setup(),super.reset(),(x=this._selectionService)==null||x.reset(),this._decorationService.reset(),(H=this.viewport)==null||H.reset(),this._customKeyEventHandler=M,this.refresh(0,this.rows-1)}clearTextureAtlas(){var M;(M=this._renderService)==null||M.clearTextureAtlas()}_reportFocus(){var M;(M=this.element)!=null&&M.classList.contains("focus")?this.coreService.triggerDataEvent(T.C0.ESC+"[I"):this.coreService.triggerDataEvent(T.C0.ESC+"[O")}_reportWindowsOptions(M){if(this._renderService)switch(M){case D.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const x=this._renderService.dimensions.css.canvas.width.toFixed(0),H=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[4;${H};${x}t`);break;case D.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const O=this._renderService.dimensions.css.cell.width.toFixed(0),U=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[6;${U};${O}t`)}}cancel(M,x){if(this.options.cancelEvents||x)return M.preventDefault(),M.stopPropagation(),!1}}n.Terminal=z},9924:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(a,c=1e3){this._renderCallback=a,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,c,u){this._rowCount=u,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const o=Date.now();if(o-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=o,this._innerRefresh();else if(!this._additionalRefreshRequested){const h=o-this._lastRefreshMs,d=this._debounceThresholdMS-h;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},d)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c)}}},1680:function(S,n,a){var c=this&&this.__decorate||function(i,e,s,l){var v,g=arguments.length,p=g<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,e,s,l);else for(var f=i.length-1;f>=0;f--)(v=i[f])&&(p=(g<3?v(p):g>3?v(e,s,p):v(e,s))||p);return g>3&&p&&Object.defineProperty(e,s,p),p},u=this&&this.__param||function(i,e){return function(s,l){e(s,l,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const o=a(3656),h=a(4725),d=a(8460),_=a(844),r=a(2585);let t=n.Viewport=class extends _.Disposable{constructor(i,e,s,l,v,g,p,f){super(),this._viewportElement=i,this._scrollArea=e,this._bufferService=s,this._optionsService=l,this._charSizeService=v,this._renderService=g,this._coreBrowserService=p,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new d.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,o.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(m=>this._activeBuffer=m.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(m=>this._renderDimensions=m)),this._handleThemeChange(f.colors),this.register(f.onChangeColors(m=>this._handleThemeChange(m))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(i){this._viewportElement.style.backgroundColor=i.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(i){if(i)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const i=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==i&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=i),this._refreshAnimationFrame=null}syncScrollArea(i=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(i);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(i)}_handleScroll(i){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const i=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(i*(this._smoothScrollState.target-this._smoothScrollState.origin)),i<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(i,e){const s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&s<this._lastRecordedBufferHeight)||(i.cancelable&&i.preventDefault(),!1)}handleWheel(i){const e=this._getPixelsScrolled(i);return e!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+e:this._smoothScrollState.target+=e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=e,this._bubbleScroll(i,e))}scrollLines(i){if(i!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const e=i*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!1})}_getPixelsScrolled(i){if(i.deltaY===0||i.shiftKey)return 0;let e=this._applyScrollModifier(i.deltaY,i);return i.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._currentRowHeight:i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._currentRowHeight*this._bufferService.rows),e}getBufferElements(i,e){var f;let s,l="";const v=[],g=e??this._bufferService.buffer.lines.length,p=this._bufferService.buffer.lines;for(let m=i;m<g;m++){const C=p.get(m);if(!C)continue;const w=(f=p.get(m+1))==null?void 0:f.isWrapped;if(l+=C.translateToString(!w),!w||m===p.length-1){const L=document.createElement("div");L.textContent=l,v.push(L),l.length>0&&(s=L),l=""}}return{bufferElements:v,cursorElement:s}}getLinesScrolled(i){if(i.deltaY===0||i.shiftKey)return 0;let e=this._applyScrollModifier(i.deltaY,i);return i.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(i,e){const s=this._optionsService.rawOptions.fastScrollModifier;return s==="alt"&&e.altKey||s==="ctrl"&&e.ctrlKey||s==="shift"&&e.shiftKey?i*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:i*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(i){this._lastTouchY=i.touches[0].pageY}handleTouchMove(i){const e=this._lastTouchY-i.touches[0].pageY;return this._lastTouchY=i.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(i,e))}};n.Viewport=t=c([u(2,r.IBufferService),u(3,r.IOptionsService),u(4,h.ICharSizeService),u(5,h.IRenderService),u(6,h.ICoreBrowserService),u(7,h.IThemeService)],t)},3107:function(S,n,a){var c=this&&this.__decorate||function(r,t,i,e){var s,l=arguments.length,v=l<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,t,i,e);else for(var g=r.length-1;g>=0;g--)(s=r[g])&&(v=(l<3?s(v):l>3?s(t,i,v):s(t,i))||v);return l>3&&v&&Object.defineProperty(t,i,v),v},u=this&&this.__param||function(r,t){return function(i,e){t(i,e,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const o=a(4725),h=a(844),d=a(2585);let _=n.BufferDecorationRenderer=class extends h.Disposable{constructor(r,t,i,e,s){super(),this._screenElement=r,this._bufferService=t,this._coreBrowserService=i,this._decorationService=e,this._renderService=s,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(l=>this._removeDecoration(l))),this.register((0,h.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const r of this._decorationService.decorations)this._renderDecoration(r);this._dimensionsChanged=!1}_renderDecoration(r){this._refreshStyle(r),this._dimensionsChanged&&this._refreshXPosition(r)}_createElement(r){var e;const t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((e=r==null?void 0:r.options)==null?void 0:e.layer)==="top"),t.style.width=`${Math.round((r.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(r.options.height||1)*this._renderService.dimensions.css.cell.height+"px",t.style.top=(r.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const i=r.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(r,t),t}_refreshStyle(r){const t=r.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)r.element&&(r.element.style.display="none",r.onRenderEmitter.fire(r.element));else{let i=this._decorationElements.get(r);i||(i=this._createElement(r),r.element=i,this._decorationElements.set(r,i),this._container.appendChild(i),r.onDispose(()=>{this._decorationElements.delete(r),i.remove()})),i.style.top=t*this._renderService.dimensions.css.cell.height+"px",i.style.display=this._altBufferIsActive?"none":"block",r.onRenderEmitter.fire(i)}}_refreshXPosition(r,t=r.element){if(!t)return;const i=r.options.x??0;(r.options.anchor||"left")==="right"?t.style.right=i?i*this._renderService.dimensions.css.cell.width+"px":"":t.style.left=i?i*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(r){var t;(t=this._decorationElements.get(r))==null||t.remove(),this._decorationElements.delete(r),r.dispose()}};n.BufferDecorationRenderer=_=c([u(1,d.IBufferService),u(2,o.ICoreBrowserService),u(3,d.IDecorationService),u(4,o.IRenderService)],_)},5871:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const c of this._zones)if(c.color===a.options.overviewRulerOptions.color&&c.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,a.marker.line))return;if(this._lineAdjacentToZone(c,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(c,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,c){return c>=a.startBufferLine&&c<=a.endBufferLine}_lineAdjacentToZone(a,c,u){return c>=a.startBufferLine-this._linePadding[u||"full"]&&c<=a.endBufferLine+this._linePadding[u||"full"]}_addLineToZone(a,c){a.startBufferLine=Math.min(a.startBufferLine,c),a.endBufferLine=Math.max(a.endBufferLine,c)}}},5744:function(S,n,a){var c=this&&this.__decorate||function(s,l,v,g){var p,f=arguments.length,m=f<3?l:g===null?g=Object.getOwnPropertyDescriptor(l,v):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,l,v,g);else for(var C=s.length-1;C>=0;C--)(p=s[C])&&(m=(f<3?p(m):f>3?p(l,v,m):p(l,v))||m);return f>3&&m&&Object.defineProperty(l,v,m),m},u=this&&this.__param||function(s,l){return function(v,g){l(v,g,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const o=a(5871),h=a(4725),d=a(844),_=a(2585),r={full:0,left:0,center:0,right:0},t={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0};let e=n.OverviewRulerRenderer=class extends d.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(s,l,v,g,p,f,m){var w;super(),this._viewportElement=s,this._screenElement=l,this._bufferService=v,this._decorationService=g,this._renderService=p,this._optionsService=f,this._coreBrowserService=m,this._colorZoneStore=new o.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(w=this._viewportElement.parentElement)==null||w.insertBefore(this._canvas,this._viewportElement);const C=this._canvas.getContext("2d");if(!C)throw new Error("Ctx cannot be null");this._ctx=C,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,d.toDisposable)(()=>{var L;(L=this._canvas)==null||L.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const s=Math.floor(this._canvas.width/3),l=Math.ceil(this._canvas.width/3);t.full=this._canvas.width,t.left=s,t.center=l,t.right=s,this._refreshDrawHeightConstants(),i.full=0,i.left=0,i.center=t.left,i.right=t.left+t.center}_refreshDrawHeightConstants(){r.full=Math.round(2*this._coreBrowserService.dpr);const s=this._canvas.height/this._bufferService.buffer.lines.length,l=Math.round(Math.max(Math.min(s,12),6)*this._coreBrowserService.dpr);r.left=l,r.center=l,r.right=l}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*r.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*r.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*r.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*r.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const l of this._decorationService.decorations)this._colorZoneStore.addDecoration(l);this._ctx.lineWidth=1;const s=this._colorZoneStore.zones;for(const l of s)l.position!=="full"&&this._renderColorZone(l);for(const l of s)l.position==="full"&&this._renderColorZone(l);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(s){this._ctx.fillStyle=s.color,this._ctx.fillRect(i[s.position||"full"],Math.round((this._canvas.height-1)*(s.startBufferLine/this._bufferService.buffers.active.lines.length)-r[s.position||"full"]/2),t[s.position||"full"],Math.round((this._canvas.height-1)*((s.endBufferLine-s.startBufferLine)/this._bufferService.buffers.active.lines.length)+r[s.position||"full"]))}_queueRefresh(s,l){this._shouldUpdateDimensions=s||this._shouldUpdateDimensions,this._shouldUpdateAnchor=l||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};n.OverviewRulerRenderer=e=c([u(2,_.IBufferService),u(3,_.IDecorationService),u(4,h.IRenderService),u(5,_.IOptionsService),u(6,h.ICoreBrowserService)],e)},2950:function(S,n,a){var c=this&&this.__decorate||function(r,t,i,e){var s,l=arguments.length,v=l<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,t,i,e);else for(var g=r.length-1;g>=0;g--)(s=r[g])&&(v=(l<3?s(v):l>3?s(t,i,v):s(t,i))||v);return l>3&&v&&Object.defineProperty(t,i,v),v},u=this&&this.__param||function(r,t){return function(i,e){t(i,e,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const o=a(4725),h=a(2585),d=a(2584);let _=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(r,t,i,e,s,l){this._textarea=r,this._compositionView=t,this._bufferService=i,this._optionsService=e,this._coreService=s,this._renderService=l,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(r){this._compositionView.textContent=r.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(r){if(this._isComposing||this._isSendingComposition){if(r.keyCode===229||r.keyCode===16||r.keyCode===17||r.keyCode===18)return!1;this._finalizeComposition(!1)}return r.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(r){if(this._compositionView.classList.remove("active"),this._isComposing=!1,r){const t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let i;this._isSendingComposition=!1,t.start+=this._dataAlreadySent.length,i=this._isComposing?this._textarea.value.substring(t.start,t.end):this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;const t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){const r=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const t=this._textarea.value,i=t.replace(r,"");this._dataAlreadySent=i,t.length>r.length?this._coreService.triggerDataEvent(i,!0):t.length<r.length?this._coreService.triggerDataEvent(`${d.C0.DEL}`,!0):t.length===r.length&&t!==r&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(r){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,e=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const l=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=e+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}r||setTimeout(()=>this.updateCompositionElements(!0),0)}}};n.CompositionHelper=_=c([u(2,h.IBufferService),u(3,h.IOptionsService),u(4,h.ICoreService),u(5,o.IRenderService)],_)},9806:(S,n)=>{function a(c,u,o){const h=o.getBoundingClientRect(),d=c.getComputedStyle(o),_=parseInt(d.getPropertyValue("padding-left")),r=parseInt(d.getPropertyValue("padding-top"));return[u.clientX-h.left-_,u.clientY-h.top-r]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=a,n.getCoords=function(c,u,o,h,d,_,r,t,i){if(!_)return;const e=a(c,u,o);return e?(e[0]=Math.ceil((e[0]+(i?r/2:0))/r),e[1]=Math.ceil(e[1]/t),e[0]=Math.min(Math.max(e[0],1),h+(i?1:0)),e[1]=Math.min(Math.max(e[1],1),d),e):void 0}},9504:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const c=a(2584);function u(t,i,e,s){const l=t-o(t,e),v=i-o(i,e),g=Math.abs(l-v)-(function(p,f,m){let C=0;const w=p-o(p,m),L=f-o(f,m);for(let y=0;y<Math.abs(w-L);y++){const R=h(p,f)==="A"?-1:1,A=m.buffer.lines.get(w+R*y);A!=null&&A.isWrapped&&C++}return C})(t,i,e);return r(g,_(h(t,i),s))}function o(t,i){let e=0,s=i.buffer.lines.get(t),l=s==null?void 0:s.isWrapped;for(;l&&t>=0&&t<i.rows;)e++,s=i.buffer.lines.get(--t),l=s==null?void 0:s.isWrapped;return e}function h(t,i){return t>i?"A":"B"}function d(t,i,e,s,l,v){let g=t,p=i,f="";for(;g!==e||p!==s;)g+=l?1:-1,l&&g>v.cols-1?(f+=v.buffer.translateBufferLineToString(p,!1,t,g),g=0,t=0,p++):!l&&g<0&&(f+=v.buffer.translateBufferLineToString(p,!1,0,t+1),g=v.cols-1,t=g,p--);return f+v.buffer.translateBufferLineToString(p,!1,t,g)}function _(t,i){const e=i?"O":"[";return c.C0.ESC+e+t}function r(t,i){t=Math.floor(t);let e="";for(let s=0;s<t;s++)e+=i;return e}n.moveToCellSequence=function(t,i,e,s){const l=e.buffer.x,v=e.buffer.y;if(!e.buffer.hasScrollback)return(function(f,m,C,w,L,y){return u(m,w,L,y).length===0?"":r(d(f,m,f,m-o(m,L),!1,L).length,_("D",y))})(l,v,0,i,e,s)+u(v,i,e,s)+(function(f,m,C,w,L,y){let R;R=u(m,w,L,y).length>0?w-o(w,L):m;const A=w,B=(function(T,P,b,E,k,D){let I;return I=u(b,E,k,D).length>0?E-o(E,k):P,T<b&&I<=E||T>=b&&I<E?"C":"D"})(f,m,C,w,L,y);return r(d(f,R,C,A,B==="C",L).length,_(B,y))})(l,v,t,i,e,s);let g;if(v===i)return g=l>t?"D":"C",r(Math.abs(l-t),_(g,s));g=v>i?"D":"C";const p=Math.abs(v-i);return r((function(f,m){return m.cols-f})(v>i?t:l,e)+(p-1)*e.cols+1+((v>i?l:t)-1),_(g,s))}},1296:function(S,n,a){var c=this&&this.__decorate||function(y,R,A,B){var T,P=arguments.length,b=P<3?R:B===null?B=Object.getOwnPropertyDescriptor(R,A):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(y,R,A,B);else for(var E=y.length-1;E>=0;E--)(T=y[E])&&(b=(P<3?T(b):P>3?T(R,A,b):T(R,A))||b);return P>3&&b&&Object.defineProperty(R,A,b),b},u=this&&this.__param||function(y,R){return function(A,B){R(A,B,y)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const o=a(3787),h=a(2550),d=a(2223),_=a(6171),r=a(6052),t=a(4725),i=a(8055),e=a(8460),s=a(844),l=a(2585),v="xterm-dom-renderer-owner-",g="xterm-rows",p="xterm-fg-",f="xterm-bg-",m="xterm-focus",C="xterm-selection";let w=1,L=n.DomRenderer=class extends s.Disposable{constructor(y,R,A,B,T,P,b,E,k,D,I,W,z){super(),this._terminal=y,this._document=R,this._element=A,this._screenElement=B,this._viewportElement=T,this._helperContainer=P,this._linkifier2=b,this._charSizeService=k,this._optionsService=D,this._bufferService=I,this._coreBrowserService=W,this._themeService=z,this._terminalClass=w++,this._rowElements=[],this._selectionRenderModel=(0,r.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(g),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(C),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,_.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(q=>this._injectCss(q))),this._injectCss(this._themeService.colors),this._rowFactory=E.createInstance(o.DomRendererRowFactory,document),this._element.classList.add(v+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(q=>this._handleLinkHover(q))),this.register(this._linkifier2.onHideLinkUnderline(q=>this._handleLinkLeave(q))),this.register((0,s.toDisposable)(()=>{this._element.classList.remove(v+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new h.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const y=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*y,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*y),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/y),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/y),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const A of this._rowElements)A.style.width=`${this.dimensions.css.canvas.width}px`,A.style.height=`${this.dimensions.css.cell.height}px`,A.style.lineHeight=`${this.dimensions.css.cell.height}px`,A.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const R=`${this._terminalSelector} .${g} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=R,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(y){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let R=`${this._terminalSelector} .${g} { color: ${y.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;R+=`${this._terminalSelector} .${g} .xterm-dim { color: ${i.color.multiplyOpacity(y.foreground,.5).css};}`,R+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const A=`blink_underline_${this._terminalClass}`,B=`blink_bar_${this._terminalClass}`,T=`blink_block_${this._terminalClass}`;R+=`@keyframes ${A} { 50% { border-bottom-style: hidden; }}`,R+=`@keyframes ${B} { 50% { box-shadow: none; }}`,R+=`@keyframes ${T} { 0% { background-color: ${y.cursor.css}; color: ${y.cursorAccent.css}; } 50% { background-color: inherit; color: ${y.cursor.css}; }}`,R+=`${this._terminalSelector} .${g}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${A} 1s step-end infinite;}${this._terminalSelector} .${g}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${B} 1s step-end infinite;}${this._terminalSelector} .${g}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${T} 1s step-end infinite;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block { background-color: ${y.cursor.css}; color: ${y.cursorAccent.css};}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${y.cursor.css} !important; color: ${y.cursorAccent.css} !important;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${y.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${y.cursor.css} inset;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${y.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,R+=`${this._terminalSelector} .${C} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${C} div { position: absolute; background-color: ${y.selectionBackgroundOpaque.css};}${this._terminalSelector} .${C} div { position: absolute; background-color: ${y.selectionInactiveBackgroundOpaque.css};}`;for(const[P,b]of y.ansi.entries())R+=`${this._terminalSelector} .${p}${P} { color: ${b.css}; }${this._terminalSelector} .${p}${P}.xterm-dim { color: ${i.color.multiplyOpacity(b,.5).css}; }${this._terminalSelector} .${f}${P} { background-color: ${b.css}; }`;R+=`${this._terminalSelector} .${p}${d.INVERTED_DEFAULT_COLOR} { color: ${i.color.opaque(y.background).css}; }${this._terminalSelector} .${p}${d.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${i.color.multiplyOpacity(i.color.opaque(y.background),.5).css}; }${this._terminalSelector} .${f}${d.INVERTED_DEFAULT_COLOR} { background-color: ${y.foreground.css}; }`,this._themeStyleElement.textContent=R}_setDefaultSpacing(){const y=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${y}px`,this._rowFactory.defaultSpacing=y}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(y,R){for(let A=this._rowElements.length;A<=R;A++){const B=this._document.createElement("div");this._rowContainer.appendChild(B),this._rowElements.push(B)}for(;this._rowElements.length>R;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(y,R){this._refreshRowElements(y,R),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(m),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(m),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(y,R,A){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(y,R,A),this.renderRows(0,this._bufferService.rows-1),!y||!R)return;this._selectionRenderModel.update(this._terminal,y,R,A);const B=this._selectionRenderModel.viewportStartRow,T=this._selectionRenderModel.viewportEndRow,P=this._selectionRenderModel.viewportCappedStartRow,b=this._selectionRenderModel.viewportCappedEndRow;if(P>=this._bufferService.rows||b<0)return;const E=this._document.createDocumentFragment();if(A){const k=y[0]>R[0];E.appendChild(this._createSelectionElement(P,k?R[0]:y[0],k?y[0]:R[0],b-P+1))}else{const k=B===P?y[0]:0,D=P===T?R[0]:this._bufferService.cols;E.appendChild(this._createSelectionElement(P,k,D));const I=b-P-1;if(E.appendChild(this._createSelectionElement(P+1,0,this._bufferService.cols,I)),P!==b){const W=T===b?R[0]:this._bufferService.cols;E.appendChild(this._createSelectionElement(b,0,W))}}this._selectionContainer.appendChild(E)}_createSelectionElement(y,R,A,B=1){const T=this._document.createElement("div"),P=R*this.dimensions.css.cell.width;let b=this.dimensions.css.cell.width*(A-R);return P+b>this.dimensions.css.canvas.width&&(b=this.dimensions.css.canvas.width-P),T.style.height=B*this.dimensions.css.cell.height+"px",T.style.top=y*this.dimensions.css.cell.height+"px",T.style.left=`${P}px`,T.style.width=`${b}px`,T}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const y of this._rowElements)y.replaceChildren()}renderRows(y,R){const A=this._bufferService.buffer,B=A.ybase+A.y,T=Math.min(A.x,this._bufferService.cols-1),P=this._optionsService.rawOptions.cursorBlink,b=this._optionsService.rawOptions.cursorStyle,E=this._optionsService.rawOptions.cursorInactiveStyle;for(let k=y;k<=R;k++){const D=k+A.ydisp,I=this._rowElements[k],W=A.lines.get(D);if(!I||!W)break;I.replaceChildren(...this._rowFactory.createRow(W,D,D===B,b,E,T,P,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${v}${this._terminalClass}`}_handleLinkHover(y){this._setCellUnderline(y.x1,y.x2,y.y1,y.y2,y.cols,!0)}_handleLinkLeave(y){this._setCellUnderline(y.x1,y.x2,y.y1,y.y2,y.cols,!1)}_setCellUnderline(y,R,A,B,T,P){A<0&&(y=0),B<0&&(R=0);const b=this._bufferService.rows-1;A=Math.max(Math.min(A,b),0),B=Math.max(Math.min(B,b),0),T=Math.min(T,this._bufferService.cols);const E=this._bufferService.buffer,k=E.ybase+E.y,D=Math.min(E.x,T-1),I=this._optionsService.rawOptions.cursorBlink,W=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let q=A;q<=B;++q){const M=q+E.ydisp,x=this._rowElements[q],H=E.lines.get(M);if(!x||!H)break;x.replaceChildren(...this._rowFactory.createRow(H,M,M===k,W,z,D,I,this.dimensions.css.cell.width,this._widthCache,P?q===A?y:0:-1,P?(q===B?R:T)-1:-1))}}};n.DomRenderer=L=c([u(7,l.IInstantiationService),u(8,t.ICharSizeService),u(9,l.IOptionsService),u(10,l.IBufferService),u(11,t.ICoreBrowserService),u(12,t.IThemeService)],L)},3787:function(S,n,a){var c=this&&this.__decorate||function(g,p,f,m){var C,w=arguments.length,L=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(g,p,f,m);else for(var y=g.length-1;y>=0;y--)(C=g[y])&&(L=(w<3?C(L):w>3?C(p,f,L):C(p,f))||L);return w>3&&L&&Object.defineProperty(p,f,L),L},u=this&&this.__param||function(g,p){return function(f,m){p(f,m,g)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const o=a(2223),h=a(643),d=a(511),_=a(2585),r=a(8055),t=a(4725),i=a(4269),e=a(6171),s=a(3734);let l=n.DomRendererRowFactory=class{constructor(g,p,f,m,C,w,L){this._document=g,this._characterJoinerService=p,this._optionsService=f,this._coreBrowserService=m,this._coreService=C,this._decorationService=w,this._themeService=L,this._workCell=new d.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(g,p,f){this._selectionStart=g,this._selectionEnd=p,this._columnSelectMode=f}createRow(g,p,f,m,C,w,L,y,R,A,B){const T=[],P=this._characterJoinerService.getJoinedCharacters(p),b=this._themeService.colors;let E,k=g.getNoBgTrimmedLength();f&&k<w+1&&(k=w+1);let D=0,I="",W=0,z=0,q=0,M=!1,x=0,H=!1,O=0;const U=[],$=A!==-1&&B!==-1;for(let j=0;j<k;j++){g.loadCell(j,this._workCell);let se=this._workCell.getWidth();if(se===0)continue;let ie=!1,oe=j,X=this._workCell;if(P.length>0&&j===P[0][0]){ie=!0;const re=P.shift();X=new i.JoinedCellData(this._workCell,g.translateToString(!0,re[0],re[1]),re[1]-re[0]),oe=re[1]-1,se=X.getWidth()}const ve=this._isCellInSelection(j,p),Q=f&&j===w,Y=$&&j>=A&&j<=B;let Z=!1;this._decorationService.forEachDecorationAtCell(j,p,void 0,re=>{Z=!0});let K=X.getChars()||h.WHITESPACE_CELL_CHAR;if(K===" "&&(X.isUnderline()||X.isOverline())&&(K="\xA0"),O=se*y-R.get(K,X.isBold(),X.isItalic()),E){if(D&&(ve&&H||!ve&&!H&&X.bg===W)&&(ve&&H&&b.selectionForeground||X.fg===z)&&X.extended.ext===q&&Y===M&&O===x&&!Q&&!ie&&!Z){X.isInvisible()?I+=h.WHITESPACE_CELL_CHAR:I+=K,D++;continue}D&&(E.textContent=I),E=this._document.createElement("span"),D=0,I=""}else E=this._document.createElement("span");if(W=X.bg,z=X.fg,q=X.extended.ext,M=Y,x=O,H=ve,ie&&w>=j&&w<=oe&&(w=j),!this._coreService.isCursorHidden&&Q&&this._coreService.isCursorInitialized){if(U.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&U.push("xterm-cursor-blink"),U.push(m==="bar"?"xterm-cursor-bar":m==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(C)switch(C){case"outline":U.push("xterm-cursor-outline");break;case"block":U.push("xterm-cursor-block");break;case"bar":U.push("xterm-cursor-bar");break;case"underline":U.push("xterm-cursor-underline")}}if(X.isBold()&&U.push("xterm-bold"),X.isItalic()&&U.push("xterm-italic"),X.isDim()&&U.push("xterm-dim"),I=X.isInvisible()?h.WHITESPACE_CELL_CHAR:X.getChars()||h.WHITESPACE_CELL_CHAR,X.isUnderline()&&(U.push(`xterm-underline-${X.extended.underlineStyle}`),I===" "&&(I="\xA0"),!X.isUnderlineColorDefault()))if(X.isUnderlineColorRGB())E.style.textDecorationColor=`rgb(${s.AttributeData.toColorRGB(X.getUnderlineColor()).join(",")})`;else{let re=X.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&X.isBold()&&re<8&&(re+=8),E.style.textDecorationColor=b.ansi[re].css}X.isOverline()&&(U.push("xterm-overline"),I===" "&&(I="\xA0")),X.isStrikethrough()&&U.push("xterm-strikethrough"),Y&&(E.style.textDecoration="underline");let J=X.getFgColor(),he=X.getFgColorMode(),ee=X.getBgColor(),de=X.getBgColorMode();const ue=!!X.isInverse();if(ue){const re=J;J=ee,ee=re;const ge=he;he=de,de=ge}let ce,le,te,ae=!1;switch(this._decorationService.forEachDecorationAtCell(j,p,void 0,re=>{re.options.layer!=="top"&&ae||(re.backgroundColorRGB&&(de=50331648,ee=re.backgroundColorRGB.rgba>>8&16777215,ce=re.backgroundColorRGB),re.foregroundColorRGB&&(he=50331648,J=re.foregroundColorRGB.rgba>>8&16777215,le=re.foregroundColorRGB),ae=re.options.layer==="top")}),!ae&&ve&&(ce=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,ee=ce.rgba>>8&16777215,de=50331648,ae=!0,b.selectionForeground&&(he=50331648,J=b.selectionForeground.rgba>>8&16777215,le=b.selectionForeground)),ae&&U.push("xterm-decoration-top"),de){case 16777216:case 33554432:te=b.ansi[ee],U.push(`xterm-bg-${ee}`);break;case 50331648:te=r.channels.toColor(ee>>16,ee>>8&255,255&ee),this._addStyle(E,`background-color:#${v((ee>>>0).toString(16),"0",6)}`);break;default:ue?(te=b.foreground,U.push(`xterm-bg-${o.INVERTED_DEFAULT_COLOR}`)):te=b.background}switch(ce||X.isDim()&&(ce=r.color.multiplyOpacity(te,.5)),he){case 16777216:case 33554432:X.isBold()&&J<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(J+=8),this._applyMinimumContrast(E,te,b.ansi[J],X,ce,void 0)||U.push(`xterm-fg-${J}`);break;case 50331648:const re=r.channels.toColor(J>>16&255,J>>8&255,255&J);this._applyMinimumContrast(E,te,re,X,ce,le)||this._addStyle(E,`color:#${v(J.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(E,te,b.foreground,X,ce,le)||ue&&U.push(`xterm-fg-${o.INVERTED_DEFAULT_COLOR}`)}U.length&&(E.className=U.join(" "),U.length=0),Q||ie||Z?E.textContent=I:D++,O!==this.defaultSpacing&&(E.style.letterSpacing=`${O}px`),T.push(E),j=oe}return E&&D&&(E.textContent=I),T}_applyMinimumContrast(g,p,f,m,C,w){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(m.getCode()))return!1;const L=this._getContrastCache(m);let y;if(C||w||(y=L.getColor(p.rgba,f.rgba)),y===void 0){const R=this._optionsService.rawOptions.minimumContrastRatio/(m.isDim()?2:1);y=r.color.ensureContrastRatio(C||p,w||f,R),L.setColor((C||p).rgba,(w||f).rgba,y??null)}return!!y&&(this._addStyle(g,`color:${y.css}`),!0)}_getContrastCache(g){return g.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(g,p){g.setAttribute("style",`${g.getAttribute("style")||""}${p};`)}_isCellInSelection(g,p){const f=this._selectionStart,m=this._selectionEnd;return!(!f||!m)&&(this._columnSelectMode?f[0]<=m[0]?g>=f[0]&&p>=f[1]&&g<m[0]&&p<=m[1]:g<f[0]&&p>=f[1]&&g>=m[0]&&p<=m[1]:p>f[1]&&p<m[1]||f[1]===m[1]&&p===f[1]&&g>=f[0]&&g<m[0]||f[1]<m[1]&&p===m[1]&&g<m[0]||f[1]<m[1]&&p===f[1]&&g>=f[0])}};function v(g,p,f){for(;g.length<f;)g=p+g;return g}n.DomRendererRowFactory=l=c([u(1,t.ICharacterJoinerService),u(2,_.IOptionsService),u(3,t.ICoreBrowserService),u(4,_.ICoreService),u(5,_.IDecorationService),u(6,t.IThemeService)],l)},2550:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(a,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const u=a.createElement("span");u.classList.add("xterm-char-measure-element");const o=a.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold";const h=a.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontStyle="italic";const d=a.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold",d.style.fontStyle="italic",this._measureElements=[u,o,h,d],this._container.appendChild(u),this._container.appendChild(o),this._container.appendChild(h),this._container.appendChild(d),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,c,u,o){a===this._font&&c===this._fontSize&&u===this._weight&&o===this._weightBold||(this._font=a,this._fontSize=c,this._weight=u,this._weightBold=o,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${u}`,this._measureElements[1].style.fontWeight=`${o}`,this._measureElements[2].style.fontWeight=`${u}`,this._measureElements[3].style.fontWeight=`${o}`,this.clear())}get(a,c,u){let o=0;if(!c&&!u&&a.length===1&&(o=a.charCodeAt(0))<256){if(this._flat[o]!==-9999)return this._flat[o];const _=this._measure(a,0);return _>0&&(this._flat[o]=_),_}let h=a;c&&(h+="B"),u&&(h+="I");let d=this._holey.get(h);if(d===void 0){let _=0;c&&(_|=1),u&&(_|=2),d=this._measure(a,_),d>0&&this._holey.set(h,d)}return d}_measure(a,c){const u=this._measureElements[c];return u.textContent=a.repeat(32),u.offsetWidth/32}}},2223:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const c=a(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(S,n)=>{function a(u){return 57508<=u&&u<=57558}function c(u){return u>=128512&&u<=128591||u>=127744&&u<=128511||u>=128640&&u<=128767||u>=9728&&u<=9983||u>=9984&&u<=10175||u>=65024&&u<=65039||u>=129280&&u<=129535||u>=127462&&u<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(u){if(!u)throw new Error("value must not be falsy");return u},n.isPowerlineGlyph=a,n.isRestrictedPowerlineGlyph=function(u){return 57520<=u&&u<=57527},n.isEmoji=c,n.allowRescaling=function(u,o,h,d){return o===1&&h>Math.ceil(1.5*d)&&u!==void 0&&u>255&&!c(u)&&!a(u)&&!(function(_){return 57344<=_&&_<=63743})(u)},n.treatGlyphAsBackgroundColor=function(u){return a(u)||(function(o){return 9472<=o&&o<=9631})(u)},n.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},n.computeNextVariantOffset=function(u,o,h=0){return(u-(2*Math.round(o)-h))%(2*Math.round(o))}},6052:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(u,o,h,d=!1){if(this.selectionStart=o,this.selectionEnd=h,!o||!h||o[0]===h[0]&&o[1]===h[1])return void this.clear();const _=u.buffers.active.ydisp,r=o[1]-_,t=h[1]-_,i=Math.max(r,0),e=Math.min(t,u.rows-1);i>=u.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=d,this.viewportStartRow=r,this.viewportEndRow=t,this.viewportCappedStartRow=i,this.viewportCappedEndRow=e,this.startCol=o[0],this.endCol=h[0])}isCellSelected(u,o,h){return!!this.hasSelection&&(h-=u.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?o>=this.startCol&&h>=this.viewportCappedStartRow&&o<this.endCol&&h<=this.viewportCappedEndRow:o<this.startCol&&h>=this.viewportCappedStartRow&&o>=this.endCol&&h<=this.viewportCappedEndRow:h>this.viewportStartRow&&h<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&h===this.viewportStartRow&&o>=this.startCol&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&h===this.viewportEndRow&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&h===this.viewportStartRow&&o>=this.startCol)}}n.createSelectionRenderModel=function(){return new a}},456:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,c=this.selectionEnd;return!(!a||!c)&&(a[1]>c[1]||a[1]===c[1]&&a[0]>c[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(S,n,a){var c=this&&this.__decorate||function(e,s,l,v){var g,p=arguments.length,f=p<3?s:v===null?v=Object.getOwnPropertyDescriptor(s,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,l,v);else for(var m=e.length-1;m>=0;m--)(g=e[m])&&(f=(p<3?g(f):p>3?g(s,l,f):g(s,l))||f);return p>3&&f&&Object.defineProperty(s,l,f),f},u=this&&this.__param||function(e,s){return function(l,v){s(l,v,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const o=a(2585),h=a(8460),d=a(844);let _=n.CharSizeService=class extends d.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,s,l){super(),this._optionsService=l,this.width=0,this.height=0,this._onCharSizeChange=this.register(new h.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new i(this._optionsService))}catch{this._measureStrategy=this.register(new t(e,s,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};n.CharSizeService=_=c([u(2,o.IOptionsService)],_);class r extends d.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(s,l){s!==void 0&&s>0&&l!==void 0&&l>0&&(this._result.width=s,this._result.height=l)}}class t extends r{constructor(s,l,v){super(),this._document=s,this._parentElement=l,this._optionsService=v,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class i extends r{constructor(s){super(),this._optionsService=s,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const l=this._ctx.measureText("W");if(!("width"in l&&"fontBoundingBoxAscent"in l&&"fontBoundingBoxDescent"in l))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const s=this._ctx.measureText("W");return this._validateAndSet(s.width,s.fontBoundingBoxAscent+s.fontBoundingBoxDescent),this._result}}},4269:function(S,n,a){var c=this&&this.__decorate||function(i,e,s,l){var v,g=arguments.length,p=g<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,e,s,l);else for(var f=i.length-1;f>=0;f--)(v=i[f])&&(p=(g<3?v(p):g>3?v(e,s,p):v(e,s))||p);return g>3&&p&&Object.defineProperty(e,s,p),p},u=this&&this.__param||function(i,e){return function(s,l){e(s,l,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const o=a(3734),h=a(643),d=a(511),_=a(2585);class r extends o.AttributeData{constructor(e,s,l){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=s,this._width=l}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=r;let t=n.CharacterJoinerService=class Ge{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new d.CellData}register(e){const s={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(s),s.id}deregister(e){for(let s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===e)return this._characterJoiners.splice(s,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];const s=this._bufferService.buffer.lines.get(e);if(!s||s.length===0)return[];const l=[],v=s.translateToString(!0);let g=0,p=0,f=0,m=s.getFg(0),C=s.getBg(0);for(let w=0;w<s.getTrimmedLength();w++)if(s.loadCell(w,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==m||this._workCell.bg!==C){if(w-g>1){const L=this._getJoinedRanges(v,f,p,s,g);for(let y=0;y<L.length;y++)l.push(L[y])}g=w,f=p,m=this._workCell.fg,C=this._workCell.bg}p+=this._workCell.getChars().length||h.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-g>1){const w=this._getJoinedRanges(v,f,p,s,g);for(let L=0;L<w.length;L++)l.push(w[L])}return l}_getJoinedRanges(e,s,l,v,g){const p=e.substring(s,l);let f=[];try{f=this._characterJoiners[0].handler(p)}catch(m){console.error(m)}for(let m=1;m<this._characterJoiners.length;m++)try{const C=this._characterJoiners[m].handler(p);for(let w=0;w<C.length;w++)Ge._mergeRanges(f,C[w])}catch(C){console.error(C)}return this._stringRangesToCellRanges(f,v,g),f}_stringRangesToCellRanges(e,s,l){let v=0,g=!1,p=0,f=e[v];if(f){for(let m=l;m<this._bufferService.cols;m++){const C=s.getWidth(m),w=s.getString(m).length||h.WHITESPACE_CELL_CHAR.length;if(C!==0){if(!g&&f[0]<=p&&(f[0]=m,g=!0),f[1]<=p){if(f[1]=m,f=e[++v],!f)break;f[0]<=p?(f[0]=m,g=!0):g=!1}p+=w}}f&&(f[1]=this._bufferService.cols)}}static _mergeRanges(e,s){let l=!1;for(let v=0;v<e.length;v++){const g=e[v];if(l){if(s[1]<=g[0])return e[v-1][1]=s[1],e;if(s[1]<=g[1])return e[v-1][1]=Math.max(s[1],g[1]),e.splice(v,1),e;e.splice(v,1),v--}else{if(s[1]<=g[0])return e.splice(v,0,s),e;if(s[1]<=g[1])return g[0]=Math.min(s[0],g[0]),e;s[0]<g[1]&&(g[0]=Math.min(s[0],g[0]),l=!0)}}return l?e[e.length-1][1]=s[1]:e.push(s),e}};n.CharacterJoinerService=t=c([u(0,_.IBufferService)],t)},5114:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const c=a(844),u=a(8460),o=a(3656);class h extends c.Disposable{constructor(r,t,i){super(),this._textarea=r,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new d(this._window),this._onDprChange=this.register(new u.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new u.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this.register((0,u.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(r){this._window!==r&&(this._window=r,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}n.CoreBrowserService=h;class d extends c.Disposable{constructor(r){super(),this._parentWindow=r,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new u.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)(()=>this.clearListener()))}setWindow(r){this._parentWindow=r,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,o.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var r;this._outerListener&&((r=this._resolutionMediaMatchList)==null||r.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const c=a(844);class u extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(h){return this.linkProviders.push(h),{dispose:()=>{const d=this.linkProviders.indexOf(h);d!==-1&&this.linkProviders.splice(d,1)}}}}n.LinkProviderService=u},8934:function(S,n,a){var c=this&&this.__decorate||function(_,r,t,i){var e,s=arguments.length,l=s<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(_,r,t,i);else for(var v=_.length-1;v>=0;v--)(e=_[v])&&(l=(s<3?e(l):s>3?e(r,t,l):e(r,t))||l);return s>3&&l&&Object.defineProperty(r,t,l),l},u=this&&this.__param||function(_,r){return function(t,i){r(t,i,_)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const o=a(4725),h=a(9806);let d=n.MouseService=class{constructor(_,r){this._renderService=_,this._charSizeService=r}getCoords(_,r,t,i,e){return(0,h.getCoords)(window,_,r,t,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(_,r){const t=(0,h.getCoordsRelativeToElement)(window,_,r);if(this._charSizeService.hasValidSize)return t[0]=Math.min(Math.max(t[0],0),this._renderService.dimensions.css.canvas.width-1),t[1]=Math.min(Math.max(t[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(t[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(t[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(t[0]),y:Math.floor(t[1])}}};n.MouseService=d=c([u(0,o.IRenderService),u(1,o.ICharSizeService)],d)},3230:function(S,n,a){var c=this&&this.__decorate||function(e,s,l,v){var g,p=arguments.length,f=p<3?s:v===null?v=Object.getOwnPropertyDescriptor(s,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,l,v);else for(var m=e.length-1;m>=0;m--)(g=e[m])&&(f=(p<3?g(f):p>3?g(s,l,f):g(s,l))||f);return p>3&&f&&Object.defineProperty(s,l,f),f},u=this&&this.__param||function(e,s){return function(l,v){s(l,v,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const o=a(6193),h=a(4725),d=a(8460),_=a(844),r=a(7226),t=a(2585);let i=n.RenderService=class extends _.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,s,l,v,g,p,f,m){super(),this._rowCount=e,this._charSizeService=v,this._renderer=this.register(new _.MutableDisposable),this._pausedResizeTask=new r.DebouncedIdleTask,this._observerDisposable=this.register(new _.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new d.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new d.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new d.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new d.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new o.RenderDebouncer((C,w)=>this._renderRows(C,w),f),this.register(this._renderDebouncer),this.register(f.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(p.onResize(()=>this._fullRefresh())),this.register(p.buffers.onBufferActivate(()=>{var C;return(C=this._renderer.value)==null?void 0:C.clear()})),this.register(l.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(g.onDecorationRegistered(()=>this._fullRefresh())),this.register(g.onDecorationRemoved(()=>this._fullRefresh())),this.register(l.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(p.cols,p.rows),this._fullRefresh()})),this.register(l.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(p.buffer.y,p.buffer.y,!0))),this.register(m.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(f.window,s),this.register(f.onWindowChange(C=>this._registerIntersectionObserver(C,s)))}_registerIntersectionObserver(e,s){if("IntersectionObserver"in e){const l=new e.IntersectionObserver(v=>this._handleIntersectionChange(v[v.length-1]),{threshold:0});l.observe(s),this._observerDisposable.value=(0,_.toDisposable)(()=>l.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,s,l=!1){this._isPaused?this._needsFullRefresh=!0:(l||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,s,this._rowCount))}_renderRows(e,s){this._renderer.value&&(e=Math.min(e,this._rowCount-1),s=Math.min(s,this._rowCount-1),this._renderer.value.renderRows(e,s),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:s}),this._onRender.fire({start:e,end:s}),this._isNextRenderRedrawOnly=!0)}resize(e,s){this._rowCount=s,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(s=>this.refreshRows(s.start,s.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,s;this._renderer.value&&((s=(e=this._renderer.value).clearTextureAtlas)==null||s.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,s){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var l;return(l=this._renderer.value)==null?void 0:l.handleResize(e,s)}):this._renderer.value.handleResize(e,s),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,s,l){var v;this._selectionState.start=e,this._selectionState.end=s,this._selectionState.columnSelectMode=l,(v=this._renderer.value)==null||v.handleSelectionChanged(e,s,l)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};n.RenderService=i=c([u(2,t.IOptionsService),u(3,h.ICharSizeService),u(4,t.IDecorationService),u(5,t.IBufferService),u(6,h.ICoreBrowserService),u(7,h.IThemeService)],i)},9312:function(S,n,a){var c=this&&this.__decorate||function(f,m,C,w){var L,y=arguments.length,R=y<3?m:w===null?w=Object.getOwnPropertyDescriptor(m,C):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,m,C,w);else for(var A=f.length-1;A>=0;A--)(L=f[A])&&(R=(y<3?L(R):y>3?L(m,C,R):L(m,C))||R);return y>3&&R&&Object.defineProperty(m,C,R),R},u=this&&this.__param||function(f,m){return function(C,w){m(C,w,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const o=a(9806),h=a(9504),d=a(456),_=a(4725),r=a(8460),t=a(844),i=a(6114),e=a(4841),s=a(511),l=a(2585),v="\xA0",g=new RegExp(v,"g");let p=n.SelectionService=class extends t.Disposable{constructor(f,m,C,w,L,y,R,A,B){super(),this._element=f,this._screenElement=m,this._linkifier=C,this._bufferService=w,this._coreService=L,this._mouseService=y,this._optionsService=R,this._renderService=A,this._coreBrowserService=B,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new s.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new r.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new r.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new r.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new r.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=T=>this._handleMouseMove(T),this._mouseUpListener=T=>this._handleMouseUp(T),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(T=>this._handleTrim(T)),this.register(this._bufferService.buffers.onBufferActivate(T=>this._handleBufferActivate(T))),this.enable(),this._model=new d.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,t.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const f=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;return!(!f||!m||f[0]===m[0]&&f[1]===m[1])}get selectionText(){const f=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;if(!f||!m)return"";const C=this._bufferService.buffer,w=[];if(this._activeSelectionMode===3){if(f[0]===m[0])return"";const L=f[0]<m[0]?f[0]:m[0],y=f[0]<m[0]?m[0]:f[0];for(let R=f[1];R<=m[1];R++){const A=C.translateBufferLineToString(R,!0,L,y);w.push(A)}}else{const L=f[1]===m[1]?m[0]:void 0;w.push(C.translateBufferLineToString(f[1],!0,f[0],L));for(let y=f[1]+1;y<=m[1]-1;y++){const R=C.lines.get(y),A=C.translateBufferLineToString(y,!0);R!=null&&R.isWrapped?w[w.length-1]+=A:w.push(A)}if(f[1]!==m[1]){const y=C.lines.get(m[1]),R=C.translateBufferLineToString(m[1],!0,0,m[0]);y&&y.isWrapped?w[w.length-1]+=R:w.push(R)}}return w.map(L=>L.replace(g," ")).join(i.isWindows?`\r
|
|
6
|
+
`:`
|
|
7
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(f){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),i.isLinux&&f&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(f){const m=this._getMouseBufferCoords(f),C=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!!(C&&w&&m)&&this._areCoordsInSelection(m,C,w)}isCellInSelection(f,m){const C=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!(!C||!w)&&this._areCoordsInSelection([f,m],C,w)}_areCoordsInSelection(f,m,C){return f[1]>m[1]&&f[1]<C[1]||m[1]===C[1]&&f[1]===m[1]&&f[0]>=m[0]&&f[0]<C[0]||m[1]<C[1]&&f[1]===C[1]&&f[0]<C[0]||m[1]<C[1]&&f[1]===m[1]&&f[0]>=m[0]}_selectWordAtCursor(f,m){var L,y;const C=(y=(L=this._linkifier.currentLink)==null?void 0:L.link)==null?void 0:y.range;if(C)return this._model.selectionStart=[C.start.x-1,C.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(C,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const w=this._getMouseBufferCoords(f);return!!w&&(this._selectWordAt(w,m),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(f,m){this._model.clearSelection(),f=Math.max(f,0),m=Math.min(m,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,f],this._model.selectionEnd=[this._bufferService.cols,m],this.refresh(),this._onSelectionChange.fire()}_handleTrim(f){this._model.handleTrim(f)&&this.refresh()}_getMouseBufferCoords(f){const m=this._mouseService.getCoords(f,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(m)return m[0]--,m[1]--,m[1]+=this._bufferService.buffer.ydisp,m}_getMouseEventScrollAmount(f){let m=(0,o.getCoordsRelativeToElement)(this._coreBrowserService.window,f,this._screenElement)[1];const C=this._renderService.dimensions.css.canvas.height;return m>=0&&m<=C?0:(m>C&&(m-=C),m=Math.min(Math.max(m,-50),50),m/=50,m/Math.abs(m)+Math.round(14*m))}shouldForceSelection(f){return i.isMac?f.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:f.shiftKey}handleMouseDown(f){if(this._mouseDownTimeStamp=f.timeStamp,(f.button!==2||!this.hasSelection)&&f.button===0){if(!this._enabled){if(!this.shouldForceSelection(f))return;f.stopPropagation()}f.preventDefault(),this._dragScrollAmount=0,this._enabled&&f.shiftKey?this._handleIncrementalClick(f):f.detail===1?this._handleSingleClick(f):f.detail===2?this._handleDoubleClick(f):f.detail===3&&this._handleTripleClick(f),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(f){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(f))}_handleSingleClick(f){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(f)?3:0,this._model.selectionStart=this._getMouseBufferCoords(f),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const m=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);m&&m.length!==this._model.selectionStart[0]&&m.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(f){this._selectWordAtCursor(f,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(f){const m=this._getMouseBufferCoords(f);m&&(this._activeSelectionMode=2,this._selectLineAt(m[1]))}shouldColumnSelect(f){return f.altKey&&!(i.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(f){if(f.stopImmediatePropagation(),!this._model.selectionStart)return;const m=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(f),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(f),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const C=this._bufferService.buffer;if(this._model.selectionEnd[1]<C.lines.length){const w=C.lines.get(this._model.selectionEnd[1]);w&&w.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}m&&m[0]===this._model.selectionEnd[0]&&m[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const f=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(f.ydisp+this._bufferService.rows,f.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=f.ydisp),this.refresh()}}_handleMouseUp(f){const m=f.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&m<500&&f.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const C=this._mouseService.getCoords(f,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){const w=(0,h.moveToCellSequence)(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(w,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const f=this._model.finalSelectionStart,m=this._model.finalSelectionEnd,C=!(!f||!m||f[0]===m[0]&&f[1]===m[1]);C?f&&m&&(this._oldSelectionStart&&this._oldSelectionEnd&&f[0]===this._oldSelectionStart[0]&&f[1]===this._oldSelectionStart[1]&&m[0]===this._oldSelectionEnd[0]&&m[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(f,m,C)):this._oldHasSelection&&this._fireOnSelectionChange(f,m,C)}_fireOnSelectionChange(f,m,C){this._oldSelectionStart=f,this._oldSelectionEnd=m,this._oldHasSelection=C,this._onSelectionChange.fire()}_handleBufferActivate(f){this.clearSelection(),this._trimListener.dispose(),this._trimListener=f.activeBuffer.lines.onTrim(m=>this._handleTrim(m))}_convertViewportColToCharacterIndex(f,m){let C=m;for(let w=0;m>=w;w++){const L=f.loadCell(w,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:L>1&&m!==w&&(C+=L-1)}return C}setSelection(f,m,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[f,m],this._model.selectionStartLength=C,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(f){this._isClickInSelection(f)||(this._selectWordAtCursor(f,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(f,m,C=!0,w=!0){if(f[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,y=L.lines.get(f[1]);if(!y)return;const R=L.translateBufferLineToString(f[1],!1);let A=this._convertViewportColToCharacterIndex(y,f[0]),B=A;const T=f[0]-A;let P=0,b=0,E=0,k=0;if(R.charAt(A)===" "){for(;A>0&&R.charAt(A-1)===" ";)A--;for(;B<R.length&&R.charAt(B+1)===" ";)B++}else{let W=f[0],z=f[0];y.getWidth(W)===0&&(P++,W--),y.getWidth(z)===2&&(b++,z++);const q=y.getString(z).length;for(q>1&&(k+=q-1,B+=q-1);W>0&&A>0&&!this._isCharWordSeparator(y.loadCell(W-1,this._workCell));){y.loadCell(W-1,this._workCell);const M=this._workCell.getChars().length;this._workCell.getWidth()===0?(P++,W--):M>1&&(E+=M-1,A-=M-1),A--,W--}for(;z<y.length&&B+1<R.length&&!this._isCharWordSeparator(y.loadCell(z+1,this._workCell));){y.loadCell(z+1,this._workCell);const M=this._workCell.getChars().length;this._workCell.getWidth()===2?(b++,z++):M>1&&(k+=M-1,B+=M-1),B++,z++}}B++;let D=A+T-P+E,I=Math.min(this._bufferService.cols,B-A+P+b-E-k);if(m||R.slice(A,B).trim()!==""){if(C&&D===0&&y.getCodePoint(0)!==32){const W=L.lines.get(f[1]-1);if(W&&y.isWrapped&&W.getCodePoint(this._bufferService.cols-1)!==32){const z=this._getWordAt([this._bufferService.cols-1,f[1]-1],!1,!0,!1);if(z){const q=this._bufferService.cols-z.start;D-=q,I+=q}}}if(w&&D+I===this._bufferService.cols&&y.getCodePoint(this._bufferService.cols-1)!==32){const W=L.lines.get(f[1]+1);if(W!=null&&W.isWrapped&&W.getCodePoint(0)!==32){const z=this._getWordAt([0,f[1]+1],!1,!1,!0);z&&(I+=z.length)}}return{start:D,length:I}}}_selectWordAt(f,m){const C=this._getWordAt(f,m);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,f[1]--;this._model.selectionStart=[C.start,f[1]],this._model.selectionStartLength=C.length}}_selectToWordAt(f){const m=this._getWordAt(f,!0);if(m){let C=f[1];for(;m.start<0;)m.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;m.start+m.length>this._bufferService.cols;)m.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?m.start:m.start+m.length,C]}}_isCharWordSeparator(f){return f.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(f.getChars())>=0}_selectLineAt(f){const m=this._bufferService.buffer.getWrappedRangeForLine(f),C={start:{x:0,y:m.first},end:{x:this._bufferService.cols-1,y:m.last}};this._model.selectionStart=[0,m.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(C,this._bufferService.cols)}};n.SelectionService=p=c([u(3,l.IBufferService),u(4,l.ICoreService),u(5,_.IMouseService),u(6,l.IOptionsService),u(7,_.IRenderService),u(8,_.ICoreBrowserService)],p)},4725:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ILinkProviderService=n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const c=a(8343);n.ICharSizeService=(0,c.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),n.IMouseService=(0,c.createDecorator)("MouseService"),n.IRenderService=(0,c.createDecorator)("RenderService"),n.ISelectionService=(0,c.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,c.createDecorator)("ThemeService"),n.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(S,n,a){var c=this&&this.__decorate||function(p,f,m,C){var w,L=arguments.length,y=L<3?f:C===null?C=Object.getOwnPropertyDescriptor(f,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(p,f,m,C);else for(var R=p.length-1;R>=0;R--)(w=p[R])&&(y=(L<3?w(y):L>3?w(f,m,y):w(f,m))||y);return L>3&&y&&Object.defineProperty(f,m,y),y},u=this&&this.__param||function(p,f){return function(m,C){f(m,C,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const o=a(7239),h=a(8055),d=a(8460),_=a(844),r=a(2585),t=h.css.toColor("#ffffff"),i=h.css.toColor("#000000"),e=h.css.toColor("#ffffff"),s=h.css.toColor("#000000"),l={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const p=[h.css.toColor("#2e3436"),h.css.toColor("#cc0000"),h.css.toColor("#4e9a06"),h.css.toColor("#c4a000"),h.css.toColor("#3465a4"),h.css.toColor("#75507b"),h.css.toColor("#06989a"),h.css.toColor("#d3d7cf"),h.css.toColor("#555753"),h.css.toColor("#ef2929"),h.css.toColor("#8ae234"),h.css.toColor("#fce94f"),h.css.toColor("#729fcf"),h.css.toColor("#ad7fa8"),h.css.toColor("#34e2e2"),h.css.toColor("#eeeeec")],f=[0,95,135,175,215,255];for(let m=0;m<216;m++){const C=f[m/36%6|0],w=f[m/6%6|0],L=f[m%6];p.push({css:h.channels.toCss(C,w,L),rgba:h.channels.toRgba(C,w,L)})}for(let m=0;m<24;m++){const C=8+10*m;p.push({css:h.channels.toCss(C,C,C),rgba:h.channels.toRgba(C,C,C)})}return p})());let v=n.ThemeService=class extends _.Disposable{get colors(){return this._colors}constructor(p){super(),this._optionsService=p,this._contrastCache=new o.ColorContrastCache,this._halfContrastCache=new o.ColorContrastCache,this._onChangeColors=this.register(new d.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:t,background:i,cursor:e,cursorAccent:s,selectionForeground:void 0,selectionBackgroundTransparent:l,selectionBackgroundOpaque:h.color.blend(i,l),selectionInactiveBackgroundTransparent:l,selectionInactiveBackgroundOpaque:h.color.blend(i,l),ansi:n.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(p={}){const f=this._colors;if(f.foreground=g(p.foreground,t),f.background=g(p.background,i),f.cursor=g(p.cursor,e),f.cursorAccent=g(p.cursorAccent,s),f.selectionBackgroundTransparent=g(p.selectionBackground,l),f.selectionBackgroundOpaque=h.color.blend(f.background,f.selectionBackgroundTransparent),f.selectionInactiveBackgroundTransparent=g(p.selectionInactiveBackground,f.selectionBackgroundTransparent),f.selectionInactiveBackgroundOpaque=h.color.blend(f.background,f.selectionInactiveBackgroundTransparent),f.selectionForeground=p.selectionForeground?g(p.selectionForeground,h.NULL_COLOR):void 0,f.selectionForeground===h.NULL_COLOR&&(f.selectionForeground=void 0),h.color.isOpaque(f.selectionBackgroundTransparent)&&(f.selectionBackgroundTransparent=h.color.opacity(f.selectionBackgroundTransparent,.3)),h.color.isOpaque(f.selectionInactiveBackgroundTransparent)&&(f.selectionInactiveBackgroundTransparent=h.color.opacity(f.selectionInactiveBackgroundTransparent,.3)),f.ansi=n.DEFAULT_ANSI_COLORS.slice(),f.ansi[0]=g(p.black,n.DEFAULT_ANSI_COLORS[0]),f.ansi[1]=g(p.red,n.DEFAULT_ANSI_COLORS[1]),f.ansi[2]=g(p.green,n.DEFAULT_ANSI_COLORS[2]),f.ansi[3]=g(p.yellow,n.DEFAULT_ANSI_COLORS[3]),f.ansi[4]=g(p.blue,n.DEFAULT_ANSI_COLORS[4]),f.ansi[5]=g(p.magenta,n.DEFAULT_ANSI_COLORS[5]),f.ansi[6]=g(p.cyan,n.DEFAULT_ANSI_COLORS[6]),f.ansi[7]=g(p.white,n.DEFAULT_ANSI_COLORS[7]),f.ansi[8]=g(p.brightBlack,n.DEFAULT_ANSI_COLORS[8]),f.ansi[9]=g(p.brightRed,n.DEFAULT_ANSI_COLORS[9]),f.ansi[10]=g(p.brightGreen,n.DEFAULT_ANSI_COLORS[10]),f.ansi[11]=g(p.brightYellow,n.DEFAULT_ANSI_COLORS[11]),f.ansi[12]=g(p.brightBlue,n.DEFAULT_ANSI_COLORS[12]),f.ansi[13]=g(p.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),f.ansi[14]=g(p.brightCyan,n.DEFAULT_ANSI_COLORS[14]),f.ansi[15]=g(p.brightWhite,n.DEFAULT_ANSI_COLORS[15]),p.extendedAnsi){const m=Math.min(f.ansi.length-16,p.extendedAnsi.length);for(let C=0;C<m;C++)f.ansi[C+16]=g(p.extendedAnsi[C],n.DEFAULT_ANSI_COLORS[C+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(p){this._restoreColor(p),this._onChangeColors.fire(this.colors)}_restoreColor(p){if(p!==void 0)switch(p){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[p]=this._restoreColors.ansi[p]}else for(let f=0;f<this._restoreColors.ansi.length;++f)this._colors.ansi[f]=this._restoreColors.ansi[f]}modifyColors(p){p(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function g(p,f){if(p!==void 0)try{return h.css.toColor(p)}catch{}return f}n.ThemeService=v=c([u(0,r.IOptionsService)],v)},6349:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const c=a(8460),u=a(844);class o extends u.Disposable{constructor(d){super(),this._maxLength=d,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(d){if(this._maxLength===d)return;const _=new Array(d);for(let r=0;r<Math.min(d,this.length);r++)_[r]=this._array[this._getCyclicIndex(r)];this._array=_,this._maxLength=d,this._startIndex=0}get length(){return this._length}set length(d){if(d>this._length)for(let _=this._length;_<d;_++)this._array[_]=void 0;this._length=d}get(d){return this._array[this._getCyclicIndex(d)]}set(d,_){this._array[this._getCyclicIndex(d)]=_}push(d){this._array[this._getCyclicIndex(this._length)]=d,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(d,_,...r){if(_){for(let t=d;t<this._length-_;t++)this._array[this._getCyclicIndex(t)]=this._array[this._getCyclicIndex(t+_)];this._length-=_,this.onDeleteEmitter.fire({index:d,amount:_})}for(let t=this._length-1;t>=d;t--)this._array[this._getCyclicIndex(t+r.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<r.length;t++)this._array[this._getCyclicIndex(d+t)]=r[t];if(r.length&&this.onInsertEmitter.fire({index:d,amount:r.length}),this._length+r.length>this._maxLength){const t=this._length+r.length-this._maxLength;this._startIndex+=t,this._length=this._maxLength,this.onTrimEmitter.fire(t)}else this._length+=r.length}trimStart(d){d>this._length&&(d=this._length),this._startIndex+=d,this._length-=d,this.onTrimEmitter.fire(d)}shiftElements(d,_,r){if(!(_<=0)){if(d<0||d>=this._length)throw new Error("start argument out of range");if(d+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let i=_-1;i>=0;i--)this.set(d+i+r,this.get(d+i));const t=d+_+r-this._length;if(t>0)for(this._length+=t;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let t=0;t<_;t++)this.set(d+t+r,this.get(d+t))}}_getCyclicIndex(d){return(this._startIndex+d)%this._maxLength}}n.CircularList=o},1439:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function a(c,u=5){if(typeof c!="object")return c;const o=Array.isArray(c)?[]:{};for(const h in c)o[h]=u<=1?c[h]:c[h]&&a(c[h],u-1);return o}},8055:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let a=0,c=0,u=0,o=0;var h,d,_,r,t;function i(s){const l=s.toString(16);return l.length<2?"0"+l:l}function e(s,l){return s<l?(l+.05)/(s+.05):(s+.05)/(l+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(s){s.toCss=function(l,v,g,p){return p!==void 0?`#${i(l)}${i(v)}${i(g)}${i(p)}`:`#${i(l)}${i(v)}${i(g)}`},s.toRgba=function(l,v,g,p=255){return(l<<24|v<<16|g<<8|p)>>>0},s.toColor=function(l,v,g,p){return{css:s.toCss(l,v,g,p),rgba:s.toRgba(l,v,g,p)}}})(h||(n.channels=h={})),(function(s){function l(v,g){return o=Math.round(255*g),[a,c,u]=t.toChannels(v.rgba),{css:h.toCss(a,c,u,o),rgba:h.toRgba(a,c,u,o)}}s.blend=function(v,g){if(o=(255&g.rgba)/255,o===1)return{css:g.css,rgba:g.rgba};const p=g.rgba>>24&255,f=g.rgba>>16&255,m=g.rgba>>8&255,C=v.rgba>>24&255,w=v.rgba>>16&255,L=v.rgba>>8&255;return a=C+Math.round((p-C)*o),c=w+Math.round((f-w)*o),u=L+Math.round((m-L)*o),{css:h.toCss(a,c,u),rgba:h.toRgba(a,c,u)}},s.isOpaque=function(v){return!(255&~v.rgba)},s.ensureContrastRatio=function(v,g,p){const f=t.ensureContrastRatio(v.rgba,g.rgba,p);if(f)return h.toColor(f>>24&255,f>>16&255,f>>8&255)},s.opaque=function(v){const g=(255|v.rgba)>>>0;return[a,c,u]=t.toChannels(g),{css:h.toCss(a,c,u),rgba:g}},s.opacity=l,s.multiplyOpacity=function(v,g){return o=255&v.rgba,l(v,o*g/255)},s.toColorRGB=function(v){return[v.rgba>>24&255,v.rgba>>16&255,v.rgba>>8&255]}})(d||(n.color=d={})),(function(s){let l,v;try{const g=document.createElement("canvas");g.width=1,g.height=1;const p=g.getContext("2d",{willReadFrequently:!0});p&&(l=p,l.globalCompositeOperation="copy",v=l.createLinearGradient(0,0,1,1))}catch{}s.toColor=function(g){if(g.match(/#[\da-f]{3,8}/i))switch(g.length){case 4:return a=parseInt(g.slice(1,2).repeat(2),16),c=parseInt(g.slice(2,3).repeat(2),16),u=parseInt(g.slice(3,4).repeat(2),16),h.toColor(a,c,u);case 5:return a=parseInt(g.slice(1,2).repeat(2),16),c=parseInt(g.slice(2,3).repeat(2),16),u=parseInt(g.slice(3,4).repeat(2),16),o=parseInt(g.slice(4,5).repeat(2),16),h.toColor(a,c,u,o);case 7:return{css:g,rgba:(parseInt(g.slice(1),16)<<8|255)>>>0};case 9:return{css:g,rgba:parseInt(g.slice(1),16)>>>0}}const p=g.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(p)return a=parseInt(p[1]),c=parseInt(p[2]),u=parseInt(p[3]),o=Math.round(255*(p[5]===void 0?1:parseFloat(p[5]))),h.toColor(a,c,u,o);if(!l||!v)throw new Error("css.toColor: Unsupported css format");if(l.fillStyle=v,l.fillStyle=g,typeof l.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(l.fillRect(0,0,1,1),[a,c,u,o]=l.getImageData(0,0,1,1).data,o!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:h.toRgba(a,c,u,o),css:g}}})(_||(n.css=_={})),(function(s){function l(v,g,p){const f=v/255,m=g/255,C=p/255;return .2126*(f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4))+.7152*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}s.relativeLuminance=function(v){return l(v>>16&255,v>>8&255,255&v)},s.relativeLuminance2=l})(r||(n.rgb=r={})),(function(s){function l(g,p,f){const m=g>>24&255,C=g>>16&255,w=g>>8&255;let L=p>>24&255,y=p>>16&255,R=p>>8&255,A=e(r.relativeLuminance2(L,y,R),r.relativeLuminance2(m,C,w));for(;A<f&&(L>0||y>0||R>0);)L-=Math.max(0,Math.ceil(.1*L)),y-=Math.max(0,Math.ceil(.1*y)),R-=Math.max(0,Math.ceil(.1*R)),A=e(r.relativeLuminance2(L,y,R),r.relativeLuminance2(m,C,w));return(L<<24|y<<16|R<<8|255)>>>0}function v(g,p,f){const m=g>>24&255,C=g>>16&255,w=g>>8&255;let L=p>>24&255,y=p>>16&255,R=p>>8&255,A=e(r.relativeLuminance2(L,y,R),r.relativeLuminance2(m,C,w));for(;A<f&&(L<255||y<255||R<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),y=Math.min(255,y+Math.ceil(.1*(255-y))),R=Math.min(255,R+Math.ceil(.1*(255-R))),A=e(r.relativeLuminance2(L,y,R),r.relativeLuminance2(m,C,w));return(L<<24|y<<16|R<<8|255)>>>0}s.blend=function(g,p){if(o=(255&p)/255,o===1)return p;const f=p>>24&255,m=p>>16&255,C=p>>8&255,w=g>>24&255,L=g>>16&255,y=g>>8&255;return a=w+Math.round((f-w)*o),c=L+Math.round((m-L)*o),u=y+Math.round((C-y)*o),h.toRgba(a,c,u)},s.ensureContrastRatio=function(g,p,f){const m=r.relativeLuminance(g>>8),C=r.relativeLuminance(p>>8);if(e(m,C)<f){if(C<m){const y=l(g,p,f),R=e(m,r.relativeLuminance(y>>8));if(R<f){const A=v(g,p,f);return R>e(m,r.relativeLuminance(A>>8))?y:A}return y}const w=v(g,p,f),L=e(m,r.relativeLuminance(w>>8));if(L<f){const y=l(g,p,f);return L>e(m,r.relativeLuminance(y>>8))?w:y}return w}},s.reduceLuminance=l,s.increaseLuminance=v,s.toChannels=function(g){return[g>>24&255,g>>16&255,g>>8&255,255&g]}})(t||(n.rgba=t={})),n.toPaddedHex=i,n.contrastRatio=e},8969:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const c=a(844),u=a(2585),o=a(4348),h=a(7866),d=a(744),_=a(7302),r=a(6975),t=a(8460),i=a(1753),e=a(1480),s=a(7994),l=a(9282),v=a(5435),g=a(5981),p=a(2660);let f=!1;class m extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new t.EventEmitter),this._onScroll.event(w=>{var L;(L=this._onScrollApi)==null||L.fire(w.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(w){for(const L in w)this.optionsService.options[L]=w[L]}constructor(w){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new t.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new t.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new t.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new t.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new t.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new t.EventEmitter),this._instantiationService=new o.InstantiationService,this.optionsService=this.register(new _.OptionsService(w)),this._instantiationService.setService(u.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(d.BufferService)),this._instantiationService.setService(u.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(h.LogService)),this._instantiationService.setService(u.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(r.CoreService)),this._instantiationService.setService(u.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(i.CoreMouseService)),this._instantiationService.setService(u.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(u.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(s.CharsetService),this._instantiationService.setService(u.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(p.OscLinkService),this._instantiationService.setService(u.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new v.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,t.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,t.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,t.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,t.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new g.WriteBuffer((L,y)=>this._inputHandler.parse(L,y))),this.register((0,t.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(w,L){this._writeBuffer.write(w,L)}writeSync(w,L){this._logService.logLevel<=u.LogLevelEnum.WARN&&!f&&(this._logService.warn("writeSync is unreliable and will be removed soon."),f=!0),this._writeBuffer.writeSync(w,L)}input(w,L=!0){this.coreService.triggerDataEvent(w,L)}resize(w,L){isNaN(w)||isNaN(L)||(w=Math.max(w,d.MINIMUM_COLS),L=Math.max(L,d.MINIMUM_ROWS),this._bufferService.resize(w,L))}scroll(w,L=!1){this._bufferService.scroll(w,L)}scrollLines(w,L,y){this._bufferService.scrollLines(w,L,y)}scrollPages(w){this.scrollLines(w*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(w){const L=w-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(w,L){return this._inputHandler.registerEscHandler(w,L)}registerDcsHandler(w,L){return this._inputHandler.registerDcsHandler(w,L)}registerCsiHandler(w,L){return this._inputHandler.registerCsiHandler(w,L)}registerOscHandler(w,L){return this._inputHandler.registerOscHandler(w,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let w=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?w=L.backend==="conpty"&&L.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(w=!0),w?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const w=[];w.push(this.onLineFeed(l.updateWindowsModeWrappedState.bind(null,this._bufferService))),w.push(this.registerCsiHandler({final:"H"},()=>((0,l.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const L of w)L.dispose()})}}}n.CoreTerminal=m},8460:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const u=[];for(let o=0;o<this._listeners.length;o++)u.push(this._listeners[o]);for(let o=0;o<u.length;o++)u[o].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(a,c){return a(u=>c.fire(u))},n.runAndSubscribe=function(a,c){return c(void 0),a(u=>c(u))}},5435:function(S,n,a){var c=this&&this.__decorate||function(P,b,E,k){var D,I=arguments.length,W=I<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,E):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(P,b,E,k);else for(var z=P.length-1;z>=0;z--)(D=P[z])&&(W=(I<3?D(W):I>3?D(b,E,W):D(b,E))||W);return I>3&&W&&Object.defineProperty(b,E,W),W},u=this&&this.__param||function(P,b){return function(E,k){b(E,k,P)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const o=a(2584),h=a(7116),d=a(2015),_=a(844),r=a(482),t=a(8437),i=a(8460),e=a(643),s=a(511),l=a(3734),v=a(2585),g=a(1480),p=a(6242),f=a(6351),m=a(5941),C={"(":0,")":1,"*":2,"+":3,"-":1,".":2},w=131072;function L(P,b){if(P>24)return b.setWinLines||!1;switch(P){case 1:return!!b.restoreWin;case 2:return!!b.minimizeWin;case 3:return!!b.setWinPosition;case 4:return!!b.setWinSizePixels;case 5:return!!b.raiseWin;case 6:return!!b.lowerWin;case 7:return!!b.refreshWin;case 8:return!!b.setWinSizeChars;case 9:return!!b.maximizeWin;case 10:return!!b.fullscreenWin;case 11:return!!b.getWinState;case 13:return!!b.getWinPosition;case 14:return!!b.getWinSizePixels;case 15:return!!b.getScreenSizePixels;case 16:return!!b.getCellSizePixels;case 18:return!!b.getWinSizeChars;case 19:return!!b.getScreenSizeChars;case 20:return!!b.getIconTitle;case 21:return!!b.getWinTitle;case 22:return!!b.pushTitle;case 23:return!!b.popTitle;case 24:return!!b.setWinLines}return!1}var y;(function(P){P[P.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",P[P.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(y||(n.WindowsOptionsReportType=y={}));let R=0;class A extends _.Disposable{getAttrData(){return this._curAttrData}constructor(b,E,k,D,I,W,z,q,M=new d.EscapeSequenceParser){super(),this._bufferService=b,this._charsetService=E,this._coreService=k,this._logService=D,this._optionsService=I,this._oscLinkService=W,this._coreMouseService=z,this._unicodeService=q,this._parser=M,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new r.StringToUtf32,this._utf8Decoder=new r.Utf8ToUtf32,this._workCell=new s.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new i.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new i.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new i.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new i.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new i.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new i.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new i.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new i.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new i.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new i.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new i.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new i.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new B(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(x=>this._activeBuffer=x.activeBuffer)),this._parser.setCsiHandlerFallback((x,H)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(x),params:H.toArray()})}),this._parser.setEscHandlerFallback(x=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(x)})}),this._parser.setExecuteHandlerFallback(x=>{this._logService.debug("Unknown EXECUTE code: ",{code:x})}),this._parser.setOscHandlerFallback((x,H,O)=>{this._logService.debug("Unknown OSC code: ",{identifier:x,action:H,data:O})}),this._parser.setDcsHandlerFallback((x,H,O)=>{H==="HOOK"&&(O=O.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(x),action:H,payload:O})}),this._parser.setPrintHandler((x,H,O)=>this.print(x,H,O)),this._parser.registerCsiHandler({final:"@"},x=>this.insertChars(x)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},x=>this.scrollLeft(x)),this._parser.registerCsiHandler({final:"A"},x=>this.cursorUp(x)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},x=>this.scrollRight(x)),this._parser.registerCsiHandler({final:"B"},x=>this.cursorDown(x)),this._parser.registerCsiHandler({final:"C"},x=>this.cursorForward(x)),this._parser.registerCsiHandler({final:"D"},x=>this.cursorBackward(x)),this._parser.registerCsiHandler({final:"E"},x=>this.cursorNextLine(x)),this._parser.registerCsiHandler({final:"F"},x=>this.cursorPrecedingLine(x)),this._parser.registerCsiHandler({final:"G"},x=>this.cursorCharAbsolute(x)),this._parser.registerCsiHandler({final:"H"},x=>this.cursorPosition(x)),this._parser.registerCsiHandler({final:"I"},x=>this.cursorForwardTab(x)),this._parser.registerCsiHandler({final:"J"},x=>this.eraseInDisplay(x,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},x=>this.eraseInDisplay(x,!0)),this._parser.registerCsiHandler({final:"K"},x=>this.eraseInLine(x,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},x=>this.eraseInLine(x,!0)),this._parser.registerCsiHandler({final:"L"},x=>this.insertLines(x)),this._parser.registerCsiHandler({final:"M"},x=>this.deleteLines(x)),this._parser.registerCsiHandler({final:"P"},x=>this.deleteChars(x)),this._parser.registerCsiHandler({final:"S"},x=>this.scrollUp(x)),this._parser.registerCsiHandler({final:"T"},x=>this.scrollDown(x)),this._parser.registerCsiHandler({final:"X"},x=>this.eraseChars(x)),this._parser.registerCsiHandler({final:"Z"},x=>this.cursorBackwardTab(x)),this._parser.registerCsiHandler({final:"`"},x=>this.charPosAbsolute(x)),this._parser.registerCsiHandler({final:"a"},x=>this.hPositionRelative(x)),this._parser.registerCsiHandler({final:"b"},x=>this.repeatPrecedingCharacter(x)),this._parser.registerCsiHandler({final:"c"},x=>this.sendDeviceAttributesPrimary(x)),this._parser.registerCsiHandler({prefix:">",final:"c"},x=>this.sendDeviceAttributesSecondary(x)),this._parser.registerCsiHandler({final:"d"},x=>this.linePosAbsolute(x)),this._parser.registerCsiHandler({final:"e"},x=>this.vPositionRelative(x)),this._parser.registerCsiHandler({final:"f"},x=>this.hVPosition(x)),this._parser.registerCsiHandler({final:"g"},x=>this.tabClear(x)),this._parser.registerCsiHandler({final:"h"},x=>this.setMode(x)),this._parser.registerCsiHandler({prefix:"?",final:"h"},x=>this.setModePrivate(x)),this._parser.registerCsiHandler({final:"l"},x=>this.resetMode(x)),this._parser.registerCsiHandler({prefix:"?",final:"l"},x=>this.resetModePrivate(x)),this._parser.registerCsiHandler({final:"m"},x=>this.charAttributes(x)),this._parser.registerCsiHandler({final:"n"},x=>this.deviceStatus(x)),this._parser.registerCsiHandler({prefix:"?",final:"n"},x=>this.deviceStatusPrivate(x)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},x=>this.softReset(x)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},x=>this.setCursorStyle(x)),this._parser.registerCsiHandler({final:"r"},x=>this.setScrollRegion(x)),this._parser.registerCsiHandler({final:"s"},x=>this.saveCursor(x)),this._parser.registerCsiHandler({final:"t"},x=>this.windowOptions(x)),this._parser.registerCsiHandler({final:"u"},x=>this.restoreCursor(x)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},x=>this.insertColumns(x)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},x=>this.deleteColumns(x)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},x=>this.selectProtected(x)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},x=>this.requestMode(x,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},x=>this.requestMode(x,!1)),this._parser.setExecuteHandler(o.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(o.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(o.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(o.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(o.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(o.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(o.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(o.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(o.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(o.C1.IND,()=>this.index()),this._parser.setExecuteHandler(o.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(o.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new p.OscHandler(x=>(this.setTitle(x),this.setIconName(x),!0))),this._parser.registerOscHandler(1,new p.OscHandler(x=>this.setIconName(x))),this._parser.registerOscHandler(2,new p.OscHandler(x=>this.setTitle(x))),this._parser.registerOscHandler(4,new p.OscHandler(x=>this.setOrReportIndexedColor(x))),this._parser.registerOscHandler(8,new p.OscHandler(x=>this.setHyperlink(x))),this._parser.registerOscHandler(10,new p.OscHandler(x=>this.setOrReportFgColor(x))),this._parser.registerOscHandler(11,new p.OscHandler(x=>this.setOrReportBgColor(x))),this._parser.registerOscHandler(12,new p.OscHandler(x=>this.setOrReportCursorColor(x))),this._parser.registerOscHandler(104,new p.OscHandler(x=>this.restoreIndexedColor(x))),this._parser.registerOscHandler(110,new p.OscHandler(x=>this.restoreFgColor(x))),this._parser.registerOscHandler(111,new p.OscHandler(x=>this.restoreBgColor(x))),this._parser.registerOscHandler(112,new p.OscHandler(x=>this.restoreCursorColor(x))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const x in h.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:x},()=>this.selectCharset("("+x)),this._parser.registerEscHandler({intermediates:")",final:x},()=>this.selectCharset(")"+x)),this._parser.registerEscHandler({intermediates:"*",final:x},()=>this.selectCharset("*"+x)),this._parser.registerEscHandler({intermediates:"+",final:x},()=>this.selectCharset("+"+x)),this._parser.registerEscHandler({intermediates:"-",final:x},()=>this.selectCharset("-"+x)),this._parser.registerEscHandler({intermediates:".",final:x},()=>this.selectCharset("."+x)),this._parser.registerEscHandler({intermediates:"/",final:x},()=>this.selectCharset("/"+x));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(x=>(this._logService.error("Parsing error: ",x),x)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new f.DcsHandler((x,H)=>this.requestStatusString(x,H)))}_preserveStack(b,E,k,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=b,this._parseStack.cursorStartY=E,this._parseStack.decodedLength=k,this._parseStack.position=D}_logSlowResolvingAsync(b){this._logService.logLevel<=v.LogLevelEnum.WARN&&Promise.race([b,new Promise((E,k)=>setTimeout(()=>k("#SLOW_TIMEOUT"),5e3))]).catch(E=>{if(E!=="#SLOW_TIMEOUT")throw E;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(b,E){let k,D=this._activeBuffer.x,I=this._activeBuffer.y,W=0;const z=this._parseStack.paused;if(z){if(k=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,E))return this._logSlowResolvingAsync(k),k;D=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,b.length>w&&(W=this._parseStack.position+w)}if(this._logService.logLevel<=v.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof b=="string"?` "${b}"`:` "${Array.prototype.map.call(b,x=>String.fromCharCode(x)).join("")}"`),typeof b=="string"?b.split("").map(x=>x.charCodeAt(0)):b),this._parseBuffer.length<b.length&&this._parseBuffer.length<w&&(this._parseBuffer=new Uint32Array(Math.min(b.length,w))),z||this._dirtyRowTracker.clearRange(),b.length>w)for(let x=W;x<b.length;x+=w){const H=x+w<b.length?x+w:b.length,O=typeof b=="string"?this._stringDecoder.decode(b.substring(x,H),this._parseBuffer):this._utf8Decoder.decode(b.subarray(x,H),this._parseBuffer);if(k=this._parser.parse(this._parseBuffer,O))return this._preserveStack(D,I,O,x),this._logSlowResolvingAsync(k),k}else if(!z){const x=typeof b=="string"?this._stringDecoder.decode(b,this._parseBuffer):this._utf8Decoder.decode(b,this._parseBuffer);if(k=this._parser.parse(this._parseBuffer,x))return this._preserveStack(D,I,x,0),this._logSlowResolvingAsync(k),k}this._activeBuffer.x===D&&this._activeBuffer.y===I||this._onCursorMove.fire();const q=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),M=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);M<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(M,this._bufferService.rows-1),Math.min(q,this._bufferService.rows-1))}print(b,E,k){let D,I;const W=this._charsetService.charset,z=this._optionsService.rawOptions.screenReaderMode,q=this._bufferService.cols,M=this._coreService.decPrivateModes.wraparound,x=this._coreService.modes.insertMode,H=this._curAttrData;let O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&k-E>0&&O.getWidth(this._activeBuffer.x-1)===2&&O.setCellFromCodepoint(this._activeBuffer.x-1,0,1,H);let U=this._parser.precedingJoinState;for(let $=E;$<k;++$){if(D=b[$],D<127&&W){const oe=W[String.fromCharCode(D)];oe&&(D=oe.charCodeAt(0))}const j=this._unicodeService.charProperties(D,U);I=g.UnicodeService.extractWidth(j);const se=g.UnicodeService.extractShouldJoin(j),ie=se?g.UnicodeService.extractWidth(U):0;if(U=j,z&&this._onA11yChar.fire((0,r.stringFromCodePoint)(D)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-ie>q){if(M){const oe=O;let X=this._activeBuffer.x-ie;for(this._activeBuffer.x=ie,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ie>0&&O instanceof t.BufferLine&&O.copyCellsFrom(oe,X,0,ie,!1);X<q;)oe.setCellFromCodepoint(X++,0,1,H)}else if(this._activeBuffer.x=q-1,I===2)continue}if(se&&this._activeBuffer.x){const oe=O.getWidth(this._activeBuffer.x-1)?1:2;O.addCodepointToCell(this._activeBuffer.x-oe,D,I);for(let X=I-ie;--X>=0;)O.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}else if(x&&(O.insertCells(this._activeBuffer.x,I-ie,this._activeBuffer.getNullCell(H)),O.getWidth(q-1)===2&&O.setCellFromCodepoint(q-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,H)),O.setCellFromCodepoint(this._activeBuffer.x++,D,I,H),I>0)for(;--I;)O.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}this._parser.precedingJoinState=U,this._activeBuffer.x<q&&k-E>0&&O.getWidth(this._activeBuffer.x)===0&&!O.hasContent(this._activeBuffer.x)&&O.setCellFromCodepoint(this._activeBuffer.x,0,1,H),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(b,E){return b.final!=="t"||b.prefix||b.intermediates?this._parser.registerCsiHandler(b,E):this._parser.registerCsiHandler(b,k=>!L(k.params[0],this._optionsService.rawOptions.windowOptions)||E(k))}registerDcsHandler(b,E){return this._parser.registerDcsHandler(b,new f.DcsHandler(E))}registerEscHandler(b,E){return this._parser.registerEscHandler(b,E)}registerOscHandler(b,E){return this._parser.registerOscHandler(b,new p.OscHandler(E))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var b;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&b.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);E.hasWidth(this._activeBuffer.x)&&!E.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const b=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-b),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(b=this._bufferService.cols-1){this._activeBuffer.x=Math.min(b,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(b,E){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=b,this._activeBuffer.y=this._activeBuffer.scrollTop+E):(this._activeBuffer.x=b,this._activeBuffer.y=E),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(b,E){this._restrictCursor(),this._setCursor(this._activeBuffer.x+b,this._activeBuffer.y+E)}cursorUp(b){const E=this._activeBuffer.y-this._activeBuffer.scrollTop;return E>=0?this._moveCursor(0,-Math.min(E,b.params[0]||1)):this._moveCursor(0,-(b.params[0]||1)),!0}cursorDown(b){const E=this._activeBuffer.scrollBottom-this._activeBuffer.y;return E>=0?this._moveCursor(0,Math.min(E,b.params[0]||1)):this._moveCursor(0,b.params[0]||1),!0}cursorForward(b){return this._moveCursor(b.params[0]||1,0),!0}cursorBackward(b){return this._moveCursor(-(b.params[0]||1),0),!0}cursorNextLine(b){return this.cursorDown(b),this._activeBuffer.x=0,!0}cursorPrecedingLine(b){return this.cursorUp(b),this._activeBuffer.x=0,!0}cursorCharAbsolute(b){return this._setCursor((b.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(b){return this._setCursor(b.length>=2?(b.params[1]||1)-1:0,(b.params[0]||1)-1),!0}charPosAbsolute(b){return this._setCursor((b.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(b){return this._moveCursor(b.params[0]||1,0),!0}linePosAbsolute(b){return this._setCursor(this._activeBuffer.x,(b.params[0]||1)-1),!0}vPositionRelative(b){return this._moveCursor(0,b.params[0]||1),!0}hVPosition(b){return this.cursorPosition(b),!0}tabClear(b){const E=b.params[0];return E===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:E===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let E=b.params[0]||1;for(;E--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let E=b.params[0]||1;for(;E--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(b){const E=b.params[0];return E===1&&(this._curAttrData.bg|=536870912),E!==2&&E!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(b,E,k,D=!1,I=!1){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);W.replaceCells(E,k,this._activeBuffer.getNullCell(this._eraseAttrData()),I),D&&(W.isWrapped=!1)}_resetBufferLine(b,E=!1){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);k&&(k.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),E),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+b),k.isWrapped=!1)}eraseInDisplay(b,E=!1){let k;switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:for(k=this._activeBuffer.y,this._dirtyRowTracker.markDirty(k),this._eraseInBufferLine(k++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,E);k<this._bufferService.rows;k++)this._resetBufferLine(k,E);this._dirtyRowTracker.markDirty(k);break;case 1:for(k=this._activeBuffer.y,this._dirtyRowTracker.markDirty(k),this._eraseInBufferLine(k,0,this._activeBuffer.x+1,!0,E),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(k+1).isWrapped=!1);k--;)this._resetBufferLine(k,E);this._dirtyRowTracker.markDirty(0);break;case 2:for(k=this._bufferService.rows,this._dirtyRowTracker.markDirty(k-1);k--;)this._resetBufferLine(k,E);this._dirtyRowTracker.markDirty(0);break;case 3:const D=this._activeBuffer.lines.length-this._bufferService.rows;D>0&&(this._activeBuffer.lines.trimStart(D),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-D,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-D,0),this._onScroll.fire(0))}return!0}eraseInLine(b,E=!1){switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,E);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,E);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,E)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(b){this._restrictCursor();let E=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=this._activeBuffer.ybase+this._activeBuffer.y,D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-D+1;for(;E--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(k,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(b){this._restrictCursor();let E=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=this._activeBuffer.ybase+this._activeBuffer.y;let D;for(D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,D=this._bufferService.rows-1+this._activeBuffer.ybase-D;E--;)this._activeBuffer.lines.splice(k,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(b){this._restrictCursor();const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return E&&(E.insertCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(b){this._restrictCursor();const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return E&&(E.deleteCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(b){let E=b.params[0]||1;for(;E--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(b){let E=b.params[0]||1;for(;E--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(t.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=b.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);D.deleteCells(0,E,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=b.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);D.insertCells(0,E,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=b.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);D.insertCells(this._activeBuffer.x,E,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=b.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);D.deleteCells(this._activeBuffer.x,E,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(b){this._restrictCursor();const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return E&&(E.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(b.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(b){const E=this._parser.precedingJoinState;if(!E)return!0;const k=b.params[0]||1,D=g.UnicodeService.extractWidth(E),I=this._activeBuffer.x-D,W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),z=new Uint32Array(W.length*k);let q=0;for(let x=0;x<W.length;){const H=W.codePointAt(x)||0;z[q++]=H,x+=H>65535?2:1}let M=q;for(let x=1;x<k;++x)z.copyWithin(M,0,q),M+=q;return this.print(z,0,M),!0}sendDeviceAttributesPrimary(b){return b.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(o.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(o.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(b){return b.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(o.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(o.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(b.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(o.C0.ESC+"[>83;40003;0c")),!0}_is(b){return(this._optionsService.rawOptions.termName+"").indexOf(b)===0}setMode(b){for(let E=0;E<b.length;E++)switch(b.params[E]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(b){for(let E=0;E<b.length;E++)switch(b.params[E]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,h.DEFAULT_CHARSET),this._charsetService.setgCharset(1,h.DEFAULT_CHARSET),this._charsetService.setgCharset(2,h.DEFAULT_CHARSET),this._charsetService.setgCharset(3,h.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(b){for(let E=0;E<b.length;E++)switch(b.params[E]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(b){for(let E=0;E<b.length;E++)switch(b.params[E]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),b.params[E]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(b,E){const k=this._coreService.decPrivateModes,{activeProtocol:D,activeEncoding:I}=this._coreMouseService,W=this._coreService,{buffers:z,cols:q}=this._bufferService,{active:M,alt:x}=z,H=this._optionsService.rawOptions,O=se=>se?1:2,U=b.params[0];return $=U,j=E?U===2?4:U===4?O(W.modes.insertMode):U===12?3:U===20?O(H.convertEol):0:U===1?O(k.applicationCursorKeys):U===3?H.windowOptions.setWinLines?q===80?2:q===132?1:0:0:U===6?O(k.origin):U===7?O(k.wraparound):U===8?3:U===9?O(D==="X10"):U===12?O(H.cursorBlink):U===25?O(!W.isCursorHidden):U===45?O(k.reverseWraparound):U===66?O(k.applicationKeypad):U===67?4:U===1e3?O(D==="VT200"):U===1002?O(D==="DRAG"):U===1003?O(D==="ANY"):U===1004?O(k.sendFocus):U===1005?4:U===1006?O(I==="SGR"):U===1015?4:U===1016?O(I==="SGR_PIXELS"):U===1048?1:U===47||U===1047||U===1049?O(M===x):U===2004?O(k.bracketedPasteMode):0,W.triggerDataEvent(`${o.C0.ESC}[${E?"":"?"}${$};${j}$y`),!0;var $,j}_updateAttrColor(b,E,k,D,I){return E===2?(b|=50331648,b&=-16777216,b|=l.AttributeData.fromColorRGB([k,D,I])):E===5&&(b&=-50331904,b|=33554432|255&k),b}_extractColor(b,E,k){const D=[0,0,-1,0,0,0];let I=0,W=0;do{if(D[W+I]=b.params[E+W],b.hasSubParams(E+W)){const z=b.getSubParams(E+W);let q=0;do D[1]===5&&(I=1),D[W+q+1+I]=z[q];while(++q<z.length&&q+W+1+I<D.length);break}if(D[1]===5&&W+I>=2||D[1]===2&&W+I>=5)break;D[1]&&(I=1)}while(++W+E<b.length&&W+I<D.length);for(let z=2;z<D.length;++z)D[z]===-1&&(D[z]=0);switch(D[0]){case 38:k.fg=this._updateAttrColor(k.fg,D[1],D[3],D[4],D[5]);break;case 48:k.bg=this._updateAttrColor(k.bg,D[1],D[3],D[4],D[5]);break;case 58:k.extended=k.extended.clone(),k.extended.underlineColor=this._updateAttrColor(k.extended.underlineColor,D[1],D[3],D[4],D[5])}return W}_processUnderline(b,E){E.extended=E.extended.clone(),(!~b||b>5)&&(b=1),E.extended.underlineStyle=b,E.fg|=268435456,b===0&&(E.fg&=-268435457),E.updateExtended()}_processSGR0(b){b.fg=t.DEFAULT_ATTR_DATA.fg,b.bg=t.DEFAULT_ATTR_DATA.bg,b.extended=b.extended.clone(),b.extended.underlineStyle=0,b.extended.underlineColor&=-67108864,b.updateExtended()}charAttributes(b){if(b.length===1&&b.params[0]===0)return this._processSGR0(this._curAttrData),!0;const E=b.length;let k;const D=this._curAttrData;for(let I=0;I<E;I++)k=b.params[I],k>=30&&k<=37?(D.fg&=-50331904,D.fg|=16777216|k-30):k>=40&&k<=47?(D.bg&=-50331904,D.bg|=16777216|k-40):k>=90&&k<=97?(D.fg&=-50331904,D.fg|=16777224|k-90):k>=100&&k<=107?(D.bg&=-50331904,D.bg|=16777224|k-100):k===0?this._processSGR0(D):k===1?D.fg|=134217728:k===3?D.bg|=67108864:k===4?(D.fg|=268435456,this._processUnderline(b.hasSubParams(I)?b.getSubParams(I)[0]:1,D)):k===5?D.fg|=536870912:k===7?D.fg|=67108864:k===8?D.fg|=1073741824:k===9?D.fg|=2147483648:k===2?D.bg|=134217728:k===21?this._processUnderline(2,D):k===22?(D.fg&=-134217729,D.bg&=-134217729):k===23?D.bg&=-67108865:k===24?(D.fg&=-268435457,this._processUnderline(0,D)):k===25?D.fg&=-536870913:k===27?D.fg&=-67108865:k===28?D.fg&=-1073741825:k===29?D.fg&=2147483647:k===39?(D.fg&=-67108864,D.fg|=16777215&t.DEFAULT_ATTR_DATA.fg):k===49?(D.bg&=-67108864,D.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):k===38||k===48||k===58?I+=this._extractColor(b,I,D):k===53?D.bg|=1073741824:k===55?D.bg&=-1073741825:k===59?(D.extended=D.extended.clone(),D.extended.underlineColor=-1,D.updateExtended()):k===100?(D.fg&=-67108864,D.fg|=16777215&t.DEFAULT_ATTR_DATA.fg,D.bg&=-67108864,D.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",k);return!0}deviceStatus(b){switch(b.params[0]){case 5:this._coreService.triggerDataEvent(`${o.C0.ESC}[0n`);break;case 6:const E=this._activeBuffer.y+1,k=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[${E};${k}R`)}return!0}deviceStatusPrivate(b){if(b.params[0]===6){const E=this._activeBuffer.y+1,k=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[?${E};${k}R`)}return!0}softReset(b){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(b){const E=b.params[0]||1;switch(E){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const k=E%2==1;return this._optionsService.options.cursorBlink=k,!0}setScrollRegion(b){const E=b.params[0]||1;let k;return(b.length<2||(k=b.params[1])>this._bufferService.rows||k===0)&&(k=this._bufferService.rows),k>E&&(this._activeBuffer.scrollTop=E-1,this._activeBuffer.scrollBottom=k-1,this._setCursor(0,0)),!0}windowOptions(b){if(!L(b.params[0],this._optionsService.rawOptions.windowOptions))return!0;const E=b.length>1?b.params[1]:0;switch(b.params[0]){case 14:E!==2&&this._onRequestWindowsOptionsReport.fire(y.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(y.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${o.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:E!==0&&E!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),E!==0&&E!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:E!==0&&E!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),E!==0&&E!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(b){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(b){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(b){return this._windowTitle=b,this._onTitleChange.fire(b),!0}setIconName(b){return this._iconName=b,!0}setOrReportIndexedColor(b){const E=[],k=b.split(";");for(;k.length>1;){const D=k.shift(),I=k.shift();if(/^\d+$/.exec(D)){const W=parseInt(D);if(T(W))if(I==="?")E.push({type:0,index:W});else{const z=(0,m.parseColor)(I);z&&E.push({type:1,index:W,color:z})}}}return E.length&&this._onColor.fire(E),!0}setHyperlink(b){const E=b.split(";");return!(E.length<2)&&(E[1]?this._createHyperlink(E[0],E[1]):!E[0]&&this._finishHyperlink())}_createHyperlink(b,E){this._getCurrentLinkId()&&this._finishHyperlink();const k=b.split(":");let D;const I=k.findIndex(W=>W.startsWith("id="));return I!==-1&&(D=k[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:E}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(b,E){const k=b.split(";");for(let D=0;D<k.length&&!(E>=this._specialColors.length);++D,++E)if(k[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[E]}]);else{const I=(0,m.parseColor)(k[D]);I&&this._onColor.fire([{type:1,index:this._specialColors[E],color:I}])}return!0}setOrReportFgColor(b){return this._setOrReportSpecialColor(b,0)}setOrReportBgColor(b){return this._setOrReportSpecialColor(b,1)}setOrReportCursorColor(b){return this._setOrReportSpecialColor(b,2)}restoreIndexedColor(b){if(!b)return this._onColor.fire([{type:2}]),!0;const E=[],k=b.split(";");for(let D=0;D<k.length;++D)if(/^\d+$/.exec(k[D])){const I=parseInt(k[D]);T(I)&&E.push({type:2,index:I})}return E.length&&this._onColor.fire(E),!0}restoreFgColor(b){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(b){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(b){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,h.DEFAULT_CHARSET),!0}selectCharset(b){return b.length!==2?(this.selectDefaultCharset(),!0):(b[0]==="/"||this._charsetService.setgCharset(C[b[0]],h.CHARSETS[b[1]]||h.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const b=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,b,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(b){return this._charsetService.setgLevel(b),!0}screenAlignmentPattern(){const b=new s.CellData;b.content=4194373,b.fg=this._curAttrData.fg,b.bg=this._curAttrData.bg,this._setCursor(0,0);for(let E=0;E<this._bufferService.rows;++E){const k=this._activeBuffer.ybase+this._activeBuffer.y+E,D=this._activeBuffer.lines.get(k);D&&(D.fill(b),D.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(b,E){const k=this._bufferService.buffer,D=this._optionsService.rawOptions;return(I=>(this._coreService.triggerDataEvent(`${o.C0.ESC}${I}${o.C0.ESC}\\`),!0))(b==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:b==='"p'?'P1$r61;1"p':b==="r"?`P1$r${k.scrollTop+1};${k.scrollBottom+1}r`:b==="m"?"P1$r0m":b===" q"?`P1$r${{block:2,underline:4,bar:6}[D.cursorStyle]-(D.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(b,E){this._dirtyRowTracker.markRangeDirty(b,E)}}n.InputHandler=A;let B=class{constructor(P){this._bufferService=P,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(P){P<this.start?this.start=P:P>this.end&&(this.end=P)}markRangeDirty(P,b){P>b&&(R=P,P=b,b=R),P<this.start&&(this.start=P),b>this.end&&(this.end=b)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function T(P){return 0<=P&&P<256}B=c([u(0,v.IBufferService)],B)},844:(S,n)=>{function a(c){for(const u of c)u.dispose();c.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const u=this._disposables.indexOf(c);u!==-1&&this._disposables.splice(u,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var u;this._isDisposed||c===this._value||((u=this._value)==null||u.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},n.toDisposable=function(c){return{dispose:c}},n.disposeArray=a,n.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},1505:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(u,o,h){this._data[u]||(this._data[u]={}),this._data[u][o]=h}get(u,o){return this._data[u]?this._data[u][o]:void 0}clear(){this._data={}}}n.TwoKeyMap=a,n.FourKeyMap=class{constructor(){this._data=new a}set(c,u,o,h,d){this._data.get(c,u)||this._data.set(c,u,new a),this._data.get(c,u).set(o,h,d)}get(c,u,o,h){var d;return(d=this._data.get(c,u))==null?void 0:d.get(o,h)}clear(){this._data.clear()}}},6114:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const a=n.isNode?"node":navigator.userAgent,c=n.isNode?"node":navigator.platform;n.isFirefox=a.includes("Firefox"),n.isLegacyEdge=a.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(a),n.getSafariVersion=function(){if(!n.isSafari)return 0;const u=a.match(/Version\/(\d+)/);return u===null||u.length<2?0:parseInt(u[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),n.isIpad=c==="iPad",n.isIphone=c==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),n.isLinux=c.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(a)},6106:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let a=0;n.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(a=this._search(this._getKey(c)),this._array.splice(a,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const u=this._getKey(c);if(u===void 0||(a=this._search(u),a===-1)||this._getKey(this._array[a])!==u)return!1;do if(this._array[a]===c)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===u);return!1}*getKeyIterator(c){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===c)}forEachByKey(c,u){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do u(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===c)}values(){return[...this._array].values()}_search(c){let u=0,o=this._array.length-1;for(;o>=u;){let h=u+o>>1;const d=this._getKey(this._array[h]);if(d>c)o=h-1;else{if(!(d<c)){for(;h>0&&this._getKey(this._array[h-1])===c;)h--;return h}u=h+1}}return u}}},7226:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const c=a(6114);class u{constructor(){this._tasks=[],this._i=0}enqueue(d){this._tasks.push(d),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(d){this._idleCallback=void 0;let _=0,r=0,t=d.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(_=Date.now(),this._tasks[this._i]()||this._i++,_=Math.max(1,Date.now()-_),r=Math.max(_,r),i=d.timeRemaining(),1.5*r>i)return t-_<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(t-_))}ms`),void this._start();t=i}this.clear()}}class o extends u{_requestCallback(d){return setTimeout(()=>d(this._createDeadline(16)))}_cancelCallback(d){clearTimeout(d)}_createDeadline(d){const _=Date.now()+d;return{timeRemaining:()=>Math.max(0,_-Date.now())}}}n.PriorityTaskQueue=o,n.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends u{_requestCallback(h){return requestIdleCallback(h)}_cancelCallback(h){cancelIdleCallback(h)}}:o,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(h){this._queue.clear(),this._queue.enqueue(h)}flush(){this._queue.flush()}}},9282:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const c=a(643);n.updateWindowsModeWrappedState=function(u){const o=u.buffer.lines.get(u.buffer.ybase+u.buffer.y-1),h=o==null?void 0:o.get(u.cols-1),d=u.buffer.lines.get(u.buffer.ybase+u.buffer.y);d&&h&&(d.isWrapped=h[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&h[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){const o=new a;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return!(50331648&~this.fg)}isBgRGB(){return!(50331648&~this.bg)}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return!(50331648&this.fg)}isBgDefault(){return!(50331648&this.bg)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?!(50331648&~this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?!(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}n.AttributeData=a;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}get underlineVariantOffset(){const o=(3758096384&this._ext)>>29;return o<0?4294967288^o:o}set underlineVariantOffset(o){this._ext&=536870911,this._ext|=o<<29&3758096384}constructor(o=0,h=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=h}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=c},9092:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const c=a(6349),u=a(7226),o=a(3734),h=a(8437),d=a(4634),_=a(511),r=a(643),t=a(4863),i=a(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(e,s,l){this._hasScrollback=e,this._optionsService=s,this._bufferService=l,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=h.DEFAULT_ATTR_DATA.clone(),this.savedCharset=i.DEFAULT_CHARSET,this.markers=[],this._nullCell=_.CellData.fromCharData([0,r.NULL_CELL_CHAR,r.NULL_CELL_WIDTH,r.NULL_CELL_CODE]),this._whitespaceCell=_.CellData.fromCharData([0,r.WHITESPACE_CELL_CHAR,r.WHITESPACE_CELL_WIDTH,r.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new u.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,s){return new h.BufferLine(this._bufferService.cols,this.getNullCell(e),s)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const s=e+this._optionsService.rawOptions.scrollback;return s>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:s}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=h.DEFAULT_ATTR_DATA);let s=this._rows;for(;s--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,s){const l=this.getNullCell(h.DEFAULT_ATTR_DATA);let v=0;const g=this._getCorrectBufferLength(s);if(g>this.lines.maxLength&&(this.lines.maxLength=g),this.lines.length>0){if(this._cols<e)for(let f=0;f<this.lines.length;f++)v+=+this.lines.get(f).resize(e,l);let p=0;if(this._rows<s)for(let f=this._rows;f<s;f++)this.lines.length<s+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new h.BufferLine(e,l)):this.ybase>0&&this.lines.length<=this.ybase+this.y+p+1?(this.ybase--,p++,this.ydisp>0&&this.ydisp--):this.lines.push(new h.BufferLine(e,l)));else for(let f=this._rows;f>s;f--)this.lines.length>s+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(g<this.lines.maxLength){const f=this.lines.length-g;f>0&&(this.lines.trimStart(f),this.ybase=Math.max(this.ybase-f,0),this.ydisp=Math.max(this.ydisp-f,0),this.savedY=Math.max(this.savedY-f,0)),this.lines.maxLength=g}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,s-1),p&&(this.y+=p),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=s-1,this._isReflowEnabled&&(this._reflow(e,s),this._cols>e))for(let p=0;p<this.lines.length;p++)v+=+this.lines.get(p).resize(e,l);this._cols=e,this._rows=s,this._memoryCleanupQueue.clear(),v>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let s=0;for(;this._memoryCleanupPosition<this.lines.length;)if(s+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),s>100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,s){this._cols!==e&&(e>this._cols?this._reflowLarger(e,s):this._reflowSmaller(e,s))}_reflowLarger(e,s){const l=(0,d.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(h.DEFAULT_ATTR_DATA));if(l.length>0){const v=(0,d.reflowLargerCreateNewLayout)(this.lines,l);(0,d.reflowLargerApplyNewLayout)(this.lines,v.layout),this._reflowLargerAdjustViewport(e,s,v.countRemoved)}}_reflowLargerAdjustViewport(e,s,l){const v=this.getNullCell(h.DEFAULT_ATTR_DATA);let g=l;for(;g-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<s&&this.lines.push(new h.BufferLine(e,v))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-l,0)}_reflowSmaller(e,s){const l=this.getNullCell(h.DEFAULT_ATTR_DATA),v=[];let g=0;for(let p=this.lines.length-1;p>=0;p--){let f=this.lines.get(p);if(!f||!f.isWrapped&&f.getTrimmedLength()<=e)continue;const m=[f];for(;f.isWrapped&&p>0;)f=this.lines.get(--p),m.unshift(f);const C=this.ybase+this.y;if(C>=p&&C<p+m.length)continue;const w=m[m.length-1].getTrimmedLength(),L=(0,d.reflowSmallerGetNewLineLengths)(m,this._cols,e),y=L.length-m.length;let R;R=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+y):Math.max(0,this.lines.length-this.lines.maxLength+y);const A=[];for(let k=0;k<y;k++){const D=this.getBlankLine(h.DEFAULT_ATTR_DATA,!0);A.push(D)}A.length>0&&(v.push({start:p+m.length+g,newLines:A}),g+=A.length),m.push(...A);let B=L.length-1,T=L[B];T===0&&(B--,T=L[B]);let P=m.length-y-1,b=w;for(;P>=0;){const k=Math.min(b,T);if(m[B]===void 0)break;if(m[B].copyCellsFrom(m[P],b-k,T-k,k,!0),T-=k,T===0&&(B--,T=L[B]),b-=k,b===0){P--;const D=Math.max(P,0);b=(0,d.getWrappedLineTrimmedLength)(m,D,this._cols)}}for(let k=0;k<m.length;k++)L[k]<e&&m[k].setCell(L[k],l);let E=y-R;for(;E-- >0;)this.ybase===0?this.y<s-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+g)-s&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+y,this.ybase+s-1)}if(v.length>0){const p=[],f=[];for(let B=0;B<this.lines.length;B++)f.push(this.lines.get(B));const m=this.lines.length;let C=m-1,w=0,L=v[w];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+g);let y=0;for(let B=Math.min(this.lines.maxLength-1,m+g-1);B>=0;B--)if(L&&L.start>C+y){for(let T=L.newLines.length-1;T>=0;T--)this.lines.set(B--,L.newLines[T]);B++,p.push({index:C+1,amount:L.newLines.length}),y+=L.newLines.length,L=v[++w]}else this.lines.set(B,f[C--]);let R=0;for(let B=p.length-1;B>=0;B--)p[B].index+=R,this.lines.onInsertEmitter.fire(p[B]),R+=p[B].amount;const A=Math.max(0,m+g-this.lines.maxLength);A>0&&this.lines.onTrimEmitter.fire(A)}}translateBufferLineToString(e,s,l=0,v){const g=this.lines.get(e);return g?g.translateToString(s,l,v):""}getWrappedRangeForLine(e){let s=e,l=e;for(;s>0&&this.lines.get(s).isWrapped;)s--;for(;l+1<this.lines.length&&this.lines.get(l+1).isWrapped;)l++;return{first:s,last:l}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].line===e&&(this.markers[s].dispose(),this.markers.splice(s--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){const s=new t.Marker(e);return this.markers.push(s),s.register(this.lines.onTrim(l=>{s.line-=l,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(l=>{s.line>=l.index&&(s.line+=l.amount)})),s.register(this.lines.onDelete(l=>{s.line>=l.index&&s.line<l.index+l.amount&&s.dispose(),s.line>l.index&&(s.line-=l.amount)})),s.register(s.onDispose(()=>this._removeMarker(s))),s}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const c=a(3734),u=a(511),o=a(643),h=a(482);n.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let d=0;class _{constructor(t,i,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*t);const s=i||u.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]);for(let l=0;l<t;++l)this.setCell(l,s);this.length=t}get(t){const i=this._data[3*t+0],e=2097151&i;return[this._data[3*t+1],2097152&i?this._combined[t]:e?(0,h.stringFromCodePoint)(e):"",i>>22,2097152&i?this._combined[t].charCodeAt(this._combined[t].length-1):e]}set(t,i){this._data[3*t+1]=i[o.CHAR_DATA_ATTR_INDEX],i[o.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[t]=i[1],this._data[3*t+0]=2097152|t|i[o.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*t+0]=i[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|i[o.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(t){return this._data[3*t+0]>>22}hasWidth(t){return 12582912&this._data[3*t+0]}getFg(t){return this._data[3*t+1]}getBg(t){return this._data[3*t+2]}hasContent(t){return 4194303&this._data[3*t+0]}getCodePoint(t){const i=this._data[3*t+0];return 2097152&i?this._combined[t].charCodeAt(this._combined[t].length-1):2097151&i}isCombined(t){return 2097152&this._data[3*t+0]}getString(t){const i=this._data[3*t+0];return 2097152&i?this._combined[t]:2097151&i?(0,h.stringFromCodePoint)(2097151&i):""}isProtected(t){return 536870912&this._data[3*t+2]}loadCell(t,i){return d=3*t,i.content=this._data[d+0],i.fg=this._data[d+1],i.bg=this._data[d+2],2097152&i.content&&(i.combinedData=this._combined[t]),268435456&i.bg&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){2097152&i.content&&(this._combined[t]=i.combinedData),268435456&i.bg&&(this._extendedAttrs[t]=i.extended),this._data[3*t+0]=i.content,this._data[3*t+1]=i.fg,this._data[3*t+2]=i.bg}setCellFromCodepoint(t,i,e,s){268435456&s.bg&&(this._extendedAttrs[t]=s.extended),this._data[3*t+0]=i|e<<22,this._data[3*t+1]=s.fg,this._data[3*t+2]=s.bg}addCodepointToCell(t,i,e){let s=this._data[3*t+0];2097152&s?this._combined[t]+=(0,h.stringFromCodePoint)(i):2097151&s?(this._combined[t]=(0,h.stringFromCodePoint)(2097151&s)+(0,h.stringFromCodePoint)(i),s&=-2097152,s|=2097152):s=i|4194304,e&&(s&=-12582913,s|=e<<22),this._data[3*t+0]=s}insertCells(t,i,e){if((t%=this.length)&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),i<this.length-t){const s=new u.CellData;for(let l=this.length-t-i-1;l>=0;--l)this.setCell(t+i+l,this.loadCell(t+l,s));for(let l=0;l<i;++l)this.setCell(t+l,e)}else for(let s=t;s<this.length;++s)this.setCell(s,e);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,e)}deleteCells(t,i,e){if(t%=this.length,i<this.length-t){const s=new u.CellData;for(let l=0;l<this.length-t-i;++l)this.setCell(t+l,this.loadCell(t+i+l,s));for(let l=this.length-i;l<this.length;++l)this.setCell(l,e)}else for(let s=t;s<this.length;++s)this.setCell(s,e);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),this.getWidth(t)!==0||this.hasContent(t)||this.setCellFromCodepoint(t,0,1,e)}replaceCells(t,i,e,s=!1){if(s)for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,e),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,e);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,e),t++;else for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,e);t<i&&t<this.length;)this.setCell(t++,e)}resize(t,i){if(t===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const e=3*t;if(t>this.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const s=new Uint32Array(e);s.set(this._data),this._data=s}for(let s=this.length;s<t;++s)this.setCell(s,i)}else{this._data=this._data.subarray(0,e);const s=Object.keys(this._combined);for(let v=0;v<s.length;v++){const g=parseInt(s[v],10);g>=t&&delete this._combined[g]}const l=Object.keys(this._extendedAttrs);for(let v=0;v<l.length;v++){const g=parseInt(l[v],10);g>=t&&delete this._extendedAttrs[g]}}return this.length=t,4*e*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,t);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,t)}}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(const i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(const i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){const t=new _(0);t._data=new Uint32Array(this._data),t.length=this.length;for(const i in this._combined)t._combined[i]=this._combined[i];for(const i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0])return t+(this._data[3*t+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0]||50331648&this._data[3*t+2])return t+(this._data[3*t+0]>>22);return 0}copyCellsFrom(t,i,e,s,l){const v=t._data;if(l)for(let p=s-1;p>=0;p--){for(let f=0;f<3;f++)this._data[3*(e+p)+f]=v[3*(i+p)+f];268435456&v[3*(i+p)+2]&&(this._extendedAttrs[e+p]=t._extendedAttrs[i+p])}else for(let p=0;p<s;p++){for(let f=0;f<3;f++)this._data[3*(e+p)+f]=v[3*(i+p)+f];268435456&v[3*(i+p)+2]&&(this._extendedAttrs[e+p]=t._extendedAttrs[i+p])}const g=Object.keys(t._combined);for(let p=0;p<g.length;p++){const f=parseInt(g[p],10);f>=i&&(this._combined[f-i+e]=t._combined[f])}}translateToString(t,i,e,s){i=i??0,e=e??this.length,t&&(e=Math.min(e,this.getTrimmedLength())),s&&(s.length=0);let l="";for(;i<e;){const v=this._data[3*i+0],g=2097151&v,p=2097152&v?this._combined[i]:g?(0,h.stringFromCodePoint)(g):o.WHITESPACE_CELL_CHAR;if(l+=p,s)for(let f=0;f<p.length;++f)s.push(i);i+=v>>22||1}return s&&s.push(i),l}}n.BufferLine=_},4841:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(a,c){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return c*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(S,n)=>{function a(c,u,o){if(u===c.length-1)return c[u].getTrimmedLength();const h=!c[u].hasContent(o-1)&&c[u].getWidth(o-1)===1,d=c[u+1].getWidth(0)===2;return h&&d?o-1:o}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(c,u,o,h,d){const _=[];for(let r=0;r<c.length-1;r++){let t=r,i=c.get(++t);if(!i.isWrapped)continue;const e=[c.get(r)];for(;t<c.length&&i.isWrapped;)e.push(i),i=c.get(++t);if(h>=r&&h<t){r+=e.length-1;continue}let s=0,l=a(e,s,u),v=1,g=0;for(;v<e.length;){const f=a(e,v,u),m=f-g,C=o-l,w=Math.min(m,C);e[s].copyCellsFrom(e[v],g,l,w,!1),l+=w,l===o&&(s++,l=0),g+=w,g===f&&(v++,g=0),l===0&&s!==0&&e[s-1].getWidth(o-1)===2&&(e[s].copyCellsFrom(e[s-1],o-1,l++,1,!1),e[s-1].setCell(o-1,d))}e[s].replaceCells(l,o,d);let p=0;for(let f=e.length-1;f>0&&(f>s||e[f].getTrimmedLength()===0);f--)p++;p>0&&(_.push(r+e.length-p),_.push(p)),r+=e.length-1}return _},n.reflowLargerCreateNewLayout=function(c,u){const o=[];let h=0,d=u[h],_=0;for(let r=0;r<c.length;r++)if(d===r){const t=u[++h];c.onDeleteEmitter.fire({index:r-_,amount:t}),r+=t-1,_+=t,d=u[++h]}else o.push(r);return{layout:o,countRemoved:_}},n.reflowLargerApplyNewLayout=function(c,u){const o=[];for(let h=0;h<u.length;h++)o.push(c.get(u[h]));for(let h=0;h<o.length;h++)c.set(h,o[h]);c.length=u.length},n.reflowSmallerGetNewLineLengths=function(c,u,o){const h=[],d=c.map((i,e)=>a(c,e,u)).reduce((i,e)=>i+e);let _=0,r=0,t=0;for(;t<d;){if(d-t<o){h.push(d-t);break}_+=o;const i=a(c,r,u);_>i&&(_-=i,r++);const e=c[r].getWidth(_-1)===2;e&&_--;const s=e?o-1:o;h.push(s),t+=s}return h},n.getWrappedLineTrimmedLength=a},5295:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const c=a(8460),u=a(844),o=a(9092);class h extends u.Disposable{constructor(_,r){super(),this._optionsService=_,this._bufferService=r,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new o.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new o.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(_){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(_),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(_,r){this._normal.resize(_,r),this._alt.resize(_,r),this.setupTabStops(_)}setupTabStops(_){this._normal.setupTabStops(_),this._alt.setupTabStops(_)}}n.BufferSet=h},511:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const c=a(482),u=a(643),o=a(3734);class h extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(_){const r=new h;return r.setFromCharData(_),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(_){this.fg=_[u.CHAR_DATA_ATTR_INDEX],this.bg=0;let r=!1;if(_[u.CHAR_DATA_CHAR_INDEX].length>2)r=!0;else if(_[u.CHAR_DATA_CHAR_INDEX].length===2){const t=_[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=t&&t<=56319){const i=_[u.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i&&i<=57343?this.content=1024*(t-55296)+i-56320+65536|_[u.CHAR_DATA_WIDTH_INDEX]<<22:r=!0}else r=!0}else this.content=_[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[u.CHAR_DATA_WIDTH_INDEX]<<22;r&&(this.combinedData=_[u.CHAR_DATA_CHAR_INDEX],this.content=2097152|_[u.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=h},643:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const c=a(8460),u=a(844);class o{get id(){return this._id}constructor(d){this.line=d,this.isDisposed=!1,this._disposables=[],this._id=o._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,u.disposeArray)(this._disposables),this._disposables.length=0)}register(d){return this._disposables.push(d),d}}n.Marker=o,o._nextId=1},7116:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},n.CHARSETS.A={"#":"\xA3"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},n.CHARSETS.C=n.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},n.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},n.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},n.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},n.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},n.CHARSETS.E=n.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},n.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},n.CHARSETS.H=n.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},n.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},2584:(S,n)=>{var a,c,u;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,(function(o){o.NUL="\0",o.SOH="",o.STX="",o.ETX="",o.EOT="",o.ENQ="",o.ACK="",o.BEL="\x07",o.BS="\b",o.HT=" ",o.LF=`
|
|
8
|
+
`,o.VT="\v",o.FF="\f",o.CR="\r",o.SO="",o.SI="",o.DLE="",o.DC1="",o.DC2="",o.DC3="",o.DC4="",o.NAK="",o.SYN="",o.ETB="",o.CAN="",o.EM="",o.SUB="",o.ESC="\x1B",o.FS="",o.GS="",o.RS="",o.US="",o.SP=" ",o.DEL="\x7F"})(a||(n.C0=a={})),(function(o){o.PAD="\x80",o.HOP="\x81",o.BPH="\x82",o.NBH="\x83",o.IND="\x84",o.NEL="\x85",o.SSA="\x86",o.ESA="\x87",o.HTS="\x88",o.HTJ="\x89",o.VTS="\x8A",o.PLD="\x8B",o.PLU="\x8C",o.RI="\x8D",o.SS2="\x8E",o.SS3="\x8F",o.DCS="\x90",o.PU1="\x91",o.PU2="\x92",o.STS="\x93",o.CCH="\x94",o.MW="\x95",o.SPA="\x96",o.EPA="\x97",o.SOS="\x98",o.SGCI="\x99",o.SCI="\x9A",o.CSI="\x9B",o.ST="\x9C",o.OSC="\x9D",o.PM="\x9E",o.APC="\x9F"})(c||(n.C1=c={})),(function(o){o.ST=`${a.ESC}\\`})(u||(n.C1_ESCAPED=u={}))},7399:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const c=a(2584),u={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};n.evaluateKeyboardEvent=function(o,h,d,_){const r={type:0,cancel:!1,key:void 0},t=(o.shiftKey?1:0)|(o.altKey?2:0)|(o.ctrlKey?4:0)|(o.metaKey?8:0);switch(o.keyCode){case 0:o.key==="UIKeyInputUpArrow"?r.key=h?c.C0.ESC+"OA":c.C0.ESC+"[A":o.key==="UIKeyInputLeftArrow"?r.key=h?c.C0.ESC+"OD":c.C0.ESC+"[D":o.key==="UIKeyInputRightArrow"?r.key=h?c.C0.ESC+"OC":c.C0.ESC+"[C":o.key==="UIKeyInputDownArrow"&&(r.key=h?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:r.key=o.ctrlKey?"\b":c.C0.DEL,o.altKey&&(r.key=c.C0.ESC+r.key);break;case 9:if(o.shiftKey){r.key=c.C0.ESC+"[Z";break}r.key=c.C0.HT,r.cancel=!0;break;case 13:r.key=o.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,r.cancel=!0;break;case 27:r.key=c.C0.ESC,o.altKey&&(r.key=c.C0.ESC+c.C0.ESC),r.cancel=!0;break;case 37:if(o.metaKey)break;t?(r.key=c.C0.ESC+"[1;"+(t+1)+"D",r.key===c.C0.ESC+"[1;3D"&&(r.key=c.C0.ESC+(d?"b":"[1;5D"))):r.key=h?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(o.metaKey)break;t?(r.key=c.C0.ESC+"[1;"+(t+1)+"C",r.key===c.C0.ESC+"[1;3C"&&(r.key=c.C0.ESC+(d?"f":"[1;5C"))):r.key=h?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(o.metaKey)break;t?(r.key=c.C0.ESC+"[1;"+(t+1)+"A",d||r.key!==c.C0.ESC+"[1;3A"||(r.key=c.C0.ESC+"[1;5A")):r.key=h?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(o.metaKey)break;t?(r.key=c.C0.ESC+"[1;"+(t+1)+"B",d||r.key!==c.C0.ESC+"[1;3B"||(r.key=c.C0.ESC+"[1;5B")):r.key=h?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:o.shiftKey||o.ctrlKey||(r.key=c.C0.ESC+"[2~");break;case 46:r.key=t?c.C0.ESC+"[3;"+(t+1)+"~":c.C0.ESC+"[3~";break;case 36:r.key=t?c.C0.ESC+"[1;"+(t+1)+"H":h?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:r.key=t?c.C0.ESC+"[1;"+(t+1)+"F":h?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:o.shiftKey?r.type=2:o.ctrlKey?r.key=c.C0.ESC+"[5;"+(t+1)+"~":r.key=c.C0.ESC+"[5~";break;case 34:o.shiftKey?r.type=3:o.ctrlKey?r.key=c.C0.ESC+"[6;"+(t+1)+"~":r.key=c.C0.ESC+"[6~";break;case 112:r.key=t?c.C0.ESC+"[1;"+(t+1)+"P":c.C0.ESC+"OP";break;case 113:r.key=t?c.C0.ESC+"[1;"+(t+1)+"Q":c.C0.ESC+"OQ";break;case 114:r.key=t?c.C0.ESC+"[1;"+(t+1)+"R":c.C0.ESC+"OR";break;case 115:r.key=t?c.C0.ESC+"[1;"+(t+1)+"S":c.C0.ESC+"OS";break;case 116:r.key=t?c.C0.ESC+"[15;"+(t+1)+"~":c.C0.ESC+"[15~";break;case 117:r.key=t?c.C0.ESC+"[17;"+(t+1)+"~":c.C0.ESC+"[17~";break;case 118:r.key=t?c.C0.ESC+"[18;"+(t+1)+"~":c.C0.ESC+"[18~";break;case 119:r.key=t?c.C0.ESC+"[19;"+(t+1)+"~":c.C0.ESC+"[19~";break;case 120:r.key=t?c.C0.ESC+"[20;"+(t+1)+"~":c.C0.ESC+"[20~";break;case 121:r.key=t?c.C0.ESC+"[21;"+(t+1)+"~":c.C0.ESC+"[21~";break;case 122:r.key=t?c.C0.ESC+"[23;"+(t+1)+"~":c.C0.ESC+"[23~";break;case 123:r.key=t?c.C0.ESC+"[24;"+(t+1)+"~":c.C0.ESC+"[24~";break;default:if(!o.ctrlKey||o.shiftKey||o.altKey||o.metaKey)if(d&&!_||!o.altKey||o.metaKey)!d||o.altKey||o.ctrlKey||o.shiftKey||!o.metaKey?o.key&&!o.ctrlKey&&!o.altKey&&!o.metaKey&&o.keyCode>=48&&o.key.length===1?r.key=o.key:o.key&&o.ctrlKey&&(o.key==="_"&&(r.key=c.C0.US),o.key==="@"&&(r.key=c.C0.NUL)):o.keyCode===65&&(r.type=1);else{const i=u[o.keyCode],e=i==null?void 0:i[o.shiftKey?1:0];if(e)r.key=c.C0.ESC+e;else if(o.keyCode>=65&&o.keyCode<=90){const s=o.ctrlKey?o.keyCode-64:o.keyCode+32;let l=String.fromCharCode(s);o.shiftKey&&(l=l.toUpperCase()),r.key=c.C0.ESC+l}else if(o.keyCode===32)r.key=c.C0.ESC+(o.ctrlKey?c.C0.NUL:" ");else if(o.key==="Dead"&&o.code.startsWith("Key")){let s=o.code.slice(3,4);o.shiftKey||(s=s.toLowerCase()),r.key=c.C0.ESC+s,r.cancel=!0}}else o.keyCode>=65&&o.keyCode<=90?r.key=String.fromCharCode(o.keyCode-64):o.keyCode===32?r.key=c.C0.NUL:o.keyCode>=51&&o.keyCode<=55?r.key=String.fromCharCode(o.keyCode-51+27):o.keyCode===56?r.key=c.C0.DEL:o.keyCode===219?r.key=c.C0.ESC:o.keyCode===220?r.key=c.C0.FS:o.keyCode===221&&(r.key=c.C0.GS)}return r}},482:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},n.utf32ToString=function(a,c=0,u=a.length){let o="";for(let h=c;h<u;++h){let d=a[h];d>65535?(d-=65536,o+=String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):o+=String.fromCharCode(d)}return o},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,c){const u=a.length;if(!u)return 0;let o=0,h=0;if(this._interim){const d=a.charCodeAt(h++);56320<=d&&d<=57343?c[o++]=1024*(this._interim-55296)+d-56320+65536:(c[o++]=this._interim,c[o++]=d),this._interim=0}for(let d=h;d<u;++d){const _=a.charCodeAt(d);if(55296<=_&&_<=56319){if(++d>=u)return this._interim=_,o;const r=a.charCodeAt(d);56320<=r&&r<=57343?c[o++]=1024*(_-55296)+r-56320+65536:(c[o++]=_,c[o++]=r)}else _!==65279&&(c[o++]=_)}return o}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,c){const u=a.length;if(!u)return 0;let o,h,d,_,r=0,t=0,i=0;if(this.interim[0]){let l=!1,v=this.interim[0];v&=(224&v)==192?31:(240&v)==224?15:7;let g,p=0;for(;(g=63&this.interim[++p])&&p<4;)v<<=6,v|=g;const f=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=f-p;for(;i<m;){if(i>=u)return 0;if(g=a[i++],(192&g)!=128){i--,l=!0;break}this.interim[p++]=g,v<<=6,v|=63&g}l||(f===2?v<128?i--:c[r++]=v:f===3?v<2048||v>=55296&&v<=57343||v===65279||(c[r++]=v):v<65536||v>1114111||(c[r++]=v)),this.interim.fill(0)}const e=u-4;let s=i;for(;s<u;){for(;!(!(s<e)||128&(o=a[s])||128&(h=a[s+1])||128&(d=a[s+2])||128&(_=a[s+3]));)c[r++]=o,c[r++]=h,c[r++]=d,c[r++]=_,s+=4;if(o=a[s++],o<128)c[r++]=o;else if((224&o)==192){if(s>=u)return this.interim[0]=o,r;if(h=a[s++],(192&h)!=128){s--;continue}if(t=(31&o)<<6|63&h,t<128){s--;continue}c[r++]=t}else if((240&o)==224){if(s>=u)return this.interim[0]=o,r;if(h=a[s++],(192&h)!=128){s--;continue}if(s>=u)return this.interim[0]=o,this.interim[1]=h,r;if(d=a[s++],(192&d)!=128){s--;continue}if(t=(15&o)<<12|(63&h)<<6|63&d,t<2048||t>=55296&&t<=57343||t===65279)continue;c[r++]=t}else if((248&o)==240){if(s>=u)return this.interim[0]=o,r;if(h=a[s++],(192&h)!=128){s--;continue}if(s>=u)return this.interim[0]=o,this.interim[1]=h,r;if(d=a[s++],(192&d)!=128){s--;continue}if(s>=u)return this.interim[0]=o,this.interim[1]=h,this.interim[2]=d,r;if(_=a[s++],(192&_)!=128){s--;continue}if(t=(7&o)<<18|(63&h)<<12|(63&d)<<6|63&_,t<65536||t>1114111)continue;c[r++]=t}}return r}}},225:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const c=a(1480),u=[[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]],o=[[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]];let h;n.UnicodeV6=class{constructor(){if(this.version="6",!h){h=new Uint8Array(65536),h.fill(1),h[0]=0,h.fill(0,1,32),h.fill(0,127,160),h.fill(2,4352,4448),h[9001]=2,h[9002]=2,h.fill(2,11904,42192),h[12351]=1,h.fill(2,44032,55204),h.fill(2,63744,64256),h.fill(2,65040,65050),h.fill(2,65072,65136),h.fill(2,65280,65377),h.fill(2,65504,65511);for(let d=0;d<u.length;++d)h.fill(0,u[d][0],u[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?h[d]:(function(_,r){let t,i=0,e=r.length-1;if(_<r[0][0]||_>r[e][1])return!1;for(;e>=i;)if(t=i+e>>1,_>r[t][1])i=t+1;else{if(!(_<r[t][0]))return!0;e=t-1}return!1})(d,o)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}charProperties(d,_){let r=this.wcwidth(d),t=r===0&&_!==0;if(t){const i=c.UnicodeService.extractWidth(_);i===0?t=!1:i>r&&(r=i)}return c.UnicodeService.createPropertyValue(0,r,t)}}},5981:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const c=a(8460),u=a(844);class o extends u.Disposable{constructor(d){super(),this._action=d,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(d,_){if(_!==void 0&&this._syncCalls>_)return void(this._syncCalls=0);if(this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let r;for(this._isSyncWriting=!0;r=this._writeBuffer.shift();){this._action(r);const t=this._callbacks.shift();t&&t()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(d,_){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(_),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(_)}_innerWrite(d=0,_=!0){const r=d||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const t=this._writeBuffer[this._bufferOffset],i=this._action(t,_);if(i){const s=l=>Date.now()-r>=12?setTimeout(()=>this._innerWrite(0,l)):this._innerWrite(r,l);return void i.catch(l=>(queueMicrotask(()=>{throw l}),Promise.resolve(!1))).then(s)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=t.length,Date.now()-r>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}n.WriteBuffer=o},5941:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function u(o,h){const d=o.toString(16),_=d.length<2?"0"+d:d;switch(h){case 4:return d[0];case 8:return _;case 12:return(_+_).slice(0,3);default:return _+_}}n.parseColor=function(o){if(!o)return;let h=o.toLowerCase();if(h.indexOf("rgb:")===0){h=h.slice(4);const d=a.exec(h);if(d){const _=d[1]?15:d[4]?255:d[7]?4095:65535;return[Math.round(parseInt(d[1]||d[4]||d[7]||d[10],16)/_*255),Math.round(parseInt(d[2]||d[5]||d[8]||d[11],16)/_*255),Math.round(parseInt(d[3]||d[6]||d[9]||d[12],16)/_*255)]}}else if(h.indexOf("#")===0&&(h=h.slice(1),c.exec(h)&&[3,6,9,12].includes(h.length))){const d=h.length/3,_=[0,0,0];for(let r=0;r<3;++r){const t=parseInt(h.slice(d*r,d*r+d),16);_[r]=d===1?t<<4:d===2?t:d===3?t>>4:t>>8}return _}},n.toRgbString=function(o,h=16){const[d,_,r]=o;return`rgb:${u(d,h)}/${u(_,h)}/${u(r,h)}`}},5770:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const c=a(482),u=a(8742),o=a(5770),h=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=h,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}registerHandler(_,r){this._handlers[_]===void 0&&(this._handlers[_]=[]);const t=this._handlers[_];return t.push(r),{dispose:()=>{const i=t.indexOf(r);i!==-1&&t.splice(i,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}reset(){if(this._active.length)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].unhook(!1);this._stack.paused=!1,this._active=h,this._ident=0}hook(_,r){if(this.reset(),this._ident=_,this._active=this._handlers[_]||h,this._active.length)for(let t=this._active.length-1;t>=0;t--)this._active[t].hook(r);else this._handlerFb(this._ident,"HOOK",r)}put(_,r,t){if(this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].put(_,r,t);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(_,r,t))}unhook(_,r=!0){if(this._active.length){let t=!1,i=this._active.length-1,e=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,t=r,e=this._stack.fallThrough,this._stack.paused=!1),!e&&t===!1){for(;i>=0&&(t=this._active[i].unhook(_),t!==!0);i--)if(t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,t;i--}for(;i>=0;i--)if(t=this._active[i].unhook(!1),t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,t}else this._handlerFb(this._ident,"UNHOOK",_);this._active=h,this._ident=0}};const d=new u.Params;d.addParam(0),n.DcsHandler=class{constructor(_){this._handler=_,this._data="",this._params=d,this._hitLimit=!1}hook(_){this._params=_.length>1||_.params[0]?_.clone():d,this._data="",this._hitLimit=!1}put(_,r,t){this._hitLimit||(this._data+=(0,c.utf32ToString)(_,r,t),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(_){let r=!1;if(this._hitLimit)r=!1;else if(_&&(r=this._handler(this._data,this._params),r instanceof Promise))return r.then(t=>(this._params=d,this._data="",this._hitLimit=!1,t));return this._params=d,this._data="",this._hitLimit=!1,r}}},2015:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const c=a(844),u=a(8742),o=a(6242),h=a(6351);class d{constructor(i){this.table=new Uint8Array(i)}setDefault(i,e){this.table.fill(i<<4|e)}add(i,e,s,l){this.table[e<<8|i]=s<<4|l}addMany(i,e,s,l){for(let v=0;v<i.length;v++)this.table[e<<8|i[v]]=s<<4|l}}n.TransitionTable=d;const _=160;n.VT500_TRANSITION_TABLE=(function(){const t=new d(4095),i=Array.apply(null,Array(256)).map((p,f)=>f),e=(p,f)=>i.slice(p,f),s=e(32,127),l=e(0,24);l.push(25),l.push.apply(l,e(28,32));const v=e(0,14);let g;for(g in t.setDefault(1,0),t.addMany(s,0,2,0),v)t.addMany([24,26,153,154],g,3,0),t.addMany(e(128,144),g,3,0),t.addMany(e(144,152),g,3,0),t.add(156,g,0,0),t.add(27,g,11,1),t.add(157,g,4,8),t.addMany([152,158,159],g,0,7),t.add(155,g,11,3),t.add(144,g,11,9);return t.addMany(l,0,3,0),t.addMany(l,1,3,1),t.add(127,1,0,1),t.addMany(l,8,0,8),t.addMany(l,3,3,3),t.add(127,3,0,3),t.addMany(l,4,3,4),t.add(127,4,0,4),t.addMany(l,6,3,6),t.addMany(l,5,3,5),t.add(127,5,0,5),t.addMany(l,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(s,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(e(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(s,7,0,7),t.addMany(l,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(e(64,127),3,7,0),t.addMany(e(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(e(48,60),4,8,4),t.addMany(e(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(e(32,64),6,0,6),t.add(127,6,0,6),t.addMany(e(64,127),6,0,0),t.addMany(e(32,48),3,9,5),t.addMany(e(32,48),5,9,5),t.addMany(e(48,64),5,0,6),t.addMany(e(64,127),5,7,0),t.addMany(e(32,48),4,9,5),t.addMany(e(32,48),1,9,2),t.addMany(e(32,48),2,9,2),t.addMany(e(48,127),2,10,0),t.addMany(e(48,80),1,10,0),t.addMany(e(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(e(96,127),1,10,0),t.add(80,1,11,9),t.addMany(l,9,0,9),t.add(127,9,0,9),t.addMany(e(28,32),9,0,9),t.addMany(e(32,48),9,9,12),t.addMany(e(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(l,11,0,11),t.addMany(e(32,128),11,0,11),t.addMany(e(28,32),11,0,11),t.addMany(l,10,0,10),t.add(127,10,0,10),t.addMany(e(28,32),10,0,10),t.addMany(e(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(e(32,48),10,9,12),t.addMany(l,12,0,12),t.add(127,12,0,12),t.addMany(e(28,32),12,0,12),t.addMany(e(32,48),12,9,12),t.addMany(e(48,64),12,0,11),t.addMany(e(64,127),12,12,13),t.addMany(e(64,127),10,12,13),t.addMany(e(64,127),9,12,13),t.addMany(l,13,13,13),t.addMany(s,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(_,0,2,0),t.add(_,8,5,8),t.add(_,6,0,6),t.add(_,11,0,11),t.add(_,13,13,13),t})();class r extends c.Disposable{constructor(i=n.VT500_TRANSITION_TABLE){super(),this._transitions=i,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new u.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,s,l)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,s)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new o.OscParser),this._dcsParser=this.register(new h.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(i,e=[64,126]){let s=0;if(i.prefix){if(i.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=i.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(i.intermediates){if(i.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let v=0;v<i.intermediates.length;++v){const g=i.intermediates.charCodeAt(v);if(32>g||g>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=g}}if(i.final.length!==1)throw new Error("final must be a single byte");const l=i.final.charCodeAt(0);if(e[0]>l||l>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return s<<=8,s|=l,s}identToString(i){const e=[];for(;i;)e.push(String.fromCharCode(255&i)),i>>=8;return e.reverse().join("")}setPrintHandler(i){this._printHandler=i}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(i,e){const s=this._identifier(i,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);const l=this._escHandlers[s];return l.push(e),{dispose:()=>{const v=l.indexOf(e);v!==-1&&l.splice(v,1)}}}clearEscHandler(i){this._escHandlers[this._identifier(i,[48,126])]&&delete this._escHandlers[this._identifier(i,[48,126])]}setEscHandlerFallback(i){this._escHandlerFb=i}setExecuteHandler(i,e){this._executeHandlers[i.charCodeAt(0)]=e}clearExecuteHandler(i){this._executeHandlers[i.charCodeAt(0)]&&delete this._executeHandlers[i.charCodeAt(0)]}setExecuteHandlerFallback(i){this._executeHandlerFb=i}registerCsiHandler(i,e){const s=this._identifier(i);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);const l=this._csiHandlers[s];return l.push(e),{dispose:()=>{const v=l.indexOf(e);v!==-1&&l.splice(v,1)}}}clearCsiHandler(i){this._csiHandlers[this._identifier(i)]&&delete this._csiHandlers[this._identifier(i)]}setCsiHandlerFallback(i){this._csiHandlerFb=i}registerDcsHandler(i,e){return this._dcsParser.registerHandler(this._identifier(i),e)}clearDcsHandler(i){this._dcsParser.clearHandler(this._identifier(i))}setDcsHandlerFallback(i){this._dcsParser.setHandlerFallback(i)}registerOscHandler(i,e){return this._oscParser.registerHandler(i,e)}clearOscHandler(i){this._oscParser.clearHandler(i)}setOscHandlerFallback(i){this._oscParser.setHandlerFallback(i)}setErrorHandler(i){this._errorHandler=i}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(i,e,s,l,v){this._parseStack.state=i,this._parseStack.handlers=e,this._parseStack.handlerPos=s,this._parseStack.transition=l,this._parseStack.chunkPos=v}parse(i,e,s){let l,v=0,g=0,p=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,p=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const f=this._parseStack.handlers;let m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&m>-1){for(;m>=0&&(l=f[m](this._params),l!==!0);m--)if(l instanceof Promise)return this._parseStack.handlerPos=m,l}this._parseStack.handlers=[];break;case 4:if(s===!1&&m>-1){for(;m>=0&&(l=f[m](),l!==!0);m--)if(l instanceof Promise)return this._parseStack.handlerPos=m,l}this._parseStack.handlers=[];break;case 6:if(v=i[this._parseStack.chunkPos],l=this._dcsParser.unhook(v!==24&&v!==26,s),l)return l;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(v=i[this._parseStack.chunkPos],l=this._oscParser.end(v!==24&&v!==26,s),l)return l;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,p=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let f=p;f<e;++f){switch(v=i[f],g=this._transitions.table[this.currentState<<8|(v<160?v:_)],g>>4){case 2:for(let y=f+1;;++y){if(y>=e||(v=i[y])<32||v>126&&v<_){this._printHandler(i,f,y),f=y-1;break}if(++y>=e||(v=i[y])<32||v>126&&v<_){this._printHandler(i,f,y),f=y-1;break}if(++y>=e||(v=i[y])<32||v>126&&v<_){this._printHandler(i,f,y),f=y-1;break}if(++y>=e||(v=i[y])<32||v>126&&v<_){this._printHandler(i,f,y),f=y-1;break}}break;case 3:this._executeHandlers[v]?this._executeHandlers[v]():this._executeHandlerFb(v),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:f,code:v,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const m=this._csiHandlers[this._collect<<8|v];let C=m?m.length-1:-1;for(;C>=0&&(l=m[C](this._params),l!==!0);C--)if(l instanceof Promise)return this._preserveStack(3,m,C,g,f),l;C<0&&this._csiHandlerFb(this._collect<<8|v,this._params),this.precedingJoinState=0;break;case 8:do switch(v){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(v-48)}while(++f<e&&(v=i[f])>47&&v<60);f--;break;case 9:this._collect<<=8,this._collect|=v;break;case 10:const w=this._escHandlers[this._collect<<8|v];let L=w?w.length-1:-1;for(;L>=0&&(l=w[L](),l!==!0);L--)if(l instanceof Promise)return this._preserveStack(4,w,L,g,f),l;L<0&&this._escHandlerFb(this._collect<<8|v),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|v,this._params);break;case 13:for(let y=f+1;;++y)if(y>=e||(v=i[y])===24||v===26||v===27||v>127&&v<_){this._dcsParser.put(i,f,y),f=y-1;break}break;case 14:if(l=this._dcsParser.unhook(v!==24&&v!==26),l)return this._preserveStack(6,[],0,g,f),l;v===27&&(g|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let y=f+1;;y++)if(y>=e||(v=i[y])<32||v>127&&v<_){this._oscParser.put(i,f,y),f=y-1;break}break;case 6:if(l=this._oscParser.end(v!==24&&v!==26),l)return this._preserveStack(5,[],0,g,f),l;v===27&&(g|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&g}}}n.EscapeSequenceParser=r},6242:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const c=a(5770),u=a(482),o=[];n.OscParser=class{constructor(){this._state=0,this._active=o,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(h,d){this._handlers[h]===void 0&&(this._handlers[h]=[]);const _=this._handlers[h];return _.push(d),{dispose:()=>{const r=_.indexOf(d);r!==-1&&_.splice(r,1)}}}clearHandler(h){this._handlers[h]&&delete this._handlers[h]}setHandlerFallback(h){this._handlerFb=h}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}reset(){if(this._state===2)for(let h=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;h>=0;--h)this._active[h].end(!1);this._stack.paused=!1,this._active=o,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||o,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].start();else this._handlerFb(this._id,"START")}_put(h,d,_){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(h,d,_);else this._handlerFb(this._id,"PUT",(0,u.utf32ToString)(h,d,_))}start(){this.reset(),this._state=1}put(h,d,_){if(this._state!==3){if(this._state===1)for(;d<_;){const r=h[d++];if(r===59){this._state=2,this._start();break}if(r<48||57<r)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+r-48}this._state===2&&_-d>0&&this._put(h,d,_)}}end(h,d=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let _=!1,r=this._active.length-1,t=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,_=d,t=this._stack.fallThrough,this._stack.paused=!1),!t&&_===!1){for(;r>=0&&(_=this._active[r].end(h),_!==!0);r--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,_;r--}for(;r>=0;r--)if(_=this._active[r].end(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,_}else this._handlerFb(this._id,"END",h);this._active=o,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(h){this._handler=h,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(h,d,_){this._hitLimit||(this._data+=(0,u.utf32ToString)(h,d,_),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(h){let d=!1;if(this._hitLimit)d=!1;else if(h&&(d=this._handler(this._data),d instanceof Promise))return d.then(_=>(this._data="",this._hitLimit=!1,_));return this._data="",this._hitLimit=!1,d}}},8742:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const a=2147483647;class c{static fromArray(o){const h=new c;if(!o.length)return h;for(let d=Array.isArray(o[0])?1:0;d<o.length;++d){const _=o[d];if(Array.isArray(_))for(let r=0;r<_.length;++r)h.addSubParam(_[r]);else h.addParam(_)}return h}constructor(o=32,h=32){if(this.maxLength=o,this.maxSubParamsLength=h,h>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(o),this.length=0,this._subParams=new Int32Array(h),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(o),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const o=new c(this.maxLength,this.maxSubParamsLength);return o.params.set(this.params),o.length=this.length,o._subParams.set(this._subParams),o._subParamsLength=this._subParamsLength,o._subParamsIdx.set(this._subParamsIdx),o._rejectDigits=this._rejectDigits,o._rejectSubDigits=this._rejectSubDigits,o._digitIsSub=this._digitIsSub,o}toArray(){const o=[];for(let h=0;h<this.length;++h){o.push(this.params[h]);const d=this._subParamsIdx[h]>>8,_=255&this._subParamsIdx[h];_-d>0&&o.push(Array.prototype.slice.call(this._subParams,d,_))}return o}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(o){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=o>a?a:o}}addSubParam(o){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=o>a?a:o,this._subParamsIdx[this.length-1]++}}hasSubParams(o){return(255&this._subParamsIdx[o])-(this._subParamsIdx[o]>>8)>0}getSubParams(o){const h=this._subParamsIdx[o]>>8,d=255&this._subParamsIdx[o];return d-h>0?this._subParams.subarray(h,d):null}getSubParamsAll(){const o={};for(let h=0;h<this.length;++h){const d=this._subParamsIdx[h]>>8,_=255&this._subParamsIdx[h];_-d>0&&(o[h]=this._subParams.slice(d,_))}return o}addDigit(o){let h;if(this._rejectDigits||!(h=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const d=this._digitIsSub?this._subParams:this.params,_=d[h-1];d[h-1]=~_?Math.min(10*_+o,a):o}}n.Params=c},5741:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,c){const u={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(u),c.dispose=()=>this._wrappedAddonDispose(u),c.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let c=-1;for(let u=0;u<this._addons.length;u++)if(this._addons[u]===a){c=u;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(c,1)}}},8771:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const c=a(3785),u=a(511);n.BufferApiView=class{constructor(o,h){this._buffer=o,this.type=h}init(o){return this._buffer=o,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(o){const h=this._buffer.lines.get(o);if(h)return new c.BufferLineApiView(h)}getNullCell(){return new u.CellData}}},3785:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const c=a(511);n.BufferLineApiView=class{constructor(u){this._line=u}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(u,o){if(!(u<0||u>=this._line.length))return o?(this._line.loadCell(u,o),o):this._line.loadCell(u,new c.CellData)}translateToString(u,o,h){return this._line.translateToString(u,o,h)}}},8285:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const c=a(8771),u=a(8460),o=a(844);class h extends o.Disposable{constructor(_){super(),this._core=_,this._onBufferChange=this.register(new u.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(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 new 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)}}n.BufferNamespaceApi=h},7975:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,c){return this._core.registerCsiHandler(a,u=>c(u.toArray()))}addCsiHandler(a,c){return this.registerCsiHandler(a,c)}registerDcsHandler(a,c){return this._core.registerDcsHandler(a,(u,o)=>c(u,o.toArray()))}addDcsHandler(a,c){return this.registerDcsHandler(a,c)}registerEscHandler(a,c){return this._core.registerEscHandler(a,c)}addEscHandler(a,c){return this.registerEscHandler(a,c)}registerOscHandler(a,c){return this._core.registerOscHandler(a,c)}addOscHandler(a,c){return this.registerOscHandler(a,c)}}},7090:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(S,n,a){var c=this&&this.__decorate||function(t,i,e,s){var l,v=arguments.length,g=v<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,e):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(t,i,e,s);else for(var p=t.length-1;p>=0;p--)(l=t[p])&&(g=(v<3?l(g):v>3?l(i,e,g):l(i,e))||g);return v>3&&g&&Object.defineProperty(i,e,g),g},u=this&&this.__param||function(t,i){return function(e,s){i(e,s,t)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const o=a(8460),h=a(844),d=a(5295),_=a(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let r=n.BufferService=class extends h.Disposable{get buffer(){return this.buffers.active}constructor(t){super(),this.isUserScrolling=!1,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(t.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new d.BufferSet(t,this))}resize(t,i){this.cols=t,this.rows=i,this.buffers.resize(t,i),this._onResize.fire({cols:t,rows:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,i=!1){const e=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===t.fg&&s.getBg(0)===t.bg||(s=e.getBlankLine(t,i),this._cachedBlankLine=s),s.isWrapped=i;const l=e.ybase+e.scrollTop,v=e.ybase+e.scrollBottom;if(e.scrollTop===0){const g=e.lines.isFull;v===e.lines.length-1?g?e.lines.recycle().copyFrom(s):e.lines.push(s.clone()):e.lines.splice(v+1,0,s.clone()),g?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{const g=v-l+1;e.lines.shiftElements(l+1,g-1,-1),e.lines.set(v,s.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(t,i,e){const s=this.buffer;if(t<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else t+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const l=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+t,s.ybase),0),l!==s.ydisp&&(i||this._onScroll.fire(s.ydisp))}};n.BufferService=r=c([u(0,_.IOptionsService)],r)},7994:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,c){this._charsets[a]=c,this.glevel===a&&(this.charset=c)}}},1753:function(S,n,a){var c=this&&this.__decorate||function(s,l,v,g){var p,f=arguments.length,m=f<3?l:g===null?g=Object.getOwnPropertyDescriptor(l,v):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,l,v,g);else for(var C=s.length-1;C>=0;C--)(p=s[C])&&(m=(f<3?p(m):f>3?p(l,v,m):p(l,v))||m);return f>3&&m&&Object.defineProperty(l,v,m),m},u=this&&this.__param||function(s,l){return function(v,g){l(v,g,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const o=a(2585),h=a(8460),d=a(844),_={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:s=>s.button!==4&&s.action===1&&(s.ctrl=!1,s.alt=!1,s.shift=!1,!0)},VT200:{events:19,restrict:s=>s.action!==32},DRAG:{events:23,restrict:s=>s.action!==32||s.button!==3},ANY:{events:31,restrict:s=>!0}};function r(s,l){let v=(s.ctrl?16:0)|(s.shift?4:0)|(s.alt?8:0);return s.button===4?(v|=64,v|=s.action):(v|=3&s.button,4&s.button&&(v|=64),8&s.button&&(v|=128),s.action===32?v|=32:s.action!==0||l||(v|=3)),v}const t=String.fromCharCode,i={DEFAULT:s=>{const l=[r(s,!1)+32,s.col+32,s.row+32];return l[0]>255||l[1]>255||l[2]>255?"":`\x1B[M${t(l[0])}${t(l[1])}${t(l[2])}`},SGR:s=>{const l=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${r(s,!0)};${s.col};${s.row}${l}`},SGR_PIXELS:s=>{const l=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${r(s,!0)};${s.x};${s.y}${l}`}};let e=n.CoreMouseService=class extends d.Disposable{constructor(s,l){super(),this._bufferService=s,this._coreService=l,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new h.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const v of Object.keys(_))this.addProtocol(v,_[v]);for(const v of Object.keys(i))this.addEncoding(v,i[v]);this.reset()}addProtocol(s,l){this._protocols[s]=l}addEncoding(s,l){this._encodings[s]=l}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(s){if(!this._protocols[s])throw new Error(`unknown protocol "${s}"`);this._activeProtocol=s,this._onProtocolChange.fire(this._protocols[s].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(s){if(!this._encodings[s])throw new Error(`unknown encoding "${s}"`);this._activeEncoding=s}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(s){if(s.col<0||s.col>=this._bufferService.cols||s.row<0||s.row>=this._bufferService.rows||s.button===4&&s.action===32||s.button===3&&s.action!==32||s.button!==4&&(s.action===2||s.action===3)||(s.col++,s.row++,s.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,s,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(s))return!1;const l=this._encodings[this._activeEncoding](s);return l&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(l):this._coreService.triggerDataEvent(l,!0)),this._lastEvent=s,!0}explainEvents(s){return{down:!!(1&s),up:!!(2&s),drag:!!(4&s),move:!!(8&s),wheel:!!(16&s)}}_equalEvents(s,l,v){if(v){if(s.x!==l.x||s.y!==l.y)return!1}else if(s.col!==l.col||s.row!==l.row)return!1;return s.button===l.button&&s.action===l.action&&s.ctrl===l.ctrl&&s.alt===l.alt&&s.shift===l.shift}};n.CoreMouseService=e=c([u(0,o.IBufferService),u(1,o.ICoreService)],e)},6975:function(S,n,a){var c=this&&this.__decorate||function(e,s,l,v){var g,p=arguments.length,f=p<3?s:v===null?v=Object.getOwnPropertyDescriptor(s,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,l,v);else for(var m=e.length-1;m>=0;m--)(g=e[m])&&(f=(p<3?g(f):p>3?g(s,l,f):g(s,l))||f);return p>3&&f&&Object.defineProperty(s,l,f),f},u=this&&this.__param||function(e,s){return function(l,v){s(l,v,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const o=a(1439),h=a(8460),d=a(844),_=a(2585),r=Object.freeze({insertMode:!1}),t=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let i=n.CoreService=class extends d.Disposable{constructor(e,s,l){super(),this._bufferService=e,this._logService=s,this._optionsService=l,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new h.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new h.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,o.clone)(r),this.decPrivateModes=(0,o.clone)(t)}reset(){this.modes=(0,o.clone)(r),this.decPrivateModes=(0,o.clone)(t)}triggerDataEvent(e,s=!1){if(this._optionsService.rawOptions.disableStdin)return;const l=this._bufferService.buffer;s&&this._optionsService.rawOptions.scrollOnUserInput&&l.ybase!==l.ydisp&&this._onRequestScrollToBottom.fire(),s&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,()=>e.split("").map(v=>v.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,()=>e.split("").map(s=>s.charCodeAt(0))),this._onBinary.fire(e))}};n.CoreService=i=c([u(0,_.IBufferService),u(1,_.ILogService),u(2,_.IOptionsService)],i)},9074:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const c=a(8055),u=a(8460),o=a(844),h=a(6106);let d=0,_=0;class r extends o.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new h.SortedList(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this.register(new u.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new u.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,o.toDisposable)(()=>this.reset()))}registerDecoration(e){if(e.marker.isDisposed)return;const s=new t(e);if(s){const l=s.marker.onDispose(()=>s.dispose());s.onDispose(()=>{s&&(this._decorations.delete(s)&&this._onDecorationRemoved.fire(s),l.dispose())}),this._decorations.insert(s),this._onDecorationRegistered.fire(s)}return s}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,s,l){let v=0,g=0;for(const p of this._decorations.getKeyIterator(s))v=p.options.x??0,g=v+(p.options.width??1),e>=v&&e<g&&(!l||(p.options.layer??"bottom")===l)&&(yield p)}forEachDecorationAtCell(e,s,l,v){this._decorations.forEachByKey(s,g=>{d=g.options.x??0,_=d+(g.options.width??1),e>=d&&e<_&&(!l||(g.options.layer??"bottom")===l)&&v(g)})}}n.DecorationService=r;class t extends o.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new u.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const c=a(2585),u=a(8343);class o{constructor(...d){this._entries=new Map;for(const[_,r]of d)this.set(_,r)}set(d,_){const r=this._entries.get(d);return this._entries.set(d,_),r}forEach(d){for(const[_,r]of this._entries.entries())d(_,r)}has(d){return this._entries.has(d)}get(d){return this._entries.get(d)}}n.ServiceCollection=o,n.InstantiationService=class{constructor(){this._services=new o,this._services.set(c.IInstantiationService,this)}setService(h,d){this._services.set(h,d)}getService(h){return this._services.get(h)}createInstance(h,...d){const _=(0,u.getServiceDependencies)(h).sort((i,e)=>i.index-e.index),r=[];for(const i of _){const e=this._services.get(i.id);if(!e)throw new Error(`[createInstance] ${h.name} depends on UNKNOWN service ${i.id}.`);r.push(e)}const t=_.length>0?_[0].index:d.length;if(d.length!==t)throw new Error(`[createInstance] First service dependency of ${h.name} at position ${t+1} conflicts with ${d.length} static arguments`);return new h(...d,...r)}}},7866:function(S,n,a){var c=this&&this.__decorate||function(t,i,e,s){var l,v=arguments.length,g=v<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,e):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(t,i,e,s);else for(var p=t.length-1;p>=0;p--)(l=t[p])&&(g=(v<3?l(g):v>3?l(i,e,g):l(i,e))||g);return v>3&&g&&Object.defineProperty(i,e,g),g},u=this&&this.__param||function(t,i){return function(e,s){i(e,s,t)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const o=a(844),h=a(2585),d={trace:h.LogLevelEnum.TRACE,debug:h.LogLevelEnum.DEBUG,info:h.LogLevelEnum.INFO,warn:h.LogLevelEnum.WARN,error:h.LogLevelEnum.ERROR,off:h.LogLevelEnum.OFF};let _,r=n.LogService=class extends o.Disposable{get logLevel(){return this._logLevel}constructor(t){super(),this._optionsService=t,this._logLevel=h.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),_=this}_updateLogLevel(){this._logLevel=d[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let i=0;i<t.length;i++)typeof t[i]=="function"&&(t[i]=t[i]())}_log(t,i,e){this._evalLazyOptionalParams(e),t.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+i,...e)}trace(t,...i){var e;this._logLevel<=h.LogLevelEnum.TRACE&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.trace.bind(this._optionsService.options.logger))??console.log,t,i)}debug(t,...i){var e;this._logLevel<=h.LogLevelEnum.DEBUG&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.debug.bind(this._optionsService.options.logger))??console.log,t,i)}info(t,...i){var e;this._logLevel<=h.LogLevelEnum.INFO&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.info.bind(this._optionsService.options.logger))??console.info,t,i)}warn(t,...i){var e;this._logLevel<=h.LogLevelEnum.WARN&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.warn.bind(this._optionsService.options.logger))??console.warn,t,i)}error(t,...i){var e;this._logLevel<=h.LogLevelEnum.ERROR&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.error.bind(this._optionsService.options.logger))??console.error,t,i)}};n.LogService=r=c([u(0,h.IOptionsService)],r),n.setTraceLogger=function(t){_=t},n.traceCall=function(t,i,e){if(typeof e.value!="function")throw new Error("not supported");const s=e.value;e.value=function(...l){if(_.logLevel!==h.LogLevelEnum.TRACE)return s.apply(this,l);_.trace(`GlyphRenderer#${s.name}(${l.map(g=>JSON.stringify(g)).join(", ")})`);const v=s.apply(this,l);return _.trace(`GlyphRenderer#${s.name} return`,v),v}}},7302:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const c=a(8460),u=a(844),o=a(6114);n.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:o.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const h=["normal","bold","100","200","300","400","500","600","700","800","900"];class d extends u.Disposable{constructor(r){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const t={...n.DEFAULT_OPTIONS};for(const i in r)if(i in t)try{const e=r[i];t[i]=this._sanitizeAndValidateOption(i,e)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this.register((0,u.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(r,t){return this.onOptionChange(i=>{i===r&&t(this.rawOptions[r])})}onMultipleOptionChange(r,t){return this.onOptionChange(i=>{r.indexOf(i)!==-1&&t()})}_setupOptions(){const r=i=>{if(!(i in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,e)=>{if(!(i in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);e=this._sanitizeAndValidateOption(i,e),this.rawOptions[i]!==e&&(this.rawOptions[i]=e,this._onOptionChange.fire(i))};for(const i in this.rawOptions){const e={get:r.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,e)}}_sanitizeAndValidateOption(r,t){switch(r){case"cursorStyle":if(t||(t=n.DEFAULT_OPTIONS[r]),!(function(i){return i==="block"||i==="underline"||i==="bar"})(t))throw new Error(`"${t}" is not a valid value for ${r}`);break;case"wordSeparator":t||(t=n.DEFAULT_OPTIONS[r]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=h.includes(t)?t:n.DEFAULT_OPTIONS[r];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${r} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(10*t)/10));break;case"scrollback":if((t=Math.min(t,4294967295))<0)throw new Error(`${r} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${r} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${r} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{}}return t}}n.OptionsService=d},2660:function(S,n,a){var c=this&&this.__decorate||function(d,_,r,t){var i,e=arguments.length,s=e<3?_:t===null?t=Object.getOwnPropertyDescriptor(_,r):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(d,_,r,t);else for(var l=d.length-1;l>=0;l--)(i=d[l])&&(s=(e<3?i(s):e>3?i(_,r,s):i(_,r))||s);return e>3&&s&&Object.defineProperty(_,r,s),s},u=this&&this.__param||function(d,_){return function(r,t){_(r,t,d)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const o=a(2585);let h=n.OscLinkService=class{constructor(d){this._bufferService=d,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(d){const _=this._bufferService.buffer;if(d.id===void 0){const l=_.addMarker(_.ybase+_.y),v={data:d,id:this._nextId++,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(v,l)),this._dataByLinkId.set(v.id,v),v.id}const r=d,t=this._getEntryIdKey(r),i=this._entriesWithId.get(t);if(i)return this.addLineToLink(i.id,_.ybase+_.y),i.id;const e=_.addMarker(_.ybase+_.y),s={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[e]};return e.onDispose(()=>this._removeMarkerFromLink(s,e)),this._entriesWithId.set(s.key,s),this._dataByLinkId.set(s.id,s),s.id}addLineToLink(d,_){const r=this._dataByLinkId.get(d);if(r&&r.lines.every(t=>t.line!==_)){const t=this._bufferService.buffer.addMarker(_);r.lines.push(t),t.onDispose(()=>this._removeMarkerFromLink(r,t))}}getLinkData(d){var _;return(_=this._dataByLinkId.get(d))==null?void 0:_.data}_getEntryIdKey(d){return`${d.id};;${d.uri}`}_removeMarkerFromLink(d,_){const r=d.lines.indexOf(_);r!==-1&&(d.lines.splice(r,1),d.lines.length===0&&(d.data.id!==void 0&&this._entriesWithId.delete(d.key),this._dataByLinkId.delete(d.id)))}};n.OscLinkService=h=c([u(0,o.IBufferService)],h)},8343:(S,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const a="di$target",c="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(u){return u[c]||[]},n.createDecorator=function(u){if(n.serviceRegistry.has(u))return n.serviceRegistry.get(u);const o=function(h,d,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(r,t,i){t[a]===t?t[c].push({id:r,index:i}):(t[c]=[{id:r,index:i}],t[a]=t)})(o,h,_)};return o.toString=()=>u,n.serviceRegistry.set(u,o),o}},2585:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const c=a(8343);var u;n.IBufferService=(0,c.createDecorator)("BufferService"),n.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),n.ICoreService=(0,c.createDecorator)("CoreService"),n.ICharsetService=(0,c.createDecorator)("CharsetService"),n.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.OFF=5]="OFF"})(u||(n.LogLevelEnum=u={})),n.ILogService=(0,c.createDecorator)("LogService"),n.IOptionsService=(0,c.createDecorator)("OptionsService"),n.IOscLinkService=(0,c.createDecorator)("OscLinkService"),n.IUnicodeService=(0,c.createDecorator)("UnicodeService"),n.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(S,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const c=a(8460),u=a(225);class o{static extractShouldJoin(d){return!!(1&d)}static extractWidth(d){return d>>1&3}static extractCharKind(d){return d>>3}static createPropertyValue(d,_,r=!1){return(16777215&d)<<3|(3&_)<<1|(r?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const d=new u.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let _=0,r=0;const t=d.length;for(let i=0;i<t;++i){let e=d.charCodeAt(i);if(55296<=e&&e<=56319){if(++i>=t)return _+this.wcwidth(e);const v=d.charCodeAt(i);56320<=v&&v<=57343?e=1024*(e-55296)+v-56320+65536:_+=this.wcwidth(v)}const s=this.charProperties(e,r);let l=o.extractWidth(s);o.extractShouldJoin(s)&&(l-=o.extractWidth(r)),_+=l,r=s}return _}charProperties(d,_){return this._activeProvider.charProperties(d,_)}}n.UnicodeService=o}},N={};function V(S){var n=N[S];if(n!==void 0)return n.exports;var a=N[S]={exports:{}};return G[S].call(a.exports,a,a.exports,V),a.exports}var F={};return(()=>{var S=F;Object.defineProperty(S,"__esModule",{value:!0}),S.Terminal=void 0;const n=V(9042),a=V(3236),c=V(844),u=V(5741),o=V(8285),h=V(7975),d=V(7090),_=["cols","rows"];class r extends c.Disposable{constructor(i){super(),this._core=this.register(new a.Terminal(i)),this._addonManager=this.register(new u.AddonManager),this._publicOptions={...this._core.options};const e=l=>this._core.options[l],s=(l,v)=>{this._checkReadonlyOptions(l),this._core.options[l]=v};for(const l in this._core.options){const v={get:e.bind(this,l),set:s.bind(this,l)};Object.defineProperty(this._publicOptions,l,v)}}_checkReadonlyOptions(i){if(_.includes(i))throw new Error(`Option "${i}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new 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||(this._parser=new h.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new d.UnicodeApi(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._buffer=this.register(new o.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const i=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:i.applicationCursorKeys,applicationKeypadMode:i.applicationKeypad,bracketedPasteMode:i.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:i.origin,reverseWraparoundMode:i.reverseWraparound,sendFocusMode:i.sendFocus,wraparoundMode:i.wraparound}}get options(){return this._publicOptions}set options(i){for(const e in i)this._publicOptions[e]=i[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(i,e=!0){this._core.input(i,e)}resize(i,e){this._verifyIntegers(i,e),this._core.resize(i,e)}open(i){this._core.open(i)}attachCustomKeyEventHandler(i){this._core.attachCustomKeyEventHandler(i)}attachCustomWheelEventHandler(i){this._core.attachCustomWheelEventHandler(i)}registerLinkProvider(i){return this._core.registerLinkProvider(i)}registerCharacterJoiner(i){return this._checkProposedApi(),this._core.registerCharacterJoiner(i)}deregisterCharacterJoiner(i){this._checkProposedApi(),this._core.deregisterCharacterJoiner(i)}registerMarker(i=0){return this._verifyIntegers(i),this._core.registerMarker(i)}registerDecoration(i){return this._checkProposedApi(),this._verifyPositiveIntegers(i.x??0,i.width??0,i.height??0),this._core.registerDecoration(i)}hasSelection(){return this._core.hasSelection()}select(i,e,s){this._verifyIntegers(i,e,s),this._core.select(i,e,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(i,e){this._verifyIntegers(i,e),this._core.selectLines(i,e)}dispose(){super.dispose()}scrollLines(i){this._verifyIntegers(i),this._core.scrollLines(i)}scrollPages(i){this._verifyIntegers(i),this._core.scrollPages(i)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(i){this._verifyIntegers(i),this._core.scrollToLine(i)}clear(){this._core.clear()}write(i,e){this._core.write(i,e)}writeln(i,e){this._core.write(i),this._core.write(`\r
|
|
9
|
+
`,e)}paste(i){this._core.paste(i)}refresh(i,e){this._verifyIntegers(i,e),this._core.refresh(i,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(i){this._addonManager.loadAddon(this,i)}static get strings(){return n}_verifyIntegers(...i){for(const e of i)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...i){for(const e of i)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}S.Terminal=r})(),F})())})(We)),We.exports);function it(ne){const G={cursor:"#ffffff",cursorAccent:"#000000"};return ne==="dark"?{...G,background:"#0f172a",foreground:"#f8fafc",black:"#0f172a",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#f1f5f9",brightBlack:"#475569",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#ffffff",selection:"rgba(148, 163, 184, 0.3)"}:{...G,background:"#ffffff",foreground:"#0f172a",cursor:"#0f172a",black:"#0f172a",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#e2e8f0",brightBlack:"#64748b",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#ffffff",selection:"rgba(71, 85, 105, 0.2)"}}const pe=ne=>{const G=ut.c(11),{onClick:N,disabled:V,icon:F,children:S,keyboardShortcut:n}=ne,a=V!==void 0&&V;let c,u,o,h;return G[0]===Symbol.for("react.memo_cache_sentinel")?(c=je("w-full text-left px-3 py-2 text-sm flex items-center gap-3 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-muted"),G[0]=c):c=G[0],G[1]!==F?(u=_e.jsx(F,{className:"w-4 h-4"}),G[1]=F,G[2]=u):u=G[2],G[3]!==n?(o=n&&_e.jsx(ft,{className:"ml-auto",shortcut:n}),G[3]=n,G[4]=o):o=G[4],G[5]!==S||G[6]!==a||G[7]!==N||G[8]!==u||G[9]!==o?(h=_e.jsxs("button",{className:c,type:"button",onClick:N,disabled:a,children:[u,S,o]}),G[5]=S,G[6]=a,G[7]=N,G[8]=u,G[9]=o,G[10]=h):h=G[10],h};qe=ze.memo(({visible:ne,onClose:G})=>{const N=fe.useRef(null),V=fe.useRef(null),[{terminal:F,fitAddon:S,searchAddon:n}]=fe.useState(()=>{const m=new tt.Terminal({fontFamily:"Menlo, DejaVu Sans Mono, Consolas, Lucida Console, monospace",fontSize:14,scrollback:1e4,cursorBlink:!0,cursorStyle:"block",allowTransparency:!1,theme:it("dark"),rightClickSelectsWord:!0,wordSeparator:` \r
|
|
10
|
+
"'\`(){}[]<>|&;`,allowProposedApi:!0}),C=new Ye.FitAddon,w=new Ze.SearchAddon,L=new Je.CanvasAddon,y=new Qe.Unicode11Addon,R=new et.WebLinksAddon;return m.loadAddon(C),m.loadAddon(w),m.loadAddon(L),m.loadAddon(y),m.loadAddon(R),m.unicode.activeVersion="11",{terminal:m,fitAddon:C,searchAddon:w}}),[a,c]=ze.useState(!1),[u,o]=fe.useState(null),h=at(),d=gt(),{removeCommand:_,setReady:r}=pt(),t=Ce((function(m){return C=>{const{ctrlKey:w,metaKey:L,key:y}=C;if(w||L)switch(y){case"c":m.hasSelection()&&(C.preventDefault(),dt(m.getSelection()));break;case"v":C.preventDefault(),navigator.clipboard.readText().then(R=>{m.paste(R)});break;case"a":C.preventDefault(),m.selectAll();break;case"l":C.preventDefault(),m.clear()}}})(F)),i=Ce(m=>{m.preventDefault();const C=window.innerHeight-m.clientY<200;o({x:m.clientX,y:m.clientY,placement:C?"top":"bottom"})}),e=Ce(m=>{const C=m.target,w=C&&C instanceof HTMLElement&&C.closest(".xterm-context-menu");u&&!w&&o(null)}),s=ht(({cols:m,rows:C})=>{V.current&&V.current.readyState===WebSocket.OPEN&&(ye.debug("Sending resize to backend terminal",{cols:m,rows:C}),V.current.send(JSON.stringify({type:"resize",cols:m,rows:C})))},100),l=Ce(()=>{F&&S&&S.fit()}),{handleCopy:v,handlePaste:g,handleSelectAll:p,handleClear:f}=fe.useMemo(()=>(function(m,C){const w=()=>C(null);return{handleCopy:()=>{m.hasSelection()&&navigator.clipboard.writeText(m.getSelection()),w()},handlePaste:()=>{navigator.clipboard.readText().then(L=>{m.paste(L)}),w()},handleSelectAll:()=>{m.selectAll(),w()},handleClear:()=>{m.clear(),w()},closeMenu:w}})(F,o),[F]);return fe.useEffect(()=>{if(!a)return(async()=>{try{await _t();const m=new WebSocket(h.getTerminalWsURL()),C=new Xe.AttachAddon(m);F.loadAddon(C),V.current=m;const w=()=>{r(m.readyState===WebSocket.OPEN)},L=()=>{w()},y=()=>{w()},R=()=>{G(),C.dispose(),V.current=null,F.clear(),c(!1),r(!1)};m.addEventListener("open",y),m.addEventListener("close",R),m.addEventListener("error",L),w(),c(!0)}catch(m){ye.error("Runtime health check failed for terminal",m),G()}})(),()=>{}},[a]),fe.useEffect(()=>{var m;if(d.isReady&&d.pendingCommands.length!==0)for(const C of d.pendingCommands)F&&((m=V.current)==null?void 0:m.readyState)===WebSocket.OPEN&&(ye.debug("Sending programmatic command to terminal",{command:C.text}),F.input(C.text),F.focus(),_(C.id))},[F,d.isReady,d.pendingCommands,_]),fe.useEffect(()=>{ne&&(S.fit(),F.focus())},[ne]),fe.useEffect(()=>{if(!N.current)return;F.open(N.current),setTimeout(()=>{S.fit()},100),F.focus();const m=new AbortController;return window.addEventListener("resize",l,{signal:m.signal}),N.current.addEventListener("keydown",t,{signal:m.signal}),N.current.addEventListener("contextmenu",i,{signal:m.signal}),F.onResize(s),document.addEventListener("click",e,{signal:m.signal}),()=>{m.abort()}},[]),_e.jsxs("div",{className:"relative w-full h-[calc(100%-4px)] bg-popover",children:[_e.jsx("div",{className:"w-full h-full",ref:N}),u&&_e.jsxs("div",{className:"xterm-context-menu fixed z-50 rounded-md shadow-lg py-1 min-w-[160px] border bg-popover",style:{left:u.x,[u.placement==="top"?"bottom":"top"]:u.placement==="top"?window.innerHeight-u.y:u.y},children:[_e.jsx(pe,{onClick:v,disabled:!F.hasSelection(),icon:ct,keyboardShortcut:"mod-c",children:"Copy"}),_e.jsx(pe,{onClick:g,icon:mt,keyboardShortcut:"mod-v",children:"Paste"}),_e.jsx("hr",{className:je("my-1 border-border")}),_e.jsx(pe,{onClick:p,icon:Ve,keyboardShortcut:"mod-a",children:"Select all"}),_e.jsx(pe,{onClick:f,icon:lt,keyboardShortcut:"mod-l",children:"Clear terminal"})]})]})})});export{wt as __tla,qe as default};
|